MCP Server Atlassian Bitbucket
Raw access to the Bitbucket Cloud REST API 2.0 through five HTTP-verb tools plus a repo clone tool
Browse, review and manage pull requests on a self-hosted Bitbucket Data Center instance
By Eugene Moroz (individual) TypeScript Local · stdio Git and code hostingDeveloper tools
61 popularity score ★ 109 ↓ 8.8k/wk
Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
It needs BITBUCKET_HOST, BITBUCKET_API_TOKEN. Replace each <NAME> with your value.
claude mcp add atlassian-bitbucket-data-center -e BITBUCKET_HOST=<BITBUCKET_HOST> -e BITBUCKET_API_TOKEN=<BITBUCKET_API_TOKEN> -- npx -y @atlassian-dc-mcp/bitbucket{
"mcpServers": {
"atlassian-bitbucket-data-center": {
"command": "npx",
"args": [
"-y",
"@atlassian-dc-mcp/bitbucket"
],
"env": {
"BITBUCKET_HOST": "<BITBUCKET_HOST>",
"BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
}
}
}
}{
"mcpServers": {
"atlassian-bitbucket-data-center": {
"command": "npx",
"args": [
"-y",
"@atlassian-dc-mcp/bitbucket"
],
"env": {
"BITBUCKET_HOST": "<BITBUCKET_HOST>",
"BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
}
}
}
}{
"servers": {
"atlassian-bitbucket-data-center": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@atlassian-dc-mcp/bitbucket"
],
"env": {
"BITBUCKET_HOST": "<BITBUCKET_HOST>",
"BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
}
}
}
}[mcp_servers.atlassian-bitbucket-data-center]
command = "npx"
args = ["-y", "@atlassian-dc-mcp/bitbucket"]
[mcp_servers.atlassian-bitbucket-data-center.env]
BITBUCKET_HOST = "<BITBUCKET_HOST>"
BITBUCKET_API_TOKEN = "<BITBUCKET_API_TOKEN>"gemini mcp add --scope user -e BITBUCKET_HOST=<BITBUCKET_HOST> -e BITBUCKET_API_TOKEN=<BITBUCKET_API_TOKEN> atlassian-bitbucket-data-center npx -- -y @atlassian-dc-mcp/bitbucketBITBUCKET_HOST |
Required: Instance host and port without protocol (https is assumed). Use BITBUCKET_API_BASE_PATH instead to give a full URL such as https://host/rest. |
|---|---|
BITBUCKET_API_TOKEN secret |
Required: Bitbucket HTTP access token. Not needed in the env if the setup command saved it. |
BITBUCKET_API_BASE_PATH |
Optional: Full API base URL including protocol, as an alternative to BITBUCKET_HOST; /api/latest is added automatically. |
BITBUCKET_DEFAULT_PAGE_SIZE |
Optional: Page size for list tools and code search when no limit is given. |
ATLASSIAN_DC_MCP_CONFIG_FILE |
Optional: Absolute path to a shared dotenv file holding the settings; the server fails if it is set but missing. |
ATLASSIAN_DC_MCP_REQUEST_TIMEOUT_MS |
Optional: API request timeout in milliseconds. |
| Set together: merge | |
BITBUCKET_MERGE_ENABLED |
Optional: Set to true to register the merge tool; needs BITBUCKET_MERGE_ALLOWED_REPOS. |
BITBUCKET_MERGE_ALLOWED_REPOS |
Optional: Comma-separated PROJECT/slug or PROJECT/* entries that may be merged. |
BITBUCKET_MERGE_ALLOWED_TARGET_REFS |
Optional: Optional list of target branches merges may land on; empty allows any. |
| Set together: decline | |
BITBUCKET_DECLINE_ENABLED |
Optional: Set to true to register the decline tool; needs BITBUCKET_DECLINE_ALLOWED_REPOS. |
BITBUCKET_DECLINE_ALLOWED_REPOS |
Optional: Comma-separated PROJECT/slug or PROJECT/* entries where declining is allowed. |
This is the Bitbucket package from the atlassian-dc-mcp monorepo, which also publishes separate Jira and Confluence servers. It runs on your machine over stdio and talks to the REST API of a self-managed Bitbucket Data Center instance using a personal HTTP access token. It is a community project, and its makers say it is not affiliated with or supported by Atlassian.
Reading comes first. It lists projects, repositories and commits. It can open files or page through directories at any branch, tag or commit without a clone, and diff two branches even when no pull request exists. Code search takes project:, repo:, path:, lang: and ext: modifiers inside the query and pages with start. If Bitbucket cannot apply the query as written, the tool returns an error instead of quietly giving you results for some other query. Pull requests can be inspected in detail: changed files, per-file diffs, comments, required reviewers, CI build statuses and whether a merge would be blocked. On the write side it creates branches and pull requests, edits pull requests, posts and edits comments (draft review comments too) and submits a review verdict.
The source registers 29 tools (packages/bitbucket/src/index.ts plus register-pr-comments-tool.ts), while the package README documents about a dozen. That README still describes a bitbucket_getBranches tool, which the code does not register. Merging and declining start switched off. Each needs its own flag and a list of allowed repositories, and every call is checked against that list before Bitbucket is contacted. Reopen is always there.
| Runtime | Node.js 18+ |
|---|---|
| Runs on | macOS, Windows, Linux |
| Bitbucket Data Center | Your own instanceAn HTTP access token from Manage Account > HTTP access tokens |
Give the instance as BITBUCKET_HOST (host and port, https assumed) or as a full BITBUCKET_API_BASE_PATH, with the token as BITBUCKET_API_TOKEN. You can instead store them once with `npx @atlassian-dc-mcp/bitbucket setup`, which writes to the macOS Keychain or ~/.atlassian-dc-mcp/bitbucket.env.
The package README lists only about a dozen tools and still includes bitbucket_getBranches, which the code does not register. Go by the tool list on this page, taken from the registration code.
It suits teams that run Bitbucket Data Center on their own infrastructure and want an assistant to read code, review pull requests and open branches or pull requests, all with one user's token. Because merging and declining are opt-in and limited to named repositories, the operator can permit write access in stages. It is not an Atlassian product. We also list mrrefactoring/atlassian-dc-mcp (npm bitbucket-datacenter-mcp), a separate community server for Bitbucket Data Center. Check that one's own page before choosing between them.
20 only read, 8 change things, 1 can delete or overwrite. A ? marks an optional parameter.
bitbucket_getProjectsname?: stringpermission?: stringstart?: numberlimit?: numberbitbucket_getProjectprojectKey: stringbitbucket_getRepositoriesprojectKey: stringstart?: numberlimit?: numberbitbucket_getRepositoryprojectKey: stringrepositorySlug: stringbitbucket_getFileContentprojectKey: stringrepositorySlug: stringpath: stringat?: stringbitbucket_browseRepositoryprojectKey: stringrepositorySlug: stringpath?: stringat?: stringstart?: numberlimit?: numberbitbucket_createBranch changesprojectKey: stringrepositorySlug: stringname: stringstartPoint: stringbitbucket_getCommitsprojectKey: stringrepositorySlug: stringpath?: stringsince?: stringuntil?: stringlimit?: numberbitbucket_getPullRequestsprojectKey: stringrepositorySlug: stringwithAttributes?: stringat?: stringwithProperties?: stringdraft?: stringfilterText?: stringstate?: stringorder?: stringdirection?: stringstart?: numberlimit?: numberbitbucket_getPullRequestprojectKey: stringrepositorySlug: stringpullRequestId: stringbitbucket_getPR_CommentsAndActionprojectKey: stringrepositorySlug: stringpullRequestId: stringstart?: numberlimit?: numberoutput?: enumincludeResolved?: booleanbitbucket_getPullRequestChangesprojectKey: stringrepositorySlug: stringpullRequestId: stringsinceId?: stringchangeScope?: stringuntilId?: stringwithComments?: stringstart?: numberlimit?: numberoutput?: enumbitbucket_getUseruserSlug?: stringfilter?: stringbitbucket_postPullRequestComment changesprojectKey: stringrepositorySlug: stringpullRequestId: stringtext: stringparentId?: numberfilePath?: stringstartLine?: numberstartLineType?: enumline?: numberlineType?: enumpending?: booleanseverity?: enumoutput?: enumbitbucket_updatePullRequestComment changesprojectKey: stringrepositorySlug: stringpullRequestId: stringcommentId: stringversion: numbertext?: stringstate?: enumseverity?: enumthreadResolved?: booleanoutput?: enumbitbucket_submitPullRequestReview changesprojectKey: stringrepositorySlug: stringpullRequestId: stringuserSlug: stringstatus: enumlastReviewedCommit?: stringbitbucket_getPullRequestDiffprojectKey: stringrepositorySlug: stringpullRequestId: stringpath: stringcontextLines?: stringsinceId?: stringsrcPath?: stringdiffType?: stringuntilId?: stringwhitespace?: stringbitbucket_getBranchDiffprojectKey: stringrepositorySlug: stringsourceBranch: stringtargetBranch?: stringpath?: stringcontextLines?: stringsrcPath?: stringwhitespace?: stringoutput?: enumbitbucket_createPullRequest changesprojectKey: stringrepositorySlug: stringtitle: stringdescription?: stringfromRefId: stringtoRefId: stringdraft?: booleanreviewers?: arrayoutput?: enumfromProjectKey?: stringfromRepositorySlug?: stringbitbucket_updatePullRequest changesprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numbertitle?: stringdescription?: stringdraft?: booleanreviewers?: arrayoutput?: enumbitbucket_canMergePullRequestprojectKey: stringrepositorySlug: stringpullRequestId: stringbitbucket_getPullRequestBuildsprojectKey: stringrepositorySlug: stringpullRequestId: stringbitbucket_mergePullRequest deletesprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numberstrategyId?: stringmessage?: stringoutput?: enumbitbucket_declinePullRequest changesprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numbercomment?: stringoutput?: enumbitbucket_reopenPullRequest changesprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numberoutput?: enumbitbucket_getRequiredReviewersprojectKey: stringrepositorySlug: stringsourceRefId: stringtargetRefId: stringsourceRepoId?: stringtargetRepoId?: stringbitbucket_getInboxPullRequestsstart?: numberlimit?: numberbitbucket_getDashboardPullRequestsrole?: enumstate?: enumclosedSince?: numberorder?: enumstart?: numberlimit?: numberbitbucket_searchCodequery: stringlimit?: numberstart?: number