bb-mcp-server
An MCP server for Bitbucket Cloud that enables reading and managing pull requests, comments, and descriptions via MCP clients.
README
bb-mcp-server
An MCP server for Bitbucket Cloud, giving MCP clients (Claude Code, Claude Desktop, etc.) tools to read and manage pull requests, their comments, and their descriptions.
Atlassian has announced an official Bitbucket MCP server; at the time this was written it wasn't yet available, so this fills the gap with the same underlying REST API.
Features
- Pull requests — list, get, create, update, merge, decline, approve/unapprove, diff, diffstat
- Comments — list, get, create (general, inline, or as a reply), update, delete
- Descriptions — focused get/update tools that touch only the description field
See Tools below for the full list.
Requirements
- Node.js >= 18.17
- A Bitbucket Cloud account with an Atlassian API token
Setup
npm install
npm run build
Configure credentials via environment variables (see .env.example):
| Variable | Required | Description |
|---|---|---|
BITBUCKET_EMAIL |
yes | Atlassian account email, used with the API token for Basic Auth. |
BITBUCKET_API_TOKEN |
yes | API token from id.atlassian.com. |
BITBUCKET_WORKSPACE |
no | Default workspace slug, so tools can omit workspace per call. |
BITBUCKET_REPO_SLUG |
no | Default repository slug, so tools can omit repoSlug per call. |
BITBUCKET_BASE_URL |
no | API base URL override. Defaults to https://api.bitbucket.org/2.0. |
Register with an MCP client
Example for Claude Code (claude mcp add) or a client's mcp.json:
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/absolute/path/to/bb-mcp-server/dist/index.js"],
"env": {
"BITBUCKET_EMAIL": "you@example.com",
"BITBUCKET_API_TOKEN": "your-api-token",
"BITBUCKET_WORKSPACE": "my-workspace",
"BITBUCKET_REPO_SLUG": "my-repo"
}
}
}
}
BITBUCKET_WORKSPACE and BITBUCKET_REPO_SLUG are optional — omit them to require every tool
call to specify workspace/repoSlug explicitly, which is useful if the client should be able to
work across multiple repositories.
Try it with the MCP Inspector
npm run inspector
Tools
All tools accept optional workspace / repoSlug arguments that fall back to
BITBUCKET_WORKSPACE / BITBUCKET_REPO_SLUG when omitted.
Pull requests
| Tool | Description |
|---|---|
bb_list_pull_requests |
List PRs, filterable by state or a Bitbucket query string. |
bb_get_pull_request |
Fetch full details of one PR. |
bb_create_pull_request |
Open a new PR. |
bb_update_pull_request |
Update title, description, reviewers, and/or destination. |
bb_merge_pull_request |
Merge an open PR. |
bb_decline_pull_request |
Decline an open PR. |
bb_approve_pull_request |
Approve a PR as the authenticated user. |
bb_unapprove_pull_request |
Remove the authenticated user's approval. |
bb_get_pull_request_diff |
Fetch the unified diff as raw text. |
bb_get_pull_request_diffstat |
Fetch a per-file change summary. |
Comments
| Tool | Description |
|---|---|
bb_list_pull_request_comments |
List all (non-deleted) comments on a PR. |
bb_get_pull_request_comment |
Fetch a single comment. |
bb_create_pull_request_comment |
Add a comment — general, inline (via inlinePath/inlineLine), or a reply (via parentId). |
bb_update_pull_request_comment |
Edit a comment's body. |
bb_delete_pull_request_comment |
Delete a comment. |
Descriptions
| Tool | Description |
|---|---|
bb_get_pull_request_description |
Read just a PR's description. |
bb_update_pull_request_description |
Replace just a PR's description, without touching other fields. |
Development
npm run dev # run the server directly with tsx (no build step)
npm run typecheck # tsc --noEmit
npm run lint # eslint
npm run format # prettier --write
npm test # vitest
npm run build # compile to dist/
Architecture
src/
config.ts # env var loading/validation (zod)
bitbucket/
client.ts # typed Bitbucket REST API v2.0 client (auth, pagination, errors)
errors.ts # BitbucketApiError
types.ts # Bitbucket API response shapes
tools/
shared.ts # zod param helpers, workspace/repo resolution, error wrapping
pullRequests.ts # bb_* PR tools
comments.ts # bb_* comment tools
descriptions.ts # bb_* description tools
index.ts # registerAllTools
server.ts # builds the McpServer and registers tools
index.ts # stdio entrypoint
Authentication notes
This server authenticates with HTTP Basic Auth using your Atlassian account email and an API token — the auth method Atlassian currently recommends for Bitbucket Cloud (app passwords are being phased out). The token only needs the Pull Requests scope for the operations this server performs.
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。