bitbucket-mcp
Provides tools for interacting with Bitbucket Server / Data Center pull requests, including listing and reading PRs, checking merge status, viewing activity threads, posting and threading comments, resolving tasks, toggling draft status, and merging pull requests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bitbucket-mcp check the merge status of PR #42 and merge it if it's clean"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 |
|
| Base URL, e.g. |
|
| Username |
|
| 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 |
| List PRs; optional state and page size |
| Read one PR by id |
|
|
| The PR discussion thread |
| Tasks on the PR with their state and ids |
| Post a comment; thread it with |
| Resolve a task by its comment id |
| Turn the draft flag on or off |
| Merge the PR; needs |
Safety
bitbucket_merge_pull_requestrefuses unlessconfirm:trueis passed, and merging is irreversible.bitbucket_set_draftre-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 + coverageEvery network function takes an injectable fetchImpl, so the tests never make
a real request and no fixtures carry real data.
Available Tools
9 toolsbitbucket_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
Scored across 9 tools
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.
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.
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.
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
Related MCP Connectors
Hosted coding agent: start, follow up on and stop tasks that can open GitHub pull requests.
Assess pull requests and read verdicts, findings, evidence and suggested fixes from coding agents.
Check GitHub pull requests and schedule, move, cancel or revert merges from an AI assistant.
Pull change requests from your Amendor board into your coding agent to build and open PRs.
Related MCP Servers
- AlicenseAqualityAmaintenanceFacilitates interaction with Bitbucket Server for pull request management using the MCP protocol, supporting operations such as creating, merging, commenting, and reviewing pull requests.28166 npm69Apache 2.0
- AlicenseAqualityCmaintenanceEnables retrieval of pull request metadata and diffs from Bitbucket Cloud and Server/Data Center, with optional comment creation.31MIT
- AlicenseBqualityCmaintenanceEnables interaction with Bitbucket Server/Data Center (Stash) for project and repository discovery, pull request management, code review, and code search.18MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.1ISC