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
Metadata
Release files for bitbucket-mcp-atlassian 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bitbucket_mcp_atlassian-0.1.0.tar.gz | 53.3 kB | With provenance | Details for bitbucket_mcp_atlassian-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bitbucket_mcp_atlassian-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for bitbucket_mcp_atlassian-0.1.0-py3-none-any.whl |
Total release size: 61.6 kB
Release files / bitbucket_mcp_atlassian-0.1.0.tar.gz
| Download URL | bitbucket_mcp_atlassian-0.1.0.tar.gz |
|---|---|
| Size | 53.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a672a7d705b39027bed64a4a3ddb693639488bed748f11b56e2052194638a0d
|
|
BLAKE2b-256 checksum How to use checksums |
f760e0211629a1bf273c016b1a0a6e19ebd5e86e1f28fdaf56f575701b2c4fbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 9, 2026.
Transparency logRelease files / bitbucket_mcp_atlassian-0.1.0-py3-none-any.whl
| Download URL | bitbucket_mcp_atlassian-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ce2d197308a9591801895e98c2d198fe9eff0e594f4963b710da71313592f06
|
|
BLAKE2b-256 checksum How to use checksums |
6526dd7c28fef5255b8691189edca5cda454f90de19f83e1b43a0d5f29645d43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 9, 2026.
Transparency logSecurity for bitbucket-mcp-atlassian 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for bitbucket_mcp_atlassian-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 9, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.