Skip to main content
Glama

Bitbucket MCP Server

CI/CD PyPI version npm version License: MIT

MCP server for Bitbucket API operations. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.

Language Versions

This repository contains both TypeScript and Python implementations:

Version

Directory

Status

Installation

TypeScript

/typescript

✅ Recommended (Smithery)

npm install -g mcp-server-bitbucket

Python

/python

✅ Stable

pipx install mcp-server-bitbucket

Note: The TypeScript version is used for Smithery deployments. Both versions provide identical functionality.

Use patched Node.js 22.23.4 or 24.22.1 for TypeScript, or Python 3.11+ for Python. See the security update for HTTP request bounds and reproducible image builds.

Related MCP server: Bitbucket Server MCP

Features

  • Repositories: get, create, delete, list, update (move to project, rename)

  • Pull Requests: create, get, list, merge, approve, decline, request changes, comments, diff

  • Pipelines: trigger, get status, list, view logs, stop

  • Branches: list, get

  • Projects: list, get

  • Commits: list, get details, compare/diff between branches

  • Commit Statuses: get build statuses, create status (CI/CD integration)

  • Deployments: list environments, get environment details, deployment history

  • Webhooks: list, create, get, delete

  • Tags: list, create, delete

  • Branch Restrictions: list, create, delete branch protection rules

  • Source Browsing: read files, list directories without cloning

  • Repository Permissions: manage user and group permissions

  • Pipeline Variables: manage CI/CD environment variables

  • MCP Prompts: reusable workflow templates (code review, release notes, etc.)

  • MCP Resources: browsable workspace data

Quick Start

# Install globally
npm install -g mcp-server-bitbucket

# Or run directly with npx
npx mcp-server-bitbucket

Python

# Install with pipx
pipx install mcp-server-bitbucket

# Configure Claude Code
claude mcp add bitbucket -s user \
  -e BITBUCKET_WORKSPACE=your-workspace \
  -e BITBUCKET_EMAIL=your-email@example.com \
  -e BITBUCKET_API_TOKEN=your-api-token \
  -- mcp-server-bitbucket

Full Installation Guide - Includes API token creation, permissions setup, and troubleshooting.

Hosted

If you'd rather not run the server yourself, a hosted deployment is available on Fronteir AI.

Configuration

Environment Variables

Variable

Required

Description

BITBUCKET_WORKSPACE

✅

Bitbucket workspace slug

BITBUCKET_EMAIL

✅ (basic auth)

Account email for Basic Auth

BITBUCKET_API_TOKEN

✅

Atlassian API token (Basic auth)

BITBUCKET_OAUTH_TOKEN

Access token sent as Authorization: Bearer

BITBUCKET_AUTH_TYPE

Force auth mode: basic or bearer (auto-detected)

API_TIMEOUT

Request timeout in seconds (default: 30)

MAX_RETRIES

Max retry attempts for rate limiting (default: 3)

Authentication modes

Bitbucket Cloud has two credential families, and they do not share an auth scheme:

Credential

Header

Configuration

Atlassian API token (ATATT...), tied to a personal account

Authorization: Basic base64(email:token)

BITBUCKET_EMAIL + BITBUCKET_API_TOKEN

Workspace / project / repository access token (ATCTT...), owned by the workspace

Authorization: Bearer <token>

BITBUCKET_OAUTH_TOKEN

Access tokens return 401 with Basic auth, so the server picks the mode automatically:

  1. BITBUCKET_AUTH_TYPE, when set, always wins.

  2. Otherwise bearer is used when BITBUCKET_OAUTH_TOKEN is set, or when no BITBUCKET_EMAIL is configured.

  3. Otherwise basic is used (the default for personal API tokens).

Bearer example — a company-owned workspace access token with no personal account involved:

claude mcp add bitbucket -s user \
  -e BITBUCKET_WORKSPACE=your-workspace \
  -e BITBUCKET_OAUTH_TOKEN=your-workspace-access-token \
  -- npx mcp-server-bitbucket

Protecting the remote server (OAuth)

