
Bitbucket MCP
为 Bitbucket Cloud 和 Server 提供的模型上下文协议(MCP)服务器,让 AI 助手(如 Cursor)能够通过自然语言管理仓库、拉取请求、流水线等。

概述
Bitbucket MCP 是一个开源模型上下文协议(MCP)服务器,用于集成 Bitbucket Cloud 与 Bitbucket Server/Data Center API。它能够让 AI 助手(例如 Cursor)通过自然语言提示,安全地与您的 Bitbucket 仓库、拉取请求、流水线及其他资源进行交互。
该服务器实现了 MCP 标准,并以 bitbucket-mcp 为名称发布在 npm 上。
功能特性
- 仓库操作:列出仓库并获取详细信息
- 拉取请求生命周期:列出、获取、创建、更新、合并、批准、拒绝、添加/查看评论、差异对比及任务
- 流水线操作:列出运行、触发/停止流水线、查看步骤和日志
- 分页支持(
pagelen、page、all、limit) - 默认安全设计:除非显式设置
BITBUCKET_ENABLE_DANGEROUS=true,否则 DELETE 操作处于禁用状态
支持的操作
该服务器为常见的 Bitbucket 工作流程提供了多种工具,包括仓库浏览、PR 管理、代码审查自动化以及流水线监控。完整的工具列表和 API 映射在源代码中定义。
安全性与最佳实践
- 需要具有最小权限范围的 Bitbucket 应用密码(或访问令牌):仓库(读取)、拉取请求(读取/写入)、流水线(读取)
- 默认情况下不启用 DELETE 操作
- 可配置的日志记录(基于文件或禁用)
- 支持 Bitbucket Cloud(
https://api.bitbucket.org/2.0)以及通过可配置的BITBUCKET_URL支持自托管的 Bitbucket Server
兼容性
可与任何兼容 MCP 的 AI 运行时一起使用。主要集成示例侧重于 Cursor,同时支持 Bitbucket Cloud 和 Server。
链接
MCP 设置
前提条件
- 需要 Node.js(用于 npx/npm)
- 拥有 Bitbucket 账户及应用密码或访问令牌
访问要求
- 需通过环境变量提供 Bitbucket 应用密码(仓库:读取,拉取请求:读取/写入,流水线:读取)或访问令牌
客户端设置
Cursor
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"env": {
"BITBUCKET_URL": "https://api.bitbucket.org/2.0",
"BITBUCKET_WORKSPACE": "your-workspace",
"BITBUCKET_USERNAME": "your-username",
"BITBUCKET_PASSWORD": "your-app-password"
},
"args": ["-y", "bitbucket-mcp@latest"]
}
}
}
- 在你的项目根目录下创建或编辑
.cursor/mcp.json。 - 粘贴上面的配置块,并将占位符(
your-workspace、your-username、your-app-password)替换为实际值。
认证:
- 凭据通过 MCP 配置中的环境变量传递。无需浏览器登录或额外的授权步骤。
旧版 URL 格式(https://bitbucket.org/your-workspace )也支持工作区自动检测。
Claude Code
未记录
Claude Desktop
未记录
VS Code
未记录
Codex
未记录
Windsurf
未记录
Lovable
未记录
Other
通过 npx -y bitbucket-mcp@latest 运行,同时带上所需的环境变量(参见 envVars)。在你的 MCP 客户端中使用 stdio/command 传输方式进行配置。
环境变量
BITBUCKET_URL(默认值为https://api.bitbucket.org/2.0)BITBUCKET_WORKSPACE(可选,旧版模式下从 URL 自动检测)BITBUCKET_USERNAME(你的 Bitbucket 邮箱/用户名)BITBUCKET_PASSWORD(应用密码或 API 令牌)BITBUCKET_TOKEN(用户名/密码的替代方案)
设置文档:https://github.com/MatanYemini/bitbucket-mcp
Tags
Related Entries
Keep exploring similar tools and resources in this category.

FetchSandbox
MCP ServersFetchSandbox is a stdio MCP server and hosted API-sandbox service that lets AI coding agents import OpenAPI 3.x specifications, discover runnable workflows, and execute stateful integration tests without using production API credentials. It is designed for validating request flows, lifecycle state, webhooks, retries, and shareable run traces from MCP-compatible development tools.
Related Reads
Background, tutorials, and protocol context connected to this entry.






