跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Bitbucket,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 在 Bitbucket Cloud 中工作:浏览仓库、分支、提交和文件,评审带有差异和评论的拉取请求,在你确认后批准、评论和合并,并查看 Bitbucket Pipelines 的运行、步骤日志和部署。
试试这样问
Bitbucket 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Bitbucket、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Bitbucket
让你的 AI 在 Bitbucket Cloud 中工作:浏览仓库、分支、提交和文件,评审带有差异和评论的拉取请求,在你确认后批准、评论和合并,并查看 Bitbucket Pipelines 的运行、步骤日志和部署。
设置
- 登录
https://id.atlassian.com/manage-profile/security/api-tokens(Atlassian 账户中的 Security → API tokens),点击 Create API token with scopes。 - 给令牌起个名字(例如 AnythingMCP),选择到期日期,并选择应用 Bitbucket。
- 勾选读取范围
read:user:bitbucket、read:workspace:bitbucket、read:repository:bitbucket、read:pullrequest:bitbucket和read:pipeline:bitbucket。如需创建、评论、批准和合并拉取请求,再加上write:pullrequest:bitbucket;如需启动流水线,再加上write:pipeline:bitbucket。 - 复制令牌(以
ATATT开头),不要加 Bearer 一词,粘贴到BITBUCKET_API_TOKEN,然后安装连接器。连接器以 Bearer 令牌的方式发送它,所以不需要你的 Atlassian 邮箱。 - 先用
bitbucket_get_current_user,再用bitbucket_list_workspaces检查设置。
应用密码已不再可用:Bitbucket 于 2025 年 9 月 9 日停止创建应用密码,并于 2026 年 7 月 28 日停用了剩余的应用密码。请按上述步骤使用带范围的 API 令牌。仓库、项目或工作区访问令牌(Repository settings → Access tokens;项目和工作区令牌需要 Premium 套餐)也可以填在同一字段中,但它以机器人身份运行,仅限于该仓库、项目或工作区:bitbucket_get_current_user 和 bitbucket_list_workspaces 可能会被拒绝,超出其范围的内容会返回 403 或 404。
谁能看到什么:AI 以令牌所属用户的身份操作,只能查看和修改该用户及所勾选范围允许的内容。不加两个写入范围,令牌就保持只读。
会改动真实分支并触达你的团队,所以 AI 会先问你:bitbucket_create_pull_request 以你的名义创建拉取请求(源分支必须已经推送)。bitbucket_add_pull_request_comment 发布普通评论、回复或针对某一行的代码评论,拉取请求的所有参与者都能看到,并可能收到通知。bitbucket_approve_pull_request 添加你的批准,它会计入合并检查。bitbucket_merge_pull_request 会为所有人改变目标分支,可能触发部署流水线,并且在设置 close_source_branch 时删除源分支;合并前 AI 会先用 bitbucket_get_pull_request 检查状态和批准情况。bitbucket_run_pipeline 会消耗构建分钟数,并执行流水线中的所有操作,包括部署步骤。每次调用前,AI 都会告诉你仓库、分支、拉取请求以及合并策略或流水线,并等你同意。安装时没有关闭任何工具;除了带 close_source_branch 的合并会删除源分支外,没有工具会删除仓库、分支或评论。
使用方法:bitbucket_list_workspaces 给出工作区 slug,bitbucket_list_repositories 给出仓库 slug;两者都出现在地址 bitbucket.org/<workspace>/<repo> 中。代码:bitbucket_get_repository(主分支)、bitbucket_list_branches、bitbucket_list_commits、bitbucket_get_commit 和 bitbucket_get_file(文件文本或文件夹列表)。评审:bitbucket_list_pull_requests、bitbucket_get_pull_request、用于查看改动规模的 bitbucket_get_pull_request_diffstat,然后是 bitbucket_get_pull_request_diff、bitbucket_list_pull_request_commits 和 bitbucket_list_pull_request_comments。部署:bitbucket_list_environments 和 bitbucket_list_deployments。
流水线:先用 bitbucket_list_pipelines,然后对失败的步骤使用 bitbucket_get_pipeline、bitbucket_list_pipeline_steps 和 bitbucket_get_pipeline_step_log。流水线和步骤的 uuid 带有花括号;AI 会按返回的原样传递。超过 200 KB 的步骤日志会被截断并保留开头部分,而错误通常在末尾,所以对于长日志,AI 会用类似 bytes=-150000(最后 150 KB)的范围读取末尾。差异和文件同样在 200 KB 处截断。
列表和筛选:有下一页时,列表结果中会带有 next;AI 会带上 page 再次调用(大多数列表是页码,提交列表是不透明的令牌),pagelen 设置每页条数。q 使用 Bitbucket 的查询语言,例如 name ~ "api" 或 destination.branch.name = "main"。
没有问题跟踪和 Wiki:Bitbucket 已于 2026 年 8 月 20 日移除内置的问题跟踪器和 Wiki(API 返回 410),因此本连接器没有相关工具。如需管理问题,请添加 Jira 连接器。
常见错误:401:令牌错误、已过期或已撤销,或者是旧的应用密码;请创建带范围的 API 令牌。403:缺少某个范围(错误信息会指出是哪个),或用户没有权限。404:工作区、仓库或条目不存在,或令牌看不到它。429:已达到每小时速率限制;请稍候重试。
该连接器不涉及创建或删除仓库和分支、编辑文件或推送提交、拒绝拉取请求、停止流水线、仓库变量和设置以及管理功能。
前提条件: BITBUCKET_API_TOKEN
本地安装连接器
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
打开 http://localhost:3000/connectors/store,选择 Bitbucket 并填入前提条件中列出的环境变量。
可用工具
| Tool | What it does |
|---|---|
bitbucket_get_current_user | Get the Bitbucket account the token belongs to: display name, nickname, uuid, account_id and profile link |
bitbucket_list_workspaces | List the workspaces the token's user belongs to: slug, name, uuid and whether the user is an administrator there |
bitbucket_list_repositories | List repositories in a workspace, most recently updated first: full_name, slug, description, private flag, language, main branch, project… |
bitbucket_get_repository | Get one repository: description, main branch, project, privacy, language, size, fork parent, clone URLs and web link |
bitbucket_list_branches | List branches of a repository with the latest commit of each (hash, date, message, author) |
bitbucket_list_commits | List commits newest first: hash, date, message, author and parents |
bitbucket_get_commit | Get one commit: full hash, date, full message, author, parents and web link |
bitbucket_get_file | Read a file or list a folder at a commit or branch |
bitbucket_list_pull_requests | List pull requests of a repository, open ones by default: id, title, state, draft, author, source and destination branch, comment and task… |
bitbucket_get_pull_request | Get one pull request: title, description, state, branches and commits, merge commit, reviewers and participants with their approval state… |
bitbucket_get_pull_request_diffstat | List the files a pull request changes: status (added, removed, modified, renamed), old and new path, lines added and removed |
bitbucket_get_pull_request_diff | Read the unified diff of a pull request as plain text |
bitbucket_list_pull_request_commits | List the commits a pull request contains, newest first: hash, date, message and author |
bitbucket_list_pull_request_comments | List comments on a pull request, oldest first: id, author, text, inline position (file and line) for code comments, parent id for replies… |
bitbucket_create_pull_request | Open a pull request from a source branch into a destination branch of the same repository, as the token's user |
bitbucket_add_pull_request_comment | Post a comment on a pull request as the token's user: a general comment, a reply (parent) or a code comment on a line (inline) |
bitbucket_approve_pull_request | Approve a pull request as the token's user |
bitbucket_merge_pull_request | Merge an open pull request into its destination branch |
bitbucket_list_pipelines | List Bitbucket Pipelines runs of a repository, newest first: uuid, build number, state (PENDING, IN_PROGRESS, COMPLETED), result… |
bitbucket_get_pipeline | Get one pipeline run: state, result, branch or tag, commit, custom pipeline name, trigger, creator, start, end and duration |
bitbucket_list_pipeline_steps | List the steps of a pipeline run: uuid, name, state, result, start, end, duration, build image name and script command names |
bitbucket_get_pipeline_step_log | Read the log of one pipeline step as plain text |
bitbucket_run_pipeline | Start a Bitbucket Pipelines run on a branch or tag, optionally a custom pipeline from bitbucket-pipelines.yml |
bitbucket_list_environments | List the deployment environments of a repository (for example Test, Staging, Production): uuid, name, type, rank and lock state |
bitbucket_list_deployments | List deployments of a repository: environment uuid, state (UNDEPLOYED, IN_PROGRESS, COMPLETED), status (SUCCESSFUL, FAILED, STOPPED), who… |
示例提示
- “acme/web-app 中哪些拉取请求仍处于打开状态?分别是谁创建的,哪些还没有任何批准?”
- “评审 web-app 中的拉取请求 #42:总结改动的文件,指出有风险的改动,并列出尚未解决的评审评论。”
- “main 上最近一次流水线为什么失败?读取失败步骤的日志,把错误给我看。”
- “等拉取请求 #42 有两个批准后,用 squash 方式合并到 main。先给我看分支和合并策略,合并前问我。”
- “最近一次部署到 Production 的是什么?什么时候、由谁部署,发布的是哪个提交?”
下一步
这份指南对你有帮助吗?