Skip to main content

bitbucket-review-mcp

An MCP server for interactive Bitbucket Cloud pull-request review with Claude. Claude reads the PR, its diff and the surrounding source code, analyses design/data-flow, proposes per-module test cases and best practices, and — only when you confirm — posts findings back as inline + summary comments.

Tools exposed

Tool Purpose
list_open_prs List open pull requests.
get_pr PR metadata: title, description, branches, commit hashes.
get_pr_diff The raw unified diff for a PR.
get_pr_files Changed files with per-file added/removed line counts.
get_file_content Read a file's full contents at a commit/branch.
post_inline_comment Post an inline comment on a line in the diff.
post_summary_comment Post a top-level summary comment on the PR.

Installation

Install from PyPI:

pip install bitbucket-review-mcp

This installs a console command, bitbucket-review-mcp, that runs the MCP server over stdio.

Install from source

git clone https://github.com/fahidnibu/pr_mcp.git
cd pr_mcp
pip install .

Configuration

The server reads credentials from environment variables (or a .env file in the directory it is launched from). Copy .env.example to .env and fill it in:

# Prefer an access token (Bitbucket → Workspace/Repo settings → Access tokens).
# Scopes needed: pullrequest (read) and pullrequest:write (to post comments).
BITBUCKET_ACCESS_TOKEN=

# Fallback auth if you don't use an access token (app passwords are being
# phased out by Atlassian):
BITBUCKET_USERNAME=
BITBUCKET_APP_PASSWORD=

# Optional defaults so you can review by PR id alone:
BITBUCKET_WORKSPACE=
BITBUCKET_REPO_SLUG=

Register with Claude Code

Add the server to your .mcp.json (this repo ships one already):

{
  "mcpServers": {
    "bitbucket": {
      "command": "bitbucket-review-mcp"
    }
  }
}

Restart Claude Code so it picks up .mcp.json, approve the bitbucket server when prompted, and verify with /mcp.

If the bitbucket-review-mcp command isn't on your PATH (e.g. it's installed in a virtualenv), use the interpreter form instead:

{
  "mcpServers": {
    "bitbucket": {
      "command": "python",
      "args": ["-m", "bitbucket_review_mcp.server"]
    }
  }
}

Usage

Just ask Claude, e.g.:

  • "Review PR 412"
  • "Review PR 88 in repo web-app"
  • "List open PRs, then review the newest one"

Claude presents the full review in chat first and always asks before posting anything to Bitbucket.

Development & publishing to PyPI

Build the distribution artifacts (wheel + sdist):

pip install --upgrade build twine
python -m build

This produces dist/*.whl and dist/*.tar.gz. Check and upload them:

twine check dist/*

# Upload to TestPyPI first (recommended):
twine upload --repository testpypi dist/*

# Then the real index:
twine upload dist/*

You'll be prompted for credentials — use a PyPI API token (username __token__, password = the token). Bump version in both pyproject.toml and src/bitbucket_review_mcp/__init__.py before each release; PyPI rejects re-uploads of an existing version.

Note: bitbucket-review-mcp is the distribution name declared in pyproject.toml. If that name is already taken on PyPI, change name in pyproject.toml (the import package bitbucket_review_mcp can stay).

License

MIT

Metadata

Release files for bitbucket-review-mcp 0.1.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 bitbucket-review-mcp 0.1.0
File Size Uploaded
bitbucket_review_mcp-0.1.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bitbucket-review-mcp 0.1.0
File Interpreter ABI Platform
bitbucket_review_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / bitbucket_review_mcp-0.1.0.tar.gz

Download URL bitbucket_review_mcp-0.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0199648d40607ab4a9ec49cb8f7dc5067e2664d59e601a717b39ba2781c71307
BLAKE2b-256 checksum
How to use checksums
980f910c84f49942ce9d607b1e6cccac380f2d8079665701c2872c68d9fa8a65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / bitbucket_review_mcp-0.1.0-py3-none-any.whl

Download URL bitbucket_review_mcp-0.1.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c2b5aaed70e704f5fa3aebacc9383bc359ae91db55ad5c8f64834b43d60b0f5
BLAKE2b-256 checksum
How to use checksums
e356fed8168834893b413b32c8264503049a5da1f3c84e6bda5fdda32626c9ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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