# Bitbucket MCP

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: FabianSchurig
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/FabianSchurig/bitbucket-cli
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/mcp/bitbucket-mcp

## What it 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.

## Requirements
- Needs: Docker
- Environment variables: `BITBUCKET_USERNAME`, `BITBUCKET_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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 <…> with your own values

### Codex

**Platform CLI**
```bash
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.2
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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.2
```
Replace <…> with your own values

## When to use it
- 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
- Show me the open pull requests in the `backend-api` repository
- What branches exist in `web-app`?
- Find commits from the last week in `infra`

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [GitDiagram](https://affpapa.org/en/nevibecode/mcp/gitdiagram.md) — MCP server · ★ 18446
- [Repowise](https://affpapa.org/en/nevibecode/mcp/repowise.md) — MCP server · ★ 7891
- [sem](https://affpapa.org/en/nevibecode/mcp/sem.md) — MCP server · ★ 3422
- [GitLab MCP Server](https://affpapa.org/en/nevibecode/mcp/gitlab-mcp-server.md) — MCP server · ★ 2065
- [Octocode MCP - AI Context Platform](https://affpapa.org/en/nevibecode/mcp/octocode-mcp-ai-context-platform.md) — MCP server · ★ 955

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
