Bitbucket MCP Server: Setup & PR Workflows (2026 Guide)
The Bitbucket MCP server lets your AI agent list repos, read pull-request diffs, post review comments, check pipelines, and merge — straight against Bitbucket Cloud’s REST API. This guide covers the auth migration everyone is hitting right now (app passwords are being switched off in mid-2026), the precise state of Atlassian’s official MCP server vs the community one, install steps for every client, the six-generic-tools design, and the PR-review, pipeline, and repo-Q&A workflows that make it worth running.

TL;DR + what you actually need
- One package:
@aashari/mcp-server-atlassian-bitbucket— the most-installed community implementation. Runs vianpx, needs Node 18+, and covers Bitbucket Cloud only (not Server/Data Center). - Two env vars:
ATLASSIAN_USER_EMAILandATLASSIAN_API_TOKEN— a scoped API token created at id.atlassian.com with therepository,workspace, and (for PR writes)pullrequestscopes. Do not set this up with an app password: Atlassian started browning them out on June 9, 2026 and removes them on July 28, 2026. - Six tools:
bb_get,bb_post,bb_put,bb_patch,bb_delete,bb_clone— generic REST passthrough to any Bitbucket Cloud 2.0 endpoint, with JMESPath filtering and a token-efficient default output format.
The copy-paste, if that’s all you came for:
claude mcp add bitbucket \
-e [email protected] \
-e ATLASSIAN_API_TOKEN=your_scoped_token \
-- npx -y @aashari/mcp-server-atlassian-bitbucketThe rest of this guide explains why the auth looks like that, how the official Atlassian MCP server fits, and where the sharp edges are.
What Bitbucket MCP actually does
The Bitbucket MCP server is a stdio process — your MCP client launches it as a subprocess — that translates tool calls from the model into authenticated requests against Bitbucket Cloud’s REST API 2.0. Ask “show me the open pull requests that need my review” and the agent calls bb_get with /repositories/your-workspace/your-repo/pullrequests and a state filter, gets real JSON back, and answers from data instead of guessing.
The design choice that defines this server: instead of shipping one named tool per operation, version 2.x ships six generic tools mapped to HTTP verbs. Any endpoint Bitbucket exposes — pull requests, branches, commits, file contents, pipelines, deployments, issues — is reachable by passing the right path. The server prepends the /2.0 API prefix automatically, supports server-side query parameters, and lets the agent attach a JMESPath expression (passed as jq) to strip the response down to the fields it needs.
Two consequences worth internalizing before you install. First, the tool list costs very little context — six tool schemas instead of thirty. Second, correctness now depends on the model knowing Bitbucket’s REST paths. Claude knows this API well, and the tool descriptions include the common paths, but you’ll occasionally see an invented endpoint return a 404 — more on that in limits.
The server also ships a CLI mode (same commands, terminal output) which is the fastest way to verify your credentials before blaming your MCP client:
export ATLASSIAN_USER_EMAIL="[email protected]"
export ATLASSIAN_API_TOKEN="your_scoped_token"
npx -y @aashari/mcp-server-atlassian-bitbucket get --path "/workspaces"If that prints your workspaces, the MCP side will work. If it doesn’t, fix auth first.
The Bitbucket MCP landscape: community vs official
“Bitbucket MCP” is not one thing. Three implementations matter in 2026, and the differences are sharper than most roundups admit.
| Server | Deployment | Covers | Auth |
|---|---|---|---|
| aashari (this guide’s default) | Local stdio via npx | Bitbucket Cloud only | Scoped API token (app password legacy) |
| nexus2520 / pdogra1299 | Local stdio via npx | Cloud and Server/Data Center | Token per deployment type |
| Atlassian Rovo MCP (official) | Remote, mcp.atlassian.com | Jira, Confluence, Compass + restricted Bitbucket Cloud tools | OAuth 2.1; Bitbucket tools API-token-only |
Does Atlassian’s official MCP server cover Bitbucket?
Yes — but with enough caveats that the answer is effectively “not for most individual developers.” Atlassian’s remote MCP server (now branded the Rovo MCP Server, endpoint https://mcp.atlassian.com/v1/mcp/authv2) launched around Jira and Confluence, and its getting-started docs still headline Jira, Confluence, and Compass. Bitbucket Cloud tools were added to the supported-tools list — read tools for workspaces, repos, PRs, pipelines, and deployments, plus write tools for PR create/approve/merge — but Atlassian’s own documentation attaches three conditions: Bitbucket tools work over API-token authentication only (not the OAuth 2.1 browser flow), they must be enabled by your organization admin, and your Bitbucket workspace must be linked to an Atlassian organization.
In practice: if you’re on a team whose admin has wired all of that up, the official remote server is a reasonable zero-install path — especially if you already use it for Jira and Confluence. If you’re an individual developer with a Bitbucket workspace and an API token, the community server works today with no admin in the loop, which is why it remains the default install. One migration note if you adopted the official server early: Atlassian is retiring the original mcp.atlassian.com/v1/sse endpoint after June 30, 2026 — switch configs to the /v1/mcp/authv2 URL.
When the second community server is the right pick
The aashari server is Cloud-only by design. If your company runs self-hosted Bitbucket Server or Data Center, use pdogra1299’s bitbucket-mcp-server (npm: @nexus2520/bitbucket-mcp-server) instead. It takes the opposite design position — 29 named tools like get_pull_request_diff and set_pr_approval, grouped and filterable via BITBUCKET_TOOL_GROUPS to control context cost — and supports both Cloud and Server, including server-only features like PR tasks and index-backed code search. Both implementations are catalogued on our /servers/bitbucket page.
Auth: scoped API token, not app password (this changed in June 2026)
This is the section most likely to fix your broken setup. Bitbucket historically used app passwords — per-user secondary passwords with permission checkboxes — and nearly every Bitbucket MCP tutorial from 2025 tells you to create one. That advice is now actively harmful. Atlassian’s deprecation timeline:
- September 9, 2025 — creating new app passwords disabled.
- June 9 – July 27, 2026 — controlled brownouts: existing app passwords intermittently rejected. (If your MCP server worked last week and fails intermittently this week, this is the cause.)
- July 28, 2026 — app passwords removed entirely.
The replacement is the scoped API token, and the aashari server supports it as the recommended path:
- Go to id.atlassian.com → Security → API tokens.
- Click “Create API token with scopes” — the scoped variant, not the classic unscoped token.
- Select Bitbucket as the product.
- Pick scopes:
repository+workspacefor read-only; addpullrequestif the agent should create, comment on, approve, or merge PRs. - Copy the token (it starts with
ATATT) and pair it with your Atlassian account email.
The env block the server expects:
[email protected]
ATLASSIAN_API_TOKEN=ATATT... # scoped API token
BITBUCKET_DEFAULT_WORKSPACE=acme # optional but saves tokensTwo details that prevent most auth tickets. The username for token auth is your Atlassian account email, not your Bitbucket username — mixing those up is the classic 401. And scope choice is your real permission boundary: an agent holding a read-only token can call bb_post all it likes; Bitbucket returns 403 and nothing changes. Issue separate tokens per agent and per write level, and rotate them like any other production secret — they ride as plain basic auth on every request.
Install (every client)
The community server is stdio-only — there’s no hosted endpoint to point at. Every install path runs npx -y @aashari/mcp-server-atlassian-bitbucket as a subprocess with the env vars above. The install panel below pulls its config snippets from the canonical /servers/bitbucket catalog entry, so it stays in sync as the package evolves:
One-line install · Bitbucket
Open server pageInstall
Client-specific notes:
- Claude Code: the one-liner from the TL;DR. Add
--scope projectto register it in the repo’s.mcp.jsonfor your whole team — but then keep the token itself out of the file and in each user’s environment. Flag reference at /clients/claude-code. - Claude Desktop: add the
mcpServersJSON block toclaude_desktop_config.jsonwithcommand: "npx",args: ["-y", "@aashari/mcp-server-atlassian-bitbucket"], and the two env vars. Restart the app. - Cursor: same JSON shape in
~/.cursor/mcp.json; the tools appear in the agent’s tool list after restart. - VS Code / Windsurf: paste the panel’s JSON into the extension’s MCP config (
mcp.jsonin workspace settings for VS Code,~/.codeium/windsurf/mcp_config.jsonfor Windsurf). - System-wide: the server also reads
~/.mcp/configs.json— one place for credentials shared across clients, keyed as"bitbucket".
Codex CLI
Codex reads MCP servers from ~/.codex/config.toml:
[mcp_servers.bitbucket]
command = "npx"
args = ["-y", "@aashari/mcp-server-atlassian-bitbucket"]
[mcp_servers.bitbucket.env]
ATLASSIAN_USER_EMAIL = "[email protected]"
ATLASSIAN_API_TOKEN = "ATATT..."Restart Codex and confirm with codex mcp list. On Windows, npx-launched servers are their own genre of failure (path escaping, cmd /c wrappers, the -32601 startup crash) — we wrote up every verified fix in the Codex MCP Windows troubleshooting guide.
Tools walkthrough
Six tools, five of them HTTP verbs. All API tools accept path (the /2.0 prefix is added for you), optional queryParams, an optional JMESPath filter (jq), and an outputFormat of toon (default) or json.
bb_get— read anything: workspaces, repo metadata, PR lists, PR diffs, commits, branch lists, file contents, pipeline runs.bb_post— create: open a PR, add a comment, approve, request changes, merge, decline, trigger a pipeline.bb_put/bb_patch— replace or partially update resources. Note: Bitbucket’s PR-update endpoint expectsPUT, so PR edits go throughbb_put, notbb_patch(a recurring GitHub-issue trap).bb_delete— remove: stale branches, comments, approvals (aDELETEon/approvewithdraws yours).bb_clone— clone a repository to a local path, bridging from “agent reads the API” to “agent works on the checkout.”
The paths the agent will use constantly — worth pasting into your project’s CLAUDE.md so the model never guesses:
/workspaces
/repositories/{workspace}
/repositories/{workspace}/{repo}
/repositories/{workspace}/{repo}/refs/branches
/repositories/{workspace}/{repo}/commits
/repositories/{workspace}/{repo}/src/{commit}/{filepath}
/repositories/{workspace}/{repo}/pullrequests # GET list, POST create
/repositories/{workspace}/{repo}/pullrequests/{id} # GET / PUT
/repositories/{workspace}/{repo}/pullrequests/{id}/diff
/repositories/{workspace}/{repo}/pullrequests/{id}/comments
/repositories/{workspace}/{repo}/pullrequests/{id}/approve
/repositories/{workspace}/{repo}/pullrequests/{id}/merge
/repositories/{workspace}/{repo}/pipelines
/repositories/{workspace}/{repo}/deploymentsOn output: TOON (Token-Oriented Object Notation) is a tabular format the server emits by default, cutting 30–60% of tokens vs raw JSON on list-shaped responses. Combined with a jq filter like values[*].{id: id, title: title, state: state}, a 50-PR listing collapses from tens of kilobytes of JSON to a few hundred tokens. The README’s own advice is blunt: always filter. Unfiltered Bitbucket responses are the main way this server gets expensive.
Recipes
Five workflows where the install pays for itself. Each assumes valid credentials and (ideally) a BITBUCKET_DEFAULT_WORKSPACE set.
Recipe 1 — PR review without leaving the editor
The flagship workflow. Prompt: “Pull the diff for PR #42 in acme/backend-api, read the existing review comments, and review the change: flag anything that touches auth or changes error handling. Post your findings as a single PR comment, but show me the comment text first.” The agent chains bb_get on /pullrequests/42/diff and /comments, reasons over the patch, then bb_posts the comment after you approve it. The human-preview step matters: review comments are public artefacts, and you want the model’s tone checked once before it speaks for you.
Recipe 2 — Pipeline checks before merge
Prompt: “For PR #42, check the latest pipeline run on its source branch. If anything failed, fetch the failed step and summarize the error. If it’s green and the PR has two approvals, merge with squash.” The agent reads /pipelines filtered by branch, inspects the run, then conditionally bb_posts to /merge with {"merge_strategy": "squash"}. Gate the merge behind your client’s tool-approval prompt — this is the most side-effectful call in the whole server.
Recipe 3 — Repo Q&A on code you haven’t cloned
Prompt: “In acme/payments-service, get src/config/retry.ts from main and explain how backoff is configured. Then list the last five commits that touched that file.” File reads go through /src/{commit}/{filepath}, commit history through /commits with a path filter. For one-file questions this beats cloning; for whole-subsystem questions, bb_clone into a workspace folder and let your agent grep locally instead.
Recipe 4 — Standup digest across the team
Prompt: “List open PRs across acme/backend-api, acme/frontend, and acme/infra. Group by author, flag anything open longer than five days or with zero reviewers, and give me a one-line status each.” Three bb_get calls with queryParams {"state": "OPEN", "pagelen": "20"} and a jq projection, joined in-context. This is the recipe that converts skeptical team leads.
Recipe 5 — Branch hygiene sweep
Prompt: “List branches in acme/backend-api whose latest commit is older than 90 days and that have no open PR. Show me the list; after I confirm, delete them.” Reads via /refs/branches, cross-checked against open PRs, deletions via bb_delete one branch at a time. Run it monthly; keep the confirm step forever.
Limits + what we got wrong
Honest constraints, including the ones we tripped on while testing.
- Cloud only. The canonical server authenticates against bitbucket.org. Self-hosted Server/Data Center needs the nexus2520 implementation or Atlassian’s separate DC tooling. There is no flag that makes aashari’s server talk to an internal Bitbucket — an open GitHub issue asks exactly this.
- The generic-tool tradeoff is real. Six tools keep context cheap, but the model must produce correct REST paths. We saw occasional invented endpoints (a 404 on a plausible-looking
/pullrequests/{id}/files) until we pasted the path list from the tools section into the project’s instructions file. Some users preferred the pre-2.0 named tools for discoverability — the migration drew complaints in the repo’s issue tracker — so if you want named tools, that’s another reason to look at nexus2520. - What we got wrong #1: we assumed
bb_patchwould update a PR title. Bitbucket’s PR endpoint wantsPUT; the PATCH fails. Usebb_puton/pullrequests/{id}with the fields you’re changing. - What we got wrong #2: we assumed
bb_clonewould reuse the API token transparently. Cloning is git-over-HTTPS, not the REST API, and there’s an open issue reporting 403s onbb_clonewith the new scoped tokens. If you hit it, clone manually with your git credential helper and use the MCP tools for the API half. - Rate limits are Bitbucket’s, not the server’s. Bitbucket Cloud enforces per-user hourly limits that vary by endpoint group; the server surfaces 429s verbatim. A loop-happy agent paginating a large workspace can hit them — prefer one filtered list call over fifty detail calls.
- Response size is the hidden cost. A full PR object with links and rendered fields is enormous. The combination of
pagelen, Bitbucket’sfieldssparse fieldsets, andjqis not optional hygiene — it’s the difference between a 500-token tool result and a 20,000-token one.
Troubleshooting
Worked for months, now failing intermittently
You’re on an app password and inside the brownout window (June 9 – July 27, 2026). Atlassian is intermittently rejecting app passwords before removing them on July 28, 2026. Create a scoped API token, switch your env vars to ATLASSIAN_USER_EMAIL + ATLASSIAN_API_TOKEN, and delete the app-password pair from your config.
401 Unauthorized on every call
Usually the username half, not the token. Token auth pairs the token with your Atlassian account email, not your Bitbucket username. Verify outside MCP first: npx -y @aashari/mcp-server-atlassian-bitbucket get --path "/workspaces" with the env vars exported. Add DEBUG=true to see the exact request.
Token authenticates but can’t see workspaces
Scope problem — reported on the repo as “API Token authentication method can’t access workspaces.” A classic unscoped token, or a scoped token created without the workspace scope, fails on /workspaces. Recreate the token via Create API token with scopes → Bitbucket → repository + workspace (+ pullrequest).
Client says “connected” but tools fail
The stdio server starts and registers tools even with missing credentials — an open issue notes the “connected” status is not an auth check. Connection state proves the subprocess launched, nothing more. Run the CLI verification command above; if it fails there, fix the env block in your client config and restart the client (env edits don’t hot-reload).
PR updates fail with 400 via bb_patch
Bitbucket’s pull-request endpoint expects PUT for updates. Tell the agent to use bb_put on /pullrequests/{id} with the changed fields in the body. If it keeps reaching for PATCH, add one line to your instructions file: “PR updates use bb_put.”
npx fails to launch the server (Windows especially)
Confirm Node 18+ with node --version, then try npx -y @aashari/mcp-server-atlassian-bitbucket --help in a terminal. On Windows, MCP clients often need a cmd /c npx wrapper and escaped paths — the fixes in our Codex Windows MCP guide apply to this server too.
Considering GitHub or GitLab instead?
If you’re evaluating Bitbucket MCP as part of a broader “which forge plays best with agents” decision, calibrate expectations:
- GitHub: the GitHub MCP server is first-party (maintained by GitHub itself), ships a hosted remote option with OAuth, and has the largest tool surface of the three. If your code already lives on GitHub, it’s the most polished agent integration in the category.
- GitLab: the GitLab MCP servers are community-maintained (several active implementations) and cover MRs, issues, and CI in the same shape this guide covers PRs and Pipelines.
- Bitbucket: you’re in the middle — no fully open first-party server, but a mature community option plus restricted official coverage through Atlassian’s remote MCP. For teams already paying for Atlassian Cloud, that combination is entirely workable.
The agent workflows themselves transfer almost 1:1 across forges — a PR review recipe is a PR review recipe. For the broader map of what’s worth installing this year, see our awesome MCP servers roundup and the full server directory.
FAQ
What is the Bitbucket MCP server?
A local stdio process that exposes Bitbucket Cloud's REST API to AI agents like Claude as MCP tools. The most-installed community implementation, @aashari/mcp-server-atlassian-bitbucket, ships six generic tools (bb_get, bb_post, bb_put, bb_patch, bb_delete, bb_clone) that can reach any Bitbucket Cloud 2.0 endpoint — list repos, read PR diffs, post review comments, merge, check pipelines.
Does Atlassian have an official Bitbucket MCP server?
Partially. Atlassian's official remote MCP server (the Rovo MCP Server at mcp.atlassian.com) launched around Jira and Confluence, and its OAuth flow still centers on Jira, Confluence, and Compass. Bitbucket Cloud tools exist in it, but with restrictions: API-token authentication only, your org admin must enable them, and your Bitbucket workspace must be linked to an Atlassian organization. Most individual developers use the community server instead.
How do I connect Claude to Bitbucket?
Create a scoped Atlassian API token at id.atlassian.com with the repository, workspace, and pullrequest scopes, then register the server. For Claude Code: claude mcp add bitbucket -e [email protected] -e ATLASSIAN_API_TOKEN=your_token -- npx -y @aashari/mcp-server-atlassian-bitbucket. For Claude Desktop, paste the equivalent JSON block into claude_desktop_config.json and restart.
Do Bitbucket app passwords still work with MCP?
They are actively being switched off. Atlassian stopped issuing new app passwords on September 9, 2025, started controlled brownouts on June 9, 2026, and removes them entirely on July 28, 2026. If your Bitbucket MCP setup suddenly started failing in June 2026, this is almost certainly why. Migrate to a scoped API token (ATLASSIAN_USER_EMAIL + ATLASSIAN_API_TOKEN) now.
Which API token scopes does the Bitbucket MCP server need?
Create the token with 'Create API token with scopes', select Bitbucket as the product, then pick repository and workspace for read-only use, and add pullrequest if you want the agent to create, comment on, approve, or merge PRs. Fewer scopes is safer: a read-only token makes bb_post, bb_put, and bb_delete fail at the API even if the agent tries them.
Does Bitbucket MCP work with Bitbucket Server or Data Center?
Not the canonical aashari server — it is Bitbucket Cloud only. For self-hosted Bitbucket Server or Data Center, use @nexus2520/bitbucket-mcp-server (the pdogra1299 implementation), which supports both deployment types and ships 29 named tools including server-only features like PR tasks and index-backed code search.
Can the agent merge or approve pull requests through MCP?
Yes, if the API token has the pullrequest scope. Approval is a bb_post to /repositories/{workspace}/{repo}/pullrequests/{id}/approve, and merge is a bb_post to the /merge endpoint. Treat these as side-effectful writes: keep them behind your client's tool-approval prompt, or issue a read-only token to agents that should only review.
Why does the Bitbucket MCP server only have six tools?
The 2.x redesign collapsed the earlier catalog of named tools into six generic REST passthrough tools. Any of Bitbucket Cloud's hundreds of endpoints is reachable through bb_get/bb_post/bb_put/bb_patch/bb_delete with a path argument, and a small tool list costs far fewer context tokens. The tradeoff: the model has to know (or be told) the right API paths.
Sources
- Canonical community implementation: github.com/aashari/mcp-server-atlassian-bitbucket (README: auth options, tool table, CLI commands, TOON/JMESPath guidance) and its issue tracker (bb_clone 403, bb_patch on PRs, workspace-scope and connected-status reports cited above)
- npm package: @aashari/mcp-server-atlassian-bitbucket
- Bitbucket Cloud REST API 2.0 reference: developer.atlassian.com/cloud/bitbucket/rest
- App-password deprecation timeline: Atlassian: Bitbucket Cloud transitions to API tokens and the brownout schedule notice
- Atlassian Rovo MCP Server docs: getting started and supported tools (Bitbucket tool conditions, endpoint migration date)
- Cloud + Server/DC alternative: github.com/pdogra1299/bitbucket-mcp-server
- Canonical MCP.Directory entry: /servers/bitbucket
Note on community embeds: we found no verifiable first-party X/Twitter post from the maintainer announcing this server, so this guide cites the repository, its issue tracker, and Atlassian’s documentation instead of embedding social posts.
Server
Bitbucket MCP — install configs & tools
OpenTroubleshooting
Codex MCP Not Working? Every Windows Fix (2026)
ReadClient
Claude Code — MCP client reference
OpenFound an issue?
If something in this guide is out of date — a tool rename, a change in Atlassian’s official MCP coverage, a new implementation worth covering — email [email protected] or read more on our about page. We keep these guides current.