
HTTP MCP 服务器用于 Bitbucket Data Center REST API
概览
一个模型上下文协议(MCP)服务器,作为AI助手的工具。 该服务器允许兼容MCP的客户端(Claude Desktop、VS Code、IDE、自定义应用)通过55个工具与Bitbucket数据中心实例交互,涵盖: - — 列表、获取、创建、更新 - — 列表、获取、创建、分支、默认分支 - — CRUD、合并、拒绝、重新打开、批准、审核员、可合并 - — 列表、添加、获取、更新、删除(内联 + 通用)- — diffs、文件变更、冲突标记 - — 活动流、参与者、观察者 - — 阻断评论任务 - — 列表、创建、删除 - — 列表、获取、修改、差异 - — 浏览、阅读、编辑、递归列表 - — 每次提交构建状态,构建统计 连接后,试着问你的AI助手: - “列出PROJ项目中的所有仓库” - “向我展示仓库X中的打开拉取请求” - “PR #42发生了什么变化?
概述(AI 翻译)
这是一个模型上下文协议(MCP)服务器,将 Bitbucket Data Center REST API v1.0 作为 AI 助手的工具。
概述
该服务器允许兼容MCP的客户端(Claude Desktop、VS Code、IDE、自定义应用)通过55个工具与Bitbucket数据中心实例交互,涵盖:
- 项目 — 列表、获取、创建、更新
- 仓库 — 列表、获取、创建、分支、默认分支
- 拉取请求 — CRUD、合并、拒绝、重新开放、批准、审核员、可合并
- PR评论 — 列表、添加、获取、更新、删除(内联+通用)
- PR 差异与变更 — 差别、文件变更、冲突标记
- PR 活动 — 活动源、参与者、观察者
- PR 任务 — 阻断评论任务
- 分支与标签 — 列表、创建、删除
- 提交 — 列表、获取、变更、差分(整个提交或通过
path的一个文件) - 文件 — 浏览、阅读、编辑、递归列表
- 构建状态 — 每次提交的构建状态,构建统计
- 合并队列 — 对每个仓库的合并队列进行排队、查看和处理
示例提示
连接后,试着问你的AI助手:
- “列出PROJ项目中的所有仓库”
- “在仓库X中显示打开的拉取请求”
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Bitbucket DC MCP Server
A Model Context Protocol (MCP) server that exposes Bitbucket Data Center REST API v1.0 as tools for AI assistants.
Overview
This server lets MCP-compatible clients (Claude Desktop, VS Code, IDEs, custom apps) interact with a Bitbucket Data Center instance through 55 tools covering:
- Projects — list, get, create, update
- Repositories — list, get, create, fork, default branch
- Pull Requests — CRUD, merge, decline, reopen, approve, reviewers, can-merge
- PR Comments — list, add, get, update, delete (inline + general)
- PR Diff & Changes — diffs, file changes, conflict markers
- PR Activity — activity feed, participants, watchers
- PR Tasks — blocker comment tasks
- Branches & Tags — list, create, delete
- Commits — list, get, changes, diff (whole commit or one file via
path) - Files — browse, read, edit, recursive listing
- Build Status — build statuses per commit, build statistics
- Merge Queue — enqueue, view, dequeue, and process per-repository merge queues
graph LR
A[AI Client] |MCP| B[bitbucket-dc-mcp]
B |REST API v1.0| C[Bitbucket Data Center]
Example Prompts
Once connected, try asking your AI assistant:
- “List all repositories in the PROJ project”
- “Show me open pull requests in repo X”
- “What changed in PR #42? Summarize the diff”
- “Create a branch called feature/login from main in PROJ/my-repo”
- “Add a comment on PR #15 suggesting a fix for the null check on line 23”
- “What’s the build status for the latest commit on main?”
- “Show me the last 10 commits on the develop branch”
- “Read the contents of src/index.ts from the main branch”
- “Are there any unresolved tasks blocking PR #8 from merging?”
- “Who approved PR #21 and what comments were left?”
- “Enqueue PR #5 into the merge queue for PROJ/my-repo”
- “Show me the merge queue for PROJ/my-repo”
- “Remove PR #5 from the merge queue for PROJ/my-repo”
- “Process the merge queue for PROJ/my-repo”
Installation
Global install
npm install -g @shibainu16/bitbucket-dc-mcp
Using npx (no install required)
BITBUCKET_URL=https://bitbucket.example.com \
BITBUCKET_TOKEN=your-token \
MCP_TRANSPORT=stdio \
npx @shibainu16/bitbucket-dc-mcp
Prerequisites
- Node.js >= 22
- A Bitbucket Data Center instance with API access
- A personal access token or username/password credentials
Quick Start
1. Configure environment
Create a .env file (or export variables in your shell):
安装
npx -y @shibainu16/bitbucket-dc-mcp配置
{
"mcpServers": {
"bitbucket-dc-mcp": {
"command": "npx",
"args": ["-y", "@shibainu16/bitbucket-dc-mcp"],
"env": {
"BITBUCKET_URL": "https://bitbucket.example.com",
"BITBUCKET_TOKEN": "your-token",
"MCP_TRANSPORT": "stdio"
}
}
}
}