Skip to main content
Glama

mcp-bitbucket

An MCP server (stdio) for the Bitbucket Cloud REST API 2.0. Works with Cursor: pull requests, pipelines, logs, clone.

The tools are consistent with the typical bb_get / bb_post / bb_put / bb_patch / bb_delete / bb_clone set.

Requirements

  • Node.js 18+

  • Scoped Atlassian API Token (App Passwords don't work)

Token: id.atlassian.com → API tokens.
Useful scopes: repository, pull request, pipeline, and user read (read:repository:bitbucket, read:pullrequest:bitbucket, read:pipeline:bitbucket, read:user:bitbucket). For write, add the corresponding write:*.

Related MCP server: Bitbucket Cloud MCP Server

Installation

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

Copy .env.example to .env and fill in the values locally. Do not commit the .env file.

Cursor (~/.cursor/mcp.json)

Keep the token and email only in the local Cursor configuration, not in this 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"
      }
    }
  }
}

After making changes, reload the MCP servers in Cursor.

Variables:

Variable

Description

ATLASSIAN_USER_EMAIL

Atlassian account email

ATLASSIAN_API_TOKEN

Scoped API Token

BITBUCKET_DEFAULT_WORKSPACE

Default workspace (used by bb_clone)

Aliases: BITBUCKET_USERNAME, BITBUCKET_API_TOKEN.

Tools

The /2.0 prefix is added automatically. The path starts with /, e.g. /workspaces.

Tool

Purpose

bb_get

Read (PRs, pipelines, logs, files)

bb_post

Create (PR, comment, merge)

bb_put

Full resource replacement

bb_patch

Partial update

bb_delete

Delete / decline PR

bb_clone

git clone (SSH, then HTTPS)

Common parameters: path, optionally queryParams, jq (JMESPath), outputFormat (toon or json). bb_post / bb_put / bb_patch require body.

Example paths:

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

It's worth applying the jq filter whenever dealing with lists, to avoid pulling the entire JSON into the model.

Security

  • Do not commit tokens, .env, or mcp.json with secrets.

  • This server only forwards requests to api.bitbucket.org with Basic Auth (email + token).

  • Logs and errors do not print the token.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Facilitates interaction with Bitbucket Server for pull request management using the MCP protocol, supporting operations such as creating, merging, commenting, and reviewing pull requests.
    15
    68
    Apache 2.0
  • A
    license
    B
    quality
    C
    maintenance
    Enables interaction with Bitbucket Cloud through 25+ tools for managing repositories, pull requests, branches, commits, issues, pipelines, and code search with OAuth 2.0 authentication.
    34
    15 npm
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that provides tools for interacting with the Bitbucket API, supporting both Bitbucket Cloud and Bitbucket Server, enabling pull request, branch, file, code review, and search operations.
    19
    3,671 npm
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    MCP server for the Bitbucket Cloud REST API v2.0, providing 32 tools across 5 toolsets for repository management, pull requests, issues, pipelines, and more with safety controls and LLM-optimized output.
    33
    10 npm
    2
    MIT