mcp-bitbucket-server 1.0.0 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +6 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/services/bitbucket.d.ts +6 -1
  6. package/dist/services/bitbucket.d.ts.map +1 -1
  7. package/dist/services/bitbucket.js +8 -6
  8. package/dist/services/bitbucket.js.map +1 -1
  9. package/dist/tools/index.d.ts.map +1 -1
  10. package/dist/tools/index.js +10 -1
  11. package/dist/tools/index.js.map +1 -1
  12. package/dist/tools/projects/list_projects.d.ts +1 -1
  13. package/dist/tools/projects/list_projects.d.ts.map +1 -1
  14. package/dist/tools/projects/list_projects.js +13 -41
  15. package/dist/tools/projects/list_projects.js.map +1 -1
  16. package/dist/tools/pull-requests/add_pr_comment.d.ts.map +1 -1
  17. package/dist/tools/pull-requests/add_pr_comment.js +17 -28
  18. package/dist/tools/pull-requests/add_pr_comment.js.map +1 -1
  19. package/dist/tools/pull-requests/add_pr_comment_reaction.d.ts +3 -0
  20. package/dist/tools/pull-requests/add_pr_comment_reaction.d.ts.map +1 -0
  21. package/dist/tools/pull-requests/add_pr_comment_reaction.js +35 -0
  22. package/dist/tools/pull-requests/add_pr_comment_reaction.js.map +1 -0
  23. package/dist/tools/pull-requests/add_pr_file_comment.d.ts +3 -0
  24. package/dist/tools/pull-requests/add_pr_file_comment.d.ts.map +1 -0
  25. package/dist/tools/pull-requests/add_pr_file_comment.js +33 -0
  26. package/dist/tools/pull-requests/add_pr_file_comment.js.map +1 -0
  27. package/dist/tools/pull-requests/add_pr_line_comment.d.ts +3 -0
  28. package/dist/tools/pull-requests/add_pr_line_comment.d.ts.map +1 -0
  29. package/dist/tools/pull-requests/add_pr_line_comment.js +41 -0
  30. package/dist/tools/pull-requests/add_pr_line_comment.js.map +1 -0
  31. package/dist/tools/pull-requests/create_pull_request.d.ts +3 -0
  32. package/dist/tools/pull-requests/create_pull_request.d.ts.map +1 -0
  33. package/dist/tools/pull-requests/create_pull_request.js +50 -0
  34. package/dist/tools/pull-requests/create_pull_request.js.map +1 -0
  35. package/dist/tools/pull-requests/delete_pr_comment.d.ts +3 -0
  36. package/dist/tools/pull-requests/delete_pr_comment.d.ts.map +1 -0
  37. package/dist/tools/pull-requests/delete_pr_comment.js +33 -0
  38. package/dist/tools/pull-requests/delete_pr_comment.js.map +1 -0
  39. package/dist/tools/pull-requests/get_inbox_pull_requests.d.ts +1 -1
  40. package/dist/tools/pull-requests/get_inbox_pull_requests.d.ts.map +1 -1
  41. package/dist/tools/pull-requests/get_inbox_pull_requests.js +18 -38
  42. package/dist/tools/pull-requests/get_inbox_pull_requests.js.map +1 -1
  43. package/dist/tools/pull-requests/get_pr_activities.d.ts +1 -1
  44. package/dist/tools/pull-requests/get_pr_activities.d.ts.map +1 -1
  45. package/dist/tools/pull-requests/get_pr_activities.js +61 -85
  46. package/dist/tools/pull-requests/get_pr_activities.js.map +1 -1
  47. package/dist/tools/pull-requests/get_pr_changes.d.ts +1 -1
  48. package/dist/tools/pull-requests/get_pr_changes.d.ts.map +1 -1
  49. package/dist/tools/pull-requests/get_pr_changes.js +18 -23
  50. package/dist/tools/pull-requests/get_pr_changes.js.map +1 -1
  51. package/dist/tools/pull-requests/get_pr_details.d.ts +3 -0
  52. package/dist/tools/pull-requests/get_pr_details.d.ts.map +1 -0
  53. package/dist/tools/pull-requests/get_pr_details.js +29 -0
  54. package/dist/tools/pull-requests/get_pr_details.js.map +1 -0
  55. package/dist/tools/pull-requests/get_pr_diff.d.ts +3 -0
  56. package/dist/tools/pull-requests/get_pr_diff.d.ts.map +1 -0
  57. package/dist/tools/pull-requests/get_pr_diff.js +44 -0
  58. package/dist/tools/pull-requests/get_pr_diff.js.map +1 -0
  59. package/dist/tools/pull-requests/get_pr_file_diff.d.ts +1 -1
  60. package/dist/tools/pull-requests/get_pr_file_diff.d.ts.map +1 -1
  61. package/dist/tools/pull-requests/get_pr_file_diff.js +19 -23
  62. package/dist/tools/pull-requests/get_pr_file_diff.js.map +1 -1
  63. package/dist/tools/pull-requests/index.d.ts +11 -2
  64. package/dist/tools/pull-requests/index.d.ts.map +1 -1
  65. package/dist/tools/pull-requests/index.js +11 -2
  66. package/dist/tools/pull-requests/index.js.map +1 -1
  67. package/dist/tools/pull-requests/remove_pr_comment_reaction.d.ts +3 -0
  68. package/dist/tools/pull-requests/remove_pr_comment_reaction.d.ts.map +1 -0
  69. package/dist/tools/pull-requests/remove_pr_comment_reaction.js +35 -0
  70. package/dist/tools/pull-requests/remove_pr_comment_reaction.js.map +1 -0
  71. package/dist/tools/pull-requests/update_review_status.d.ts +3 -0
  72. package/dist/tools/pull-requests/update_review_status.d.ts.map +1 -0
  73. package/dist/tools/pull-requests/update_review_status.js +33 -0
  74. package/dist/tools/pull-requests/update_review_status.js.map +1 -0
  75. package/dist/tools/repositories/list_repositories.d.ts.map +1 -1
  76. package/dist/tools/repositories/list_repositories.js +12 -28
  77. package/dist/tools/repositories/list_repositories.js.map +1 -1
  78. package/dist/tools/tools.types.d.ts +121 -0
  79. package/dist/tools/tools.types.d.ts.map +1 -0
  80. package/dist/tools/tools.types.js +7 -0
  81. package/dist/tools/tools.types.js.map +1 -0
  82. package/dist/tools/users/get_all_users.d.ts.map +1 -1
  83. package/dist/tools/users/get_all_users.js +7 -8
  84. package/dist/tools/users/get_all_users.js.map +1 -1
  85. package/dist/tools/users/get_user_profile.d.ts.map +1 -1
  86. package/dist/tools/users/get_user_profile.js +14 -28
  87. package/dist/tools/users/get_user_profile.js.map +1 -1
  88. package/package.json +21 -48
  89. package/BitbucketServerSwagger.json +0 -67522
  90. package/CLAUDE.md +0 -492
  91. package/LICENSE +0 -21
  92. package/biome.json +0 -35
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ export * from 'bitbucket-data-center-client';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,cAAc,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  #!/usr/bin/env node
2
+ // ============ Library Exports ============
3
+ // Re-export the Bitbucket client library (use bitbucket-data-center-client directly for library usage)
4
+ // ============ MCP Server Setup ============
2
5
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
6
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
7
  import { registerTools } from './tools/index.js';
