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.0.tar.gz (10.3 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.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_server_bitbucket-0.1.0.tar.gz
  • Upload date:
  • Size: 10.3 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.0.tar.gz
Algorithm Hash digest
SHA256 4c9b362da6c8e72346a05b6f30a6f3e966a7100057fb0eb44f08efa6ec115f9c
MD5 11cc001207d9bfb9e7a55fad56e5c201
BLAKE2b-256 ce5aa912e163c2b7e48292c0961de6d8cd5405586287f030ef729081618950ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mcp_server_bitbucket-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f03fd16aa230fef07782e08131302a1098488feabaaa5095a2fec4f711ec70e1
MD5 04cd146aa52a7ecb2d2ec7e280fc5e91
BLAKE2b-256 7e3b85d61d840ec60f52e44f4582e25c4d75042e50471c4ae4b247f0f09a3c51

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