Bitbucket MCP — Claude Code MCP server: what it does, how to install
A Go MCP server that gives your agent access to Bitbucket Cloud: repos, branches, pull requests. Useful when Bitbucket work runs through an AI assistant.
claude mcp add --env BITBUCKET_USERNAME=<BITBUCKET_USERNAME> --env BITBUCKET_TOKEN=<BITBUCKET_TOKEN> --transport stdio bitbucket-mcp -- docker run -i --rm -e BITBUCKET_USERNAME -e BITBUCKET_TOKEN ghcr.io/fabianschurig/bitbucket-mcp:0.20.2What Bitbucket MCP does
Bitbucket MCP is one of three tools built from the same Bitbucket OpenAPI pipeline in the bitbucket-cli project, alongside the bb-cli command line tool and a Terraform provider. The schema is generated from the live spec, so new Bitbucket endpoints arrive without hand-written glue for each one. The runtime stays thin: auth, dispatch and output are shared.
The server speaks stdio and runs in Docker. Two environment variables are required: BITBUCKET_USERNAME and BITBUCKET_TOKEN. Without them there is no auth and no API calls. Both install commands pass them through --env and -e.
Endpoints missing from the public spec are covered too. Schemas under schema/ can be written by hand, and the generators treat them the same as generated ones. That matters if you need Bitbucket features the open API does not describe.
What it helps with
- list repositories and branches in Bitbucket Cloud
- read a pull request and its comments from the agent
- check branch restrictions for a project
- fetch commit history without opening a browser
- wire Bitbucket into an AI assistant workflow
Example prompts for the agent
- Show me the open pull requests in the
backend-apirepository - What branches exist in
web-app? - Find commits from the last week in
infra
How to install Bitbucket MCP
Platform CLI
claude mcp add --env BITBUCKET_USERNAME=<BITBUCKET_USERNAME> --env BITBUCKET_TOKEN=<BITBUCKET_TOKEN> --transport stdio bitbucket-mcp -- docker run -i --rm -e BITBUCKET_USERNAME -e BITBUCKET_TOKEN ghcr.io/fabianschurig/bitbucket-mcp:0.20.2Replace <…> with your own values
Platform CLI
codex mcp add bitbucket-mcp --env BITBUCKET_USERNAME=<BITBUCKET_USERNAME> --env BITBUCKET_TOKEN=<BITBUCKET_TOKEN> -- docker run -i --rm -e BITBUCKET_USERNAME -e BITBUCKET_TOKEN ghcr.io/fabianschurig/bitbucket-mcp:0.20.2Replace <…> with your own values
Config file
{
"mcpServers": {
"bitbucket-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"BITBUCKET_USERNAME",
"-e",
"BITBUCKET_TOKEN",
"ghcr.io/fabianschurig/bitbucket-mcp:0.20.2"
],
"env": {
"BITBUCKET_USERNAME": "<BITBUCKET_USERNAME>",
"BITBUCKET_TOKEN": "<BITBUCKET_TOKEN>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"bitbucket-mcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"BITBUCKET_USERNAME",
"-e",
"BITBUCKET_TOKEN",
"ghcr.io/fabianschurig/bitbucket-mcp:0.20.2"
],
"env": {
"BITBUCKET_USERNAME": "<BITBUCKET_USERNAME>",
"BITBUCKET_TOKEN": "<BITBUCKET_TOKEN>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e BITBUCKET_USERNAME=<BITBUCKET_USERNAME> -e BITBUCKET_TOKEN=<BITBUCKET_TOKEN> bitbucket-mcp docker run -i --rm -e BITBUCKET_USERNAME -e BITBUCKET_TOKEN ghcr.io/fabianschurig/bitbucket-mcp:0.20.2Replace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Bitbucket MCP
How do I install Bitbucket MCP in Claude Code?
Run `claude mcp add --env BITBUCKET_USERNAME=<BITBUCKET_USERNAME> --env BITBUCKET_TOKEN=<BITBUCKET_TOKEN> --transport stdio bitbucket-mcp -- docker run -i --rm -e BITBUCKET_USERNAME -e BITBUCKET_TOKEN ghcr.io/fabianschurig/bitbucket-mcp:0.20.2`. Replace the placeholders with your Bitbucket credentials.
What does Bitbucket MCP do?
It exposes Bitbucket Cloud to an AI agent over MCP: repositories, branches, pull requests and other endpoints from the spec. It runs over stdio inside Docker.
What do I need before running it?
Docker installed, plus BITBUCKET_USERNAME and BITBUCKET_TOKEN set to your Bitbucket account details.