bitbucket-mcp
Provides tools for managing Bitbucket Cloud repositories, pull requests, comments, tasks, diffs, pipelines, build statuses, reviewers, draft PRs, and batch review.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bitbucket-mcpShow my recent pull requests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Bitbucket MCP Server (Python)
Connect Claude Code, VS Code (GitHub Copilot), Cursor, and any MCP-compatible AI assistant to your Bitbucket Cloud repositories. Review pull requests, monitor pipelines, and manage your code — all through natural language.
Features
45 MCP tools — repositories, pull requests, comments, tasks, diffs, pipelines, build statuses, reviewers, draft PRs, batch review
Slim responses — stripped API noise for lower LLM token usage
Configurable — enable/disable tools via
configs/tools.jsonorBITBUCKET_TOOLS_CONFIGenv varSecure credentials — environment variables or system keychain
Quick Start
1. Install
The recommended way to run the server is via uvx (zero install, isolated environment):
# Always latest version
uvx --from bitbucket-mcp-py bitbucket-mcp
# Pin a specific version
uvx --from bitbucket-mcp-py==1.8.1 bitbucket-mcpWhy
--from? The PyPI package isbitbucket-mcp-pybut the command entry point isbitbucket-mcp. The--fromflag tells uvx which package to install.
Mode | Command | Best for |
pip global |
| Simple, persistent install |
Local dev |
| Contributing to the project |
Docker | See Docker section | Container-based workflows |
2. Configure credentials
Set the following environment variables (or use a .env file — see Credentials):
Variable | Description |
| Your Bitbucket email |
| Your Bitbucket API token |
| Your workspace slug |
Get your API token at: https://id.atlassian.com/manage-profile/security/api-tokens
⚠️ Use a scoped token, not a global one. When creating the token, select specific scopes (e.g.
Repositories: Read,Pull requests: Read/Write). Global tokens without explicit scopes do not work with this MCP server.
3. Configure your AI assistant
Claude Code (recommended)
Option A — CLI (fastest):
claude mcp add bitbucket-mcp \
-e BITBUCKET_USERNAME=your-email@example.com \
-e BITBUCKET_TOKEN=your-api-token \
-e BITBUCKET_WORKSPACE=your-workspace \
-- uvx --from bitbucket-mcp-py bitbucket-mcpOption B — JSON config (~/.claude.json or project .mcp.json):
{
"mcpServers": {
"bitbucket-mcp": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
"env": {
"BITBUCKET_USERNAME": "your-email@example.com",
"BITBUCKET_TOKEN": "your-api-token",
"BITBUCKET_WORKSPACE": "your-workspace"
}
}
}
}VS Code (GitHub Copilot)
Add to .vscode/mcp.json (workspace) or ~/Library/Application Support/Code/User/mcp.json (global, macOS):
{
"servers": {
"bitbucket-mcp": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
"env": {
"BITBUCKET_USERNAME": "your-email@example.com",
"BITBUCKET_TOKEN": "your-api-token",
"BITBUCKET_WORKSPACE": "your-workspace"
}
}
}
}Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"bitbucket-mcp": {
"command": "uvx",
"args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
"env": {
"BITBUCKET_USERNAME": "your-email@example.com",
"BITBUCKET_TOKEN": "your-api-token",
"BITBUCKET_WORKSPACE": "your-workspace"
}
}
}
}Available Tools
Category | Tools |
Repositories |
|
Pull Requests |
|
Comments |
|
Tasks PR |
|
Diff / Review |
|
PR Discovery |
|
Build / CI |
|
Pipelines |
|
Reviewers |
|
Draft PR |
|
Batch Review |
|
Review Summary |
|
Disabled by default:
merge_pull_request(safety),stop_pipeline(safety),get_pull_request_patch(git am format — not useful for AI review),convert_pull_request_to_draft(not supported by Bitbucket API). Enable inconfigs/tools.json.
Custom tool configuration
By default the server reads configs/tools.json bundled with the package. You can point to a custom file at runtime without rebuilding:
export BITBUCKET_TOOLS_CONFIG=/path/to/my-tools.jsonFallback chain (first match wins):
BITBUCKET_TOOLS_CONFIGenvironment variableBuilt-in
configs/tools.json
Fail-safe behaviour — If
BITBUCKET_TOOLS_CONFIGis set but the file is missing or contains invalid JSON, the server raises an error on startup (explicit failure rather than silently ignoring the override). If the built-in default is missing, all tools are enabled.
Token tip —
get_pull_request_diffaccepts an optionalpathparameter to filter the diff to a single file, reducing token usage by ~95% on large PRs:get_pull_request_diff(repo_slug, pull_request_id, path="src/services/myService.ts")
Credentials
Option 1: .env file (recommended)
cp .env.example .env
# Edit .env with your credentialsOption 2: System keychain (most secure)
pip install 'bitbucket-mcp-py[keyring]'
python3 -c "import keyring; keyring.set_password('bitbucket-mcp', 'bitbucket_token', 'YOUR_TOKEN')"Docker (Alternative)
If you prefer running the server in a container:
docker build -t bitbucket-mcp-py .
docker run -d --name bitbucket-mcp --env-file .env bitbucket-mcp-pyThen configure your AI assistant to use docker exec:
{
"mcpServers": {
"bitbucket-mcp": {
"command": "docker",
"args": ["exec", "-i", "bitbucket-mcp", "python", "-m", "src.main", "--transport", "stdio"]
}
}
}Development
# Install dev dependencies
uv sync --extra dev
# Run tests
uv run pytest tests/ -v
# Run specific test
uv run pytest tests/test_client.py -vRequirements
Python 3.12+
Bitbucket API token
License
MIT
References
MCP Registry — Official MCP server registry
PyPI Package — Python package
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lawp09/bitbucket-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server