
Bitbucket
STDIOMCP server for Bitbucket integration enabling secure, local tool access for repositories
MCP server for Bitbucket integration enabling secure, local tool access for repositories
A Python implementation of an MCP server for Bitbucket integration. MCP (Model Context Protocol) enables secure, local tool access for AI applications. The server runs locally on the same machine as your AI application.
# Install the server locally git clone https://github.com/kallows/mcp-bitbucket.git cd mcp-bitbucket # Install dependencies using uv (recommended) or pip uv install # or pip install -e .
This MCP server provides the following Bitbucket integration tools:
bb_create_repository
: Create a new Bitbucket repository
bb_create_branch
: Create a new branch in a repository
bb_delete_repository
: Delete a Bitbucket repository
bb_read_file
: Read a file from a repository
bb_write_file
: Create or update a file in a repository
bb_create_issue
: Create an issue in a repository
bb_delete_issue
: Delete an issue from a repository
bb_search_repositories
: Search Bitbucket repositories using query syntax
bb_delete_file
: Delete a file from a repository
bb_create_pull_request
: Create a pull request
The server requires Bitbucket credentials to be set up as environment variables:
export BITBUCKET_USERNAME="your-username" export BITBUCKET_APP_PASSWORD="your-app-password"
Add this configuration to your claude_desktop_config.json
:
{ "mcpServers": { "bitbucket-api": { "command": "C:\\\\Users\\\\YOURUSERNAME\\\\.local\\\\bin\\\\uv.exe", "args": [ "--directory", "D:\\\\mcp\\\\mcp-bitbucket", "run", "-m", "mcp_bitbucket.server" ], "env": { "BITBUCKET_USERNAME": "your-username", "BITBUCKET_APP_PASSWORD": "your-app-password" } } } }
{ "mcpServers": { "bitbucket-api": { "command": "uv", "args": [ "run", "--directory", "/path/to/mcp-bitbucket", "-m", "mcp_bitbucket.server" ], "env": { "BITBUCKET_USERNAME": "your-username", "BITBUCKET_APP_PASSWORD": "your-app-password" } } } }
⚠️ Important: You must restart Claude Desktop after modifying the configuration file.
Once configured, the Bitbucket tools will be available in Claude Desktop. You can:
Example queries:
The tools default to the "kallows" workspace, but you can:
workspace
parameterworkspace='~'
to work with your personal workspaceThe project includes unit and integration tests:
# Run all tests python -m unittest discover tests # Run specific test files python -m unittest tests.test_bb_api python -m unittest tests.test_bb_integration # Run with verbose output python -m unittest discover tests -v
handle_list_tools()
in server.py
handle_call_tool()
in server.py
The server includes comprehensive error handling:
mcp-bitbucket/
├── README.md
├── pyproject.toml
├── uv.lock
├── .gitignore
├── .python-version
├── src/
│ └── mcp_bitbucket/
│ ├── __init__.py
│ └── server.py
└── tests/
├── README.md
├── test_bb_api.py
└── test_bb_integration.py
This project is licensed under the MIT License.
For issues and questions: