bitbucket-mcp
Enables AI assistants to programmatically manage Bitbucket Cloud resources, including pull requests, repositories, and branches, automating code review workflows.
README
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_workspaces |
List all configured Bitbucket workspace connections |
list_repos |
List repositories in a workspace |
list_branches |
List branches in a repository with optional name filter |
get_pull_requests |
List pull requests filtered by state, source, or destination branch |
get_pull_request |
Get details of a single pull request |
create_pull_request |
Open a new pull request |
merge_pull_request |
Merge a pull request (merge commit, squash, or fast-forward) |
decline_pull_request |
Decline a pull request |
get_pr_diff |
List all files changed in a PR with line counts |
get_pr_file_diff |
Get the full diff for a specific file in a PR |
Installation
Via npx (recommended)
npx @yunusemregul/bitbucket-mcp
Global install
npm install -g @yunusemregul/bitbucket-mcp
bitbucket-mcp
The server starts on http://localhost:18434 by default.
Options:
-p, --port Port to listen on (default: 18434)
-v, --version Print version
-h, --help Show help
Workspace 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 |
|---|---|---|
name |
string | Display name for this connection |
workspaceSlug |
string | Bitbucket workspace slug (from the URL) |
username |
string | Atlassian account email |
token |
string | Bitbucket app password |
repoSlug |
string | Default repository slug (optional) |
protectedBranches |
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/sse
Other 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 # Styles
Security 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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.