The stdio server runs on your machine with your own credential, so it needs no protection. A remote deployment is different: it holds one shared credential and serves whoever reaches it, so /mcp can be gated on a bearer token issued by an external authorization server (Microsoft Entra ID, Okta, Auth0…).

Variable

Description

MCP_OAUTH_ISSUER

Token issuer, e.g. https://login.microsoftonline.com/<tenant>/v2.0

MCP_OAUTH_AUDIENCE

Expected aud claim, e.g. api://bitbucket-mcp

MCP_OAUTH_JWKS_URI

Signing keys (derived from the issuer when omitted)

MCP_OAUTH_REQUIRED_SCOPE

Scope the token must carry, e.g. mcp.access

MCP_PUBLIC_URL

Public URL of this server, advertised as the resource

Protection is off unless both MCP_OAUTH_ISSUER and MCP_OAUTH_AUDIENCE are set, so existing deployments are unaffected. With them set, the server:

  • answers unauthenticated /mcp requests with 401 and a WWW-Authenticate header pointing at /.well-known/oauth-protected-resource, which is what makes an MCP client start the OAuth flow;

  • serves that metadata document (RFC 9728) naming the authorization server;

  • verifies every request's JWT — signature against the issuer's JWKS, plus iss, aud and expiry — and returns 403 insufficient_scope when a valid token lacks the required scope;

  • leaves /health open, so platform probes keep working.

Note what this does and does not do: it controls who may use the server. Calls still reach Bitbucket under the server's own credential, so it does not attribute actions to individual users.

Claude Code CLI

# TypeScript version
claude mcp add bitbucket -s user \
  -e BITBUCKET_WORKSPACE=your-workspace \
  -e BITBUCKET_EMAIL=your-email@example.com \
  -e BITBUCKET_API_TOKEN=your-api-token \
  -- npx mcp-server-bitbucket

# Python version
claude mcp add bitbucket -s user \
  -e BITBUCKET_WORKSPACE=your-workspace \
  -e BITBUCKET_EMAIL=your-email@example.com \
  -e BITBUCKET_API_TOKEN=your-api-token \
  -- mcp-server-bitbucket

Cursor IDE

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "bitbucket": {
      "command": "npx",
      "args": ["mcp-server-bitbucket"],
      "env": {
        "BITBUCKET_WORKSPACE": "your-workspace",
        "BITBUCKET_EMAIL": "your-email@example.com",
        "BITBUCKET_API_TOKEN": "your-api-token"
      }
    }
  }
}

Available Tools (62 Python / 64 TypeScript)

Repositories

Tool

Description

list_repositories

List and search repositories

get_repository

Get repository details

create_repository

Create a new repository

delete_repository

Delete a repository

update_repository

Update repo settings

Pull Requests

Tool

Description

list_pull_requests

List PRs

get_pull_request

Get PR details

create_pull_request

Create a new PR

merge_pull_request

Merge a PR

approve_pr

Approve a PR

unapprove_pr

Remove approval

request_changes_pr

Request changes

decline_pr

Decline a PR

list_pr_comments

List comments

add_pr_comment

Add comment

get_pr_diff

Get the diff

Pipelines

Tool

Description

list_pipelines

List recent runs

get_pipeline

Get status

get_pipeline_logs

View logs

trigger_pipeline

Trigger a run (supports custom pipelines and commit triggers)

stop_pipeline

Stop pipeline

list_pipeline_variables

List variables

get_pipeline_variable

Get variable

create_pipeline_variable

Create variable

update_pipeline_variable

Update variable

delete_pipeline_variable

Delete variable

trigger_pipeline Parameters

Parameter

Type

Description

repo_slug

string

Repository slug (required)

branch

string

Branch to run on (default: main). Mutually exclusive with commit

commit

string

Commit hash to run on. Mutually exclusive with branch

custom_pipeline

string

Name from custom: section in bitbucket-pipelines.yml

variables

array

Variables as [{key, value, secured?}]

Examples:

# Default pipeline on main
trigger_pipeline(repo_slug="my-repo")

