Skip to main content
Glama
bitbucket-mcp

bitbucket-mcp

by sapn95

bitbucket-mcp

An MCP server for Bitbucket Server / Data Center. It wraps the REST 1.0 API so an agent can work a pull request end to end: list and read PRs, check the merge state, read the activity thread, post and thread comments, resolve tasks, toggle the draft flag, and merge.

The official Atlassian MCP for Bitbucket ships only with Data Center 10.5 and later. This server covers an older Bitbucket Server that does not have it yet, and the Atlassian Cloud MCP does not reach a self-hosted instance.

Configuration

The host and credentials come from the environment. No server URL is baked into the code, so the repository holds nothing site-specific.

Variable

Fallback

Meaning

BITBUCKET_URL

BB_URL

Base URL, e.g. https://bitbucket.example.com

BITBUCKET_USER

BB_USER

Username

BITBUCKET_TOKEN

BB_TOKEN

Personal access token or app password

BITBUCKET_* wins when both a BITBUCKET_* and a BB_* variable are set.

Register it with your MCP client, for example:

{
  "mcpServers": {
    "bitbucket": {
      "command": "node",
      "args": ["/path/to/bitbucket-mcp/index.js"]
    }
  }
}

The client passes the BITBUCKET_* variables through from its own environment.

Related MCP server: Bitbucket MCP Server

Tools

Tool

What it does

bitbucket_list_pull_requests

List PRs; optional state and page size

bitbucket_get_pull_request

Read one PR by id

bitbucket_get_merge_status

canMerge, conflicted, and veto reasons

bitbucket_get_activities

The PR discussion thread

bitbucket_get_blocker_comments

Tasks on the PR with their state and ids

bitbucket_add_comment

Post a comment; thread it with parentId

bitbucket_resolve_task

Resolve a task by its comment id

bitbucket_set_draft

Turn the draft flag on or off

bitbucket_merge_pull_request

Merge the PR; needs confirm:true

Safety

  • bitbucket_merge_pull_request refuses unless confirm:true is passed, and merging is irreversible.

  • bitbucket_set_draft re-sends the title, description and full reviewer list on the PUT that Bitbucket requires, because a Bitbucket PUT replaces the whole resource and would otherwise drop the reviewers.

Development

npm install
npm test      # node --test, no network — fetch is injected
npm run gate  # lint + coverage

Every network function takes an injectable fetchImpl, so the tests never make a real request and no fixtures carry real data.

Available Tools

9 tools
bitbucket_add_commentB

Post a comment on a pull request. Pass parentId to thread the comment as a reply under an existing comment; omit it for a top-level comment.

Inputs: id (required), repo (required), text (required), project (required), +1 more.

bitbucket_get_activitiesB

Get the activity stream of a pull request (comments, approvals, updates) for reading the discussion thread.

Inputs: id (required), repo (required), project (required), limit.

bitbucket_get_blocker_commentsA

List the tasks (blocker comments) on a pull request with their OPEN/RESOLVED state and ids.

Inputs: id (required), repo (required), project (required).

bitbucket_get_merge_statusA

Get the merge state of a pull request: canMerge, conflicted, and the list of veto reasons.

Inputs: id (required), repo (required), project (required).

bitbucket_get_pull_requestB

Get one pull request by id (title, description, branches, reviewers, draft flag).

Inputs: id (required), repo (required), project (required).

bitbucket_list_pull_requestsA

List pull requests in a repository. Optional state (OPEN/MERGED/DECLINED/ALL) and page size.

Inputs: repo (required), project (required), limit, state.

bitbucket_merge_pull_requestA

IRREVERSIBLE: merge a pull request. Requires confirm:true. Uses the current PR version unless one is given. Optional message and strategyId (merge-commit/squash/fast-forward).

Inputs: id (required), repo (required), confirm (required), project (required), +3 more.

bitbucket_resolve_taskB

Resolve a task (blocker comment) on a pull request by its comment id. Fetches the comment version first, then flips state to RESOLVED.

Inputs: id (required), repo (required), project (required), commentId (required).

bitbucket_set_draftA

Turn a pull request's draft flag on or off. Preserves title, description and the full reviewer list across the required PUT (Bitbucket PUT replaces the whole resource).

Inputs: id (required), repo (required), draft (required), project (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct pull-request operation: listing, fetching, merge status, activity stream, blocker comments, commenting, resolving tasks, draft flag, and merging. Boundaries between get_activities and get_blocker_comments are clear from their descriptions, and add_comment versus resolve_task is unambiguous.

    Naming Consistency5/5

    All tools use a consistent bitbucket_ prefix followed by a clear verb_noun snake_case pattern. The convention is predictable throughout, with no mixing of styles.

    Tool Count5/5

    Nine tools is well-scoped for a pull-request-focused Bitbucket server. Each tool earns its place by covering a distinct review, discussion, or merge operation.

    Completeness3/5

    The set covers reviewing, commenting, task resolution, draft management, and merging existing pull requests well. However, it lacks obvious PR lifecycle operations such as creating, updating, approving, or declining pull requests, and has no repository or branch tools, which are notable gaps for a Bitbucket MCP server.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      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.
      28
      166 npm
      69
      Apache 2.0
    • A
      license
      B
      quality
      C
      maintenance
      Enables interaction with Bitbucket Server/Data Center (Stash) for project and repository discovery, pull request management, code review, and code search.
      18
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to interact with Bitbucket Server (Data Center) via MCP, supporting reading pull requests and diffs, drafting and submitting reviews with verdicts, posting tasks, browsing code and commits, and managing pull requests.
      1
      ISC