Provides comprehensive Bitbucket API operations including repository management, pull request workflows, pipeline orchestration, branch and tag management, commit tracking, deployment monitoring, webhook configuration, file browsing, and permissions management.
Bitbucket MCP Server
MCP server for Bitbucket API operations. Works with Claude Code, Claude Desktop, and any MCP-compatible client.
Features
Repositories: get, create, delete, list, update (move to project, rename)
Pull Requests: create, get, list, merge, approve, decline, request changes, comments, diff
Pipelines: trigger, get status, list, view logs, stop
Branches: list, get
Projects: list, get
Commits: list, get details, compare/diff between branches
Commit Statuses: get build statuses, create status (CI/CD integration)
Deployments: list environments, get environment details, deployment history
Webhooks: list, create, get, delete
Tags: list, create, delete
Branch Restrictions: list, create, delete branch protection rules
Source Browsing: read files, list directories without cloning
Repository Permissions: manage user and group permissions
Pipeline Variables: manage CI/CD environment variables
MCP Prompts: reusable workflow templates (code review, release notes, etc.)
MCP Resources: browsable workspace data
Quick Start
Full Installation Guide - Includes API token creation, permissions setup, and troubleshooting.
Available Tools (58 total)
Repositories
Tool | Description |
| List and search repositories (supports fuzzy name matching) |
| Get repository details |
| Create a new repository |
| Delete a repository |
| Update repo settings (project, visibility, description, name) |
Branches & Commits
Tool | Description |
| List branches in a repo |
| Get branch details |
| List commits (filter by branch or file path) |
| Get commit details |
| Compare two commits/branches (diff stats) |
Tags
Tool | Description |
| List tags in a repo |
| Create a new tag |
| Delete a tag |
Branch Restrictions
Tool | Description |
| List branch protection rules |
| Create branch protection rule |
| Delete branch protection rule |
Source (File Browsing)
Tool | Description |
| Read file contents without cloning |
| List directory contents |
Commit Statuses (CI/CD)
Tool | Description |
| Get build/CI statuses for a commit |
| Report build status from external CI |
Pull Requests
Tool | Description |
| List PRs (open, merged, etc.) |
| Get PR details |
| Create a new PR |
| Merge a PR |
| Approve a PR |
| Remove approval from a PR |
| Request changes on a PR |
| Decline (close) a PR |
| List comments on a PR |
| Add comment to a PR (general or inline) |
| Get the diff of a PR |
Pipelines
Tool | Description |
| List recent pipeline runs |
| Get pipeline status |
| View pipeline logs |
| Trigger a pipeline run |
| Stop a running pipeline |
Pipeline Variables
Tool | Description |
| List pipeline variables for a repo |
| Get variable details |
| Create a new pipeline variable |
| Update variable value |
| Delete a pipeline variable |
Deployments
Tool | Description |
| List deployment environments (test, staging, prod) |
| Get environment details |
| Get deployment history for an environment |
Webhooks
Tool | Description |
| List configured webhooks |
| Create a new webhook |
| Get webhook details |
| Delete a webhook |
Repository Permissions
Tool | Description |
| List user permissions for a repo |
| Get specific user's permission |
| Add/update user permission |
| Remove user permission |
| List group permissions for a repo |
| Get specific group's permission |
| Add/update group permission |
| Remove group permission |
Projects
Tool | Description |
| List projects in workspace |
| Get project details |
MCP Prompts
Reusable workflow templates that guide Claude through common tasks:
Prompt | Description |
| Comprehensive PR code review |
| Generate changelog between versions |
| Debug failed CI/CD pipelines |
| Complete repository status overview |
MCP Resources
Browsable workspace data as markdown:
Resource URI | Description |
| List all repos in workspace |
| Repository details |
| Branch list |
| Open PRs |
| List all projects |
Example Usage
Once configured, ask Claude to:
Repositories & Branches:
"List all repositories in my workspace"
"Search for repositories with 'api' in the name"
"Show me the last 10 commits on the main branch"
"Compare develop branch with main"
Pull Requests & Code Review:
"Show me open pull requests in my-repo"
"Create a PR from feature-branch to main"
"Approve PR #42"
"Add a comment to PR #15 saying 'Looks good!'"
"Show me the diff for PR #42"
"Merge PR #42 using squash strategy"
Pipelines & CI/CD:
"Trigger a pipeline on the develop branch"
"What's the status of the latest pipeline?"
"Get the build status for commit abc123"
Deployments:
"List deployment environments for my-repo"
"Show deployment history for production"
Webhooks:
"List webhooks configured for my-repo"
"Create a webhook for push events"
Tags:
"List all tags in my-repo"
"Create a tag v1.0.0 on the main branch"
"Delete the old-release tag"
Branch Protection:
"List branch restrictions for my-repo"
"Require 2 approvals to merge to main"
"Prevent force push to production branches"
Source Browsing:
"Show me the contents of src/main.py"
"List files in the root directory"
"Read the README.md from the develop branch"
Repository Permissions:
"List user permissions for my-repo"
"Give user@example.com write access to my-repo"
"List group permissions for my-repo"
"Grant admin access to the DevOps group"
Repository Search
The list_repositories tool supports flexible searching:
Query syntax supports: name ~ "term", is_private = true/false, AND, OR
Installation Options
From PyPI (Recommended)
Updating
From Source
Configuration
Claude Code CLI (Recommended)
Output Format (Optional)
Set OUTPUT_FORMAT to optimize token usage:
Format | Description | Use case |
(default) | Standard JSON | Maximum compatibility, debugging |
| High-volume usage, token cost optimization |
Cursor IDE
Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project):
Claude Desktop / Manual Configuration
Add to ~/.claude.json:
Creating a Bitbucket API Token
Go to your repository in Bitbucket
Navigate to Repository settings > Access tokens
Click Create Repository Access Token
Select permissions:
Repository: Read, Write, Admin, Delete
Pull requests: Read, Write
Pipelines: Read, Write
Copy the token immediately
See the full installation guide for detailed instructions.
HTTP Server (Remote Deployment)
Deploy the MCP server as an HTTP service for remote access from any MCP client. Uses the standard MCP Streamable HTTP transport protocol.
Running Locally
Deploy to Cloud Run (Google Cloud)
Deploy to Railway/Render/Fly.io
Set these environment variables in your platform:
BITBUCKET_WORKSPACE: Your Bitbucket workspace slugBITBUCKET_EMAIL: Your Bitbucket account emailBITBUCKET_API_TOKEN: Your repository access tokenPORT: (usually auto-set by platform)
Docker Deployment
Connecting Claude Code to Remote Server
Once deployed, connect Claude Code to your remote MCP server:
Manual Configuration for Remote Server
Add to ~/.claude.json:
Development
Requirements
Python 3.11+
uv for dependency management
PyPI account for publishing
Setup
Running Locally
CI/CD Pipeline
The project uses GitHub Actions for automated testing and publishing:
Every push to main: Runs tests with coverage
Pull requests: Runs full test suite
Tags (: Tests, builds, and publishes to PyPI
To release a new version:
Manual Publishing
If you need to publish manually:
Get a PyPI API Token:
Create a token with scope "Entire account" (first time) or project-specific
Set environment variable:
export UV_PUBLISH_TOKEN=pypi-YOUR_TOKEN
Build and publish:
uv build uv publish
Links
License
MIT