8
+ export * from 'bitbucket-data-center-client';
5
9
  async function startMcpServer() {
6
10
  const server = new McpServer({
7
11
  name: 'mcp-bitbucket-server',
@@ -16,7 +20,8 @@ async function main() {
16
20
  await startMcpServer();
17
21
  }
18
22
  main().catch((error) => {
19
- console.error('Error:', error.message);
23
+ const message = error instanceof Error ? error.message : 'Unknown error';
24
+ console.error('Error:', message);
20
25
  process.exit(1);
21
26
  });
22
27
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,KAAK,UAAU,cAAc;IAC3B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAA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AC,CAAC,CAAC,eAAe,CAAC;IACzE,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,2 +1,7 @@
1
- export declare const bitbucketClient: import("axios").AxiosInstance;
1
+ import { BitbucketClient } from 'bitbucket-data-center-client';
2
+ /**
3
+ * Singleton BitbucketClient instance for MCP tools.
4
+ * Created from environment configuration.
5
+ */
6
+ export declare const bitbucketService: BitbucketClient;
2
7
  //# sourceMappingURL=bitbucket.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bitbucket.d.ts","sourceRoot":"","sources":["../../src/services/bitbucket.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,+BAK1B,CAAC"}
1
+ {"version":3,"file":"bitbucket.d.ts","sourceRoot":"","sources":["../../src/services/bitbucket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D;;;GAGG;AACH,eAAO,MAAM,gBAAgB,iBAG3B,CAAC"}
@@ -1,9 +1,11 @@
1
- import axios from 'axios';
1
+ import { BitbucketClient } from 'bitbucket-data-center-client';
2
2
  import { bitbucketConfig } from '../config.js';
3
- export const bitbucketClient = axios.create({
4
- baseURL: `${bitbucketConfig.baseUrl}/rest/api/latest`,
5
- headers: {
6
- Authorization: `Bearer ${bitbucketConfig.token}`,
7
- },
3
+ /**
4
+ * Singleton BitbucketClient instance for MCP tools.
5
+ * Created from environment configuration.
6
+ */
7
+ export const bitbucketService = new BitbucketClient({
8
+ baseUrl: bitbucketConfig.baseUrl,
9
+ token: bitbucketConfig.token,
8
10
  });
9
11
  //# sourceMappingURL=bitbucket.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bitbucket.js","sourceRoot":"","sources":["../../src/services/bitbucket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,GAAG,eAAe,CAAC,OAAO,kBAAkB;IACrD,OAAO,EAAE;QACP,aAAa,EAAE,UAAU,eAAe,CAAC,KAAK,EAAE;KACjD;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"bitbucket.js","sourceRoot":"","sources":["../../src/services/bitbucket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,eAAe,CAAC;IAClD,OAAO,EAAE,eAAe,CAAC,OAAO;IAChC,KAAK,EAAE,eAAe,CAAC,KAAK;CAC7B,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,QAiB9C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,QA0B9C"}
@@ -1,5 +1,5 @@
1
- import { addPrCommentTool, getPrChangesTool, getPrFileDiffTool, getPrActivitiesTool, getInboxPullRequestsTool } from './pull-requests/index.js';
2
1
  import { listProjectsTool } from './projects/index.js';
2
+ import { addPrCommentReactionTool, addPrCommentTool, addPrFileCommentTool, addPrLineCommentTool, createPullRequestTool, deletePrCommentTool, getInboxPullRequestsTool, getPrActivitiesTool, getPrChangesTool, getPrFileDiffTool, getPullRequestDetailsTool, getPullRequestDiffTool, removePrCommentReactionTool, updateReviewStatusTool, } from './pull-requests/index.js';
3
3
  import { listRepositoriesTool } from './repositories/index.js';
4
4
  import { getAllUsersTool, getUserProfileTool } from './users/index.js';
5
5
  export function registerTools(server) {
@@ -11,10 +11,19 @@ export function registerTools(server) {
11
11
  // Repository tools
12
12
  listRepositoriesTool(server);
13
13
  // Pull request tools
14
+ createPullRequestTool(server);
14
15
  getInboxPullRequestsTool(server);
16
+ getPullRequestDetailsTool(server);
15
17
  addPrCommentTool(server);
18
+ addPrCommentReactionTool(server);
19
+ addPrFileCommentTool(server);
20
+ addPrLineCommentTool(server);
21
+ deletePrCommentTool(server);
16
22
  getPrChangesTool(server);
23
+ getPullRequestDiffTool(server);
17
24
  getPrFileDiffTool(server);
18
25
  getPrActivitiesTool(server);
26
+ removePrCommentReactionTool(server);
27
+ updateReviewStatusTool(server);
19
28
  }
20
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAChJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,aAAa;IACb,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,eAAe,CAAC,MAAM,CAAC,CAAC;IAExB,gBAAgB;IAChB,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEzB,mBAAmB;IACnB,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAE7B,qBAAqB;IACrB,wBAAwB,CAAC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C5B,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/B,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC5B,2BAA2B,CAAC,MAAM,CAAC,CAAC;IACpC,sBAAsB,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  export declare const listProjectsTool: (server: McpServer) => void;
3
3
  //# sourceMappingURL=list_projects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list_projects.d.ts","sourceRoot":"","sources":["../../../src/tools/projects/list_projects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsBzE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,SAwCjD,CAAC"}
1
+ {"version":3,"file":"list_projects.d.ts","sourceRoot":"","sources":["../../../src/tools/projects/list_projects.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASzE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,SAsBjD,CAAC"}
@@ -1,51 +1,23 @@
1
- import { z } from "zod";
2
- import { bitbucketClient } from "../../services/bitbucket.js";
1
+ import { z } from 'zod';
2
+ import { bitbucketService } from '../../services/bitbucket.js';
3
3
  const schema = z.object({
4
- name: z
5
- .string()
6
- .optional()
7
- .describe("Filter projects by name (partial match)"),
8
- permission: z
9
- .string()
10
- .optional()
11
- .describe("Filter by permission (e.g., PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN)"),
12
- start: z
13
- .number()
14
- .optional()
15
- .describe("Starting index for pagination (default: 0)"),
16
- limit: z
17
- .number()
18
- .optional()
19
- .describe("Maximum number of projects to return (default: 25)"),
4
+ name: z.string().optional().describe('Filter projects by name (partial match)'),
5
+ permission: z.string().optional().describe('Filter by permission (e.g., PROJECT_READ, PROJECT_WRITE, PROJECT_ADMIN)'),
6
+ start: z.number().optional().describe('Starting index for pagination (default: 0)'),
7
+ limit: z.number().optional().describe('Maximum number of projects to return (default: 25)'),
20
8
  });
21
9
  export const listProjectsTool = (server) => {
22
- server.registerTool("bitbucket_list_projects", {
23
- title: "List Projects",
24
- description: "Retrieve a page of projects. Only projects for which the authenticated user has PROJECT_VIEW permission will be returned. Can filter by name or permission level.",
10
+ server.registerTool('list_projects', {
11
+ title: 'List Projects',
12
+ description: 'Retrieve a page of projects. Only projects for which the authenticated user has PROJECT_VIEW permission will be returned. Can filter by name or permission level.',
25
13
  inputSchema: schema.shape,
26
- }, async (params) => {
27
- const { name, permission, start, limit } = schema.parse(params);
28
- const queryParams = {};
29
- if (name !== undefined) {
30
- queryParams.name = name;
31
- }
32
- if (permission !== undefined) {
33
- queryParams.permission = permission;
34
- }
35
- if (start !== undefined) {
36
- queryParams.start = start.toString();
37
- }
38
- if (limit !== undefined) {
39
- queryParams.limit = limit.toString();
40
- }
41
- const response = await bitbucketClient.get("/projects", {
42
- params: Object.keys(queryParams).length > 0 ? queryParams : undefined,
43
- });
14
+ }, async ({ name, permission, start, limit }) => {
15
+ const result = await bitbucketService.listProjects({ name, permission, start, limit });
44
16
  return {
45
17
  content: [
46
18
  {
47
- type: "text",
48
- text: JSON.stringify(response.data, null, 2),
19
+ type: 'text',
20
+ text: JSON.stringify(result, null, 2),
49
21
  },
50
22
  ],
51
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"list_projects.js","sourceRoot":"","sources":["../../../src/tools/projects/list_projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACvB,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AI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAEvF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBACtC;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"add_pr_comment.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgBzE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,SA6CjD,CAAC"}
1
+ {"version":3,"file":"add_pr_comment.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_comment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUzE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,SAgCjD,CAAC"}
@@ -1,44 +1,33 @@
1
1
  import { z } from 'zod';
2
- import { bitbucketClient } from '../../services/bitbucket.js';
2
+ import { bitbucketService } from '../../services/bitbucket.js';
3
3
  const schema = z.object({
4
4
  projectKey: z.string().describe('The Bitbucket project key'),
5
5
  repositorySlug: z.string().describe('The repository slug'),
6
6
  pullRequestId: z.number().describe('The pull request ID'),
7
7
  text: z.string().describe('The comment text'),
8
- parentId: z.number().optional().describe('Parent comment ID for replies'),
9
- path: z.string().optional().describe('File path for file-specific comments'),
10
- line: z.number().optional().describe('Line number for inline comments'),
11
- lineType: z.enum(['ADDED', 'REMOVED', 'CONTEXT']).optional().describe('Type of line (default: CONTEXT)'),
12
- fileType: z.enum(['FROM', 'TO']).optional().describe('Side of diff (default: TO)'),
8
+ parentId: z.number().optional().describe('Parent comment ID to reply to an existing comment'),
13
9
  });
14
10
  export const addPrCommentTool = (server) => {
15
- server.registerTool('bitbucket_add_pr_comment', {
16
- title: 'Add Pull Request Comment',
17
- description: 'Add a comment to a pull request. Supports general comments, replies, and inline file/line comments',
11
+ server.registerTool('add_pr_comment', {
12
+ title: 'Add General Pull Request Comment',
13
+ description: 'Add a general comment to a pull request (not attached to any specific file or line). Use parentId to reply to an existing comment. For file or line-specific comments, use add_pr_file_comment or add_pr_line_comment instead.',
18
14
  inputSchema: schema.shape,
19
- }, async (params) => {
20
- const { projectKey, repositorySlug, pullRequestId, text, parentId, path, line, lineType, fileType } = schema.parse(params);
21
- const body = { text };
22
- if (parentId) {
23
- body.parent = { id: parentId };
24
- }
25
- if (path) {
26
- body.anchor = {
27
- path,
28
- diffType: 'EFFECTIVE',
29
- ...(line && {
30
- line,
31
- lineType: lineType || 'CONTEXT',
32
- fileType: fileType || 'TO',
33
- }),
34
- };
35
- }
36
- const response = await bitbucketClient.post(`/projects/${projectKey}/repos/${repositorySlug}/pull-requests/${pullRequestId}/comments`, body);
15
+ }, async ({ projectKey, repositorySlug, pullRequestId, text, parentId }) => {
16
+ const result = await bitbucketService.addPullRequestComment({
17
+ projectKey,
18
+ repositorySlug,
19
+ pullRequestId,
20
+ text,
21
+ parentId,
22
+ });
23
+ const message = parentId
24
+ ? `Reply added successfully. Comment ID: ${result.id}`
25
+ : `Comment added successfully. Comment ID: ${result.id}`;
37
26
  return {
38
27
  content: [
39
28
  {
40
29
  type: 'text',
41
- text: JSON.stringify(response.data, null, 2),
30
+ text: message,
42
31
  },
43
32
  ],
44
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"add_pr_comment.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_comment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,K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QAAQ,CAAC,2BAA2B,CAAC;IAC5D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAC1D,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;CAC9F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAiB,EAAE,EAAE;IACpD,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,gOAAgO;QAClO,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;QACtE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,qBAAqB,CAAC;YAC1D,UAAU;YACV,cAAc;YACd,aAAa;YACb,IAAI;YACJ,QAAQ;SACT,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,QAAQ;YACtB,CAAC,CAAC,yCAAyC,MAAM,CAAC,EAAE,EAAE;YACtD,CAAC,CAAC,2CAA2C,MAAM,CAAC,EAAE,EAAE,CAAC;QAE3D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,OAAO;iBACd;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const addPrCommentReactionTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=add_pr_comment_reaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_pr_comment_reaction.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_comment_reaction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAYzE,eAAO,MAAM,wBAAwB,GAAI,QAAQ,SAAS,SA4BzD,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import { bitbucketService } from '../../services/bitbucket.js';
3
+ const schema = z.object({
4
+ projectKey: z.string().describe('The Bitbucket project key'),
5
+ repositorySlug: z.string().describe('The repository slug'),
6
+ pullRequestId: z.number().describe('The pull request ID'),
7
+ commentId: z.number().describe('The comment ID'),
8
+ emoticon: z
9
+ .enum(['thumbsup', 'thumbsdown', 'heart', 'thinking_face', 'laughing'])
10
+ .describe('The emoticon to add (thumbsup, thumbsdown, heart, thinking_face, laughing)'),
11
+ });
12
+ export const addPrCommentReactionTool = (server) => {
13
+ server.registerTool('add_pr_comment_reaction', {
14
+ title: 'Add Emoticon Reaction to PR Comment',
15
+ description: 'Add an emoticon reaction to a pull request comment. Supported emoticons: thumbsup, thumbsdown, heart, thinking_face, laughing. The operation is idempotent - adding the same reaction twice will succeed.',
16
+ inputSchema: schema.shape,
17
+ }, async ({ projectKey, repositorySlug, pullRequestId, commentId, emoticon }) => {
18
+ const result = await bitbucketService.addPullRequestCommentReaction({
19
+ projectKey,
20
+ repositorySlug,
21
+ pullRequestId,
22
+ commentId,
23
+ emoticon,
24
+ });
25
+ return {
26
+ content: [
27
+ {
28
+ type: 'text',
29
+ text: `Reaction "${result.emoticon.shortcut}" added successfully to comment ${commentId} by ${result.user.displayName}.`,
30
+ },
31
+ ],
32
+ };
33
+ });
34
+ };
35
+ //# sourceMappingURL=add_pr_comment_reaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_pr_comment_reaction.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_comment_rea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I,CAAC,WAAW,GAAG;iBACzH;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const addPrFileCommentTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=add_pr_file_comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_pr_file_comment.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_file_comment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUzE,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,SA4BrD,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { bitbucketService } from '../../services/bitbucket.js';
3
+ const schema = z.object({
4
+ projectKey: z.string().describe('The Bitbucket project key'),
5
+ repositorySlug: z.string().describe('The repository slug'),
6
+ pullRequestId: z.number().describe('The pull request ID'),
7
+ text: z.string().describe('The comment text'),
8
+ path: z.string().describe('File path to attach the comment to (e.g., "src/main.ts")'),
9
+ });
10
+ export const addPrFileCommentTool = (server) => {
11
+ server.registerTool('add_pr_file_comment', {
12
+ title: 'Add File-Level Pull Request Comment',
13
+ description: 'Add a comment attached to a specific file in a pull request (not to a specific line). The comment will appear at the file level in the PR diff view. To reply to an existing comment (including file/line comments), use add_pr_comment instead.',
14
+ inputSchema: schema.shape,
15
+ }, async ({ projectKey, repositorySlug, pullRequestId, text, path }) => {
16
+ const result = await bitbucketService.addPullRequestComment({
17
+ projectKey,
18
+ repositorySlug,
19
+ pullRequestId,
20
+ text,
21
+ path,
22
+ });
23
+ return {
24
+ content: [
25
+ {
26
+ type: 'text',
27
+ text: `File comment added successfully. Comment ID: ${result.id}`,
28
+ },
29
+ ],
30
+ };
31
+ });
32
+ };
33
+ //# sourceMappingURL=add_pr_file_comment.js.map
@@ -0,0 +1 @@
1
+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J,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const addPrLineCommentTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=add_pr_line_comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_pr_line_comment.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_line_comment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAezE,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,SA+BrD,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import { bitbucketService } from '../../services/bitbucket.js';
3
+ const schema = z.object({
4
+ projectKey: z.string().describe('The Bitbucket project key'),
5
+ repositorySlug: z.string().describe('The repository slug'),
6
+ pullRequestId: z.number().describe('The pull request ID'),
7
+ text: z.string().describe('The comment text'),
8
+ path: z.string().describe('File path (e.g., "src/main.ts")'),
9
+ line: z.number().describe('Line number to comment on (use destination line number from diff)'),
10
+ lineType: z
11
+ .enum(['ADDED', 'REMOVED', 'CONTEXT'])
12
+ .describe('Type of line: ADDED (green +), REMOVED (red -), or CONTEXT (unchanged)'),
13
+ fileType: z.enum(['FROM', 'TO']).describe('Side of diff: FROM (source/old) or TO (destination/new)'),
14
+ });
15
+ export const addPrLineCommentTool = (server) => {
16
+ server.registerTool('add_pr_line_comment', {
17
+ title: 'Add Line-Level Pull Request Comment',
18
+ description: 'Add an inline comment to a specific line in a pull request. Use the line numbers from get_pull_request_file_diff (destination line for TO side, source line for FROM side). Match the lineType to the segment type from the diff (ADDED/REMOVED/CONTEXT). To reply to an existing comment (including file/line comments), use add_pr_comment instead.',
19
+ inputSchema: schema.shape,
20
+ }, async ({ projectKey, repositorySlug, pullRequestId, text, path, line, lineType, fileType }) => {
21
+ const result = await bitbucketService.addPullRequestComment({
22
+ projectKey,
23
+ repositorySlug,
24
+ pullRequestId,
25
+ text,
26
+ path,
27
+ line,
28
+ lineType,
29
+ fileType,
30
+ });
31
+ return {
32
+ content: [
33
+ {
34
+ type: 'text',
35
+ text: `Line comment added successfully. Comment ID: ${result.id}`,
36
+ },
37
+ ],
38
+ };
39
+ });
40
+ };
41
+ //# sourceMappingURL=add_pr_line_comment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add_pr_line_comment.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/add_pr_line_comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC5D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAC1D,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mEAAmE,CAAC;IAC9F,QAAQ,EAAE,CAAC;SACR,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;SACrC,QAAQ,CAAC,wEAAwE,CAAC;IACrF,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,yDAAyD,CAAC;CACrG,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAiB,EAAE,EAAE;IACxD,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;QACE,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EACT,uVAAuV;QACzV,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC5F,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,qBAAqB,CAAC;YAC1D,UAAU;YACV,cAAc;YACd,aAAa;YACb,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,QAAQ;YACR,QAAQ;SACT,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,gDAAgD,MAAM,CAAC,EAAE,EAAE;iBAClE;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const createPullRequestTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=create_pull_request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create_pull_request.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/create_pull_request.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAYzE,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,SA6CtD,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ import { bitbucketService } from '../../services/bitbucket.js';
3
+ const schema = z.object({
4
+ projectKey: z.string().describe('The Bitbucket project key'),
5
+ repositorySlug: z.string().describe('The repository slug'),
6
+ fromBranch: z.string().describe('Source branch name (e.g., "feature-x")'),
7
+ toBranch: z.string().describe('Target branch name (e.g., "main")'),
8
+ title: z.string().describe('PR title'),
9
+ description: z.string().optional().describe('PR description in markdown format'),
10
+ reviewers: z.array(z.string()).optional().describe('Array of reviewer usernames to add'),
11
+ });
12
+ export const createPullRequestTool = (server) => {
13
+ server.registerTool('create_pull_request', {
14
+ title: 'Create Pull Request',
15
+ description: 'Create a new pull request from a source branch to a target branch. Accepts simple branch names (e.g., "feature-x", "main") - they are automatically converted to full refs. If no reviewers are provided, default/required reviewers are automatically fetched and added. Returns the created PR details including ID, title, state, and web URL.',
16
+ inputSchema: schema.shape,
17
+ }, async ({ projectKey, repositorySlug, fromBranch, toBranch, title, description, reviewers }) => {
18
+ let finalReviewers = reviewers;
19
+ // Auto-fetch default reviewers if none provided
20
+ if (!reviewers || reviewers.length === 0) {
21
+ const repo = await bitbucketService.getRepository({ projectKey, repositorySlug });
22
+ const defaultReviewers = await bitbucketService.getRequiredReviewers({
23
+ projectKey,
24
+ repositorySlug,
25
+ repositoryId: repo.id,
26
+ sourceBranch: fromBranch,
27
+ targetBranch: toBranch,
28
+ });
29
+ finalReviewers = defaultReviewers.map((r) => r.name);
30
+ }
31
+ const result = await bitbucketService.createPullRequest({
32
+ projectKey,
33
+ repositorySlug,
34
+ title,
35
+ description,
36
+ fromBranch,
37
+ toBranch,
38
+ reviewers: finalReviewers,
39
+ });
40
+ return {
41
+ content: [
42
+ {
43
+ type: 'text',
44
+ text: JSON.stringify(result, null, 2),
45
+ },
46
+ ],
47
+ };
48
+ });
49
+ };
50
+ //# sourceMappingURL=create_pull_request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create_pull_request.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/create_pull_request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,UAAU,EAAE,CAAC,CAAC,MA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EAAE,IAAI,CAAC,EAAE;gBACrB,YAAY,EAAE,UAAU;gBACxB,YAAY,EAAE,QAAQ;aACvB,CAAC,CAAC;YACH,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,CAAC;YACtD,UAAU;YACV,cAAc;YACd,KAAK;YACL,WAAW;YACX,UAAU;YACV,QAAQ;YACR,SAAS,EAAE,cAAc;SAC1B,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBACtC;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const deletePrCommentTool: (server: McpServer) => void;
3
+ //# sourceMappingURL=delete_pr_comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_pr_comment.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/delete_pr_comment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUzE,eAAO,MAAM,mBAAmB,GAAI,QAAQ,SAAS,SA4BpD,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { bitbucketService } from '../../services/bitbucket.js';
3
+ const schema = z.object({
4
+ projectKey: z.string().describe('The Bitbucket project key'),
5
+ repositorySlug: z.string().describe('The repository slug'),
6
+ pullRequestId: z.number().describe('The pull request ID'),
7
+ commentId: z.number().describe('The ID of the comment to delete'),
8
+ version: z.number().describe('The expected version of the comment (get from comment object)'),
9
+ });
10
+ export const deletePrCommentTool = (server) => {
11
+ server.registerTool('delete_pr_comment', {
12
+ title: 'Delete Pull Request Comment',
13
+ description: 'Delete a pull request comment. You can delete your own comments. Only REPO_ADMIN users can delete comments created by others. Comments with replies cannot be deleted. You must provide the comment version to prevent concurrent modification conflicts - get the version from the comment object.',
14
+ inputSchema: schema.shape,
15
+ }, async ({ projectKey, repositorySlug, pullRequestId, commentId, version }) => {
16
+ await bitbucketService.deletePullRequestComment({
17
+ projectKey,
18
+ repositorySlug,
19
+ pullRequestId,
20
+ commentId,
21
+ version,
22
+ });
23
+ return {
24
+ content: [
25
+ {
26
+ type: 'text',
27
+ text: `Comment ${commentId} deleted successfully.`,
28
+ },
29
+ ],
30
+ };
31
+ });
32
+ };
33
+ //# sourceMappingURL=delete_pr_comment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_pr_comment.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/delete_pr_comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC5D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAC1D,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IACzD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IACjE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;CAC9F,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAiB,EAAE,EAAE;IACvD,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,qSAAqS;QACvS,WAAW,EAAE,MAAM,CAAC,KAAK;KAC1B,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;QAC1E,MAAM,gBAAgB,CAAC,wBAAwB,CAAC;YAC9C,UAAU;YACV,cAAc;YACd,aAAa;YACb,SAAS;YACT,OAAO;SACR,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,WAAW,SAAS,wBAAwB;iBACnD;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  export declare const getInboxPullRequestsTool: (server: McpServer) => void;
3
3
  //# sourceMappingURL=get_inbox_pull_requests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get_inbox_pull_requests.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/get_inbox_pull_requests.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAczE,eAAO,MAAM,wBAAwB,GAAI,QAAQ,SAAS,SA0DzD,CAAC"}
1
+ {"version":3,"file":"get_inbox_pull_requests.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/get_inbox_pull_requests.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,eAAO,MAAM,wBAAwB,GAAI,QAAQ,SAAS,SAyCzD,CAAC"}