bitbucket-mcp
A self-owned Model Context Protocol server for Bitbucket
Cloud, covering the full pull-request lifecycle and Bitbucket Pipelines build diagnosis in
twenty-three tools — list, read, diff, comment, edit, resolve, task, review, create, update, check what
blocks a merge, merge (merge queues included), decline, and then wait for the build, find the failing
step and the line of its log that explains it. It includes the gaps in Atlassian's own Bitbucket
tools (update, decline, request changes, unapprove, diffstat, inline comments, comment edits, thread
resolution, tasks, build statuses, mergeability, default reviewers, pipeline logs, code insights). It is written in C# on .NET 10 and ships as a Native AOT binary per platform: one
self-contained executable, about 20 MB on win-x64 (7 MB in the release archive), starting in
roughly ten milliseconds. The point of the project is a supply chain one person can actually audit
— five direct package references over a transitive closure of seventeen, every one of them from
Microsoft or the official MCP organisation:
ModelContextProtocol and its Tasks
extension ModelContextProtocol.Extensions.Tasks (both pinned exactly to 2.4.0),
Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.Logging.Console and
System.Security.Cryptography.ProtectedData. Tool names follow Atlassian's camelCase verbNoun
convention, so it sits alongside the official Atlassian MCP server without a naming clash. MIT
licensed.
Bitbucket Data Center is explicitly out of scope.
Tools
| Tool | What it does | Annotations |
|---|
listPullRequests | Lists a repository's pull requests, most recently updated first — a summary per pull request (id, title, state, author, branches, closeSourceBranch, web URL). Defaults to open ones only; sourceBranch answers "does this branch already have a pull request?", reviewer "what is waiting on my review?", destinationBranch "what goes into main?". | read-only, idempotent |
getPullRequest | Reads one pull request in full: title, description, state, branches, web URL, reviewers and participants with their approvals. | read-only, idempotent |
getPullRequestDiff | Fetches a pull request's changes: with no arguments it lists the changed files, and passing paths returns those files' unified diff. sinceCommit narrows either to what changed since a commit already reviewed. Truncation is always marked inline. | read-only, idempotent |
getPullRequestComments | Lists a pull request's comments — general and inline — oldest first, with deleted comments filtered out; unresolvedOnly leaves out the threads already resolved. | read-only, idempotent |
listDefaultReviewers | Lists the repository's effective default reviewers with their account UUIDs, including the ones inherited from its project. Where reviewer UUIDs come from when there is no pull request to read them off. | read-only, idempotent |
listPullRequestStatuses | Lists the build statuses reported against a pull request, each with the URL of its run. | read-only, idempotent |
listPullRequestTasks | Lists a pull request's tasks, RESOLVED or UNRESOLVED — the outstanding work, which the comments alone do not tell you. | read-only, idempotent |
getPullRequestMergeability | Bitbucket's own dry run of a merge: state, permission, conflicts, every configured merge check (approvals, builds, tasks…) and the merge queue, blocking checks first — the check to make before mergePullRequest. | read-only, idempotent |
createPullRequest | Opens a new pull request. Title and source branch are required, and closeSourceBranch and draft are settable here. Reviewers are account UUIDs and are entirely optional: omit reviewers for the repository's own default-reviewer rule, or pass [] to open it with nobody on it. | write, not destructive |
updatePullRequest | Changes an existing pull request's title, description, destination branch, reviewer list, closeSourceBranch flag or draft status. reviewers replaces the whole list; the two flags are only reachable here once the pull request is open. | write, destructive |
addPullRequestComment | Posts a comment: general, a reply, or inline on a line of the diff — anchored by codeSnippet copied verbatim out of the diff, or by line plus lineType. | write, not destructive |
updatePullRequestComment | Corrects one of your own comments, or deletes it. The old text is gone either way; an edited inline comment keeps its line. | write, destructive, idempotent |
resolvePullRequestComment | Marks a comment thread resolved, or reopens it — any top-level comment, inline or on the pull request as a whole. Asking for the state it is already in is not an error. | write, not destructive, idempotent |