Atlassian Bitbucket Data Center MCP

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

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs BITBUCKET_HOST, BITBUCKET_API_TOKEN. Replace each <NAME> with your value.

Claude CodeTerminal
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
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "atlassian-bitbucket-data-center": {
      "command": "npx",
      "args": [
        "-y",
        "@atlassian-dc-mcp/bitbucket"
      ],
      "env": {
        "BITBUCKET_HOST": "<BITBUCKET_HOST>",
        "BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "atlassian-bitbucket-data-center": {
      "command": "npx",
      "args": [
        "-y",
        "@atlassian-dc-mcp/bitbucket"
      ],
      "env": {
        "BITBUCKET_HOST": "<BITBUCKET_HOST>",
        "BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "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>"
      }
    }
  }
}
Codex~/.codex/config.toml
[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 CLITerminal
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/bitbucket

Settings 11

BITBUCKET_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. Default 25.
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. Default 30000.
Set together: merge
BITBUCKET_MERGE_ENABLED Optional: Set to true to register the merge tool; needs BITBUCKET_MERGE_ALLOWED_REPOS. Default false. For bitbucket_mergePullRequest.
BITBUCKET_MERGE_ALLOWED_REPOS Optional: Comma-separated PROJECT/slug or PROJECT/* entries that may be merged. For bitbucket_mergePullRequest.
BITBUCKET_MERGE_ALLOWED_TARGET_REFS Optional: Optional list of target branches merges may land on; empty allows any. For bitbucket_mergePullRequest.
Set together: decline
BITBUCKET_DECLINE_ENABLED Optional: Set to true to register the decline tool; needs BITBUCKET_DECLINE_ALLOWED_REPOS. Default false. For bitbucket_declinePullRequest.
BITBUCKET_DECLINE_ALLOWED_REPOS Optional: Comma-separated PROJECT/slug or PROJECT/* entries where declining is allowed. For bitbucket_declinePullRequest.

What it does

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.

What it needs

RuntimeNode.js 18+
Runs onmacOS, Windows, Linux
Bitbucket Data CenterYour 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.

Limits

  • Not covered Targets the Bitbucket Data Center REST API only; Bitbucket Cloud is not covered
  • Limit Exits at startup when no host or token is found in the environment, an env file, the home file or the Keychain
  • Limit bitbucket_mergePullRequest and bitbucket_declinePullRequest are not registered unless their ENABLED flag and an allowed-repository list are set
  • Limit A repository entry whose project is * (such as */*) is ignored, so no allowlist can open every project
  • Not covered No auto-merge, and the README's bitbucket_getBranches tool is not registered by the code
  • Size cap List tools and code search return 25 items unless limit or BITBUCKET_DEFAULT_PAGE_SIZE is set
  • Limit API requests time out after 30 seconds unless ATLASSIAN_DC_MCP_REQUEST_TIMEOUT_MS is set

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.

Who it suits

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.

Tools 29

20 only read, 8 change things, 1 can delete or overwrite. A ? marks an optional parameter.

bitbucket_getProjects
List projects, optionally filtered by name or permissionname?: stringpermission?: stringstart?: numberlimit?: number
bitbucket_getProject
Fetch one project by its keyprojectKey: string
bitbucket_getRepositories
List the repositories in a projectprojectKey: stringstart?: numberlimit?: number
bitbucket_getRepository
Fetch details of one repositoryprojectKey: stringrepositorySlug: string
bitbucket_getFileContent
Read a whole file at a branch, tag or commit; a directory path gives its treeprojectKey: stringrepositorySlug: stringpath: stringat?: string
bitbucket_browseRepository
Page through a directory listing or a file's lines without cloningprojectKey: stringrepositorySlug: stringpath?: stringat?: stringstart?: numberlimit?: number
bitbucket_createBranch changes
Create a new branch from a branch, tag or commitprojectKey: stringrepositorySlug: stringname: stringstartPoint: string
bitbucket_getCommits
List commits in a repository, optionally for one path or rangeprojectKey: stringrepositorySlug: stringpath?: stringsince?: stringuntil?: stringlimit?: number
bitbucket_getPullRequests
List a repository's pull requests, filterable by state, branch or textprojectKey: stringrepositorySlug: stringwithAttributes?: stringat?: stringwithProperties?: stringdraft?: stringfilterText?: stringstate?: stringorder?: stringdirection?: stringstart?: numberlimit?: number
bitbucket_getPullRequest
Fetch one pull request, including its reviewers and current versionprojectKey: stringrepositorySlug: stringpullRequestId: string
bitbucket_getPR_CommentsAndAction
Read a pull request's comments and activity such as approvals; resolved threads are hidden unless asked forprojectKey: stringrepositorySlug: stringpullRequestId: stringstart?: numberlimit?: numberoutput?: enumincludeResolved?: boolean
bitbucket_getPullRequestChanges
List the files a pull request changesprojectKey: stringrepositorySlug: stringpullRequestId: stringsinceId?: stringchangeScope?: stringuntilId?: stringwithComments?: stringstart?: numberlimit?: numberoutput?: enum
bitbucket_getUser
Look up a user by slug, or search users by name or emailuserSlug?: stringfilter?: string
bitbucket_postPullRequestComment changes
Add a comment to a pull request, optionally inline or as a pending draftprojectKey: stringrepositorySlug: stringpullRequestId: stringtext: stringparentId?: numberfilePath?: stringstartLine?: numberstartLineType?: enumline?: numberlineType?: enumpending?: booleanseverity?: enumoutput?: enum
bitbucket_updatePullRequestComment changes
Edit a comment, change its severity or task state, or resolve its threadprojectKey: stringrepositorySlug: stringpullRequestId: stringcommentId: stringversion: numbertext?: stringstate?: enumseverity?: enumthreadResolved?: booleanoutput?: enum
bitbucket_submitPullRequestReview changes
Publish draft comments and set the reviewer's verdictprojectKey: stringrepositorySlug: stringpullRequestId: stringuserSlug: stringstatus: enumlastReviewedCommit?: string
bitbucket_getPullRequestDiff
Get the text diff of one file in a pull requestprojectKey: stringrepositorySlug: stringpullRequestId: stringpath: stringcontextLines?: stringsinceId?: stringsrcPath?: stringdiffType?: stringuntilId?: stringwhitespace?: string
bitbucket_getBranchDiff
Diff two branches, tags or commits, with or without a pull requestprojectKey: stringrepositorySlug: stringsourceBranch: stringtargetBranch?: stringpath?: stringcontextLines?: stringsrcPath?: stringwhitespace?: stringoutput?: enum
bitbucket_createPullRequest changes
Open a pull request, including one from a forkprojectKey: stringrepositorySlug: stringtitle: stringdescription?: stringfromRefId: stringtoRefId: stringdraft?: booleanreviewers?: arrayoutput?: enumfromProjectKey?: stringfromRepositorySlug?: string
bitbucket_updatePullRequest changes
Change a pull request's title, description, reviewers or draft stateprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numbertitle?: stringdescription?: stringdraft?: booleanreviewers?: arrayoutput?: enum
bitbucket_canMergePullRequest
Report whether a pull request can merge and what vetoes block itprojectKey: stringrepositorySlug: stringpullRequestId: string
bitbucket_getPullRequestBuilds
Show CI build statuses reported on a pull request's latest commitprojectKey: stringrepositorySlug: stringpullRequestId: string
bitbucket_mergePullRequest deletes
Merge a pull request; registered only when merging is enabled for listed repositoriesprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numberstrategyId?: stringmessage?: stringoutput?: enum
bitbucket_declinePullRequest changes
Close a pull request without merging; registered only when declining is enabledprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numbercomment?: stringoutput?: enum
bitbucket_reopenPullRequest changes
Reopen a declined pull requestprojectKey: stringrepositorySlug: stringpullRequestId: stringversion: numberoutput?: enum
bitbucket_getRequiredReviewers
List required reviewers for a planned source and target refprojectKey: stringrepositorySlug: stringsourceRefId: stringtargetRefId: stringsourceRepoId?: stringtargetRepoId?: string
bitbucket_getInboxPullRequests
List pull requests waiting for the current user's reviewstart?: numberlimit?: number
bitbucket_getDashboardPullRequests
List the user's pull requests across all repositories by role and staterole?: enumstate?: enumclosedSince?: numberorder?: enumstart?: numberlimit?: number
bitbucket_searchCode
Search code across the instance with project, repo, path, lang and ext modifiers, paged by startquery: stringlimit?: numberstart?: number

Similar servers