Skip to main content
Glama
sanscdm

bitbucket-mcp

by sanscdm
README.md
# Bitbucket MCP

A FastMCP server for Bitbucket Cloud REST API.

## Features

- List repositories
- Get repo details
- List branches
- List pull requests
- Create/manage pull requests
- And more...

## Setup

### 1. Create a Bitbucket API Token

1. Go to [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
2. Click **"Create API token with scopes"** (not the regular one)
3. Name it (e.g., "MCP Tool")
4. Under "Select app", choose **Bitbucket**
5. Grant the needed permissions (repo read/write, PR read/write, etc.)
6. Copy the token

### 2. Set Environment Variables

```bash
export BITBUCKET_EMAIL="your-email@domain.com"
export BITBUCKET_API_TOKEN="your-api-token-here"
```

Or create a `.env` file:

```bash
BITBUCKET_EMAIL=your-email@domain.com
BITBUCKET_API_TOKEN=your-api-token-here
```

### 3. Run the Server

```bash
# Using uv (recommended)
uv run --directory /path/to/bitbucket-mcp python server.py

# Or with pip
pip install -r requirements.txt
python server.py
```

### 4. Connect via mcporter

Add to your `mcporter.json`:

```json
{
  "mcpServers": {
    "bitbucket": {
      "command": "/path/to/uv",
      "args": [
        "run",
        "--directory",
        "/path/to/bitbucket-mcp",
        "python",
        "server.py"
      ],
      "env": {
        "BITBUCKET_EMAIL": "your-email@domain.com",
        "BITBUCKET_API_TOKEN": "your-api-token"
      }
    }
  }
}
```

## Requirements

- Python 3.10+
- `uv` (optional, but recommended)

## License

MIT

TDQS

B3.2/5.0

Scored across 32 tools

Disambiguation5/5

Each tool targets a distinct resource and action. Comment tools are differentiated by operation (list/add/inline/reply/edit/delete), and PR views are clearly separated by data type (diff, diffstat, commits, activity, build status). No two tools appear to serve the same purpose.

Naming Consistency3/5

Most tools follow a verb_noun pattern (list_repos, create_pull_request), but there are notable deviations: data-view tools use a noun-first 'pr_' prefix (pr_diff, pr_commits, pr_activity, pr_build_status) and 'pipeline_steps' lacks a verb. The resource is inconsistently called 'pull_request' in some tools and 'pr' in others, and comment actions use varying prepositions (on, to). Still, the names remain readable and understandable.

Tool Count2/5

At 32 tools, the server exceeds the 'borderline' range of 16-25 and feels heavy. While many tools are justified for a Bitbucket API, there is some overlap (e.g., list_commits vs pr_commits) and the PR comment workflow alone accounts for six tools. The count would be more appropriate if consolidated or scoped tighter, such as focusing on core PR operations.

Completeness3/5

The pull request lifecycle is thoroughly covered (create, update, approve, merge, decline, comments, diff, commits, activity, build status). However, repository management is incomplete: there is no create/update/delete repo, and branch operations are limited to listing. These are notable gaps for a Bitbucket integration and could force agents to use external tools.

Maintenance

ActivityInactive
ResponsivenessNo issues