Token导航 LogoToken导航TokenDH.com
Bitbucket Code Review MCP logo
开发工具stdio官方级别未说明来源级核验

Bitbucket Code Review MCP

MCP Server

github

一个MCP(Model Context Protocol)服务器,使AI代理能够在Bitbucket Cloud的拉取请求中发布格式良好的代码审查评论。

工具数

21

提示词数

0

GitHub Stars

1

资源数

0
代码审查开发工具TypeScript

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Adyel

提供方

Adyel

最后核验

2026/5/17 20:21

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y github:Adyel/bitbucket-code-review-mcp

详细介绍

🔍 比特桶代码审查MCP服务器

MCP(模型上下文协议) 支持AI代理的服务器,如 Gemini CLI反重力 在上发布格式良好的代码审查评论 比特桶云 pull请求。

MCP本身不审查代码 --它为代理提供了创建标记为的评论的工具 [🤖 AI Review] 人工审查员将审查和批准。

✨ 特性

类别工具
公关发现列出PR,按ID/分支/URL获取,查看差异,列出更改的文件,读取文件内容
行内注释在特定行上发布带有严重表情符号的帖子(💡⚠️🐛📝🔒)
代码建议Bitbucket的单线和多线建议 /suggest 语法--单击应用
文件和一般评论文件级和PR范围内的评论
评论管理回复、更新(带标记)、删除(仅限AI保护)、解决/重新打开
待定评论以草稿形式创建评论——在审阅者提交评论之前不会发布
任务创建、列出、更新PR上的任务
批量操作在一次通话中发布多条内联评论

🚀 设置

先决条件

- 所需权限: Repositories: Read, Pull requests: Read & Write

从GitHub安装

使用此MCP的最简单方法是直接从GitHub使用,无需克隆:

# npx directly from GitHub (recommended for agents)
npx -y github:Adyel/bitbucket-code-review-mcp

或者克隆并在本地构建:

git clone https://github.com/Adyel/bitbucket-code-review-mcp.git
cd bitbucket-code-review-mcp
nvm use 22
npm install   # auto-builds via `prepare` script

环境变量

# Required
export BITBUCKET_EMAIL="your-atlassian-email@example.com"
export BITBUCKET_API_TOKEN="your-api-token"

# Optional defaults (avoids specifying in every tool call)
# These values come from your Bitbucket repo URL:
#   https://bitbucket.org/{workspace}/{repo_slug}
# e.g. https://bitbucket.org/acme-corp/backend-api
#   → BITBUCKET_DEFAULT_WORKSPACE=acme-corp
#   → BITBUCKET_DEFAULT_REPO_SLUG=backend-api
export BITBUCKET_DEFAULT_WORKSPACE="your-workspace"
export BITBUCKET_DEFAULT_REPO_SLUG="your-repo"

# Optional: customize the AI review tag (default: 🤖 AI Review)
# Set to empty string to disable tagging entirely: BITBUCKET_AI_TAG=""
export BITBUCKET_AI_TAG="🤖 AI Review"

# Optional: create comments as pending/draft (default: false)
# When true, comments are not published until the reviewer submits the review
export BITBUCKET_COMMENTS_PENDING=false

🔌 代理配置

Gemini CLI

添加 ~/.gemini/settings.json:

{
  "mcpServers": {
    "bitbucket-code-review": {
      "command": "npx",
      "args": ["-y", "github:Adyel/bitbucket-code-review-mcp"],
      "env": {
        "BITBUCKET_EMAIL": "your-atlassian-email@example.com",
        "BITBUCKET_API_TOKEN": "your-api-token",
        "BITBUCKET_DEFAULT_WORKSPACE": "your-workspace",
        "BITBUCKET_DEFAULT_REPO_SLUG": "your-repo"
      }
    }
  }
}
本地安装替代方案:如果您在本地克隆了仓库,请替换 commandargs 与: ``json "command": "node", "args": ["/absolute/path/to/bitbucket-code-review-mcp/dist/index.js"] ``

反重力/其他MCP客户端

