Bitbucket MCP Server
Enables management of Bitbucket Cloud pull requests through natural language, including creating, reviewing, approving, and commenting on PRs with automatic default reviewer support.
README
Bitbucket MCP Server
A FastMCP server for managing Pull Requests on Bitbucket Cloud. Create, list, view, update, and review PRs directly from Claude.
Features
- Create PRs with automatic default reviewer support
- List and view PR details
- Update PR title, description, destination branch, and reviewers
- Approve, unapprove, or request changes on PRs
- Add comments to PRs
- List workspace members for reviewer selection
Installation
git clone https://github.com/Acendas/bitbucket-mcp.git
cd bitbucket-mcp
pip install -r requirements.txt
Or with uv:
git clone https://github.com/Acendas/bitbucket-mcp.git
cd bitbucket-mcp
uv pip install -r requirements.txt
Getting an API Token
- Go to Atlassian API Tokens
- Click Create API token
- Give it a name (e.g., "Bitbucket MCP")
- Copy the generated token
Configuration
Option 1: Interactive Setup (Recommended)
Use the setup_bitbucket tool:
setup_bitbucket(
workspace="your-workspace",
username="your-email@example.com",
api_token="your-api-token"
)
This stores credentials securely in ~/.bitbucket-mcp/config.json with 600 permissions.
Option 2: Environment Variables
export BITBUCKET_API_TOKEN="your-api-token"
export BITBUCKET_USERNAME="your-email@example.com"
export BITBUCKET_WORKSPACE="your-workspace" # optional default
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"bitbucket": {
"command": "python",
"args": ["/path/to/bitbucket-mcp/server.py"]
}
}
}
Or with uv:
{
"mcpServers": {
"bitbucket": {
"command": "uv",
"args": ["run", "--directory", "/path/to/bitbucket-mcp", "python", "server.py"]
}
}
}
Available Tools
Configuration
setup_bitbucket
Configure Bitbucket credentials.
setup_bitbucket(
workspace="your-workspace",
username="your-email@example.com",
api_token="your-api-token"
)
get_config_status
Check if Bitbucket is configured.
get_config_status()
# Returns: { "configured": true, "workspace": "...", "username": "..." }
Workspace
list_workspace_members
List members of a workspace. Useful for finding reviewers.
list_workspace_members(
workspace="your-workspace", # optional if configured
page=1,
pagelen=50
)
# Returns: { "members": [{ "uuid": "...", "display_name": "...", "account_id": "..." }] }
get_default_reviewers
Get the default reviewers configured for a repository.
get_default_reviewers(
repo_slug="my-repo",
workspace="your-workspace" # optional if configured
)
# Returns: { "default_reviewers": [{ "uuid": "...", "display_name": "..." }] }
Pull Requests
create_pull_request
Create a new Pull Request. Automatically includes default reviewers.
create_pull_request(
repo_slug="my-repo",
title="Feature: Add new functionality",
source_branch="feature/my-feature",
destination_branch="main", # optional, defaults to "main"
description="This PR adds...", # optional
reviewers=["uuid-1", "uuid-2"], # optional, additional reviewers
use_default_reviewers=True, # optional, defaults to True
workspace="your-workspace" # optional if configured
)
list_pull_requests
List PRs for a repository.
list_pull_requests(
repo_slug="my-repo",
state="OPEN", # OPEN, MERGED, DECLINED, SUPERSEDED, or ALL
workspace="your-workspace", # optional if configured
page=1,
pagelen=25
)
get_pull_request
Get details of a specific PR.
get_pull_request(
repo_slug="my-repo",
pr_id=123,
workspace="your-workspace" # optional if configured
)
update_pull_request
Update an existing PR.
update_pull_request(
repo_slug="my-repo",
pr_id=123,
title="New title", # optional
description="New description", # optional
destination_branch="develop", # optional
reviewers=["uuid-1", "uuid-2"], # optional, replaces current reviewers
close_source_branch=True, # optional
workspace="your-workspace" # optional if configured
)
Reviews
approve_pull_request
Approve a PR.
approve_pull_request(
repo_slug="my-repo",
pr_id=123,
workspace="your-workspace" # optional if configured
)
unapprove_pull_request
Remove your approval from a PR.
unapprove_pull_request(
repo_slug="my-repo",
pr_id=123,
workspace="your-workspace" # optional if configured
)
request_changes_pull_request
Request changes on a PR.
request_changes_pull_request(
repo_slug="my-repo",
pr_id=123,
workspace="your-workspace" # optional if configured
)
add_pull_request_comment
Add a comment to a PR (supports markdown).
add_pull_request_comment(
repo_slug="my-repo",
pr_id=123,
comment="Looks good! Just one suggestion...",
workspace="your-workspace" # optional if configured
)
Example Usage with Claude
-
First time setup:
"Set up Bitbucket with my workspace 'mycompany', username 'me@example.com', and API token 'abc123'"
-
Create a PR:
"Create a PR in my-repo from feature/login to main titled 'Add user login'"
-
List open PRs:
"Show me all open PRs in my-repo"
-
Review a PR:
"Approve PR #42 in my-repo"
-
Add a comment:
"Add a comment to PR #42 saying 'LGTM!'"
-
Find reviewers:
"List all members in my workspace so I can add them as reviewers"
Security
- Credentials are stored in
~/.bitbucket-mcp/config.jsonwith 600 permissions (owner-only access) - API tokens are never logged or exposed in error messages
- Environment variables are supported for CI/CD scenarios
License
MIT License - see LICENSE for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。