Skip to main content
Glama
host-mcp-bitbucket

host-mcp-bitbucket

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 /tasks endpoint 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 all mode (capped at 1000 items); Cloud and DC pagination styles handled transparently

  • Dual 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 Cloud

Configuration

Flag

Env Variable

Default

Description

--bitbucket-url

BITBUCKET_URL

https://api.bitbucket.org/2.0

Bitbucket API base URL

--bitbucket-token

BITBUCKET_TOKEN

—

Required. API token (app password or access token)

--default-workspace

BITBUCKET_WORKSPACE

—

Default workspace (auto-extracted from URL if possible)

--insecure

BITBUCKET_INSECURE=true

false

Skip TLS certificate verification

--log-level

LOG_LEVEL

info

Log level (debug|info|warn|error)

--timeout

BITBUCKET_TIMEOUT

30000

HTTP timeout in ms

--max-retries

BITBUCKET_MAX_RETRIES

3

Max retries for transient errors

--retry-delay

BITBUCKET_RETRY_DELAY

1000

Base retry delay in ms

--transport

MCP_TRANSPORT

stdio

Transport type (stdio|http)

--port

MCP_PORT

3000

HTTP port (only with --transport http)

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 number

  • all — When true, fetches all pages automatically (capped at 1000 items)

Workspace / Connectivity

Tool

Description

getCurrentUser

Get the authenticated user (Cloud) or verify connectivity (DC)

getWorkspace

Get workspace (Cloud) or project (DC) details

Repository Operations

Tool

Description

listRepositories

List repositories in a workspace

getRepository

Get details for a specific repository

createRepository

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 from name unless repoSlug is given; on Data Center the server always derives it. defaultBranch is Data Center only — Cloud cannot set it before a branch exists, so it is ignored and reported in the response message. isPrivate maps to is_private on Cloud and to public (inverted) on Data Center; forkable maps to forkable on Data Center and to fork_policy (allow_forks/no_forks) on Cloud.

Pull Request Operations

Tool

Description

getPullRequests

List pull requests for a repository (filterable by state)

createPullRequest

Create a new pull request (supports draft mode)

getPullRequest

Get details for a specific pull request

updatePullRequest

Update pull request title and/or description

getPullRequestActivity

Get the activity log for a pull request

approvePullRequest

Approve a pull request

unapprovePullRequest

Remove approval from a pull request

requestChanges

Request changes on a pull request

removeChangeRequest

Remove a change request

declinePullRequest

Decline a pull request

mergePullRequest

Merge a pull request (merge_commit, squash, fast_forward)

getPullRequestCommits

List commits on a pull request

getPullRequestStatuses

List commit statuses for a pull request

Pull Request Comment Operations

Tool

Description

getPullRequestComments

List comments on a pull request

getPullRequestComment

Get a specific comment

addPullRequestComment

Add a comment (general or inline on a file/line)

updatePullRequestComment

Update a comment

deletePullRequestComment

Delete a comment

resolveComment

Resolve a comment thread

reopenComment

Reopen a resolved comment thread

Pull Request Diff Operations

Tool

Description

getPullRequestDiff

Get the raw diff for a pull request

getPullRequestDiffStat

Get diff statistics (files changed, lines added/removed)

getPullRequestPatch

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

getPullRequestTasks

List tasks on a pull request

createPullRequestTask

Create a task on a pull request

getPullRequestTask

Get a specific task

updatePullRequestTask

Update a task (content, state). On DC, version is fetched automatically for optimistic concurrency

deletePullRequestTask

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

addPendingReviewComment

Add a pending (draft) review comment — general, inline, or reply

getPendingReview

Get the current user's pending review with all draft comment threads

submitPendingReview

Publish all pending comments, optionally setting approval status and a summary

discardPendingReview

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

listBranches

List branches in a repository (with optional name filter)

listTags

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 mode

Integration Tests

Integration tests run against a lightweight Docker mock server that stubs both Bitbucket Cloud and Data Center REST APIs:

pnpm run test:integration

The 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 tools
addPendingReviewCommentA

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

getCurrentUserA
Read-only

Get the currently authenticated Bitbucket user. Useful for verifying connectivity and credentials.

Inputs: no named parameters. Returns: Current Bitbucket user

getPendingReviewA
Read-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

getPullRequestB
Read-only

Get details for a specific pull request

Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request details

getPullRequestActivityB
Read-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

getPullRequestCommentB
Read-only

Get a specific comment on a pull request

Inputs: repoSlug (required), commentId (required), pullRequestId (required), workspace. Returns: Pull request comment details

getPullRequestCommentsB
Read-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

getPullRequestCommitsC
Read-only

List commits on a pull request

Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request commits

getPullRequestDiffB
Read-only

Get the raw diff for a pull request

Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request raw diff

getPullRequestDiffStatA
Read-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

getPullRequestPatchC
Read-only

Get the patch for a pull request

Inputs: repoSlug (required), pullRequestId (required), workspace. Returns: Pull request patch

getPullRequestsC
Read-only

List pull requests for a repository

Inputs: repoSlug (required), all, page, state, +2 more. Returns: Pull requests for a repository

getPullRequestStatusesA
Read-only

List commit statuses associated with a pull request

Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request commit statuses

getPullRequestTaskC
Read-only

Get a specific task on a pull request

Inputs: taskId (required), repoSlug (required), pullRequestId (required), workspace. Returns: Task details

getPullRequestTasksC
Read-only

List tasks on a pull request

Inputs: repoSlug (required), pullRequestId (required), all, page, +2 more. Returns: Pull request tasks

getRepositoryC
Read-only

Get details for a specific Bitbucket repository

Inputs: repoSlug (required), workspace. Returns: Repository details

getWorkspaceB
Read-only

Get details about a Bitbucket workspace (Cloud) or project (Data Center)

Inputs: workspace. Returns: Bitbucket workspace/project details

listBranchesB
Read-only

List branches in a repository

Inputs: repoSlug (required), all, page, filter, +2 more. Returns: Repository branches

listRepositoriesB
Read-only

List Bitbucket repositories in a workspace (Cloud) or project (Data Center)

Inputs: all, name, page, pagelen, +1 more. Returns: Repositories in the workspace

listTagsB
Read-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

    B3.1/5.0

    Scored across 39 tools

    Disambiguation4/5

    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 Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness3/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers