Skip to main content
Glama

mcp-bitbucket

MCP-Server (stdio) für die Bitbucket Cloud REST API 2.0. Funktioniert mit Cursor: Pull Requests, Pipelines, Logs, Clone.

Die Tools entsprechen dem typischen Satz bb_get / bb_post / bb_put / bb_patch / bb_delete / bb_clone.

Voraussetzungen

  • Node.js 18+

  • Scoped API Token von Atlassian (App-Passwörter funktionieren nicht)

Token: id.atlassian.com → API tokens.
Nützliche Bereiche: Lesen von Repository, Pull Requests, Pipelines und Benutzer (read:repository:bitbucket, read:pullrequest:bitbucket, read:pipeline:bitbucket, read:user:bitbucket). Für Schreibzugriff entsprechende write:*-Bereiche hinzufügen.

Related MCP server: bitbucket-mcp

Installation

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

Kopiere .env.example in .env und fülle die Werte lokal aus. Die Datei .env nicht committen.

Cursor (~/.cursor/mcp.json)

Token und E-Mail nur in der lokalen Cursor-Konfiguration aufbewahren, nicht in diesem Repository.

{
  "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"
      }
    }
  }
}

Nach Änderungen die MCP-Server in Cursor neu laden.

Variablen:

Variable

Beschreibung

ATLASSIAN_USER_EMAIL

E-Mail des Atlassian-Kontos

ATLASSIAN_API_TOKEN

Scoped API Token

BITBUCKET_DEFAULT_WORKSPACE

Standard-Workspace (wird von bb_clone verwendet)

Aliasse: BITBUCKET_USERNAME, BITBUCKET_API_TOKEN.

Tools

Das Präfix /2.0 wird automatisch hinzugefügt. Der Pfad beginnt mit /, z. B. /workspaces.

Tool

Verwendung

bb_get

Lesen (PR, Pipelines, Logs, Dateien)

bb_post

Erstellen (PR, Kommentar, Merge)

bb_put

Vollständiges Ersetzen einer Ressource

bb_patch

Teilweise Aktualisierung

bb_delete

Löschen / PR ablehnen

bb_clone

git clone (SSH, dann HTTPS)

Gemeinsame Parameter: path, optional queryParams, jq (JMESPath), outputFormat (toon oder json). bb_post / bb_put / bb_patch erfordern body.

Beispiele für Pfade:

  • /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

Der jq-Filter sollte bei Listen immer verwendet werden, um nicht das gesamte JSON in das Modell zu ziehen.

Sicherheit

  • Keine Tokens, .env oder mcp.json mit Geheimnissen committen.

  • Dieser Server leitet nur Anfragen an api.bitbucket.org mit Basic Auth (E-Mail + Token) weiter.

  • Logs und Fehler geben den Token nicht aus.

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