MCP for Bitbucket DC
The MCP for Bitbucket Data Center (BBDC) plugin is a server that allows agents to interact with BBDC using the model context protocol. A set of tools is available to the agents as advertised by the server. By default these capabilities include:
Projects and repositories: list, search, create, and update projects and repositories; fork a repository; list forks.
Branches and tags: list, create, and delete branches and tags; get or set the default branch.
Commits and files: browse commit history, read file contents at a commit, and read or add commit comments.
Pull requests: create, update, merge, decline, reopen, approve, and unapprove pull requests; manage participants and reviewers; read and post comments; check merge eligibility.
File edits: commit a file change directly through edit_file.
My work: list pull requests assigned to or authored by the current user, and check the inbox count.
How does the MCP server work?
The MCP server has a whitelist of Bitbucket REST endpoints that are used to determine available tooling for agents. The whitelist can be configured to increase or reduce your server's REST endpoint coverage.
The whitelist sets the maximum set of tools the server can expose. Each caller sees only the tools its access token permits. A tool stays out of that caller's list when its required permission is outside the token's scope, even if the whitelist includes it.
Adding the MCP server to your preferred client
Different clients support different methods for adding an MCP server. Below are a few examples on how to add the Bitbucket MCP server to your preferred client.
Claude Code
claude mcp add --transport http bitbucket-dc https://bitbucket.example.com/rest/mcp/1.0/ \
--header "Authorization: Bearer <your-token>"
Cursor
Open .cursor/mcp.json (project) or ~/.cursor/mcp.json (global). Add this entry:
"mcpServers": {
"bitbucket-dc": {
"url": "https://bitbucket.example.com/rest/mcp/1.0/",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}
Codex
Codex has native support for a streamable HTTP MCP server. It reads your auth token from an environment variable.
codex mcp add bitbucket-dc --url https://bitbucket.example.com/rest/mcp/1.0/ --bearer-token-env-var BITBUCKET_MCP_TOKEN
VS Code
Open your user or workspace mcp.json . Add this entry:
{
"servers": {
"bitbucket-dc": {
"type": "http",
"url": "https://bitbucket.example.com/rest/mcp/1.0/",
"headers": {
"Authorization": "Bearer <your-token>"
}
}
}
}
MCP-remote
Any agent that only supports a local (stdio) server. For example Claude Desktop. Use the mcp-remote bridge. It runs locally and forwards to the remote HTTP server.
{
"mcpServers": {
"bitbucket-dc": {
"command": "npx",
"args": [
"mcp-remote",
"https://bitbucket.example.com/rest/mcp/1.0/",
"--header",
"Authorization: Bearer <your-token>"
]
}
}
}