# Custom pipeline
trigger_pipeline(repo_slug="my-repo", custom_pipeline="deploy-staging")

# Custom pipeline on specific commit with variables
trigger_pipeline(
    repo_slug="my-repo",
    commit="abc123def",
    custom_pipeline="deploy-prod",
    variables=[
        {"key": "ENV", "value": "production"},
        {"key": "SECRET", "value": "xxx", "secured": True}
    ]
)

See history queries, pagination and retry behavior.

Branches, Commits, Tags

Tool

Description

list_branches

List branches

get_branch

Get branch details

list_commits

Paginated history with revision include/exclude and path filters

get_commit

Get commit details

compare_commits

Paginated changed-file statistics from base to head

get_commit_diff

Raw diff, optionally by file, with explicit chunk continuation

get_merge_base

Best common ancestor of two revisions

get_file_history

Paginated file history with paths reported across renames

get_commit_statuses

Get build statuses

create_commit_status

Report CI status

list_tags

Paginated tags with filtering and configurable sorting

get_tag

Resolve an exact tag to its full target commit hash

create_tag

Create a tag

delete_tag

Delete a tag

And more...

  • Deployments: list_environments, get_environment, list_deployment_history

  • Webhooks: list_webhooks, create_webhook, get_webhook, delete_webhook

  • Branch Restrictions: list_branch_restrictions, create_branch_restriction, delete_branch_restriction

  • Source Browsing: get_file_content, list_directory

  • Permissions: User and group permission management (8 tools)

  • Projects: list_projects, get_project

MCP Prompts

Reusable workflow templates:

Prompt

Description

code_review

Comprehensive PR code review

release_notes

Generate changelog between versions

pipeline_debug

Debug failed CI/CD pipelines

repo_summary

Complete repository status overview

MCP Resources

Browsable workspace data:

Resource URI

Description

bitbucket://repositories

List all repos

bitbucket://repositories/{repo}

Repository details

bitbucket://repositories/{repo}/branches

Branch list

bitbucket://repositories/{repo}/pull-requests

Open PRs

bitbucket://projects

List all projects

Development

TypeScript

cd typescript
npm install
npm run build
npm run dev  # Watch mode

Python

cd python
uv sync
uv run python -m src.server

Creating a Bitbucket API Token

  1. Go to your repository in Bitbucket

  2. Navigate to Repository settings > Access tokens

  3. Click Create Repository Access Token

  4. Select permissions:

    • Repository: Read, Write, Admin, Delete

    • Pull requests: Read, Write

    • Pipelines: Read, Write

  5. Copy the token immediately

Using this at work

If your team is running this against a company Bitbucket, I'd like to know. It decides what gets built next, and issues that come from a real deployment get looked at first.

Two kinds of work I take on around this:

  • An MCP server for an internal system that doesn't have one. Same shape as this one, against your own API.

  • Help getting an MCP deployment past a security review — scopes, token handling, self-hosting the transport.

Open an issue, or write to javier@javieraguilar.ai.

Author

Built and maintained by Javier Aguilar — AI engineer working on agent systems and MCP integrations. There's a write-up of how and why this server was built here.

License

MIT

Available Tools

62 tools
add_pr_commentB

Add a comment to a pull request.

Can add general comments or inline comments on specific lines.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID
    content: Comment content (markdown supported)
    file_path: File path for inline comment (optional)
    line: Line number for inline comment (optional, requires file_path)

Returns:
    Created comment info

Inputs: pr_id (required), content (required), repo_slug (required), line, +1 more.

approve_prB

Approve a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID

Returns:
    Approval confirmation

Inputs: pr_id (required), repo_slug (required).

compare_commitsA

List changed files from base to head (git diff base head semantics).

Revisions can be branches, tags or hashes. Returns a complete page of file
statistics. Follow next_cursor for remaining files; cursor keeps its issued
filters and page size. Use get_commit_diff for actual changed lines.

Inputs: base (required), head (required), repo_slug (required), path, +2 more.

create_branch_restrictionA

