Bitbucket MCP Server
Bitbucket MCP
一个模型上下文协议 (MCP) 服务器,将 Cursor IDE 与 Bitbucket Cloud 集成,允许你直接从 Bitbucket 工作区获取仓库信息和提交数据。
功能特性
列出仓库:从你的 Bitbucket 工作区获取所有仓库
仓库详情:获取特定仓库的详细信息
提交信息:检索提交历史和最新提交详情
提交计数:获取每个仓库的总提交次数
最新提交数据:获取每个仓库的最新提交日期、作者和消息
工作区:列出所有可用的工作区。
合并请求 (Pull Requests):创建、查看、列出和更新合并请求,包括读取和添加 PR 评论。
项目:查看项目详情并列出默认评审人员。
分支限制:管理项目和仓库的分支限制。
提交:检索单个提交和提交列表。
Related MCP server: JIRA MCP Server
前置要求
Node.js 18 或更高版本
npm 或 yarn
Bitbucket Cloud 账户
Bitbucket 应用密码 (用于身份验证)
设置
1. 安装依赖
npm install2. 构建项目
npm run build3. 创建 Atlassian API 令牌*
如果你已经拥有 Jira 或 Confluence 的令牌,可以重复使用它 *
前往你的 Bitbucket 账户设置
在“访问管理”下导航至“应用密码”
不要点击“创建应用密码”(已过时),而是导航至“前往 API 令牌”
创建一个 API 令牌
为其起一个描述性名称(例如,“Cursor MCP Integration”)
选择过期日期
复制生成的令牌
4. 配置环境变量
在项目根目录下创建一个 .env 文件:
BITBUCKET_USERNAME=your_bitbucket_email_address
BITBUCKET_APP_PASSWORD=your_api_token
BITBUCKET_WORKSPACE=your_workspace_name注意:工作区名称通常是你的用户名或组织名称。你可以在 Bitbucket URL 中找到它(例如 https://bitbucket.org/workspace_name/)。
5. 添加到 Cursor MCP 配置
将以下配置添加到你的 Cursor MCP 设置中:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["@korfu/bitbucket-mcp"],
"env": {
"BITBUCKET_USERNAME": "your_bitbucket_email_address",
"BITBUCKET_APP_PASSWORD": "your_api_token",
"BITBUCKET_WORKSPACE": "your_workspace_name"
}
}
}
}6. 重启 Cursor
添加配置后,重启 Cursor IDE 以加载 MCP 服务器。
使用方法
配置完成后,你可以在 Cursor 中使用以下工具:
工作区
bitbucket_list_workspaces
仓库
bitbucket_list_repositoriesbitbucket_get_repository_details
提交
bitbucket_list_commitsbitbucket_get_commit
合并请求
bitbucket_list_pull_requestsbitbucket_get_pull_requestbitbucket_create_pull_requestbitbucket_update_pull_requestbitbucket_list_pull_request_commentsbitbucket_get_pull_request_commentbitbucket_add_pull_request_comment
项目
bitbucket_get_projectbitbucket_list_default_reviewers
分支限制
bitbucket_list_branch_restrictionsbitbucket_get_branch_restrictionbitbucket_update_repository_branching_model_settingsbitbucket_update_project_branching_model_settings
可用工具
工作区
list_workspaces:列出当前用户可访问的所有工作区。
仓库
list_repositories:列出已配置的 Bitbucket 工作区中的所有仓库。
get_repository_details:获取特定仓库的详细信息,包括最新提交信息。
提交
list_commits:获取特定仓库的提交信息。
get_commit:通过哈希值获取单个提交。
合并请求
list_pull_requests:列出仓库中的所有合并请求。
get_pull_request:通过 ID 获取单个合并请求。
create_pull_request:创建新的合并请求。 //测试版 - 未经测试
update_pull_request:更新现有的合并请求。 //测试版 - 未经测试
list_pull_request_comments:列出合并请求上的所有评论(全局、内联和回复),支持分页。
get_pull_request_comment:通过 ID 获取合并请求上的单个评论,包括内联文件/行上下文。
add_pull_request_comment:向合并请求添加评论。支持常规评论、特定文件/行的内联评论以及线程化回复。
项目
get_project:通过键获取单个项目。
list_default_reviewers:列出项目的默认评审人员。
分支限制
list_branch_restrictions:列出仓库的所有分支限制。
get_branch_restriction:通过 ID 获取单个分支限制。
update_repository_branching_model_settings:更新仓库的分支模型配置。 //测试版 - 未经测试
update_project_branching_model_settings:更新项目的分支模型配置。 //测试版 - 未经测试
开发
在开发模式下运行
npm run dev构建
npm run build项目结构
BitbucketMCP/
├── src/
│ └── index.ts # Main MCP server implementation
├── dist/ # Compiled JavaScript output
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── .gitignore # Git ignore rules
└── README.md # This file故障排除
身份验证问题
验证你的 Bitbucket 用户名和应用密码是否正确
确保应用密码具有正确的权限(Repositories: Read)
检查工作区名称是否正确
连接问题
验证你的互联网连接
检查你的网络是否可以访问 Bitbucket API
确保 MCP 服务器正在运行(检查 Cursor 的 MCP 日志)
找不到仓库
验证仓库名称是否正确(使用仓库 slug,而不是显示名称)
确保你有权访问该仓库
检查仓库是否存在于指定的工作区中
MCP 服务器无法加载
验证 Cursor 配置中
dist/index.js的路径是否正确确保已安装 Node.js 且可从命令行访问
检查 Cursor 的 MCP 服务器日志以获取错误消息
安全说明
妥善保管你的 Bitbucket 应用密码,切勿将其提交到版本控制中
使用环境变量或安全配置管理来处理凭据
应用密码应仅具备所需的最低权限
考虑定期轮换你的应用密码
贡献
Fork 本仓库
创建功能分支
进行更改
如适用,添加测试
提交合并请求
许可证
MIT 许可证 - 详情请参阅 LICENSE 文件
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceA Model Context Protocol server that enables seamless integration between Cursor IDE and JIRA, allowing users to retrieve issues, execute JQL searches, and log work through natural language interactions.
- AlicenseBqualityDmaintenanceA Model Context Protocol server that integrates JIRA directly into Cursor IDE, allowing users to view assigned issues, get detailed information on specific tickets, and convert JIRA issues into local tasks without leaving their editor.14236TypeScriptMIT
- AlicenseDqualityDmaintenanceA Model Context Protocol server that enables AI assistants to interact with Bitbucket repositories, pull requests, and other resources through Bitbucket Cloud and Server APIs.33,985161MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables interaction with Bitbucket repositories through the Model Context Protocol, supporting both Bitbucket Cloud and Server with features for PR lifecycle management and code review.194,62827MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
A MCP server built for developers enabling Git based project management with project and personal…
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Korfu/mcp-bitbucket'
If you have feedback or need assistance with the MCP directory API, please join our Discord server