Skip to main content

Bitbucket Server MCP

Native Python MCP server for Bitbucket Server and Data Center. It uses the Bitbucket REST API directly with a single self-contained runtime.

Install and run

Install uv, copy .env.example to .env, and set the Bitbucket URL and credentials:

cp .env.example .env
uv sync
uv run bitbucket-mcp

Use a personal access token with BITBUCKET_TOKEN, or set both BITBUCKET_USERNAME and BITBUCKET_PASSWORD. BITBUCKET_URL is the Bitbucket web base URL, for example https://bitbucket.example.com (the client appends /rest/api/1.0). Set BITBUCKET_VERIFY_TLS=false only for a deliberately trusted test certificate. BITBUCKET_TIMEOUT, BITBUCKET_MAX_RETRIES, and BITBUCKET_TRANSPORT (stdio, sse, or streamable-http) are also supported.

Example stdio MCP configuration:

{
  "mcpServers": {
    "bitbucket": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/mcp-server-wrapper-bitbucket", "bitbucket-mcp"],
      "env": {"BITBUCKET_URL": "https://bitbucket.example.com", "BITBUCKET_TOKEN": "your-token"}
    }
  }
}

Tools

The server currently exposes 23 tools, organized by capability:

  • Projects and repositories: list_projects, get_project, list_repositories, get_repository
  • Pull requests: create_pull_request, get_pull_request, list_pull_requests, update_pull_request, merge_pull_request, decline_pull_request
  • Pull-request discussion and review: add_comment, get_comments, get_diff, get_reviews
  • Source history: list_branches, list_commits, get_commit, get_file, browse_files
  • Users and access: list_users, get_user, list_permissions
  • Builds and CI: list_builds

All calls use Bitbucket Server/Data Center REST API v1.0 paths and return the API's JSON (or text for diffs and files), preserving pagination fields where Bitbucket supplies them. Write operations are limited to pull-request creation, updates, merge/decline, and comments; no delete tools are exposed.

Development and testing

uv sync
uv run pytest

Tests use mocked httpx.AsyncClient responses and never contact Bitbucket. The reusable client handles bearer-token or basic authentication, TLS verification, timeouts, retries for transient responses, JSON/text responses, and useful API errors.

Build and publish with uv

The project is a standard Python package and can be built with uv:

uv build

This creates a wheel and source distribution in dist/. After configuring a PyPI API token, publish them with:

export UV_PUBLISH_TOKEN="pypi-your-token"
uv publish

uv publish uploads to PyPI by default. Use --publish-url for a private package index. This project publishes as bitbucket-mcp-atlassian; the version in pyproject.toml must be incremented for each release. Publishing is intentionally not performed by the development/test commands.

GitHub Actions Trusted Publishing

The repository includes .github/workflows/release.yml. Configure the PyPI publisher for repository vishn9893/mcp-server-wrapper-bitbucket, workflow release.yml, and GitHub environment pypi. The workflow publishes only when a v* tag is pushed and uses PyPI's short-lived OIDC credential.

Architecture

src/bitbucket_mcp/
  client.py   async HTTP and authentication infrastructure
  config.py   pydantic-settings environment configuration
  tools.py    REST API capability functions
  server.py   FastMCP tool registration and transport entrypoint

Download files

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

Source Distribution

bitbucket_mcp_atlassian-0.1.0.tar.gz (53.3 kB view details)

Uploaded Source

Built Distribution

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

bitbucket_mcp_atlassian-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bitbucket_mcp_atlassian-0.1.0.tar.gz
  • Upload date:
  • Size: 53.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bitbucket_mcp_atlassian-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a672a7d705b39027bed64a4a3ddb693639488bed748f11b56e2052194638a0d
MD5 fc975b82c492bc68a96d17686f63f148
BLAKE2b-256 f760e0211629a1bf273c016b1a0a6e19ebd5e86e1f28fdaf56f575701b2c4fbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitbucket_mcp_atlassian-0.1.0.tar.gz:

Publisher: release.yml on vishn9893/mcp-server-wrapper-bitbucket

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for bitbucket_mcp_atlassian-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ce2d197308a9591801895e98c2d198fe9eff0e594f4963b710da71313592f06
MD5 422cac0b579b07d71f698e814cb2c787
BLAKE2b-256 6526dd7c28fef5255b8691189edca5cda454f90de19f83e1b43a0d5f29645d43

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitbucket_mcp_atlassian-0.1.0-py3-none-any.whl:

Publisher: release.yml on vishn9893/mcp-server-wrapper-bitbucket

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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