MCP Server for Bitbucket API - Container optimized with configurable tools, structured output and slim responses
Project description
Bitbucket MCP Server (Python)
A Model Context Protocol (MCP) server for Bitbucket API, optimized for container execution.
Features
- Basic Auth (
base64(email:token)) - Container-ready (Podman/Docker)
- 22 MCP tools (repositories, PRs, comments, pipelines)
- Configurable tools via
configs/tools.json - Optional keychain support for secure credentials
Quick Start
1. Configure Credentials
# Add to ~/.zshrc or ~/.bashrc
export BITBUCKET_USERNAME="your-email@example.com"
export BITBUCKET_TOKEN="your-api-token"
export BITBUCKET_WORKSPACE="your-workspace"
Get your API token at: https://id.atlassian.com/manage-profile/security/api-tokens
2. Build & Run
make build
make up
make verify # Test authentication
3. Configure Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"bitbucket": {
"command": "podman",
"args": ["exec", "-i", "bitbucket-mcp", "python", "-m", "src.main", "--transport", "stdio"]
}
}
}
4. Configure VS Code (GitHub Copilot)
Add to ~/Library/Application Support/Code/User/mcp.json:
{
"mcpServers": {
"bitbucket-mcp": {
"command": "podman",
"args": ["exec", "-i", "bitbucket-mcp", "python", "-m", "src.main", "--transport", "stdio"]
}
}
}
Available Tools
| Category | Tools |
|---|---|
| Repositories | list_repositories, get_repository |
| Pull Requests | get_pull_requests, get_pull_request, create_pull_request, update_pull_request, approve_pull_request, unapprove_pull_request, decline_pull_request |
| Comments | get_pull_request_comments, add_pull_request_comment, get_pull_request_activity, get_pull_request_diff, get_pull_request_commits |
| Build Status | get_pull_request_statuses, get_pull_request_diffstat |
| Pipelines | list_pipeline_runs, get_pipeline_run, get_pipeline_steps, get_pipeline_step_logs |
Make Commands
make build # Build container
make up # Start container
make down # Stop container
make test # Run tests
make verify # Test Bitbucket auth
make logs # View logs
make clean # Remove container/image
Secure Credentials (Optional)
For enhanced security, use system keychain instead of environment variables:
# Install keyring support
pip install 'bitbucket-mcp-py[keyring]'
# Store in macOS Keychain
python3 -c "import keyring; keyring.set_password('bitbucket-mcp', 'bitbucket_token', 'YOUR_TOKEN')"
Development
# Run tests
make test
# Run specific test
pytest tests/test_client.py -v
Requirements
- Python 3.12+
- Podman or Docker
- Bitbucket API token
License
MIT
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bitbucket_mcp_py-1.4.0.tar.gz.
File metadata
- Download URL: bitbucket_mcp_py-1.4.0.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08aa92ba0a610d6cadde239f810a1f3c06d40df3193758c3434f4371a3f5f5f1
|
|
| MD5 |
0919c2b61b5c694103b477eadc6c79b5
|
|
| BLAKE2b-256 |
5a052a56a756b8223d062cc59f0fc238d8504e8678d4c277e7a6ef195c16e193
|
File details
Details for the file bitbucket_mcp_py-1.4.0-py3-none-any.whl.
File metadata
- Download URL: bitbucket_mcp_py-1.4.0-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1dc27078c5be0f730c70513ea5101a89f1089b82533cc15572681d8c3bd9ab
|
|
| MD5 |
c0f1bd24fe73caaad82faa2b0b28aa0b
|
|
| BLAKE2b-256 |
856a61287334638c960ecaa33460f1ba871e32800ab87bcf4fd34ca55ba16b6a
|