Create a branch restriction (protection rule).

Args:
    repo_slug: Repository slug
    kind: Type of restriction. Common values:
          - "push" - Restrict who can push
          - "force" - Restrict force push
          - "delete" - Restrict branch deletion
          - "restrict_merges" - Restrict who can merge
          - "require_passing_builds_to_merge" - Require CI to pass
          - "require_approvals_to_merge" - Require PR approvals
          - "require_default_reviewer_approvals_to_merge"
          - "require_no_changes_requested"
          - "require_tasks_to_be_completed"
    pattern: Branch pattern (e.g., "main", "release/*"). Required for glob match.
    branch_match_kind: How to match branches - "glob" (pattern) or "branching_model" (development/production)
    branch_type: Branch type when using branching_model - "development", "production", or specific category
    value: Numeric value for restrictions that need it (e.g., number of required approvals)

Returns:
    Created restriction info with ID

Inputs: kind (required), repo_slug (required), value, pattern, +2 more.

create_commit_statusA

Create a build status for a commit.

Use this to report CI/CD status from external systems.

Args:
    repo_slug: Repository slug
    commit: Commit hash
    state: Status state - one of: SUCCESSFUL, FAILED, INPROGRESS, STOPPED
    key: Unique identifier for this status (e.g., "my-ci-system")
    url: URL to the build details (optional)
    name: Display name for the status (optional)
    description: Status description (optional)

Returns:
    Created status info

Inputs: key (required), state (required), commit (required), repo_slug (required), +3 more.

create_pipeline_variableA

Create a pipeline variable.

Args:
    repo_slug: Repository slug
    key: Variable name (e.g., "PYPI_TOKEN", "AWS_SECRET_KEY")
    value: Variable value
    secured: Whether to encrypt the value (default: False).
             Secured variables cannot be read back from the API.

Returns:
    Created variable info with UUID

Inputs: key (required), value (required), repo_slug (required), secured.

create_pull_requestA

Create a pull request in a Bitbucket repository.

Args:
    repo_slug: Repository slug (e.g., "anzsic_classifier")
    title: PR title
    source_branch: Source branch name
    destination_branch: Target branch (default: main)
    description: PR description in markdown
    close_source_branch: Delete source branch after merge (default: True)

Returns:
    Created PR info with id, url, and state

Inputs: title (required), repo_slug (required), source_branch (required), description, +2 more.

create_repositoryB

Create a new Bitbucket repository.

Args:
    repo_slug: Repository slug (lowercase, no spaces)
    project_key: Project key to create repo under (optional)
    is_private: Whether repository is private (default: True)
    description: Repository description

Returns:
    Created repository info with clone URLs

Inputs: repo_slug (required), is_private, description, project_key.

create_tagA

Create a new tag in a repository.

Args:
    repo_slug: Repository slug
    name: Tag name (e.g., "v1.0.0")
    target: Commit hash or branch name to tag
    message: Optional tag message (for annotated tags)

Returns:
    Created tag info

Inputs: name (required), target (required), repo_slug (required), message.

create_webhookA

Create a webhook for a repository.

Args:
    repo_slug: Repository slug
    url: URL to call when events occur
    events: List of events to trigger on. Common events:
            - repo:push (code pushed)
            - pullrequest:created, pullrequest:updated, pullrequest:merged
            - pullrequest:approved, pullrequest:unapproved
            - pullrequest:comment_created
    description: Webhook description (optional)
    active: Whether webhook is active (default: True)

Returns:
    Created webhook info with UUID

Inputs: url (required), events (required), repo_slug (required), active, +1 more.

decline_prA

Decline (close without merging) a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID

Returns:
    Declined PR info

Inputs: pr_id (required), repo_slug (required).

delete_branch_restrictionB

Delete a branch restriction.

Args:
    repo_slug: Repository slug
    restriction_id: Restriction ID (from list_branch_restrictions)

Returns:
    Confirmation of deletion

Inputs: repo_slug (required), restriction_id (required).

delete_group_permissionB

Remove a group's explicit permission from a repository.

Args:
    repo_slug: Repository slug
    group_slug: Group slug

Returns:
    Confirmation of removal

Inputs: repo_slug (required), group_slug (required).

delete_pipeline_variableB

Delete a pipeline variable.

Args:
    repo_slug: Repository slug
    variable_uuid: Variable UUID (from list_pipeline_variables)

Returns:
    Confirmation of deletion

Inputs: repo_slug (required), variable_uuid (required).

delete_repositoryA

Delete a Bitbucket repository.

WARNING: This action is irreversible!

Args:
    repo_slug: Repository slug to delete

Returns:
    Success status

Inputs: repo_slug (required).

delete_tagC

Delete a tag from a repository.

Args:
    repo_slug: Repository slug
    tag_name: Tag name to delete

Returns:
    Confirmation of deletion

Inputs: tag_name (required), repo_slug (required).

delete_user_permissionB

Remove a user's explicit permission from a repository.

Args:
    repo_slug: Repository slug
    selected_user: User's account_id or UUID

Returns:
    Confirmation of removal

Inputs: repo_slug (required), selected_user (required).

delete_webhookB

Delete a webhook.

Args:
    repo_slug: Repository slug
    webhook_uuid: Webhook UUID (from list_webhooks)

Returns:
    Confirmation of deletion

Inputs: repo_slug (required), webhook_uuid (required).

get_branchB

Get information about a specific branch.

Args:
    repo_slug: Repository slug
    branch_name: Branch name

Returns:
    Branch info with latest commit details

Inputs: repo_slug (required), branch_name (required).

get_commitC

Get detailed information about a specific commit.

Args:
    repo_slug: Repository slug
    commit: Commit hash (full or short)

Returns:
    Commit details including message, author, date, and parents

Inputs: commit (required), repo_slug (required).

get_commit_diffA

Read the raw diff from base to head, optionally restricted to a file.

Follows git diff base head semantics. A large response is clipped explicitly;
pass next_offset to read the next chunk with the same revisions/path. Pin
revisions to hashes when chunking so moving branches cannot change the diff.
max_chars is clamped to 1-100000. Bitbucket may reject oversized diffs (555);
narrow with path in that case. Binary differences may have no text patch.

Inputs: base (required), head (required), repo_slug (required), path, +2 more.

get_commit_statusesA

Get build/CI statuses for a commit.

Args:
    repo_slug: Repository slug
    commit: Commit hash
    limit: Maximum number of results (default: 20)

Returns:
    List of CI/CD statuses (builds, checks) for the commit

Inputs: commit (required), repo_slug (required), limit.

get_environmentC

Get details about a specific deployment environment.

Args:
    repo_slug: Repository slug
    environment_uuid: Environment UUID (from list_environments)

Returns:
    Environment details including restrictions and variables

Inputs: repo_slug (required), environment_uuid (required).

get_file_contentA

Get the content of a file from a repository.

Read file contents without cloning the repository.

Args:
    repo_slug: Repository slug
    path: File path (e.g., "src/main.py", "README.md")
    ref: Branch, tag, or commit hash (default: "main")

Returns:
    File content as text (or error if binary/not found)

Inputs: path (required), repo_slug (required), ref.

get_file_historyA

List a file's history at a branch, tag or commit without cloning.

Returns paths and full commit hashes, preserving paths reported by Bitbucket
across renames. Use get_commit for author, message and date; Bitbucket omits
those from filehistory. Follow next_cursor until has_more is false.
cursor keeps its issued page size; limit only applies to the first page.

Inputs: path (required), repo_slug (required), ref, limit, +1 more.

get_group_permissionC

Get a specific group's permission for a repository.

Args:
    repo_slug: Repository slug
    group_slug: Group slug

Returns:
    Group's permission level

Inputs: repo_slug (required), group_slug (required).

get_merge_baseA

Get Bitbucket's best common ancestor of two branches, tags or hashes.

Useful for ancestry checks: compare the returned hash with a resolved commit.
Bitbucket returns one best ancestor, even if the graph has several.

