This Python MCP server provides integration with Bitbucket, allowing your AI applications to interact with Bitbucket repositories, branches, issues, and more. It runs locally on your machine to ensure secure access to your Bitbucket resources.
# 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 .
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.
This MCP server provides the following Bitbucket integration tools:
bb_create_repository: Create a new Bitbucket repository
bb_delete_repository: Delete a Bitbucket repository
bb_search_repositories: Search Bitbucket repositories using query syntax
bb_read_file: Read a file from a repository
bb_write_file: Create or update a file in a repository
bb_delete_file: Delete a file from a repository
bb_create_issue: Create an issue in a repository
bb_delete_issue: Delete an issue from a repository
Once configured, the Bitbucket tools will be available in Claude Desktop. Here are some examples of how to use them:
Create a new repository called 'my-project' in my personal workspace
Create a new branch called 'feature-xyz' in the my-project repository
Create a README.md file in my-project with some basic content
Search for repositories that contain 'python' in the name
The tools default to the "kallows" workspace, but you can:
workspace
parameterworkspace='~'
to work with your personal workspaceTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "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"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"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"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"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"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect