bitbucket-mcp
Allows AI assistants to manage Bitbucket Cloud pull requests, browse repositories and branches, and automate code review workflows.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bitbucket-mcplist open pull requests in my-repo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
bitbucket-mcp
A Model Context Protocol (MCP) server that gives AI assistants (like Claude) programmatic access to Bitbucket Cloud. It enables reading and managing pull requests, browsing repositories and branches, and automating code review workflows from your MCP client.
It authenticates with Bitbucket using an app password tied to your Atlassian account. Multiple workspace connections can be configured, with an optional default repository per workspace.
What You Can Do
"List all open PRs in my-repo targeting the main branch"
"Create a pull request from feature/SCC-1234 to develop with a summary of the changes"
"Show me what files changed in PR #42 and give me a line-by-line diff of the auth module"
"Find the PR for branch feature/payments and merge it with a squash strategy"
"Decline the stale PRs that have been open for more than 30 days"

Features
Multi-workspace support: configure and switch between multiple Bitbucket Cloud workspaces
Default repository: set a default repo per workspace so you don't need to specify it every call
Web UI: browser-based management console for adding/editing workspace connections
Protected branches: mark branches as protected to prevent accidental AI-triggered merges
Branch autocomplete: the UI fetches and caches branch names for fast autocomplete
Real-time activity log: live MCP tool execution log via SSE streamed to the Web UI
Mock OAuth: built-in OAuth stub so MCP clients that require OAuth flows work out of the box
Tools
Tool | Description |
| List all configured Bitbucket workspace connections |
| List repositories in a workspace |
| List branches in a repository with optional name filter |
| List pull requests filtered by state, source, or destination branch |
| Get details of a single pull request |
| Open a new pull request |
| Merge a pull request (merge commit, squash, or fast-forward) |
| Decline a pull request |
| List all files changed in a PR with line counts |
| Get the full diff for a specific file in a PR |
Installation
Via npx (recommended)
npx @yunusemregul/bitbucket-mcpGlobal install
npm install -g @yunusemregul/bitbucket-mcp
bitbucket-mcpThe server starts on http://localhost:18434 by default.
Options:
-p, --port Port to listen on (default: 18434)
-v, --version Print version
-h, --help Show helpWorkspace configuration is stored in ~/.bitbucket-mcp/workspaces.json.
Configuration
Via Web UI
Open http://localhost:18434/ in your browser, click + Add Workspace, fill in the details (connection is tested automatically as you type), then click Save.

Workspace options
Field | Type | Description |
| string | Display name for this connection |
| string | Bitbucket workspace slug (from the URL) |
| string | Atlassian account email |
| string | Bitbucket app password |
| string | Default repository slug (optional) |
| string[] | Branches the AI is not allowed to merge into |
Tip: Set
protectedBranchesto["main", "master"]on production workspaces to block accidental merges.
Using with Claude
Claude Code (recommended)
claude mcp add --transport sse bitbucket-mcp http://localhost:18434/mcp/sseOther MCP clients
{
"mcpServers": {
"bitbucket-mcp": {
"url": "http://localhost:18434/mcp/sse"
}
}
}Project Structure
bitbucket-mcp/
├── server.js # Express app, MCP SSE endpoint, REST API
├── bitbucket.js # Bitbucket Cloud API client
├── storage.js # Workspace config persistence
├── tools/
│ ├── index.js # Tool registry
│ ├── context.js # Shared runtime state (sessions, logging)
│ └── *.js # One file per MCP tool
└── static/
├── index.html # Management console UI
├── app.js # UI logic
└── style.css # StylesSecurity Notes
Credentials are stored in plaintext in
~/.bitbucket-mcp/workspaces.json. Avoid exposing this file.Use Bitbucket app passwords with the minimum required scopes rather than your main account password.
Use
protectedBranchesto prevent the AI from merging into sensitive branches.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yunusemregul/bitbucket-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server