Bitbucket MCP server
A maintained MCP server for Bitbucket Cloud and Server: browse repos, drive pull requests, comments, tasks, and pipelines.
Bitbucket MCP is a widely used, actively maintained Model Context Protocol server that connects an agent to Atlassian Bitbucket Cloud and Server/Data Center. It lets a coding assistant work the way a developer does on Bitbucket: list and inspect repositories, read and create pull requests, manage the review lifecycle (approve, request changes, decline, merge), thread comments inline or generally, resolve and reopen comment threads, track PR tasks, read diffs and patches, and drive Bitbucket Pipelines runs and step logs.
The server is published to npm as bitbucket-mcp and runs locally over stdio via npx, authenticating with either a Bitbucket app password (BITBUCKET_USERNAME plus BITBUCKET_PASSWORD) or a BITBUCKET_TOKEN access token, and an optional default BITBUCKET_WORKSPACE. By design it is safety-conscious: destructive operations are gated behind an explicit BITBUCKET_ENABLE_DANGEROUS flag, so an agent can browse, review, and comment freely without risking data loss. Listing tools support pagination so an assistant can page through large collections without truncation. For teams on Bitbucket, it brings the same review-and-CI loop that the GitHub and GitLab servers provide for their platforms.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Available tools
| Tool | Description |
|---|---|
| listRepositories | Lists repositories in a workspace, with optional name filtering and pagination. |
| getRepository | Gets details for a specific repository. |
| getPullRequests | Gets pull requests for a repository, optionally filtered by state (OPEN, MERGED, DECLINED, SUPERSEDED). |
| createPullRequest | Creates a new pull request. |
| getPullRequest | Gets details for a specific pull request. |
| updatePullRequest | Updates a pull request. |
| getPullRequestActivity | Gets the activity log for a pull request. |
| approvePullRequest | Approves a pull request. |
| unapprovePullRequest | Removes an approval from a pull request. |
| declinePullRequest | Declines a pull request. |
| mergePullRequest | Merges a pull request. |
| requestChanges | Requests changes on a pull request. |
| removeChangeRequest | Removes a change request from a pull request. |
| createDraftPullRequest | Creates a new draft pull request. |
| publishDraftPullRequest | Publishes a draft pull request to make it ready for review. |
| convertTodraft | Converts a regular pull request to draft status. |
| getPullRequestComments | Lists comments on a pull request. |
| addPullRequestComment | Creates a comment on a pull request, general or inline. |
| getPullRequestComment | Gets a specific comment on a pull request. |
| updatePullRequestComment | Updates a comment on a pull request. |
| deletePullRequestComment | Deletes a comment on a pull request. |
| resolveComment | Resolves a comment thread on a pull request. |
| reopenComment | Reopens a resolved comment thread on a pull request. |
| getPullRequestDiff | Gets the diff for a pull request. |
| getPullRequestDiffStat | Gets the diff statistics for a pull request. |
| getPullRequestPatch | Gets the patch for a pull request. |
| getPullRequestTasks | Lists tasks on a pull request. |
| createPullRequestTask | Creates a task on a pull request. |
| getPullRequestTask | Gets a specific task on a pull request. |
| updatePullRequestTask | Updates a task on a pull request. |
| deletePullRequestTask | Deletes a task on a pull request. |
| getPullRequestCommits | Lists commits on a pull request. |
| getPullRequestStatuses | Lists commit statuses for a pull request. |
| listPipelineRuns | Lists pipeline runs for a repository. |
| getPipelineRun | Gets details for a specific pipeline run. |
| runPipeline | Triggers a new pipeline run. |
| stopPipeline | Stops a running pipeline. |
| getPipelineSteps | Lists steps for a pipeline run. |
| getPipelineStep | Gets details for a specific pipeline step. |
| getPipelineStepLogs | Gets logs for a specific pipeline step. |
Required configuration
- BITBUCKET_URLOptional
Bitbucket API base URL. Defaults to https://api.bitbucket.org/2.0 for Cloud; point it at your Server/Data Center host otherwise.
- BITBUCKET_USERNAMEOptional
Your Bitbucket username (often your account email). Required when using app-password auth.
- BITBUCKET_PASSWORDOptional
Your Bitbucket app password. Required when using app-password auth.
- BITBUCKET_TOKENOptional
A Bitbucket access token, used as an alternative to username + app password.
- BITBUCKET_WORKSPACEOptional
Default workspace slug. Auto-extracted if BITBUCKET_URL already contains it.
- BITBUCKET_ENABLE_DANGEROUSOptional
Set to true to enable destructive tools such as deletions. Disabled by default.
What you can do with it
Review and merge a pull request
An agent reads a PR's diff and activity, leaves inline comments, approves or requests changes, and merges once the checks pass, all without leaving the editor.
Investigate a failing pipeline
Using listPipelineRuns and getPipelineStepLogs, the agent finds which Bitbucket Pipelines step failed, reads its logs, and summarizes the cause before retriggering the run.
FAQ
- Is it free?
- Yes. The server is free and open source under the MIT license; you only need a Bitbucket account and an app password or access token scoped to what the agent should do.
- Does it support remote/OAuth?
- No. It runs locally over stdio via npx -y bitbucket-mcp@latest and authenticates with a Bitbucket app password (username + password) or a BITBUCKET_TOKEN access token.
- Can it delete things or break my repo?
- Not by default. Destructive operations are gated behind the BITBUCKET_ENABLE_DANGEROUS flag, so an agent can browse, review, comment, and run pipelines without risk of data loss unless you explicitly opt in.