# Bitbucket MCP

> Bitbucket MCP is an open-source MCP server for developer tools. MCP server for Bitbucket Cloud pull requests and Pipelines build diagnosis. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux, self-hosted
- **Repository:** https://github.com/lahma/bitbucket-mcp
- **MCP Registry name:** io.github.lahma/bitbucket-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-19

## About

The README describes this as a self-owned Model Context Protocol server for Bitbucket Cloud, covering a pull request from listing and diffing through review comments, tasks, approvals, merge checks and merging. It also includes a set of read-only Pipelines tools for finding the failing step and the log line behind a red build, plus Code Insights lookups.

The project is written in C# on .NET 10 and ships as a Native AOT binary per platform, or as a NuGet tool launched with dnx. Authentication can use an OAuth consumer with a browser login, an Atlassian API token, or a workspace, project or repository access token, and the README lists the scopes each one needs. Bitbucket Data Center is stated to be out of scope.

It suits developers and teams who want an AI client to review and act on Bitbucket pull requests while keeping the server's dependencies small and auditable. The README says the project is MIT licensed.

## Features

- **Pull request lifecycle tools:** Lists, reads, diffs, comments on, edits, creates, approves, merges and declines pull requests in Bitbucket Cloud.
- **Merge readiness check:** Runs Bitbucket's own dry run to show conflicts, required checks, tasks and merge queue state before merging.
- **Pipeline failure diagnosis:** Reads pipeline runs, failed steps, error messages and step logs to explain why a build went red.
- **Capped diffs:** Lists changed files first and fetches diff content only for named paths, with truncation marked in the output.
- **Multiple credential options:** Supports OAuth browser login, Atlassian API tokens and access tokens, with documented precedence between them.
- **Native AOT binaries:** Ships self-contained executables per platform, which the README says start in about ten milliseconds.

## Good for

- Reviewing a Bitbucket pull request with an AI assistant, including inline comments and tasks
- Checking whether a pull request is blocked by approvals, builds or unresolved tasks before merging
- Finding the failing step and log line of a red Bitbucket Pipelines run
- Triaging which open pull requests are waiting on a particular reviewer
- Opening pull requests with a source branch and default reviewers

## Install

### Claude Code (Terminal)

```sh
claude mcp add bitbucket-mcp --env BITBUCKET_OAUTH_SECRET='<BITBUCKET_OAUTH_SECRET>' --env BITBUCKET_ACCESS_TOKEN='<BITBUCKET_ACCESS_TOKEN>' --env BITBUCKET_API_TOKEN='<BITBUCKET_API_TOKEN>' -- dnx bitbucket-mcp --yes
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "dnx",
      "args": [
        "bitbucket-mcp",
        "--yes"
      ],
      "env": {
        "BITBUCKET_OAUTH_SECRET": "<BITBUCKET_OAUTH_SECRET>",
        "BITBUCKET_ACCESS_TOKEN": "<BITBUCKET_ACCESS_TOKEN>",
        "BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "dnx",
      "args": [
        "bitbucket-mcp",
        "--yes"
      ],
      "env": {
        "BITBUCKET_OAUTH_SECRET": "<BITBUCKET_OAUTH_SECRET>",
        "BITBUCKET_ACCESS_TOKEN": "<BITBUCKET_ACCESS_TOKEN>",
        "BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "bitbucket-mcp": {
      "type": "stdio",
      "command": "dnx",
      "args": [
        "bitbucket-mcp",
        "--yes"
      ],
      "env": {
        "BITBUCKET_OAUTH_SECRET": "<BITBUCKET_OAUTH_SECRET>",
        "BITBUCKET_ACCESS_TOKEN": "<BITBUCKET_ACCESS_TOKEN>",
        "BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "dnx",
      "args": [
        "bitbucket-mcp",
        "--yes"
      ],
      "env": {
        "BITBUCKET_OAUTH_SECRET": "<BITBUCKET_OAUTH_SECRET>",
        "BITBUCKET_ACCESS_TOKEN": "<BITBUCKET_ACCESS_TOKEN>",
        "BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "dnx",
      "args": [
        "bitbucket-mcp",
        "--yes"
      ],
      "env": {
        "BITBUCKET_OAUTH_SECRET": "<BITBUCKET_OAUTH_SECRET>",
        "BITBUCKET_ACCESS_TOKEN": "<BITBUCKET_ACCESS_TOKEN>",
        "BITBUCKET_API_TOKEN": "<BITBUCKET_API_TOKEN>"
      }
    }
  }
}
```

