mcp-bitbucket-server 1.9.0 → 1.10.0
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.
package/CLAUDE.md
CHANGED
|
@@ -311,7 +311,7 @@ export const getUserProfileTool = (server: McpServer) => {
|
|
|
311
311
|
|
|
312
312
|
**Returns**: Created pull request object including `id`, `title`, `state`, `fromRef`, `toRef`, `author`, and web URL.
|
|
313
313
|
|
|
314
|
-
**Purpose**: Create a new pull request from a source branch to a target branch. Accepts simple branch names - they are automatically converted to full refs (e.g., "main" → "refs/heads/main").
|
|
314
|
+
**Purpose**: Create a new pull request from a source branch to a target branch. Accepts simple branch names - they are automatically converted to full refs (e.g., "main" → "refs/heads/main"). If no reviewers are provided, default/required reviewers configured in Bitbucket are automatically fetched and added (matching UI behavior, since the REST API doesn't do this automatically).
|
|
315
315
|
|
|
316
316
|
**Error Cases**:
|
|
317
317
|
- 400: Malformed request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_pull_request.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/create_pull_request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAczE,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,
|
|
1
|
+
{"version":3,"file":"create_pull_request.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/create_pull_request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAczE,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,SA6CtD,CAAC"}
|
|
@@ -12,9 +12,22 @@ const schema = z.object({
|
|
|
12
12
|
export const createPullRequestTool = (server) => {
|
|
13
13
|
server.registerTool('create_pull_request', {
|
|
14
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. Returns the created PR details including ID, title, state, and web URL.',
|
|
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
16
|
inputSchema: schema.shape,
|
|
17
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
|
+
}
|
|
18
31
|
const result = await bitbucketService.createPullRequest({
|
|
19
32
|
projectKey,
|
|
20
33
|
repositorySlug,
|
|
@@ -22,7 +35,7 @@ export const createPullRequestTool = (server) => {
|
|
|
22
35
|
description,
|
|
23
36
|
fromBranch,
|
|
24
37
|
toBranch,
|
|
25
|
-
reviewers,
|
|
38
|
+
reviewers: finalReviewers,
|
|
26
39
|
});
|
|
27
40
|
return {
|
|
28
41
|
content: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create_pull_request.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/create_pull_request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAA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,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-bitbucket-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "MCP server for Bitbucket Server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@modelcontextprotocol/sdk": "^1.13.3",
|
|
67
67
|
"axios": "^1.13.2",
|
|
68
|
-
"bitbucket-data-center-client": "^1.
|
|
68
|
+
"bitbucket-data-center-client": "^1.2.0",
|
|
69
69
|
"dotenv": "^17.2.3",
|
|
70
70
|
"zod": "^3.25.67"
|
|
71
71
|
},
|