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.1.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.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_server_bitbucket-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 3c680fd6957277169f44a1c2934fb0fb59cdd260b60390dc795cbdc107ca042a
MD5 ae8b10abce1fe79c28c47646883d5f08
BLAKE2b-256 2fc41d6bccc1c8e5e5640ede714ab29be4eae797304354114d6a6a0ae3d3358f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_bitbucket-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f640da1a72b934133b330175050acaec0b02906704ff86a4032cf461d9b9e5e8
MD5 4b8c91a78642e672b7cda4d80cd5e1fc
BLAKE2b-256 fc5f1bda6e5e36cd9ce60625cbb1b052e0cbf613aaa9ae25eeaeb049001317b1

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