Bitbucket Cloud MCP Server
Provides tools for managing Bitbucket Cloud repositories, pull requests, issues, pipelines, and more via the Bitbucket Cloud REST API.
Click on "Deploy 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 Cloud MCP Server Show open pull requests in my Bitbucket repository"
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 Cloud MCP Server
A Model Context Protocol (MCP) server for the Bitbucket Cloud REST API v2.0. Works with any MCP client — Claude Code, GitHub Copilot, OpenAI Codex, and more. Provides 32 tools across 5 toolsets with safety controls and compact LLM-optimized output.
Setup
Prerequisites
Node.js v24+
Atlassian API token (see below)
Create an API Token
Go to Atlassian API Tokens
Click "Create API token with scopes"
Name the token (e.g., "Bitbucket MCP") and set expiration
Select app: Bitbucket
Enable the scopes listed below
Click Create and copy the token
Read-only scopes (6 scopes — sufficient when using BITBUCKET_READONLY=true):
Scope | Enables |
|
|
|
|
|
|
|
|
|
|
|
|
Write scopes (add these 4 for full access):
Scope | Enables |
|
|
|
|
|
|
|
|
Add to Your MCP Client
One command — no clone or build needed:
claude mcp add bitbucket \
-e ATLASSIAN_USER_EMAIL=your-email@example.com \
-e ATLASSIAN_API_TOKEN=your-api-token \
-e BITBUCKET_READONLY=false \
-- npx -y @or2ooo/bitbucket-mcp@latestVerify with:
claude mcp listAdd to .vscode/mcp.json in your project root:
{
"servers": {
"bitbucket": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@or2ooo/bitbucket-mcp@latest"],
"env": {
"ATLASSIAN_USER_EMAIL": "your-email@example.com",
"ATLASSIAN_API_TOKEN": "your-api-token",
"BITBUCKET_READONLY": "false"
}
}
}
}Add to ~/.codex/config.toml:
[mcp_servers.bitbucket]
command = "npx"
args = ["-y", "@or2ooo/bitbucket-mcp@latest"]
env = { ATLASSIAN_USER_EMAIL = "your-email@example.com", ATLASSIAN_API_TOKEN = "your-api-token", BITBUCKET_READONLY = "false" }git clone https://github.com/or2ooo/bitbucket-mcp.git
cd bitbucket-mcp
npm install && npm run build
claude mcp add bitbucket \
-e ATLASSIAN_USER_EMAIL=your-email@example.com \
-e ATLASSIAN_API_TOKEN=your-api-token \
-e BITBUCKET_READONLY=true \
-- node $(pwd)/dist/index.jsRelated MCP server: mcp-bitbucket
Environment Variables
Variable | Required | Description |
| Yes | Atlassian account email |
| Yes | Atlassian API token (see Create an API Token) |
| No | Default workspace slug |
| No | Comma-separated allowlist of workspace slugs |
| No | Comma-separated allowlist ( |
| No |
|
| No | Override API base URL |
Safety Controls
Readonly mode: Set
BITBUCKET_READONLY=trueto prevent any write operations.Workspace allowlist: Restrict access to specific workspaces.
Repository allowlist: Restrict access to specific repositories.
Destructive action confirmation: Merge PR, decline PR, and delete branch tools require explicit
confirm: true.
Tool Reference
Context (2 tools)
Tool | Description |
| Get current authenticated user |
| List accessible workspaces |
Repositories (10 tools)
Tool | Description |
| List repositories in a workspace |
| Get repository details |
| List branches |
| List commits (optionally for a branch/tag) |
| Get file content at a specific revision |
| Create a commit with file changes (write) |
| Create a new branch (write) |
| Delete a branch (destructive, requires confirm) |
| List directory contents at a specific revision |
| Search for code in a workspace or repository |
Pull Requests (12 tools)
Tool | Description |
| List PRs with optional state filter |
| Get PR details |
| Create a new PR (write) |
| Update PR title, description, or reviewers (write) |
| Get PR diff (raw text) |
| Get PR diffstat summary |
| List PR activity (comments, approvals, updates) |
| Add a comment to a PR (write) |
| Approve a PR (write) |
| Request changes on a PR (write) |
| Merge a PR (destructive, requires confirm) |
| Decline a PR (destructive, requires confirm) |
Issues (4 tools)
Tool | Description |
| List issues with optional query |
| Get issue details |
| Create a new issue (write) |
| Add a comment to an issue (write) |
Pipelines (3 tools)
Tool | Description |
| List recent pipelines |
| Get pipeline details |
| Trigger a pipeline run (write) |
Development
npm test # Run tests
npm run lint # Lint
npm run build # CompileContributing
See CONTRIBUTING.md for development setup and guidelines.
Security
See SECURITY.md for reporting vulnerabilities.
License
MIT
Available Tools
33 toolsbb_add_pull_request_commentA
Add a comment to a pull request, optionally as an inline comment on a specific file and line. Use parent_id to create a threaded reply to an existing comment.
Inputs: pr_id (required), content (required), repo_slug (required), parent_id, +3 more.
bb_approve_pull_requestC
Approve a pull request
Inputs: pr_id (required), repo_slug (required), workspace.
bb_comment_issueA
Add a comment to an issue in a Bitbucket repository
Inputs: content (required), issue_id (required), repo_slug (required), workspace.
bb_create_branchC
Create a new branch in a Bitbucket repository
Inputs: name (required), repo_slug (required), target_hash (required), workspace.
bb_create_commit_filesB
Create or update files in a Bitbucket repository by creating a new commit
Inputs: files (required), branch (required), message (required), repo_slug (required), +2 more.
bb_create_issueB
Create a new issue in a Bitbucket repository
Inputs: title (required), repo_slug (required), kind, content, +2 more.
bb_create_pull_requestC
Create a new pull request
Inputs: title (required), repo_slug (required), source_branch (required), reviewers, +4 more.
bb_decline_pull_requestB
Decline a pull request (destructive action, requires confirmation)
Inputs: pr_id (required), confirm (required), repo_slug (required), workspace.
bb_delete_branchA
Delete a branch from a Bitbucket repository (destructive action, requires confirmation)
Inputs: name (required), confirm (required), repo_slug (required), workspace.
bb_get_fileB
Get the raw content of a file from a Bitbucket repository
Inputs: path (required), commit (required), repo_slug (required), workspace.
bb_get_issueB
Get details of a specific issue in a Bitbucket repository
Inputs: issue_id (required), repo_slug (required), workspace.
bb_get_pipelineB
Get details of a specific pipeline in a Bitbucket repository
Inputs: repo_slug (required), pipeline_uuid (required), workspace.
bb_get_pull_requestB
Get details of a specific pull request
Inputs: pr_id (required), repo_slug (required), workspace.
bb_get_pull_request_diffB
Get the diff of a pull request
Inputs: pr_id (required), repo_slug (required), workspace.
bb_get_pull_request_diffstatA
Get the diffstat (summary of changed files) of a pull request
Inputs: pr_id (required), repo_slug (required), workspace.
bb_get_repositoryB
Get details of a specific Bitbucket repository
Inputs: repo_slug (required), workspace.
bb_list_branchesB
List branches in a Bitbucket repository
Inputs: repo_slug (required), page, query, pagelen, +1 more.
bb_list_commitsC
List commits in a Bitbucket repository, optionally for a specific branch/tag/hash
Inputs: repo_slug (required), page, pagelen, revision, +1 more.
bb_list_directoryB
List the contents of a directory in a Bitbucket repository
Inputs: repo_slug (required), page, path, pagelen, +2 more.
bb_list_issuesB
List issues in a Bitbucket repository
Inputs: repo_slug (required), page, query, pagelen, +1 more.
bb_list_pipelinesA
List pipelines in a Bitbucket repository, sorted by newest first
Inputs: repo_slug (required), page, pagelen, workspace.
bb_list_pull_request_activityB
List activity (comments, approvals, updates) on a pull request
Inputs: pr_id (required), repo_slug (required), workspace.
bb_list_pull_requestsC
List pull requests in a Bitbucket repository, optionally filtered by state
Inputs: repo_slug (required), page, state, pagelen, +1 more.
bb_list_repositoriesC
List repositories in a Bitbucket workspace
Inputs: page, query, pagelen, workspace.
bb_list_workspacesC
List Bitbucket workspaces accessible to the authenticated user
Inputs: role.
bb_merge_pull_requestA
Merge a pull request (destructive action, requires confirmation)
Inputs: pr_id (required), confirm (required), repo_slug (required), workspace, +2 more.
bb_request_changes_pull_requestC
Request changes on a pull request
Inputs: pr_id (required), repo_slug (required), workspace.
bb_resolve_pull_request_commentB
Resolve a comment thread on a pull request
Inputs: pr_id (required), repo_slug (required), comment_id (required), workspace.
bb_search_codeC
Search for code in a Bitbucket workspace or repository
Inputs: query (required), page, pagelen, repo_slug, +1 more.
bb_trigger_pipelineB
Trigger a new pipeline run in a Bitbucket repository
Inputs: branch (required), repo_slug (required), pattern, variables, +1 more.
bb_unresolve_pull_request_commentA
Reopen a resolved comment thread on a pull request
Inputs: pr_id (required), repo_slug (required), comment_id (required), workspace.
bb_update_pull_requestB
Update a pull request's title, description, or reviewers
Inputs: pr_id (required), repo_slug (required), title, reviewers, +2 more.
bb_whoamiA
Get the currently authenticated Bitbucket user
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Each tool targets a distinct resource and action, with clear prefixes and specific nouns. Even within the large set of pull request tools, each has a unique purpose (e.g., approve vs. merge vs. request changes). No two tools are easily confused.
All tools follow the 'bb_verb_noun' pattern consistently, using snake_case. Verbs are well-chosen (create, get, list, delete, update, etc.) and nouns are specific (pull_request, issue, branch, etc.). No mixing of conventions.
33 tools cover a wide range of Bitbucket functionality (repos, PRs, issues, pipelines, search, etc.). While on the higher end, the count is justified by the domain's complexity. Some tools could be consolidated (e.g., diff and diffstat), but overall it's well-scoped.
Pull request coverage is thorough (CRUD, comments, diff, activity). Issues lack update/delete, and repositories lack create/delete. Pipelines are missing cancel/stop. These are notable but not critical gaps, as the core workflows are covered.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for Bitbucket Cloud that enables AI agents to manage repositories, branches, pull requests, and deployments via typed tools.1743 npmISC
- AlicenseNot gradedqualityDmaintenanceMCP server for Bitbucket Cloud that exposes 35 tools covering repositories, pull requests, branching models, and pipelines, enabling AI clients to automate Bitbucket workflows.3MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Bitbucket Cloud workspaces, repositories, branches, commits, issues, pipelines, and pull requests through MCP tools for listing, reading, creating, updating, commenting, searching, comparing, approving, merging, and cloning. It connects LLMs directly to version control and repository workflows via standard API paths and configurable authentication.-
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Bitbucket Cloud workspaces, repositories, pull requests, commits, branches, diffs, comments, issues, pipelines, and deployments through MCP tools for listing, reading, creating, updating, deleting, searching, commenting, and cloning via the Bitbucket API.MIT