Connects Claude, Copilot, and Cursor to Bitbucket Cloud through 45 tools covering repos, pull requests, comments, pipelines, and build statuses. You can review PRs, post inline comments, approve or request changes, run pipelines, and query CI status all through natural language. The server strips API noise for lower token usage and lets you filter diffs by file path to cut tokens by 95% on large PRs. Ships with safety guards on destructive operations like merging and pipeline stops. Runs via uvx with zero install, supports scoped API tokens, and includes batch review and draft PR workflows. Built for teams doing code review and CI monitoring from their AI assistant.
Public tool metadata for what this MCP can expose to an agent.
BITBUCKET_CREATE_BRANCHCreates a new branch in a Bitbucket repository from a target commit hash; the branch name must be unique, adhere to Bitbucket's naming conventions, and not include the 'refs/heads/' prefix.4 paramsCreates a new branch in a Bitbucket repository from a target commit hash; the branch name must be unique, adhere to Bitbucket's naming conventions, and not include the 'refs/heads/' prefix.
namestringrepo_slugstringworkspacestringtarget_hashstringBITBUCKET_CREATE_ISSUECreates a new issue in a Bitbucket repository, setting the authenticated user as reporter; ensures assignee (if provided) has repository access, and that any specified milestone, version, or component IDs exist.11 paramsCreates a new issue in a Bitbucket repository, setting the authenticated user as reporter; ensures assignee (if provided) has repository access, and that any specified milestone, version, or component IDs exist.
kindstringtitlestringdue_onstringcontentstringassigneestringprioritystringrepo_slugstringworkspacestringversion_idintegercomponent_idintegermilestone_idintegerBITBUCKET_CREATE_ISSUE_COMMENTAdds a new comment with markdown support to an existing Bitbucket issue.4 paramsAdds a new comment with markdown support to an existing Bitbucket issue.
contentstringissue_idstringrepo_slugstringworkspacestringBITBUCKET_CREATE_PULL_REQUESTCreates a new pull request in a specified Bitbucket repository, ensuring the source branch exists and is distinct from the (optional) destination branch.8 paramsCreates a new pull request in a specified Bitbucket repository, ensuring the source branch exists and is distinct from the (optional) destination branch.
titlestringrepo_slugstringreviewersarrayworkspacestringdescriptionstringsource_branchstringdestination_branchstringclose_source_branchbooleanBITBUCKET_CREATE_REPOSITORYCreates a new Bitbucket 'git' repository in a specified workspace, defaulting to the workspace's oldest project if `project_key` is not provided.9 paramsCreates a new Bitbucket 'git' repository in a specified workspace, defaulting to the workspace's oldest project if `project_key` is not provided.
has_wikibooleanlanguagestringrepo_slugstringworkspacestringhas_issuesbooleanis_privatebooleandescriptionstringfork_policystringallow_forks · no_public_forks · no_forksdefault: allow_forksproject_keystringBITBUCKET_CREATE_SNIPPET_COMMENTPosts a new top-level comment or a threaded reply to an existing comment on a specified Bitbucket snippet.4 paramsPosts a new top-level comment or a threaded reply to an existing comment on a specified Bitbucket snippet.
contentstringparent_idintegerworkspacestringencoded_idstringBITBUCKET_DELETE_ISSUEPermanently deletes a specific issue, identified by its `issue_id`, from the repository specified by `repo_slug` within the given `workspace`.3 paramsPermanently deletes a specific issue, identified by its `issue_id`, from the repository specified by `repo_slug` within the given `workspace`.
issue_idstringrepo_slugstringworkspacestringBITBUCKET_DELETE_REPOSITORYPermanently deletes a specified Bitbucket repository; this action is irreversible and does not affect forks.2 paramsPermanently deletes a specified Bitbucket repository; this action is irreversible and does not affect forks.
repo_slugstringworkspacestringBITBUCKET_GET_CURRENT_USERRetrieves the profile information (UUID, display name, links, creation date) for the currently authenticated Bitbucket user.Retrieves the profile information (UUID, display name, links, creation date) for the currently authenticated Bitbucket user.
No parameter schema in public metadata yet.
BITBUCKET_GET_FILE_FROM_REPOSITORYRetrieves a specific file's content from a Bitbucket repository at a given commit (hash, branch, or tag), failing if the file path is invalid for that commit.4 paramsRetrieves a specific file's content from a Bitbucket repository at a given commit (hash, branch, or tag), failing if the file path is invalid for that commit.
pathstringcommitstringrepo_slugstringworkspacestringBITBUCKET_GET_PULL_REQUESTGet a single pull request by ID with complete details.3 paramsGet a single pull request by ID with complete details.
repo_slugstringworkspacestringpull_request_idintegerBITBUCKET_GET_SNIPPETRetrieves a specific Bitbucket snippet by its encoded ID from an existing workspace, returning its metadata and file structure.3 paramsRetrieves a specific Bitbucket snippet by its encoded ID from an existing workspace, returning its metadata and file structure.
workspacestringencoded_idstringaccept_formatstringBITBUCKET_LIST_PULL_REQUESTSLists pull requests in a specified, accessible Bitbucket repository, optionally filtering by state (OPEN, MERGED, DECLINED).5 paramsLists pull requests in a specified, accessible Bitbucket repository, optionally filtering by state (OPEN, MERGED, DECLINED).
pageintegerstatestringOPEN · MERGED · DECLINEDpagelenintegerrepo_slugstringworkspacestringBITBUCKET_LIST_REPOSITORIES_IN_WORKSPACELists repositories in a specified Bitbucket workspace, accessible to the authenticated user, with options to filter by role or query string, and sort results.4 paramsLists repositories in a specified Bitbucket workspace, accessible to the authenticated user, with options to filter by role or query string, and sort results.
qstringrolestringsortstringworkspacestringBITBUCKET_LIST_WORKSPACE_MEMBERSLists all members of a specified Bitbucket workspace; the workspace must exist.1 paramsLists all members of a specified Bitbucket workspace; the workspace must exist.
workspacestringBITBUCKET_LIST_WORKSPACESLists Bitbucket workspaces accessible to the authenticated user, optionally filtered and sorted.2 paramsLists Bitbucket workspaces accessible to the authenticated user, optionally filtered and sorted.
qstringsortstringBITBUCKET_UPDATE_ISSUEUpdates an existing issue in a Bitbucket repository by modifying specified attributes; requires `workspace`, `repo_slug`, `issue_id`, and at least one attribute to update.12 paramsUpdates an existing issue in a Bitbucket repository by modifying specified attributes; requires `workspace`, `repo_slug`, `issue_id`, and at least one attribute to update.
kindstringstatestringtitlestringcontentstringversionstringissue_idstringprioritystringcomponentstringmilestonestringrepo_slugstringworkspacestringassignee_account_idstringConnect 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.
configs/tools.json or BITBUCKET_TOOLS_CONFIG env varThe 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-mcp
Why
--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 | pip install bitbucket-mcp-py | Simple, persistent install |
| Local dev | pip install -e . in project dir | Contributing to the project |
| Docker | See Docker section | Container-based workflows |
Set the following environment variables (or use a .env file — see Credentials):
| Variable | Description |
|---|---|
BITBUCKET_USERNAME | Your Bitbucket email |
BITBUCKET_TOKEN | Your Bitbucket API token |
BITBUCKET_WORKSPACE | 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.
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-mcp
Option 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"
}
}
}
}
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"
}
}
}
}
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"
}
}
}
}
| Category | Tools |
|---|---|
| Repositories | list_repositories, get_repository |
| Pull Requests | get_pull_requests, get_pull_request, create_pull_request, update_pull_request, approve_pull_request, unapprove_pull_request, request_changes_pull_request, unrequest_changes_pull_request, decline_pull_request, merge_pull_request |
| Comments | get_pull_request_comments, add_pull_request_comment, get_pull_request_comment, update_pull_request_comment, delete_pull_request_comment, resolve_pull_request_comment, reopen_pull_request_comment, get_pull_request_activity |
| Tasks PR | get_pull_request_tasks, get_pull_request_task, create_pull_request_task, update_pull_request_task, delete_pull_request_task |
| Diff / Review | get_pull_request_diff, get_pull_request_patch, get_pull_request_diffstat, get_pull_request_commits |
| PR Discovery | get_pull_requests_pending_review |
| Build / CI | get_pull_request_statuses, get_commit_statuses |
| Pipelines | list_pipeline_runs, get_pipeline_run, get_pipeline_steps, get_pipeline_step_logs, run_pipeline, stop_pipeline |
| Reviewers | get_effective_default_reviewers, suggest_pull_request_reviewers |
| Draft PR | create_draft_pull_request, publish_draft_pull_request, convert_pull_request_to_draft |
| Batch Review | submit_pull_request_batch_review |
| Review Summary | get_pull_request_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.
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.json
Fallback chain (first match wins):
BITBUCKET_TOOLS_CONFIG environment variableconfigs/tools.jsonFail-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")
.env file (recommended)cp .env.example .env
# Edit .env with your credentials
pip install 'bitbucket-mcp-py[keyring]'
python3 -c "import keyring; keyring.set_password('bitbucket-mcp', 'bitbucket_token', 'YOUR_TOKEN')"
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-py
Then configure your AI assistant to use docker exec:
{
"mcpServers": {
"bitbucket-mcp": {
"command": "docker",
"args": ["exec", "-i", "bitbucket-mcp", "python", "-m", "src.main", "--transport", "stdio"]
}
}
}
# Install dev dependencies
uv sync --extra dev
# Run tests
uv run pytest tests/ -v
# Run specific test
uv run pytest tests/test_client.py -v
MIT
ray0907/git-mcp-server
cyanheads/git-mcp-server
io.github.b1ff/atlassian-dc-mcp-bitbucket
io.github.b1ff/atlassian-dc-mcp-jira
com.mcparmory/atlassian-jira
sirlordt/vscode-terminal-mcp