Inputs: base (required), head (required), repo_slug (required).

get_pipelineA

Get status of a pipeline run.

Args:
    repo_slug: Repository slug
    pipeline_uuid: Pipeline UUID (from trigger_pipeline)

Returns:
    Pipeline status including state, duration, and steps

Inputs: repo_slug (required), pipeline_uuid (required).

get_pipeline_logsA

Get logs for a pipeline run.

If step_uuid is not provided, returns list of steps to choose from.

Args:
    repo_slug: Repository slug
    pipeline_uuid: Pipeline UUID
    step_uuid: Step UUID (optional, get from steps list first)

Returns:
    Pipeline logs or list of available steps

Inputs: repo_slug (required), pipeline_uuid (required), step_uuid.

get_pipeline_variableB

Get details about a specific pipeline variable.

Args:
    repo_slug: Repository slug
    variable_uuid: Variable UUID (from list_pipeline_variables)

Returns:
    Variable details including key, secured status, and value (if not secured)

Inputs: repo_slug (required), variable_uuid (required).

get_pr_diffC

Get the diff of a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID

Returns:
    Diff content as text

Inputs: pr_id (required), repo_slug (required).

get_projectB

Get information about a specific project.

Args:
    project_key: Project key (e.g., "DS", "PROJ")

Returns:
    Project info including name, description, and metadata

Inputs: project_key (required).

get_pull_requestC

Get information about a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID

Returns:
    PR info including state, author, reviewers, and merge status

Inputs: pr_id (required), repo_slug (required).

get_repositoryB

Get information about a Bitbucket repository.

Args:
    repo_slug: Repository slug (e.g., "anzsic_classifier")

Returns:
    Repository info including name, description, clone URLs, and metadata

Inputs: repo_slug (required).

get_tagB

Resolve an exact tag name without scanning pages; returns full target hash.

Inputs: tag_name (required), repo_slug (required).

get_user_permissionB

Get a specific user's permission for a repository.

Args:
    repo_slug: Repository slug
    selected_user: User's account_id or UUID

Returns:
    User's permission level

Inputs: repo_slug (required), selected_user (required).

get_webhookB

Get details about a specific webhook.

Args:
    repo_slug: Repository slug
    webhook_uuid: Webhook UUID (from list_webhooks)

Returns:
    Webhook details including URL, events, and status

Inputs: repo_slug (required), webhook_uuid (required).

list_branchesB

List branches in a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 50)

Returns:
    List of branches with commit info

Inputs: repo_slug (required), limit.

list_branch_restrictionsB

List branch restrictions (protection rules) in a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 50)

Returns:
    List of branch restrictions with kind, pattern, and settings

Inputs: repo_slug (required), limit.

list_commitsA

List a page of commits, newest first, without cloning.

include selects commits reachable from any supplied branch/tag/hash; exclude
removes commits reachable from those revisions. For commits in v2 but not v1,
use include=["v2"], exclude=["v1"]. branch is an additional include alias.
path restricts changes to a file/directory. Follow next_cursor until has_more
is false. cursor preserves its issued filters/page size; limit (1-100) and
filters apply only to the first page. Absence from one page is not absence
from repository history.

Inputs: repo_slug (required), path, limit, branch, +3 more.

list_deployment_historyB

Get deployment history for a specific environment.

Args:
    repo_slug: Repository slug
    environment_uuid: Environment UUID (from list_environments)
    limit: Maximum number of results (default: 20)

Returns:
    List of deployments with status, commit, and timestamps

Inputs: repo_slug (required), environment_uuid (required), limit.

list_directoryA

List contents of a directory in a repository.

Browse repository structure without cloning.

Args:
    repo_slug: Repository slug
    path: Directory path (empty string for root)
    ref: Branch, tag, or commit hash (default: "main")
    limit: Maximum number of entries (default: 100)

Returns:
    List of files and directories with their types and sizes

Inputs: repo_slug (required), ref, path, limit.

list_environmentsC

List deployment environments for a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 20)

Returns:
    List of environments (e.g., test, staging, production)

