Skip to main content
Glama

mcp-bitbucket

用于 Bitbucket Cloud REST API 2.0 的 MCP(stdio)服务器。可与 Cursor 配合使用:拉取请求、流水线、日志、克隆。

工具与典型的 bb_get / bb_post / bb_put / bb_patch / bb_delete / bb_clone 集合一致。

要求

  • Node.js 18+

  • Atlassian 作用域 API 令牌(应用密码不起作用)

令牌:id.atlassian.com → API tokens。
有用的范围:读取仓库、拉取请求、流水线和用户(read:repository:bitbucket、read:pullrequest:bitbucket、read:pipeline:bitbucket、read:user:bitbucket)。如需写入,请添加相应的 write:*。

Related MCP server: bitbucket-mcp

安装

git clone https://github.com/genkis/mcp-bitbucket.git
cd mcp-bitbucket
npm install

将 .env.example 复制为 .env 并在本地填写值。不要提交 .env 文件。

Cursor(~/.cursor/mcp.json)

仅将令牌和电子邮件保存在 Cursor 的本地配置中,不要保存在此仓库中。

{
  "mcpServers": {
    "bitbucket": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/mcp-bitbucket/index.js"],
      "env": {
        "ATLASSIAN_USER_EMAIL": "you@example.com",
        "ATLASSIAN_API_TOKEN": "your-scoped-api-token",
        "BITBUCKET_DEFAULT_WORKSPACE": "your-workspace-slug"
      }
    }
  }
}

更改后,在 Cursor 中重新加载 MCP 服务器。

变量:

变量

说明

ATLASSIAN_USER_EMAIL

Atlassian 账户的电子邮件

ATLASSIAN_API_TOKEN

作用域 API 令牌

BITBUCKET_DEFAULT_WORKSPACE

默认工作区(由 bb_clone 使用)

别名:BITBUCKET_USERNAME、BITBUCKET_API_TOKEN。

工具

/2.0 前缀会自动添加。路径以 / 开头,例如 /workspaces。

工具

用途

bb_get

读取(PR、流水线、日志、文件)

bb_post

创建(PR、评论、合并)

bb_put

完全替换资源

bb_patch

部分更新

bb_delete

删除 / 拒绝 PR

bb_clone

git clone(先 SSH,后 HTTPS)

公共参数:path,可选 queryParams、jq(JMESPath)、outputFormat(toon 或 json)。bb_post / bb_put / bb_patch 需要 body。

路径示例:

  • /workspaces

  • /repositories/{workspace}/{repo}/pullrequests/{id}

  • /repositories/{workspace}/{repo}/pullrequests/{id}/diff

  • /repositories/{workspace}/{repo}/pipelines/?pagelen=50&sort=-created_on

  • /repositories/{workspace}/{repo}/pipelines/{uuid}/steps/{stepUuid}/log

在处理列表时,建议始终使用 jq 过滤器,以免将整个 JSON 拉入模型。

安全

  • 不要提交令牌、.env 或包含机密的 mcp.json。

  • 此服务器仅使用 Basic Auth(电子邮件 + 令牌)将请求转发到 api.bitbucket.org。

  • 日志和错误不会输出令牌。

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    C
    maintenance
    Enables interaction with a Bitbucket Server/Data Center instance, exposing its REST v1.0 API as MCP tools to manage projects, repositories, branches, pull requests, comments, diffs, commits, files, search, and build status.
    41
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to interact with Bitbucket workspaces, repositories, branches, commits, and pull requests through MCP tools for listing, retrieving, commenting, searching, and managing version control workflows. It supports generic GET, POST, PUT, PATCH, DELETE, and clone operations against Bitbucket Cloud REST API endpoints.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI assistants to interact with Bitbucket Cloud workspaces, repositories, pull requests, commits, branches, diffs, comments, issues, pipelines, and deployments through MCP tools for listing, reading, creating, updating, deleting, searching, commenting, and cloning via the Bitbucket API.
    MIT