mcp-bitbucket-dc 0.0.0-stage → 0.44.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/LICENSE +23 -0
- package/README.md +116 -2
- package/bin/run.js +7 -0
- package/dist/chunk-UHYAPQDB.js +11683 -0
- package/dist/index.js +293 -0
- package/dist/setup.js +19 -0
- package/package.json +63 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tekthar
|
|
4
|
+
Copyright (c) 2025 b1ff/atlassian-dc-mcp contributors
|
|
5
|
+
Copyright (c) 2024 Hyeonsoo Lee (sooperset/mcp-atlassian)
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,117 @@
|
|
|
1
|
-
#
|
|
1
|
+
# mcp-bitbucket-dc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An MCP server for **Bitbucket Data Center and Bitbucket Server**. It lets Claude and other MCP clients browse projects, repositories, files, branches and commits, search code, and review and comment on pull requests. Merging and declining pull requests are off until you allow them for named repositories.
|
|
4
|
+
|
|
5
|
+
- **27 tools**, plus 2 opt-in tools for merging and declining.
|
|
6
|
+
- **Merges stay under your control.** They are limited to the repositories and target branches you list, and are checked before anything is written.
|
|
7
|
+
- **One `npx` command:** no Python, no Docker.
|
|
8
|
+
|
|
9
|
+
Not affiliated with or endorsed by Atlassian. Bitbucket is a trademark of Atlassian.
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
- Node.js 22.22.2 or later
|
|
14
|
+
- Bitbucket Data Center or Bitbucket Server, and an HTTP access token. To create one in Bitbucket, open your profile picture, then **Manage account** > **HTTP access tokens** > **Create token**.
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
1. Save your Bitbucket address and token:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx -y mcp-bitbucket-dc setup
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
On macOS the token goes to the Keychain. Everything else goes to `~/.atlassian-dc-mcp/bitbucket.env` (on Windows, `%USERPROFILE%\.atlassian-dc-mcp\bitbucket.env`), which only your user can read.
|
|
25
|
+
|
|
26
|
+
2. Add the server to your MCP client.
|
|
27
|
+
|
|
28
|
+
Claude Code:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
claude mcp add bitbucket -- npx -y mcp-bitbucket-dc
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Claude Desktop, Cursor, VS Code and other clients with an `mcpServers` file:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"bitbucket": { "command": "npx", "args": ["-y", "mcp-bitbucket-dc"] }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
To skip `setup` and pass settings directly, add an `env` block to that entry:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
"env": { "BITBUCKET_HOST": "bitbucket.example.com", "BITBUCKET_API_TOKEN": "<HTTP access token>" }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
| Variable | Purpose |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `BITBUCKET_HOST` | Host name and optional port, without `https://`. Example: `bitbucket.example.com` |
|
|
55
|
+
| `BITBUCKET_API_BASE_PATH` | Full REST base URL, used instead of `BITBUCKET_HOST`. Example: `https://example.com/bitbucket/rest` |
|
|
56
|
+
| `BITBUCKET_API_TOKEN` | HTTP access token |
|
|
57
|
+
| `BITBUCKET_DEFAULT_PAGE_SIZE` | Page size for list tools. Default 25. |
|
|
58
|
+
| `ATLASSIAN_DC_MCP_CONFIG_FILE` | Absolute path to a dotenv file holding any of these settings, for example one file shared by several tools |
|
|
59
|
+
|
|
60
|
+
Each setting comes from the first of these places that has it:
|
|
61
|
+
1. environment variables;
|
|
62
|
+
2. the dotenv file (`ATLASSIAN_DC_MCP_CONFIG_FILE`, or `.env` in the working directory);
|
|
63
|
+
3. the file `setup` writes;
|
|
64
|
+
4. the macOS Keychain.
|
|
65
|
+
|
|
66
|
+
In scripts and CI, `setup` also runs without prompts:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx -y mcp-bitbucket-dc setup --non-interactive --host bitbucket.example.com --token "$BITBUCKET_TOKEN"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`npx -y mcp-bitbucket-dc setup --help` lists every option.
|
|
73
|
+
|
|
74
|
+
## Tools
|
|
75
|
+
|
|
76
|
+
| Area | Tools |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| Projects and repositories | `bitbucket_getProjects`, `bitbucket_getProject`, `bitbucket_getRepositories`, `bitbucket_getRepository`, `bitbucket_browseRepository`, `bitbucket_getFileContent`, `bitbucket_searchCode` |
|
|
79
|
+
| Branches and commits | `bitbucket_createBranch`, `bitbucket_getCommits`, `bitbucket_getBranchDiff` |
|
|
80
|
+
| Reading pull requests | `bitbucket_getPullRequests`, `bitbucket_getPullRequest`, `bitbucket_getPR_CommentsAndAction`, `bitbucket_getPullRequestChanges`, `bitbucket_getPullRequestDiff`, `bitbucket_getPullRequestBuilds`, `bitbucket_canMergePullRequest`, `bitbucket_getRequiredReviewers`, `bitbucket_getInboxPullRequests`, `bitbucket_getDashboardPullRequests` |
|
|
81
|
+
| Working on pull requests | `bitbucket_createPullRequest`, `bitbucket_updatePullRequest`, `bitbucket_postPullRequestComment`, `bitbucket_updatePullRequestComment`, `bitbucket_submitPullRequestReview`, `bitbucket_reopenPullRequest` |
|
|
82
|
+
| Users | `bitbucket_getUser` |
|
|
83
|
+
| Opt-in | `bitbucket_mergePullRequest`, `bitbucket_declinePullRequest` |
|
|
84
|
+
|
|
85
|
+
`bitbucket_getPR_CommentsAndAction` and `bitbucket_getPullRequestChanges` take `output=summary|compact|full`. The default is `compact`.
|
|
86
|
+
|
|
87
|
+
### Merging and declining pull requests
|
|
88
|
+
|
|
89
|
+
Both tools stay unlisted until you enable them and name the repositories they may act on. The model cannot widen that list.
|
|
90
|
+
|
|
91
|
+
| Variable | Purpose |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| `BITBUCKET_MERGE_ENABLED` | `true` lists `bitbucket_mergePullRequest` |
|
|
94
|
+
| `BITBUCKET_MERGE_ALLOWED_REPOS` | Required for merging. `PROJECT/repo` entries, comma-separated. `PROJECT/*` allows a whole project. |
|
|
95
|
+
| `BITBUCKET_MERGE_ALLOWED_TARGET_REFS` | Optional. Branches that may be merged into, such as `develop,refs/heads/release/*` |
|
|
96
|
+
| `BITBUCKET_DECLINE_ENABLED` | `true` lists `bitbucket_declinePullRequest` |
|
|
97
|
+
| `BITBUCKET_DECLINE_ALLOWED_REPOS` | Required for declining. Same format as for merging. |
|
|
98
|
+
|
|
99
|
+
Before writing anything, a merge is checked against the allowed repositories and target branches. It also has to pass Bitbucket's own merge checks: conflicts, required approvals, open tasks and builds. Both tools require the pull request's current `version`, so a pull request that changed after you looked at it is rejected. `bitbucket_reopenPullRequest` undoes a decline.
|
|
100
|
+
|
|
101
|
+
## Security notes
|
|
102
|
+
|
|
103
|
+
- **Clients can tell reads from writes.** Read tools are marked read-only for MCP clients.
|
|
104
|
+
- **Treat Bitbucket content as data, not instructions.** File contents, diffs, commit messages and comments are written by other people.
|
|
105
|
+
|
|
106
|
+
## Related projects
|
|
107
|
+
|
|
108
|
+
- [mcp-jira-dc](https://www.npmjs.com/package/mcp-jira-dc) and [mcp-confluence-dc](https://www.npmjs.com/package/mcp-confluence-dc): the same approach for Jira and Confluence Data Center.
|
|
109
|
+
- [Atlassian's official MCP server](https://github.com/atlassian/atlassian-mcp-server): a remote server for Atlassian Cloud.
|
|
110
|
+
|
|
111
|
+
## Acknowledgments
|
|
112
|
+
|
|
113
|
+
mcp-bitbucket-dc builds on [b1ff/atlassian-dc-mcp](https://github.com/b1ff/atlassian-dc-mcp) (MIT). Its copyright notice is in [LICENSE](LICENSE), together with those of the other projects this code shares parts with.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT
|