
Bitbucket Server MCP

2025.01.28
4
JavaScriptPull Request 管理代码审查团队协作交流协作
Bitbucket Server MCP Server 是一个基于 MCP (Model Context Protocol) 的服务器,专门用于管理 Bitbucket Server 的 Pull Request。它提供了一系列工具和资源,通过 MCP 协议与 Bitbucket Server API 进行交互,实现 Pull Request 的创建、获取、合并、拒绝、评论等功能。
View on GitHub
Overview
基本能力
产品定位
Bitbucket Server MCP Server 是一个专门用于管理 Bitbucket Server Pull Request 的工具,通过 MCP 协议提供与 Bitbucket Server API 的交互能力。
核心功能
- Pull Request 管理:包括创建、获取、合并、拒绝 Pull Request
- 评论功能:支持在 Pull Request 中添加评论
- 差异查看:获取 Pull Request 的代码差异
- 评审历史:查看 Pull Request 的评审历史记录
适用场景
- 团队协作开发中的代码审查流程管理
- 自动化代码合并流程
- 代码变更跟踪和评审
- 开发团队间的协作沟通
工具列表
create_pull_request
:创建新的 Pull Requestget_pull_request
:获取特定 Pull Request 的详细信息merge_pull_request
:合并 Pull Requestdecline_pull_request
:拒绝 Pull Requestadd_comment
:在 Pull Request 中添加评论get_diff
:获取 Pull Request 的代码差异get_reviews
:获取 Pull Request 的评审历史
常见问题解答
- 认证问题:需要配置 BITBUCKET_URL 和认证信息(Token 或用户名/密码)
- 项目默认值:可以通过 BITBUCKET_DEFAULT_PROJECT 设置默认项目
- 日志查看:所有操作日志记录在 bitbucket.log 文件中
使用教程
使用依赖
- Node.js >= 16
安装教程
通过 Smithery 安装
npx -y @smithery/cli install @garc33/bitbucket-server-mcp-server --client claude
手动安装
npm install
构建
npm run build
调试方式
- 确保配置了正确的环境变量(BITBUCKET_URL 和认证信息)
- 查看 bitbucket.log 日志文件获取调试信息
- 使用提供的工具命令测试各项功能
配置示例
{
"mcpServers": {
"bitbucket": {
"command": "node",
"args": ["/path/to/bitbucket-server/build/index.js"],
"env": {
"BITBUCKET_URL": "https://your-bitbucket-server.com",
"BITBUCKET_TOKEN": "your-access-token",
"BITBUCKET_DEFAULT_PROJECT": "your-default-project"
}
}
}
}