Skip to main content

MCP server for Bitbucket API operations

Project description

Bitbucket MCP Server

MCP server for Bitbucket API operations. Works with Claude Code, Claude Desktop, and any MCP-compatible client.

Features

  • Repositories: get, create, delete, list
  • Pull Requests: create, get, list, merge
  • Pipelines: trigger, get status, list, view logs, stop
  • Branches: list, get

Installation

Option 1: Install from PyPI (Recommended)

# Install with pipx (isolated environment)
pipx install mcp-server-bitbucket

# Or with pip
pip install mcp-server-bitbucket

Option 2: From Source

git clone https://github.com/simplekyc/bitbucket-mcp.git
cd bitbucket-mcp
poetry install

Configuration

Set environment variables for Bitbucket authentication:

export BITBUCKET_WORKSPACE=your-workspace
export BITBUCKET_EMAIL=your-email@example.com
export BITBUCKET_API_TOKEN=your-app-password

To create an app password:

  1. Go to Bitbucket → Settings → App passwords
  2. Create a new app password with these permissions:
    • Repositories: Read, Write, Admin, Delete
    • Pull Requests: Read, Write
    • Pipelines: Read, Write

Usage with Claude Code

Add to your Claude Code MCP configuration (~/.claude/mcp.json or project .mcp.json):

{
  "mcpServers": {
    "bitbucket": {
      "command": "mcp-server-bitbucket",
      "env": {
        "BITBUCKET_WORKSPACE": "your-workspace",
        "BITBUCKET_EMAIL": "your-email@example.com",
        "BITBUCKET_API_TOKEN": "your-app-password"
      }
    }
  }
}

If installed from source:

{
  "mcpServers": {
    "bitbucket": {
      "command": "poetry",
      "args": ["run", "python", "-m", "src.server"],
      "cwd": "/path/to/bitbucket-mcp",
      "env": {
        "BITBUCKET_WORKSPACE": "your-workspace",
        "BITBUCKET_EMAIL": "your-email@example.com",
        "BITBUCKET_API_TOKEN": "your-app-password"
      }
    }
  }
}

Available Tools

Tool Description
get_repository Get repository info
create_repository Create a new repository
delete_repository Delete a repository
list_repositories List repositories in workspace
create_pull_request Create a pull request
get_pull_request Get PR details
list_pull_requests List PRs by state
merge_pull_request Merge a PR
trigger_pipeline Run a pipeline
get_pipeline Get pipeline status
list_pipelines List recent pipelines
get_pipeline_logs View pipeline logs
stop_pipeline Stop a running pipeline
list_branches List branches
get_branch Get branch info

HTTP Server (Cloud Run)

For deploying as an HTTP API:

# Run locally
poetry run uvicorn src.http_server:app --reload --port 8080

# Deploy to Cloud Run
gcloud run deploy bitbucket-mcp-service \
  --source . \
  --region australia-southeast1 \
  --set-secrets "BITBUCKET_EMAIL=bitbucket-email:latest,BITBUCKET_API_TOKEN=bitbucket-token:latest"

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_bitbucket-0.1.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_bitbucket-0.1.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_bitbucket-0.1.2.tar.gz.

File metadata

  • Download URL: mcp_server_bitbucket-0.1.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.9 Darwin/24.6.0

File hashes

Hashes for mcp_server_bitbucket-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a6a961d29606efa4d1ce67004a4eada6ca533637aeb0c068bf913621c817db6a
MD5 54f0065fa7d1e56eae7793c49cf3d184
BLAKE2b-256 a18c9b001138ba4568a08d733cd92a484d16d5171f294ffadd92b026393d851b

See more details on using hashes here.

File details

Details for the file mcp_server_bitbucket-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_bitbucket-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74b6c6da6e71c22bd63be2cc3e51f021226d5ba34c4a95e11e3e5089b077e0ca
MD5 7272eae2bab7422ad89f9dcb7d383aa3
BLAKE2b-256 f046399afc5b6df1c61ad71e28dcb36ba7c2573a8e23c1e51fc33792b7754ff1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page