Skip to main content

Bitbucket MCP Server

A Model Context Protocol server that gives Claude Code (and any MCP-compatible AI agent) full access to the Bitbucket Cloud REST API — pull requests, diffs, comments, reviews, and more.

Tools

Tool Description
list_repos List repositories in a workspace
list_open_prs List open pull requests for a repo
get_open_pr Get the open PR for the current branch
get_pr Fetch a PR by ID
get_pr_diff Unified diff for a PR
get_pr_diffstat Per-file change statistics for a PR
get_pr_comments All comments on a PR
get_unresolved_pr_comments Unresolved comments only (optionally inline only)
post_pr_comment Post a general or inline comment
resolve_pr_comment Mark a comment as resolved
approve_pr Approve a PR
decline_pr Decline a PR
merge_pr Merge a PR (merge_commit or squash)
create_pr Open a new PR
get_commit_diff Diff for a commit, range, or list of commits

Installation

uvx mini-bitbucket-mcp

Register globally with Claude Code:

# If you use the bb CLI (credentials auto-detected)
claude mcp add --scope user bitbucket -- uvx mini-bitbucket-mcp

# Or pass a token directly
claude mcp add --scope user -e BITBUCKET_ACCESS_TOKEN=<token> bitbucket -- uvx mini-bitbucket-mcp

--scope user makes the server available in every project on your machine.

Project-level config

Drop a .mcp.json at your repo root:

{
  "mcpServers": {
    "bitbucket": {
      "command": "uvx",
      "args": ["bitbucket-mcp-server"],
      "env": {
        "BITBUCKET_ACCESS_TOKEN": "<your-token>"
      }
    }
  }
}

Authentication

The server tries credentials in this order:

Priority Source Notes
1 BITBUCKET_ACCESS_TOKEN env var Bitbucket App Password or OAuth token
2 ~/.config/bb/tokens.json Written by bb auth login
3 BITBUCKET_EMAIL + BITBUCKET_API_TOKEN Atlassian API token (Basic auth)

Generate an App Password at Bitbucket → Personal settings → App passwords with Repositories: Read and Pull requests: Read/Write scopes.

Usage with Claude Code

Once registered, Claude Code will automatically use the Bitbucket tools in any repo whose git remote points to bitbucket.org. Add this to ~/.claude/CLAUDE.md to make it explicit:

A `bitbucket` MCP server is registered globally. Use it for all Bitbucket tasks (PRs, comments, diffs, reviews).

Derive `workspace` and `repo` from `git remote get-url origin` — format: `git@bitbucket.org:{workspace}/{repo}.git`.

Local development

make install   # install dependencies
make lint      # ruff check + format
make test      # unit tests
make run       # start server on stdio

Metadata

Release files for mini-bitbucket-mcp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mini-bitbucket-mcp 0.2.0
File Size Uploaded Provenance Actions
mini_bitbucket_mcp-0.2.0.tar.gz 9.7 kB Without provenance Details for mini_bitbucket_mcp-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mini-bitbucket-mcp 0.2.0
File Interpreter ABI Platform Actions
mini_bitbucket_mcp-0.2.0-py3-none-any.whl Python 3 none any Details for mini_bitbucket_mcp-0.2.0-py3-none-any.whl

Total release size: 20.1 kB

Release files / mini_bitbucket_mcp-0.2.0.tar.gz

Download URL mini_bitbucket_mcp-0.2.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c119575c5aa312df2157f8501faf68a68fabeda50db8717bd8b8d39295901a2b
BLAKE2b-256 checksum
How to use checksums
37a2e2ebd41d602054b2bed82c6ff0924ad2e6110d5f2f1ded64318a06e3c2d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / mini_bitbucket_mcp-0.2.0-py3-none-any.whl

Download URL mini_bitbucket_mcp-0.2.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89aceae8b67b3b34a3e5016fe81b0df130ac30790914b67898ee6f5cecd42524
BLAKE2b-256 checksum
How to use checksums
f2719c3801319b25576364bdc88b6905b987418da10f406dd570eda7f3ff20f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Security for mini-bitbucket-mcp 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page