host-mcp-bitbucket
Provides tools for interacting with Bitbucket Cloud and Server/Data Center REST APIs: listing and creating repositories, managing pull requests (create, update, approve, request changes, merge, decline), reading and writing general and inline PR comments, resolving comment threads, retrieving diffs, diff stats and patches, managing PR tasks via the tasks or blocker-comments API, listing branches and tags with filtering and pagination, and staging/ submitting pending review comments on Data Center.
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., "@host-mcp-bitbucket list open pull requests in acme/web-app"
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.
host-mcp-bitbucket
A local MCP (Model Context Protocol) server for Bitbucket that provides AI assistants with access to Bitbucket repositories, pull requests, comments, diffs, and tasks via REST API.
Works with both Bitbucket Cloud and Bitbucket Server/Data Center instances.
Compatibility
Platform | Versions | Status |
Bitbucket Cloud | Current | ✅ Fully supported |
Bitbucket Data Center | 8.x | ✅ Fully supported |
Bitbucket Data Center | 9.x | ✅ Fully supported |
Bitbucket Data Center | 10.x | ✅ Fully supported |
Note: Tasks on Data Center use the blocker-comments API (
/blocker-comments) introduced in Bitbucket 7.2. The legacy/tasksendpoint was removed in Bitbucket 9.0. This MCP server uses the modern blocker-comments API, which is the only option on DC 8.0+.
Related MCP server: Bitbucket MCP
Features
Dual platform — full support for both Bitbucket Cloud and Bitbucket Server/Data Center APIs
Repository operations — list and get repository details
Pull request management — create, update, approve, merge, decline, request changes
PR comments — add, update, delete, resolve/reopen comments (including inline comments)
PR diffs — get raw diffs, diff statistics, and patches
PR tasks — create, update, delete tasks on pull requests
Pending reviews — stage draft review comments, then submit or discard the entire review at once (Data Center only)
Branch & tag listing — list branches and tags with optional filtering
Pagination — automatic pagination with
allmode (capped at 1000 items); Cloud and DC pagination styles handled transparentlyDual transport — stdio (default) and stateless Streamable HTTP (per-request sessions; supports concurrent clients and reconnections)
Retry with backoff — automatic retry on transient errors (429, 5xx)
Quick Start
Install from npm
npx @mister-good-deal/host-mcp-bitbucket --bitbucket-token <YOUR_TOKEN>Use with Claude Desktop / VS Code
Add to your MCP configuration:
{
"mcpServers": {
"bitbucket": {
"command": "npx",
"args": [
"-y",
"@mister-good-deal/host-mcp-bitbucket",
"--bitbucket-token", "<YOUR_TOKEN>",
"--default-workspace", "<YOUR_WORKSPACE>"
]
}
}
}Environment Variables
You can also configure via environment variables:
export BITBUCKET_TOKEN="your-app-password-or-access-token"
export BITBUCKET_WORKSPACE="your-workspace"
export BITBUCKET_URL="https://api.bitbucket.org/2.0" # optional, default for CloudConfiguration
Flag | Env Variable | Default | Description |
|
|
| Bitbucket API base URL |
|
| — | Required. API token (app password or access token) |
|
| — | Default workspace (auto-extracted from URL if possible) |
|
|
| Skip TLS certificate verification |
|
|
| Log level (debug|info|warn|error) |
|
|
| HTTP timeout in ms |
|
|
| Max retries for transient errors |
|
|
| Base retry delay in ms |
|
|
| Transport type (stdio|http) |
|
|
| HTTP port (only with |
Bitbucket Server / Data Center
For self-hosted instances, point --bitbucket-url to your server URL (the REST API path is auto-appended):
npx @mister-good-deal/host-mcp-bitbucket \
--bitbucket-url "https://bitbucket.mycompany.com" \
--bitbucket-token "<YOUR_HTTP_ACCESS_TOKEN>" \
--default-workspace "<PROJECT_KEY>"The server auto-detects the platform (Cloud vs Data Center) from the URL and uses the correct API paths, pagination style, and request bodies. For DC, the --default-workspace value maps to a project key.
Available Tools
Pagination
Unless noted otherwise, listing tools accept the following optional parameters:
pagelen— Number of items per page (default: 10, max: 100)page— 1-based page numberall— Whentrue, fetches all pages automatically (capped at 1000 items)
Workspace / Connectivity
Tool | Description |
| Get the authenticated user (Cloud) or verify connectivity (DC) |
| Get workspace (Cloud) or project (DC) details |
Repository Operations
Tool | Description |
| List repositories in a workspace |
| Get details for a specific repository |
| Create a repository in a workspace (Cloud) or project (Data Center) |
Note on
createRepository: the slug comes from the URL on Cloud, so it is derived fromnameunlessrepoSlugis given; on Data Center the server always derives it.defaultBranchis Data Center only — Cloud cannot set it before a branch exists, so it is ignored and reported in the response message.isPrivatemaps tois_privateon Cloud and topublic(inverted) on Data Center;forkablemaps toforkableon Data Center and tofork_policy(allow_forks/no_forks) on Cloud.
Pull Request Operations
Tool | Description |
| List pull requests for a repository (filterable by state) |
| Create a new pull request (supports draft mode) |
| Get details for a specific pull request |
| Update pull request title and/or description |
| Get the activity log for a pull request |
| Approve a pull request |
| Remove approval from a pull request |
| Request changes on a pull request |
| Remove a change request |
| Decline a pull request |
| Merge a pull request (merge_commit, squash, fast_forward) |
| List commits on a pull request |
| List commit statuses for a pull request |
Pull Request Comment Operations
Tool | Description |
| List comments on a pull request |
| Get a specific comment |
| Add a comment (general or inline on a file/line) |
| Update a comment |
| Delete a comment |
| Resolve a comment thread |
| Reopen a resolved comment thread |
Pull Request Diff Operations
Tool | Description |
| Get the raw diff for a pull request |
| Get diff statistics (files changed, lines added/removed) |
| Get the patch for a pull request |
Pull Request Task Operations
Tasks on Cloud use the standard tasks API. On Data Center, tasks are implemented via blocker-comments (/blocker-comments), which is the canonical replacement since Bitbucket 7.2+.
Tool | Description |
| List tasks on a pull request |
| Create a task on a pull request |
| Get a specific task |
| Update a task (content, state). On DC, version is fetched automatically for optimistic concurrency |
| Delete a task. On DC, version is fetched automatically for optimistic concurrency |
Pending Review Operations (Data Center only)
These tools enable a staged review workflow: an AI agent drafts review comments that remain invisible until a human reviewer submits or discards the entire review.
Tool | Description |
| Add a pending (draft) review comment — general, inline, or reply |
| Get the current user's pending review with all draft comment threads |
| Publish all pending comments, optionally setting approval status and a summary |
| Discard all pending comments permanently |
Note: Pending reviews require Bitbucket Data Center. On Cloud, these tools return a clear error message.
Branch & Tag Operations
Tool | Description |
| List branches in a repository (with optional name filter) |
| List tags in a repository (with optional name filter) |
Development
pnpm install
pnpm run build
pnpm run lint
pnpm run test
pnpm run dev # Run with tsx in dev modeIntegration Tests
Integration tests run against a lightweight Docker mock server that stubs both Bitbucket Cloud and Data Center REST APIs:
pnpm run test:integrationThe mock server starts in under 1 second and provides deterministic responses with pre-populated fixtures (projects, repositories, pull requests, comments, tasks/blocker-comments, branches, tags).
Note: Atlassian publishes an official Bitbucket Data Center Docker image (
atlassian/bitbucket) that can be used for manual smoke testing against a real instance. However, it requires ~2 GB RAM, takes 1–3 minutes to start, and needs a license — so it is not used for automated tests.
License
MIT
Available Tools
39 toolsaddPendingReviewCommentA
Add a pending (draft) review comment to a pull request. The comment remains invisible to other users until the review is submitted. Supports general, inline (file/line), and reply comments. Data Center only.
Inputs: content (required), repoSlug (required), pullRequestId (required), inline, +2 more. Returns: Pending review comment added
addPullRequestCommentC
Add a comment to a pull request (general or inline on a specific file/line)
Inputs: content (required), repoSlug (required), pullRequestId (required), inline, +2 more. Returns: Created comment
approvePullRequestC
Approve a pull request
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request approval result
createPullRequestC
Create a new pull request
Inputs: title (required), repoSlug (required), sourceBranch (required), targetBranch (required), +5 more. Returns: Created pull request
createPullRequestTaskC
Create a task on a pull request
Inputs: content (required), repoSlug (required), pullRequestId (required), state, +2 more. Returns: Created task
createRepositoryB
Create a new Bitbucket repository in a workspace (Cloud) or project (Data Center)
Inputs: name (required), forkable, repoSlug, isPrivate, +4 more. Returns: Created repository
declinePullRequestC
Decline a pull request
Inputs: repoSlug (required), pullRequestId (required), message, workspace. Returns: Declined pull request
deletePullRequestCommentC
Delete a comment on a pull request
Inputs: repoSlug (required), commentId (required), pullRequestId (required), workspace. Returns: Comment deletion result
deletePullRequestTaskA
Delete a task from a pull request. On Data Center, the task version is fetched automatically for optimistic concurrency.
Inputs: taskId (required), repoSlug (required), pullRequestId (required), workspace. Returns: Task deletion result
discardPendingReviewA
Discard the current user's pending review on a pull request. All pending (draft) comments are permanently deleted. Data Center only.
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pending review discarded
getCurrentUserARead-only
Get the currently authenticated Bitbucket user. Useful for verifying connectivity and credentials.
Inputs: no named parameters. Returns: Current Bitbucket user
getPendingReviewARead-only
Get the current user's pending (draft) review on a pull request, including all pending comment threads. Data Center only.
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pending review details
getPullRequestBRead-only
Get details for a specific pull request
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request details
getPullRequestActivityBRead-only
Get the activity log for a pull request (comments, approvals, updates, etc.)
Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request activity log
getPullRequestCommentBRead-only
Get a specific comment on a pull request
Inputs: repoSlug (required), commentId (required), pullRequestId (required), workspace. Returns: Pull request comment details
getPullRequestCommentsBRead-only
List comments on a pull request. On Data Center, comments are extracted from the activity log.
Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request comments
getPullRequestCommitsCRead-only
List commits on a pull request
Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request commits
getPullRequestDiffBRead-only
Get the raw diff for a pull request
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request raw diff
getPullRequestDiffStatARead-only
Get diff statistics for a pull request (files changed, lines added/removed)
Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request diff statistics
getPullRequestPatchCRead-only
Get the patch for a pull request
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request patch
getPullRequestsCRead-only
List pull requests for a repository
Inputs: repoSlug (required), all, page, state, +2 more. Returns: Pull requests for a repository
getPullRequestStatusesARead-only
List commit statuses associated with a pull request
Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request commit statuses
getPullRequestTaskCRead-only
Get a specific task on a pull request
Inputs: taskId (required), repoSlug (required), pullRequestId (required), workspace. Returns: Task details
getPullRequestTasksCRead-only
List tasks on a pull request
Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request tasks
getRepositoryCRead-only
Get details for a specific Bitbucket repository
Inputs: repoSlug (required), workspace. Returns: Repository details
getWorkspaceBRead-only
Get details about a Bitbucket workspace (Cloud) or project (Data Center)
Inputs: workspace. Returns: Bitbucket workspace/project details
listBranchesBRead-only
List branches in a repository
Inputs: repoSlug (required), all, page, filter, +2 more. Returns: Repository branches
listRepositoriesBRead-only
List Bitbucket repositories in a workspace (Cloud) or project (Data Center)
Inputs: all, name, page, pagelen, +1 more. Returns: Repositories in the workspace
listTagsBRead-only
List tags in a repository
Inputs: repoSlug (required), all, page, filter, +2 more. Returns: Repository tags
mergePullRequestC
Merge a pull request
Inputs: repoSlug (required), pullRequestId (required), message, workspace, +2 more. Returns: Merged pull request
removeChangeRequestB
Remove a change request from a pull request
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Change request removal result
reopenCommentC
Reopen a resolved comment thread on a pull request
Inputs: repoSlug (required), commentId (required), pullRequestId (required), workspace. Returns: Comment reopen result
requestChangesB
Request changes on a pull request
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Change request result
resolveCommentC
Resolve a comment thread on a pull request
Inputs: repoSlug (required), commentId (required), pullRequestId (required), workspace. Returns: Comment resolution result
submitPendingReviewA
Submit (publish) the current user's pending review on a pull request. All pending comments become visible. Optionally set approval status and add a summary comment. Data Center only.
Inputs: repoSlug (required), pullRequestId (required), workspace, commentText, +2 more. Returns: Pending review submitted
unapprovePullRequestC
Remove approval from a pull request
Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request unapproval result
updatePullRequestC
Update a pull request (title, description)
Inputs: repoSlug (required), pullRequestId (required), title, workspace, +1 more. Returns: Updated pull request
updatePullRequestCommentC
Update a comment on a pull request
Inputs: content (required), repoSlug (required), commentId (required), pullRequestId (required), +1 more. Returns: Updated comment
updatePullRequestTaskA
Update a task on a pull request (content, state). On Data Center, the task version is fetched automatically for optimistic concurrency.
Inputs: taskId (required), repoSlug (required), pullRequestId (required), state, +2 more. Returns: Updated task
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 39 tools
The tools are largely split cleanly by resource and action, with clear list-vs-single pairs (getPullRequestComments/getPullRequestComment, getPullRequestTasks/getPullRequestTask). A few edges blur: getPullRequestDiff, getPullRequestPatch, and getPullRequestDiffStat are three similar output-oriented tools, and getPullRequestActivity overlaps with comment/approval listing. Still, most tools have a distinct, understandable purpose.
Naming is consistently camelCase with a verb_noun shape across the majority (getPullRequest, createPullRequestTask, deletePullRequestComment). Minor deviations exist where the subject is implied rather than stated (resolveComment, reopenComment, requestChanges) and RequestChanges reads oddly, but overall it's readable and predictable.
39 tools is heavy for a single server and sits well above the comfortable 3-15 range. The bulk is justified by a genuinely rich PR domain (comments, tasks, reviews, diffs), but the surface feels large enough that discoverability and selection cost increase.
Pull request coverage is excellent—full comment and task CRUD, pending reviews, activity, diffs, and approvals—so the PR workflow has no dead ends. However, repository management only offers create/get/list with no update or delete, and branches/tags are list-only, leaving notable gaps for a general Bitbucket server.
Maintenance
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to access and manage Bitbucket repositories and pull requests through Bitbucket Cloud and Server APIs, including listing and retrieving repositories and fetching or creating pull requests.8,143 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to access and manage repositories, pull requests, and related resources through Bitbucket Cloud and Server APIs.8,143 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to interact with Bitbucket Cloud and Server APIs, including listing and retrieving repositories and fetching, creating, and viewing pull requests.8,143 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to list and retrieve repositories, fetch and create pull requests, and page through related data via Bitbucket Cloud and Server APIs.8,143 npmMIT