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-mcpcommand 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-mcpis the distribution name declared inpyproject.toml. If that name is already taken on PyPI, changenameinpyproject.toml(the import packagebitbucket_review_mcpcan stay).
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0199648d40607ab4a9ec49cb8f7dc5067e2664d59e601a717b39ba2781c71307
|
|
| MD5 |
b5f7495c28dcbcca560cb3daed816a97
|
|
| BLAKE2b-256 |
980f910c84f49942ce9d607b1e6cccac380f2d8079665701c2872c68d9fa8a65
|
File details
Details for the file bitbucket_review_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bitbucket_review_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c2b5aaed70e704f5fa3aebacc9383bc359ae91db55ad5c8f64834b43d60b0f5
|
|
| MD5 |
f2d4ce719c869e32276b1e8570a443e7
|
|
| BLAKE2b-256 |
e356fed8168834893b413b32c8264503049a5da1f3c84e6bda5fdda32626c9ea
|