## Tools

- `listPullRequests`: Lists a repository's pull requests, most recently updated first.
- `getPullRequest`: Reads one pull request in full, including reviewers and approvals.
- `getPullRequestDiff`: Fetches changed files or the unified diff for named paths.
- `getPullRequestComments`: Lists general and inline comments on a pull request.
- `listDefaultReviewers`: Lists the repository's effective default reviewers with account UUIDs.
- `listPullRequestStatuses`: Lists build statuses reported against a pull request.
- `listPullRequestTasks`: Lists a pull request's tasks by resolved state.
- `getPullRequestMergeability`: Runs Bitbucket's dry-run merge check, including merge checks and queue state.
- `createPullRequest`: Opens a new pull request.
- `updatePullRequest`: Changes a pull request's title, description, destination, reviewers or flags.
- `addPullRequestComment`: Posts a general, reply or inline comment on a pull request.
- `updatePullRequestComment`: Edits or deletes one of the authenticated user's own comments.
- `resolvePullRequestComment`: Resolves or reopens a comment thread.
- `addPullRequestTask`: Adds a task to a pull request, optionally tied to a comment.
- `updatePullRequestTask`: Resolves, reopens or rewrites a pull request task.
- `setPullRequestReviewStatus`: Sets the user's own approval or change-request status.
- `mergePullRequest`: Merges a pull request, with optional strategy, waiting up to 25 seconds.
- `declinePullRequest`: Declines a pull request without merging.
- `listPipelines`: Lists pipeline runs, filterable by branch, commit or state.
- `getPipeline`: Reads one pipeline run with its steps and error messages.
- `getPipelineStepLog`: Reads the end of a step's log or lines matching a pattern.
- `listCodeInsights`: Lists Code Insights reports and findings for a commit.

## FAQ

### Does it work with Bitbucket Data Center?

No. The README states Bitbucket Data Center is explicitly out of scope.

### What license is it under?

The README says the project is MIT licensed.

### Can it run pipelines or stop builds?

No. The README says the four pipeline tools are read-only by design, and running or stopping a build is not offered.

### Which credentials does it accept?

It accepts BITBUCKET_ACCESS_TOKEN, an Atlassian email with API token, or an OAuth consumer key and secret, in that precedence order.

### Is Bitbucket MCP free?

Yes. Bitbucket MCP is open source, so you can use and self-host it for free.

### How do I add Bitbucket MCP to Claude Code?

Run this command in your terminal: claude mcp add bitbucket-mcp --env BITBUCKET_OAUTH_SECRET='<BITBUCKET_OAUTH_SECRET>' --env BITBUCKET_ACCESS_TOKEN='<BITBUCKET_ACCESS_TOKEN>' --env BITBUCKET_API_TOKEN='<BITBUCKET_API_TOKEN>' -- dnx bitbucket-mcp --yes

### What are the best alternatives to Bitbucket MCP?

The closest alternatives to Bitbucket MCP are Git MCP Server, Sonarqube MCP, GitHub, Bitpull and Azure DevOps.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Git MCP Server](https://ai-powered.com/mcp/git-mcp-server): Git MCP Server is an open-source MCP server for developer tools.
- [Sonarqube MCP](https://ai-powered.com/mcp/sonarqube-mcp-2): Sonarqube MCP is an open-source MCP server for developer tools.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Bitpull](https://ai-powered.com/mcp/bitpull): Bitpull is a paid MCP server for ai models and llm tooling.
- [Azure DevOps](https://ai-powered.com/mcp/azure-devops): Azure DevOps is an MCP server for cloud and infrastructure.
- [Codebahn](https://ai-powered.com/mcp/codebahn): Codebahn is an MCP server for developer tools.
- [Azure DevOps (ADO)](https://ai-powered.com/mcp/azure-devops-ado): Azure DevOps (ADO) is a free MCP server for cloud and infrastructure.
- [Git Diff Mcp](https://ai-powered.com/mcp/git-diff-mcp): Git Diff Mcp is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/bitbucket-mcp-4