{
  "bitbucket-code-review": {
    "command": "npx",
    "args": ["-y", "github:Adyel/bitbucket-code-review-mcp"],
    "env": {
      "BITBUCKET_EMAIL": "your-atlassian-email@example.com",
      "BITBUCKET_API_TOKEN": "your-api-token",
      "BITBUCKET_DEFAULT_WORKSPACE": "your-workspace",
      "BITBUCKET_DEFAULT_REPO_SLUG": "your-repo"
    }
  }
}

🛠️ 可用工具

公关发现

工具说明
list_pull_requests列出PR(按打开/合并/删除/覆盖过滤)
get_pull_request按ID获取PR详细信息
get_pull_request_by_branch按源分支机构名称查找PR
get_pull_request_from_url解析Bitbucket PR URL→ 获取详细信息
get_pull_request_diff获取完整的差异文本
list_pull_request_files列出已更改的文件及其添加/删除计数
get_file_content读取特定提交/分支/标记处的文件内容

代码审查意见

工具说明
add_general_comment发布PR级别评论
add_inline_comment在特定文件上发布:具有可选严重性的行
add_inline_suggestion发布带有可选功能的代码建议 end_line 适用于多线跨度
add_file_level_comment发布文件级评论
reply_to_comment回复评论帖子
update_comment用其他上下文更新任何评论(附加 [✏️ Updated by AI])
delete_comment仅删除人工智能评论(人工评论受保护)
list_comments列出所有评论
resolve_comment解析一个线程
reopen_comment重新打开一个线程
add_multiple_inline_comments批量发布内联评论

任务

工具说明
create_task创建任务(可选链接到评论)
list_tasks列出所有任务
update_task更新任务状态(打开/已解决)

🔒 安全防护装置

  • 删除保护: delete_comment 首先获取注释并检查 [AI Review] 标签。无法通过此MCP删除人工评论。
  • 更新可追溯性: update_comment 对任何评论(人工智能或人类)都有效,但总是附加一个 [✏️ Updated by AI] 标记,这样每一个变化都是可追溯的。
  • 可配置标签:设置 BITBUCKET_AI_TAG env-var用于自定义标签,或设置为 "" 完全禁用标记。
  • 有待评论:设置 BITBUCKET_COMMENTS_PENDING=true 将评论创建为草稿,仅在审阅者提交审阅时发布。

🔄 韧性和分页

  • 自动分页:所有列表端点(list_pull_requests, list_comments, list_pull_request_files, list_tasks)自动跟随Bitbucket的 next URL返回完整结果,即使是大型PR。
  • 使用回退重试:API请求在HTTP 429(速率限制)和5xx(服务器错误)上自动重试,并遵循 Retry-After 标题。

🎨 注释格式

所有评论都会自动标记并支持严重级别:

[🤖 AI Review] 💡 Suggestion
Use optional chaining for safer property access.

[🤖 AI Review] 🐛 Bug
This will throw a NullPointerException when `user` is null.

[🤖 AI Review] 🔒 Security
SQL injection risk — use parameterized queries.

代码建议使用Bitbucket的原生语法:

[🤖 AI Review] 💡 Suggestion
Use optional chaining here

const name = user?.name ?? 'default';

📁 项目结构

src/
├── index.ts               # Entry point (Zod env validation, --version)
├── bitbucket-client.ts    # API client (auth, pagination, retry)
├── comment-formatter.ts   # Comment formatting & AI tag guards
├── schemas/
│   └── shared.ts          # Shared Zod input schemas
├── utils/
│   └── response.ts        # Response helpers & error handling
└── tools/
    ├── index.ts            # Tool registration entry point
    ├── pr-discovery.ts     # PR listing, diff, file content tools
    ├── comments.ts         # Inline, file-level, general comments
    ├── tasks.ts            # Task create/list/update
    └── bulk.ts             # Batch inline comments

🤝 贡献

贡献.md 用于开发设置、添加工具和发布过程。

命令行界面

node dist/index.js --version   # Print version and exit

许可证

麻省理工学院

目录标签

目录标签

代码审查开发工具TypeScript本地部署AI辅助Bitbucket拉取请求

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

github

工具数量(toolCount,工具数)

21

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP