Skip to main content

Bitbucket MCP server for Claude Code and AI agents

Project description

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 bitbucket-mcp-server

Register globally with Claude Code:

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

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

--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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mini_bitbucket_mcp-0.1.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mini_bitbucket_mcp-0.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file mini_bitbucket_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: mini_bitbucket_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mini_bitbucket_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 56bf77db39a3f30b2014a5de36dc23a2f97c7a03737f43e2aeee6af2d5fdac29
MD5 f295923a3cc4d80453da637c4ec4c942
BLAKE2b-256 68cdc583f5a446edd6899afc817a8f555804cba8757ee50f8fe2b2fc06c5705b

See more details on using hashes here.

File details

Details for the file mini_bitbucket_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mini_bitbucket_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mini_bitbucket_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 718876f3ca0afea027589b09a822756da5c1dd2a8f9fa9d0bbdfedb7a7abbf27
MD5 99e0a1c9ef02fbd6be666e29f4dde2ec
BLAKE2b-256 a4d7c8e251be7d6c864069719fb20d3a63f616e46c3a84e4ea844473a3c319dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page