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 の Scoped API トークン (App Passwords は機能しません)

トークン: 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

Scoped 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 の decline

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
    B
    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