@jestay/bitbucket-mcp
You can use this MCP server to review and manage Bitbucket Cloud pull requests.
List repository PRs filtered by state, with pagination.
Read full PR metadata: branches, commits, draft flag, reviewers, and approvals.
Fetch unified PR diffs and raw file contents at a branch, tag, or commit.
List existing general and inline PR comments, including resolution status.
Post review comments: general, inline on added/removed lines, or replies to existing comments.
Resolve or reopen top-level comment threads.
Update open PR titles/descriptions while preserving reviewers and other fields.
Create PRs from a source branch to a destination branch, optionally as draft, with default reviewers.
By default, ask for explicit user approval before posting or mutating;
BITBUCKET_YOLO=trueenables autonomous commenting for automation/CI.
Provides tools for code review of Bitbucket Cloud pull requests: list PRs, read diffs, file contents and comments, and post review comments (general, inline, or replies).
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., "@@jestay/bitbucket-mcp list open pull requests in my-workspace/my-repo"
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.
@jestay/bitbucket-mcp
MCP server for code review of Bitbucket Cloud pull requests: list PRs, read diffs, file contents and comments, post review comments (general, inline on specific lines, or replies), resolve comment threads, update the PR title/description and open new PRs.
Tools
Tool | Description |
| List PRs of a repo, filtered by state (default OPEN) |
| Full PR metadata: branches, commits, draft flag, reviewers, approval status |
| Unified diff of the PR (plain text); |
| Raw file content at a branch/tag/commit |
| Existing PR comments (general and inline), with resolution status |
| Post a comment: general, inline ( |
| Resolve (or reopen with |
| Update the |
| Open a PR from |
Bitbucket Cloud allows resolving any top-level comment, general or inline; replies cannot be resolved, so pass the id of the comment that opens the thread. Liking a comment is not exposed by the public REST API 2.0, so it is not available here.
Bitbucket's PUT /pullrequests/{id} is a full replace: any field omitted from
the body is dropped (reviewers included). update_pull_request therefore reads
the PR first and sends reviewers, close_source_branch and draft back
unchanged, so only the title/description you pass actually change.
Pull requests created through the REST API do not get the repository's default
reviewers (only the Bitbucket UI adds them). create_pull_request therefore
reads the effective default reviewers (repository and project level) and sends
them with the new PR, excluding the token's user, who is the author.
Related MCP server: Bitbucket MCP Server
Review workflow
By default the server ships MCP instructions telling the connected agent to
review first and comment later: read the diff, consolidate all findings,
present them to the user, and post only the comments the user explicitly
approved. create_pull_request_comment carries the same warning in its
description, and the other mutating tools (create_pull_request,
resolve_pull_request_comment, update_pull_request) ask the agent to act
only on an explicit user request.
For unattended use (automation/CI), set BITBUCKET_YOLO=true to remove the
approval gate and let the agent comment autonomously.
Requirements
Node.js 20.6+
An Atlassian API token (see below)
Creating the API token
Create an API token with scopes at https://id.atlassian.com/manage-profile/security/api-tokens, select Bitbucket as the app, and grant these scopes:
Scope | Used for |
| Authentication / identifying the token's user |
| Resolving the workspace in API routes |
| Reading repository file contents ( |
| Listing and reading PRs, diffs and comments |
| Posting review comments, resolving threads, updating and creating PRs |
No other scopes are needed — in particular, write:repository:bitbucket is
NOT required (this server never pushes code).
Note: Atlassian App Passwords are deprecated — use API tokens.
Usage (npx)
No installation needed — any machine with Node 20.6+ can run it via npx.
.mcp.json (Claude Code) or claude_desktop_config.json (Claude Desktop):
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": ["-y", "@jestay/bitbucket-mcp"],
"env": {
"BITBUCKET_EMAIL": "you@company.com",
"BITBUCKET_API_TOKEN": "your_token_here",
"BITBUCKET_WORKSPACE": "your-workspace"
}
}
}
}Or with the Claude Code CLI:
claude mcp add bitbucket \
-e BITBUCKET_EMAIL=you@company.com \
-e BITBUCKET_API_TOKEN=your_token_here \
-e BITBUCKET_WORKSPACE=your-workspace \
-- npx -y @jestay/bitbucket-mcpEnvironment variables
Variable | Required | Description |
| Yes | Atlassian account email |
| Yes | Atlassian API token (scopes above) |
| No | Default workspace so tools don't need it per call |
| No | Set to |
Local development
pnpm install
pnpm build
cp .env.example .env # then fill in the values
pnpm dev # run from source (tsx)
pnpm start # run the compiled buildpnpm dev and pnpm start load environment variables from a .env file in
the project root. When registering the server in an MCP client, environment
variables come from the client's own config instead and no .env file is
needed. To register a local build, use
node /absolute/path/to/bitbucket-mcp/dist/index.js as the command.
Project layout
src/
├── index.ts # entry point
├── config.ts # env-var configuration
├── client.ts # HTTP client for the Bitbucket Cloud API 2.0 (auth lives here)
└── server.ts # McpServer + tool registrationAvailable Tools
6 toolscreate_pull_request_commentA
Posts publicly visible content to Bitbucket — do NOT call this tool unless the user has explicitly approved the exact comment text. Post a comment on a pull request. Three modes: general (only content), inline on a specific line (file_path + line, with line_type indicating whether the line is added or removed in the diff), or a reply to an existing comment (parent_id).
Inputs: repo (required), pr_id (required), content (required), line, +4 more.
get_file_contentA
Get the raw content of a file at a given ref (branch name, tag or commit hash). Useful to see full context beyond the diff hunks during a review.
Inputs: ref (required), path (required), repo (required), workspace.
get_pull_requestA
Get full metadata of a pull request: title, description, author, branches with commit hashes, state, and reviewers with their approval status.
Inputs: repo (required), pr_id (required), workspace.
get_pull_request_diffA
Get the unified diff of a pull request as plain text. This is the primary input for a code review.
Inputs: repo (required), pr_id (required), workspace.
list_pull_request_commentsA
List the comments of a pull request (general and inline). Use it before posting review comments to avoid repeating observations already made. Paginated; next_page is set when more results exist.
Inputs: repo (required), pr_id (required), page, pagelen, +1 more.
list_pull_requestsA
List pull requests of a repository, filtered by state (default OPEN). Returns a summary per PR: id, title, author, branches, state, comment count and last update. Paginated; next_page is set when more results exist.
Inputs: repo (required), page, state, pagelen, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: listing PRs, getting PR metadata, getting the diff, reading file content, listing comments, and posting comments. There is no overlap or ambiguity between them.
All tool names follow a consistent verb_noun pattern using snake_case, such as list_pull_requests, get_pull_request_diff, and create_pull_request_comment. The naming is uniform and predictable.
With exactly 6 tools, the server is well-scoped for a pull request review workflow. Each tool serves a necessary function without redundancy or bloat.
The tool set covers the full review loop: discover PRs, inspect details and diffs, view file contents for context, check existing comments, and post new feedback. No critical gaps are apparent for the intended purpose.
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for siGit (sigit.si): browse repos, search code, manage PRs/issues, web search.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server for Bitbucket Cloud, focused on pull-request review workflows116,532 npmMIT
- AlicenseBqualityBmaintenanceMCP server for Bitbucket Server integration, enabling project, repository, pull request, source code, branch, and code review operations via the Bitbucket Server APIs.2789 npmMIT
- FlicenseCqualityDmaintenanceAn MCP server for Bitbucket Cloud, covering pull requests, pull request comments, and pipelines.26-
- AlicenseAqualityDmaintenanceMCP server for Bitbucket Cloud that enables reviewing, managing, and merging pull requests, assigning reviewers by name, reading files at a ref, and inspecting pipeline status from any MCP client.14MIT