Inputs: repo_slug (required), limit.

list_group_permissionsB

List group permissions for a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 50)

Returns:
    List of groups with their permission levels

Inputs: repo_slug (required), limit.

list_pipelinesB

List recent pipeline runs for a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 10)

Returns:
    List of recent pipeline runs

Inputs: repo_slug (required), limit.

list_pipeline_variablesB

List pipeline variables for a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 50)

Returns:
    List of pipeline variables with key, secured status, and value (if not secured)

Inputs: repo_slug (required), limit.

list_pr_commentsB

List comments on a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID
    limit: Maximum number of results (default: 50)

Returns:
    List of comments with author, content, and timestamps

Inputs: pr_id (required), repo_slug (required), limit.

list_projectsB

List projects in the workspace.

Args:
    limit: Maximum number of results (default: 50)

Returns:
    List of projects with key, name, and description

Inputs: limit.

list_pull_requestsB

List pull requests in a repository.

Args:
    repo_slug: Repository slug
    state: Filter by state: OPEN, MERGED, DECLINED, SUPERSEDED (default: OPEN)
    limit: Maximum number of results (default: 20, max: 100)

Returns:
    List of PRs with basic info

Inputs: repo_slug (required), limit, state.

list_repositoriesA

List and search repositories in the workspace.

Args:
    project_key: Filter by project key (optional)
    search: Simple search term for repository name (optional)
            Uses fuzzy matching: search="anzsic" finds "anzsic_classifier"
    query: Advanced Bitbucket query syntax (optional)
           Examples:
           - name ~ "api" (partial name match)
           - description ~ "classifier" (search description)
           - is_private = false (public repos only)
           - name ~ "test" AND is_private = true
    limit: Maximum number of results (default: 50, max: 100)

Returns:
    List of repositories with basic info

Inputs: limit, query, search, project_key.

list_tagsA

List a page of tags with their target commits.

query is Bitbucket's tag filter (e.g. name ~ "v2"). sort defaults to target
commit date descending; use name/-name for natural version-name ordering.
Target date is not tag creation date or proof of ancestry. Follow next_cursor
until has_more is false. cursor retains its issued filters and page size.

Inputs: repo_slug (required), sort, limit, query, +1 more.

list_user_permissionsB

List user permissions for a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 50)

Returns:
    List of users with their permission levels

Inputs: repo_slug (required), limit.

list_webhooksA

List webhooks configured for a repository.

Args:
    repo_slug: Repository slug
    limit: Maximum number of results (default: 50)

Returns:
    List of webhooks with URL, events, and status

Inputs: repo_slug (required), limit.

merge_pull_requestB

Merge a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID
    merge_strategy: One of 'merge_commit', 'squash', 'fast_forward' (default: merge_commit)
    close_source_branch: Delete source branch after merge (default: True)
    message: Optional merge commit message

Returns:
    Merged PR info

Inputs: pr_id (required), repo_slug (required), message, merge_strategy, +1 more.

request_changes_prC

Request changes on a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID

Returns:
    Confirmation of change request

Inputs: pr_id (required), repo_slug (required).

stop_pipelineC

Stop a running pipeline.

Args:
    repo_slug: Repository slug
    pipeline_uuid: Pipeline UUID

Returns:
    Updated pipeline status

Inputs: repo_slug (required), pipeline_uuid (required).

trigger_pipelineA

Trigger a pipeline run on a repository.

Supports custom pipelines (from 'custom:' section in bitbucket-pipelines.yml)
and commit-based triggers.

Args:
    repo_slug: Repository slug
    branch: Branch to run pipeline on (default: main). Mutually exclusive with commit.
    commit: Commit hash to run pipeline on. Mutually exclusive with branch.
    custom_pipeline: Name of custom pipeline from 'custom:' section
                    (e.g., "deploy-staging", "dry-run")
    variables: Pipeline variables as list of {key, value, secured?} objects.
              Example: [{"key": "ENV", "value": "prod", "secured": false}]

Returns:
    Pipeline run info with uuid and state

