home / mcp / bitbucket mcp server
Provides Bitbucket API operations via MCP, enabling automation of repos, branches, PRs, pipelines, and more.
Configuration
View docs{
"mcpServers": {
"javimaligno-mcp-server-bitbucket": {
"url": "https://your-deployment-url.com/mcp",
"headers": {
"OUTPUT_FORMAT": "toon",
"BITBUCKET_EMAIL": "[email protected]",
"BITBUCKET_API_TOKEN": "YOUR_TOKEN",
"BITBUCKET_WORKSPACE": "my-workspace"
}
}
}
}You run an MCP server that exposes Bitbucket API operations to MCP-compatible clients. It lets you manage repositories, branches, pull requests, pipelines, webhooks, deployments, and more, all through a consistent MCP interface while keeping your Bitbucket credentials securely tokenized on the server side.
After you start the MCP server, you connect your MCP client to the server’s endpoint and begin issuing high-level actions such as listing repositories, creating a pull request, triggering a pipeline, or reading a file. This server translates those actions into Bitbucket API calls and returns structured results that you can display in your MCP client. Practical use cases include automating repository setup, auditing branch protections, reviewing PR diffs, and tracking deployment histories across environments.
Prerequisites: you need Python 3.11+ and a working Python package manager. For local development and usage, you will also use uv or uvicorn for serving the MCP endpoint.
# Install the Bitbucket MCP Server from PyPI
pipx install mcp-server-bitbucket
# Or install via pip
pip install mcp-server-bitbucket
# Start the local MCP server in stdio mode (example runtime command)
uv run python -m src.server
# Or run the HTTP server variant for remote deployment (development example)
uv run uvicorn src.http_server:app --reload --port 8080You can connect Claude Code or other MCP clients to a remote deployment of the MCP server. To connect, you typically provide the remote URL where the MCP endpoint is exposed and, if required, an authentication header.
{
"mcpServers": {
"bitbucket_http": {
"type": "http",
"url": "https://your-deployment-url.com/mcp",
"args": []
},
"bitbucket_stdio": {
"type": "stdio",
"command": "uv",
"args": ["run", "python", "-m", "src.server"]
}
}
}Keep Bitbucket credentials and API tokens on the server side. Do not expose tokens in client configurations. Use environment variables or secret management provided by your hosting environment to supply tokens like BITBUCKET_WORKSPACE, BITBUCKET_EMAIL, and BITBUCKET_API_TOKEN when the client connects.
List and search repositories in the Bitbucket workspace; supports fuzzy name matching.
Retrieve details for a specific repository.
Create a new repository in the workspace.
Delete an existing repository.
Update repository settings such as project, visibility, description, or name.
List branches in a repository.
Get details for a specific branch.
List commits with optional filters by branch or file path.
Get details for a specific commit.
Compare two commits or branches and view diff statistics.
List tags in a repository.
Create a new tag in a repository.
Delete a tag from a repository.
List branch protection rules for a repository.
Create a branch protection rule.
Delete a branch protection rule.
Read a file's contents without cloning the repository.
List contents of a directory in the repository.
Get build/CI statuses associated with a commit.
Report a build status from an external CI system.
List pull requests for a repository.
Get details for a pull request.
Create a new pull request.
Merge a pull request.
Approve a pull request.
Remove your approval from a pull request.
Request changes on a pull request.
Close a pull request.
List comments on a pull request.
Add a comment to a pull request.
Get the diff for a pull request.
List recent pipeline runs for a repository.
Get the status of a pipeline run.
View logs for a pipeline run.
Trigger a new pipeline run.
Stop a running pipeline.
List CI/CD variables for a repository.
Get details for a pipeline variable.
Create a new pipeline variable.
Update a pipeline variable value.
Delete a pipeline variable.
List deployment environments (e.g., test, staging, prod) for a repository.
Get details for a deployment environment.
Retrieve deployment history for an environment.
List configured webhooks for a repository.
Create a new webhook.
Get details for a webhook.
Delete a webhook.
List user permissions for a repository.
Get a specific user's permission for a repository.
Add or update user permission for a repository.
Remove a user's permission from a repository.
List group permissions for a repository.
Get a specific group's permission for a repository.
Add or update group permission for a repository.
Remove a group's permission from a repository.
List projects in the workspace.
Get details for a project.