Skip to main content

An MCP server for interactive Bitbucket Cloud pull-request review with Claude.

Project description

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

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

bitbucket_review_mcp-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

bitbucket_review_mcp-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file bitbucket_review_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: bitbucket_review_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for bitbucket_review_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0199648d40607ab4a9ec49cb8f7dc5067e2664d59e601a717b39ba2781c71307
MD5 b5f7495c28dcbcca560cb3daed816a97
BLAKE2b-256 980f910c84f49942ce9d607b1e6cccac380f2d8079665701c2872c68d9fa8a65

See more details on using hashes here.

File details

Details for the file bitbucket_review_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bitbucket_review_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c2b5aaed70e704f5fa3aebacc9383bc359ae91db55ad5c8f64834b43d60b0f5
MD5 f2d4ce719c869e32276b1e8570a443e7
BLAKE2b-256 e356fed8168834893b413b32c8264503049a5da1f3c84e6bda5fdda32626c9ea

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