Examples:
    # Default branch pipeline
    trigger_pipeline(repo_slug="my-repo")

    # Custom pipeline
    trigger_pipeline(repo_slug="my-repo", custom_pipeline="deploy-staging")

    # Custom pipeline on specific commit
    trigger_pipeline(repo_slug="my-repo", commit="abc123", custom_pipeline="dry-run")

    # With secured variables
    trigger_pipeline(repo_slug="my-repo", variables=[
        {"key": "ENV", "value": "prod"},
        {"key": "SECRET", "value": "xxx", "secured": true}
    ])

Inputs: repo_slug (required), branch, commit, variables, +1 more.

unapprove_prA

Remove your approval from a pull request.

Args:
    repo_slug: Repository slug
    pr_id: Pull request ID

Returns:
    Confirmation of approval removal

Inputs: pr_id (required), repo_slug (required).

update_group_permissionB

Update or add a group's permission for a repository.

Args:
    repo_slug: Repository slug
    group_slug: Group slug
    permission: Permission level - "read", "write", or "admin"

Returns:
    Updated permission info

Inputs: repo_slug (required), group_slug (required), permission (required).

update_pipeline_variableC

Update a pipeline variable's value.

Args:
    repo_slug: Repository slug
    variable_uuid: Variable UUID (from list_pipeline_variables)
    value: New variable value

Returns:
    Updated variable info

Inputs: value (required), repo_slug (required), variable_uuid (required).

update_repositoryA

Update repository settings (project, visibility, description, name).

Use this to move a repository to a different project, change visibility,
update description, or rename the repository.

Args:
    repo_slug: Repository slug (e.g., "anzsic_classifier")
    project_key: Move to different project (optional, e.g., "DS")
    is_private: Change visibility (optional)
    description: Update description (optional)
    name: Rename repository (optional)

Returns:
    Updated repository info

Inputs: repo_slug (required), name, is_private, description, +1 more.

update_user_permissionC

Update or add a user's permission for a repository.

Args:
    repo_slug: Repository slug
    selected_user: User's account_id or UUID
    permission: Permission level - "read", "write", or "admin"

Returns:
    Updated permission info

Inputs: repo_slug (required), permission (required), selected_user (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 62 tools

    Disambiguation4/5

    Most tools target clearly distinct resources and actions (repositories, PRs, pipelines, permissions, webhooks, tags, branches). A few adjacent commit/file-history tools and pipeline status/log tools require reading descriptions carefully, but overall boundaries are clear.

    Naming Consistency4/5

    Names overwhelmingly follow a verb_noun snake_case pattern such as list_repositories, get_commit, create_pull_request, and delete_webhook. The main inconsistency is mixing 'pr' abbreviations (approve_pr, get_pr_diff) with 'pull_request' forms (create_pull_request, list_pull_requests).

    Tool Count2/5

    With 62 tools, the surface is very heavy for a single MCP server and exceeds the range where an agent can easily scan and choose tools. While the breadth reflects Bitbucket's API, the set could likely be consolidated into fewer operation groups.

    Completeness3/5

    Coverage is strong in several areas: repositories, PR review/merge actions, pipeline variables, webhooks, tags, and permissions have near-complete lifecycles. However, notable gaps remain, including branch creation/deletion, file write/update operations, project write operations, and PR metadata updates.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that provides tools for interacting with the Bitbucket API, supporting both Bitbucket Cloud and Bitbucket Server, enabling pull request, branch, file, code review, and search operations.
      19
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server for Atlassian Bitbucket Server / Data Center, providing 66 tools for managing projects, repositories, branches, files, commits, pull requests, and code search with opt-in deletion operations.
      57
      284 PyPI
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      MCP server for the Bitbucket Cloud REST API v2.0, providing 32 tools across 5 toolsets for repository management, pull requests, issues, pipelines, and more with safety controls and LLM-optimized output.
      33
      33 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A comprehensive MCP server for Bitbucket integration, providing 27 tools to manage repositories, pull requests, branches, commits, issues, and workspaces.
      MIT