Skip to main content
Glama
bitbucket-mcp

bitbucket-mcp

by lawp09

Bitbucket MCP Server (Python)

PyPI Python CI CodeQL License: MIT

Connect Claude Code, OpenAI Codex, Cursor, VS Code (GitHub Copilot), and any MCP-compatible AI assistant to your Bitbucket Cloud repositories. Review pull requests, monitor pipelines, and manage your code — all through natural language.

Features

  • 60+ MCP tools — repositories, pull requests, comments, tasks, diffs, pipelines (runtime + config), build statuses, reviewers, draft PRs, batch review, issue tracker, commits, source/file browsing

  • MCP 2025 tool annotations — every tool advertises readOnlyHint / destructiveHint / idempotentHint / openWorldHint + a human-readable title, so clients (Claude Code, Cursor) auto-include read-only tools and warn before destructive operations

  • Slim responses — stripped API noise for lower LLM token usage

  • Configurable — enable/disable tools via configs/tools.json or BITBUCKET_TOOLS_CONFIG env var

  • Secure credentials — environment variables or system keychain

Related MCP server: Atlassian Bitbucket MCP Server

Quick Start

1. Install

The recommended way to run the server is via uvx (zero install, isolated environment):

# Always latest version
uvx --from bitbucket-mcp-py bitbucket-mcp

# Pin a specific version
uvx --from bitbucket-mcp-py==1.8.1 bitbucket-mcp

Why --from? The PyPI package is bitbucket-mcp-py but the command entry point is bitbucket-mcp. The --from flag tells uvx which package to install.

Mode

Command

Best for

pip global

pip install bitbucket-mcp-py

Simple, persistent install

Local dev

pip install -e . in project dir

Contributing to the project

Docker

See Docker section

Container-based workflows

2. Configure credentials

Set the following environment variables — in your MCP client's env block, as shown above, or in the system keychain (see Credentials):

Variable

Description

BITBUCKET_USERNAME

Your Bitbucket email

BITBUCKET_TOKEN

Your Bitbucket API token

BITBUCKET_WORKSPACE

Your workspace slug

Get your API token at: https://id.atlassian.com/manage-profile/security/api-tokens

⚠️ Use a scoped token, not a global one. When creating the token, select specific scopes (e.g. Repositories: Read, Pull requests: Read/Write). Global tokens without explicit scopes do not work with this MCP server.

3. Configure your AI assistant

Option A — CLI (fastest):

claude mcp add bitbucket-mcp \
  -e BITBUCKET_USERNAME=your-email@example.com \
  -e BITBUCKET_TOKEN=your-api-token \
  -e BITBUCKET_WORKSPACE=your-workspace \
  -- uvx --from bitbucket-mcp-py bitbucket-mcp

Option B — JSON config (~/.claude.json or project .mcp.json):

{
  "mcpServers": {
    "bitbucket-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-email@example.com",
        "BITBUCKET_TOKEN": "your-api-token",
        "BITBUCKET_WORKSPACE": "your-workspace"
      }
    }
  }
}

OpenAI Codex

Option A — CLI (fastest):

codex mcp add bitbucket-mcp \
  --env BITBUCKET_USERNAME=your-email@example.com \
  --env BITBUCKET_TOKEN=your-api-token \
  --env BITBUCKET_WORKSPACE=your-workspace \
  -- uvx --from bitbucket-mcp-py bitbucket-mcp

Option B — TOML config (~/.codex/config.toml):

[mcp_servers.bitbucket-mcp]
command = "uvx"
args = ["--from", "bitbucket-mcp-py", "bitbucket-mcp"]
env = { BITBUCKET_USERNAME = "your-email@example.com", BITBUCKET_TOKEN = "your-api-token", BITBUCKET_WORKSPACE = "your-workspace" }

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "uvx",
      "args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-email@example.com",
        "BITBUCKET_TOKEN": "your-api-token",
        "BITBUCKET_WORKSPACE": "your-workspace"
      }
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json (workspace) or ~/Library/Application Support/Code/User/mcp.json (global, macOS):

{
  "servers": {
    "bitbucket-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "bitbucket-mcp-py", "bitbucket-mcp"],
      "env": {
        "BITBUCKET_USERNAME": "your-email@example.com",
        "BITBUCKET_TOKEN": "your-api-token",
        "BITBUCKET_WORKSPACE": "your-workspace"
      }
    }
  }
}

Available Tools

Category

Tools

Repositories

list_repositories, get_repository, get_repository_tags

Pull Requests

get_pull_requests, get_pull_request, create_pull_request, update_pull_request, approve_pull_request, unapprove_pull_request, request_changes_pull_request, unrequest_changes_pull_request, decline_pull_request, merge_pull_request

Comments

get_pull_request_comments, add_pull_request_comment, get_pull_request_comment, update_pull_request_comment, delete_pull_request_comment, resolve_pull_request_comment, reopen_pull_request_comment, get_pull_request_activity

Tasks PR

get_pull_request_tasks, get_pull_request_task, create_pull_request_task, update_pull_request_task, delete_pull_request_task

Diff / Review

get_pull_request_diff, get_pull_request_patch, get_pull_request_diffstat, get_pull_request_commits

PR Discovery

get_pull_requests_pending_review

Build / CI

get_pull_request_statuses, get_commit_statuses

Pipelines

list_pipeline_runs, get_pipeline_run, get_pipeline_steps, get_pipeline_step_logs, run_pipeline, stop_pipeline

Pipelines Config

get_pipeline_config, list_pipeline_variables, get_pipeline_variable, create_pipeline_variable, update_pipeline_variable, delete_pipeline_variable, list_pipeline_schedules, get_pipeline_schedule, list_pipeline_schedule_executions, create_pipeline_schedule, update_pipeline_schedule, delete_pipeline_schedule, list_pipeline_caches, delete_pipeline_cache

Reviewers

get_effective_default_reviewers, suggest_pull_request_reviewers

Draft PR

create_draft_pull_request, publish_draft_pull_request, convert_pull_request_to_draft

Batch Review

submit_pull_request_batch_review

Review Summary

get_pull_request_review_summary

Issues

list_issues, get_issue, create_issue, update_issue, delete_issue, get_issue_comments, get_issue_comment, add_issue_comment, update_issue_comment, delete_issue_comment

Commits

list_commits, get_commit, get_commit_comments, get_commit_comment, add_commit_comment

Source

get_file_content, list_directory

Deployments

list_environments, get_environment, create_environment, delete_environment, list_deployments, get_deployment, list_deployment_variables, create_deployment_variable, update_deployment_variable, delete_deployment_variable

Branch Restrictions

list_branch_restrictions, get_branch_restriction, create_branch_restriction, update_branch_restriction, delete_branch_restriction

Workspace

list_workspace_members, get_workspace_member, list_workspace_permissions, list_repository_permissions

Disabled by default: merge_pull_request (safety), stop_pipeline (safety), get_pull_request_patch (git am format — not useful for AI review), convert_pull_request_to_draft (not supported by Bitbucket API), delete_issue (safety), delete_issue_comment (safety), add_commit_comment (write op), create_pipeline_variable / update_pipeline_variable / delete_pipeline_variable (write ops), create_pipeline_schedule / update_pipeline_schedule / delete_pipeline_schedule (write ops), delete_pipeline_cache (safety), create_environment / delete_environment / create_deployment_variable / update_deployment_variable / delete_deployment_variable (write ops), create_branch_restriction / update_branch_restriction / delete_branch_restriction (write ops). Enable in configs/tools.json.

Governance scopes — Branch restriction read tools need the repository scope (repository:admin may be required depending on repo config); the write tools need repository:admin. Workspace member/permission tools need the account scope. The /members endpoint lists users without a per-user permission (use list_workspace_permissions for roles).

Deployments scopes — the read tools (list_environments, get_environment, list_deployments, get_deployment, list_deployment_variables) need the deployment scope; the write tools need deployment:write. Bitbucket has no server-side filter for deployments by environment (BCLOUD-18729) — filter on the environment field of list_deployments instead. There is no update_environment tool: Bitbucket exposes no PUT for environments (only POST .../changes for locking).

Custom tool configuration

By default the server reads configs/tools.json bundled with the package. You can point to a custom file at runtime without rebuilding:

export BITBUCKET_TOOLS_CONFIG=/path/to/my-tools.json

Fallback chain (first match wins):

  1. BITBUCKET_TOOLS_CONFIG environment variable

  2. Built-in configs/tools.json

Fail-safe behaviour — If BITBUCKET_TOOLS_CONFIG is set but the file is missing or contains invalid JSON, the server raises an error on startup (explicit failure rather than silently ignoring the override). If the built-in default is missing, all tools are enabled.

Token tip — get_pull_request_diff accepts an optional path parameter to filter the diff to a single file, reducing token usage by ~95% on large PRs:

get_pull_request_diff(repo_slug, pull_request_id, path="src/services/myService.ts")

Token tip — get_pipeline_step_logs returns only the trailing 100 KiB of a step log by default (raw logs run to several MB on long steps). The response carries a truncated flag; widen the window with the absolute byte range start / end, or pass max_bytes=null for the whole log. Pass a service container UUID as log_uuid to read that service's log instead of the build container's. This endpoint needs a real pipeline UUID — resolve it via get_pipeline_run if you only have a build number.

get_pipeline_step_logs(repo_slug, pipeline_uuid="{adab6a1f-...}", step_uuid="{84fc6465-...}")

MCP Prompts

The server also exposes MCP Prompts — parameterised templates that compatible clients (Claude Code, Cursor, ...) surface as slash commands. Instead of remembering tool names, you invoke a prompt and the assistant orchestrates the right tools for you. They appear in the client's prompt picker (prompts/list).

Prompt

Arguments

What it does

review_pull_request

repo_slug, pull_request_id

Full AI review: metadata → diffstat → diff → comments → tasks, then Summary / Risk / Quality / Security / Recommendation

debug_pipeline_failure

repo_slug, pipeline_uuid

Diagnose a failed pipeline: run → steps → failed-step logs, then Root cause / Failed step / Error / Fix

summarize_repository

repo_slug

Repo overview: info → recent commits → open PRs → CI → issues, then Purpose / Activity / Health / Contributors

onboard_reviewer

repo_slug, pull_request_id

Help a new reviewer: PR context → commits → diff → review history, then Context / Changes / Review-so-far / Focus

Prompts are enabled/disabled in configs/tools.json under the top-level prompts key (separate from tools).

Credentials

Put them in the env block of your MCP client configuration, as in the examples above, or export them in the shell that launches the server.

Option 2: System keychain (most secure)

pip install 'bitbucket-mcp-py[keyring]'
python3 -c "import keyring; keyring.set_password('bitbucket-mcp', 'bitbucket_token', 'YOUR_TOKEN')"

About .env: the server itself never reads a .env file. .env.example is a template for containers, which load it with --env-file .env or env_file: (the Docker, Makefile and docker-compose.yml setups); with uvx or python -m src.main, use option 1 or 2.

Docker (Alternative)

If you prefer running the server in a container:

docker build -t bitbucket-mcp-py .
docker run -d --name bitbucket-mcp --env-file .env bitbucket-mcp-py

Then configure your AI assistant to use docker exec:

{
  "mcpServers": {
    "bitbucket-mcp": {
      "command": "docker",
      "args": ["exec", "-i", "bitbucket-mcp", "python", "-m", "src.main", "--transport", "stdio"]
    }
  }
}

Transports

The server speaks stdio by default (the standard transport for local MCP clients). For a network deployment it also supports Streamable HTTP (MCP spec 2025-03-26):

# Streamable HTTP on localhost:8080
python -m src.main --transport http --host 127.0.0.1 --port 8080

Clients connect to http://<host>:<port>/mcp (e.g. http://localhost:8080/mcp).

⚠️ --host defaults to 0.0.0.0, every interface. Without --multi-tenant the server has no authentication of its own: anyone who can reach the port acts with your Bitbucket token. Bind to 127.0.0.1 unless the port sits behind an authenticating proxy.

--transport sse (legacy Server-Sent Events) is still accepted but deprecated — it emits a DeprecationWarning. Prefer --transport http.

Stateless HTTP (horizontal scaling / serverless)

--stateless runs the Streamable HTTP transport without server-side sessions: no Mcp-Session-Id, a fresh transport per HTTP request. Any instance behind a load balancer can serve any request — no sticky sessions required.

python -m src.main --transport http --host 0.0.0.0 --port 8080 --stateless

⚠️ Single-tenant by default. Without --multi-tenant the server serves its own process-wide Bitbucket token to every caller. Deploy it on a private network or behind an authenticated reverse proxy — or use multi-tenant mode, where each caller brings their own credentials.

--stateless requires --transport http (it is rejected on stdio and on the legacy sse, whose app ignores the setting). It also forces a single JSON response instead of an SSE stream, because edge/serverless runtimes cannot hold a streaming response open — there is currently no way to combine stateless with streaming.

A liveness endpoint is exposed on both HTTP transports for load balancers:

curl http://localhost:8080/healthz    # {"status": "ok"}

In a container — the image's default CMD keeps it idle for exec-based stdio usage, so server mode is started by overriding the command:

podman run -d --name bitbucket-mcp-http -p 127.0.0.1:8000:8000 --env-file .env bitbucket-mcp-py \
  python -m src.main --transport http --host 0.0.0.0 --port 8000 --stateless

Inside the container --host 0.0.0.0 is required; -p 127.0.0.1:8000:8000 is what keeps the published port off the network, since this single-tenant server answers every caller with the .env token.

Works identically with docker run. The image exposes port 8000.

Environment variable

Default

Purpose

BITBUCKET_ALLOWED_HOSTS

(unset)

Comma-separated Host allowlist. Enables DNS-rebinding protection when set.

BITBUCKET_ALLOWED_ORIGINS

(unset)

Comma-separated Origin allowlist.

BITBUCKET_MAX_PAGES_HARD_CAP

10

Max pages a single tool call may fetch in stateless mode. Beyond it the response carries truncated: true — never a silent cut.

The two allowlists must be set together: an empty Host allowlist rejects every request (421), and an empty Origin allowlist rejects every browser client (403). Setting only one is refused at startup rather than silently locking the server out.

export BITBUCKET_ALLOWED_HOSTS="mcp.example.com"
export BITBUCKET_ALLOWED_ORIGINS="https://app.example.com"

With neither allowlist set, no DNS-rebinding protection is applied — appropriate for a server reached through a private network or a trusted proxy. Set them as soon as the server is exposed on a real hostname.

Multi-tenant HTTP (per-request credentials)

By default an HTTP deployment is single-tenant: every caller acts with the process-wide Bitbucket token. --multi-tenant changes that — each request carries the caller's own Bitbucket OAuth access token as Authorization: Bearer, and runs under that identity. The server holds no Bitbucket credential of its own.

BITBUCKET_RESOURCE_SERVER_URL=https://mcp.example.com/mcp \
  python -m src.main --transport http --host 0.0.0.0 --port 8080 --stateless --multi-tenant

The token is verified against GET /2.0/user, which yields the caller's account_id and default workspace; the same token is then reused for the downstream API calls, so no credential is ever stored or mapped. Unauthenticated requests get a 401 with a WWW-Authenticate challenge pointing at /.well-known/oauth-protected-resource/mcp. Since Bitbucket publishes no OAuth metadata, the server serves /.well-known/oauth-authorization-server itself, pointing at Bitbucket's endpoints — which is what lets it be added to claude.ai as a custom connector (Bitbucket sign-in through the Atlassian login); setup, what was verified and the residual risks in docs/deployment-modes.md.

What this buys you:

  • Isolation — one Bitbucket client per (identity, workspace); two callers never share one, and there is no process token to fall back on.

  • workspace=None means your workspace — resolved from the caller's memberships, never from BITBUCKET_WORKSPACE. With zero or several memberships there is no default and calls must name their workspace.

  • Audit trail — every call is logged to the bitbucket_mcp.audit logger with the tool, the account_id and the workspace. Never credentials.

  • Tighter defaults — tools flagged destructiveHint are refused unless explicitly enabled. The other write tools (comment, approve, create a pull request, run a pipeline…) stay available to every caller: set BITBUCKET_MULTITENANT_READ_ONLY=1 for a first deployment.

Environment variable

Default

Purpose

BITBUCKET_RESOURCE_SERVER_URL

(required)

Public URL of the MCP endpoint, e.g. https://mcp.example.com/mcp — the OAuth resource identifier

BITBUCKET_OAUTH_ISSUER_URL

(this server's origin)

Advertised authorization server. Leave unset: the server then publishes the OAuth metadata itself

BITBUCKET_CLIENT_CACHE_SIZE / _TTL

128 / 900

Bound on the per-identity client cache (LRU + TTL, seconds). TTL 0 builds a fresh client per request

BITBUCKET_TOKEN_CACHE_SIZE / _TTL

256 / 300

Bound on cached token verifications. The TTL is the revocation window — set it to 0 to verify every request

BITBUCKET_MULTITENANT_ALLOW_DESTRUCTIVE

(off)

Allow the destructive tools that configs/tools.json enables — by default decline_pull_request, delete_pull_request_comment, delete_pull_request_task; merge, stop_pipeline and delete_issue* stay disabled there

BITBUCKET_MULTITENANT_READ_ONLY

(off)

Expose read-only tools only

BITBUCKET_MULTITENANT_ALLOWED_WORKSPACES

(unset: any account)

Comma-separated workspace slugs — only their members are admitted, and no call can reach another workspace. Set it on any public endpoint

Spec deviation: the caller's Bitbucket token is accepted without an audience check and forwarded upstream as-is, which the MCP authorization spec (2025-11-25) forbids — trade-offs and residual risks in docs/deployment-modes.md.

Not supported in this mode: Bitbucket Repository/Workspace Access Tokens — they are not bound to a user account, so no identity can be derived. Use single-tenant HTTP for that. Bearer tokens require TLS: terminate HTTPS in front of the server.

stdio is unaffected — it stays single-user with environment variables, exactly as documented above.

See docs/deployment-modes.md for the full matrix of the three deployment modes and the threat model of each.

Kubernetes (k3s, datacenter, GKE)

Each release publishes a multi-arch image (ghcr.io/lawp09/bitbucket-mcp) and a Helm chart (oci://ghcr.io/lawp09/charts/bitbucket-mcp) that deploy the multi-tenant HTTP mode; publicUrl is the only required value:

helm upgrade --install bitbucket-mcp oci://ghcr.io/lawp09/charts/bitbucket-mcp --version <version> \
  -n bitbucket-mcp --create-namespace --set publicUrl=https://mcp.example.com

Ingress, GKE and network-policy notes: docs/deployment-kubernetes.md.

Development

# Install dev dependencies
uv sync --extra dev

# Run tests
uv run pytest tests/ -v

# Run specific test
uv run pytest tests/test_client.py -v

Requirements

  • Python 3.12+

  • Bitbucket API token

License

MIT

References

Available Tools

74 tools
add_issue_commentAdd Issue CommentA

Add a comment to an issue.

Args: repo_slug: Repository slug issue_id: Issue ID content: Comment content in markdown workspace: Workspace name (optional, defaults to configured workspace)

Returns: Created issue comment details. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Inputs: content (required), issue_id (required), repo_slug (required), workspace. Returns: result

add_pull_request_commentAdd Pull Request CommentA

Add a comment to a pull request (general or inline).

Args: repo_slug: Repository slug pull_request_id: Pull request ID content: Comment content in markdown format workspace: Workspace name (optional, defaults to configured workspace) inline_path: Path to the file in the repository (for inline comments) inline_from: Line number in the old version of the file (for deleted or modified lines) inline_to: Line number in the new version of the file (for added or modified lines) pending: Whether to create this comment as a pending comment (draft state) (default: False) parent_id: ID of the comment to reply to (creates a threaded reply)

Returns: Created comment details

Inputs: content (required), repo_slug (required), pull_request_id (required), pending, +5 more. Returns: result

approve_pull_requestApprove Pull RequestA
Idempotent

Approve a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Approval details

Inputs: repo_slug (required), pull_request_id (required), workspace. Returns: result

create_draft_pull_requestCreate Draft Pull RequestA

Create a new pull request as draft. Draft PRs are not ready for review.

Args: repo_slug: Repository slug title: Pull request title description: Pull request description source_branch: Source branch name target_branch: Target branch name workspace: Workspace name (optional, defaults to configured workspace) reviewers: List of reviewer UUIDs (optional)

Returns: Created draft pull request details

Inputs: title (required), repo_slug (required), description (required), source_branch (required), +3 more. Returns: result

create_issueCreate IssueB

Create a new issue in a repository's issue tracker.

Args: repo_slug: Repository slug title: Issue title content: Issue description in markdown (optional) kind: Issue kind: bug, enhancement, proposal, task (optional) priority: Issue priority: trivial, minor, major, critical, blocker (optional) assignee: Assignee uuid (optional) state: Initial state (optional, e.g. new, open) workspace: Workspace name (optional, defaults to configured workspace)

Returns: Created issue details. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Inputs: title (required), repo_slug (required), kind, state, +4 more. Returns: result

create_pull_requestCreate Pull RequestB

Create a new pull request.

Args: repo_slug: Repository slug title: Pull request title description: Pull request description source_branch: Source branch name target_branch: Target branch name workspace: Workspace name (optional, defaults to configured workspace) reviewers: List of reviewer UUIDs (optional) draft: Whether to create the pull request as a draft (default: False)

Returns: Created pull request details

Inputs: title (required), repo_slug (required), description (required), source_branch (required), +4 more. Returns: result

create_pull_request_taskCreate Pull Request TaskB

Create a task on a pull request, optionally linked to a specific comment.

Args: repo_slug: Repository slug pull_request_id: Pull request ID content: Task content in markdown format comment_id: Optional comment ID to link the task to a specific comment workspace: Workspace name (optional, defaults to configured workspace)

Returns: Created task details

Inputs: content (required), repo_slug (required), pull_request_id (required), workspace, +1 more. Returns: result

decline_pull_requestDecline Pull RequestB
Destructive

Decline a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) message: Reason for declining (optional)

Returns: Updated pull request details

Inputs: repo_slug (required), pull_request_id (required), message, workspace. Returns: result

delete_pull_request_commentDelete Pull Request CommentB
DestructiveIdempotent

Delete a comment on a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID comment_id: Comment ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Success message

Inputs: repo_slug (required), comment_id (required), pull_request_id (required), workspace. Returns: result

delete_pull_request_taskDelete Pull Request TaskB
DestructiveIdempotent

Delete a task on a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID task_id: Task ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Success message

Inputs: task_id (required), repo_slug (required), pull_request_id (required), workspace. Returns: result

get_branch_restrictionGet Branch RestrictionA
Read-onlyIdempotent

Get a single branch restriction.

Args: repo_slug: Repository slug restriction_id: Numeric restriction id workspace: Workspace name (optional, defaults to configured workspace)

Returns: Branch restriction details

Inputs: repo_slug (required), restriction_id (required), workspace. Returns: result

get_commitGet CommitA
Read-onlyIdempotent

Get details for a single commit.

Args: repo_slug: Repository slug commit: Commit hash (a simple branch/tag name also works) workspace: Workspace name (optional, defaults to configured workspace)

Returns: Commit details

Inputs: commit (required), repo_slug (required), workspace. Returns: result

get_commit_commentGet Commit CommentA
Read-onlyIdempotent

Get a specific comment on a commit.

Args: repo_slug: Repository slug commit: Commit hash comment_id: Comment ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Commit comment details

Inputs: commit (required), repo_slug (required), comment_id (required), workspace. Returns: result

get_commit_commentsGet Commit CommentsA
Read-onlyIdempotent

List comments on a commit with pagination support.

Args: repo_slug: Repository slug commit: Commit hash workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of commit comments

Inputs: commit (required), repo_slug (required), max_pages, page_size, +1 more. Returns: result

get_commit_statusesGet Commit StatusesA
Read-onlyIdempotent

Get build/CI statuses for a specific commit (e.g. Jenkins, CI/CD).

Use this to check the Jenkins build status for any branch commit without needing to create a Pull Request first.

Args: repo_slug: Repository slug commit_hash: Commit hash (full or short, e.g. "abc1234") workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: List of build statuses (Jenkins, CI/CD, tests, etc.) Each status contains: - state: SUCCESSFUL, FAILED, INPROGRESS, STOPPED - key: Unique identifier for the build - name: Build name/description - description: Build result description - url: Link to the Jenkins build details - created_on: Timestamp of the status - updated_on: Timestamp of last update

Note: Requires Jenkins Bitbucket Build Status Notifier plugin to post statuses. Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), commit_hash (required), max_pages, page_size, +1 more. Returns: result

get_deploymentGet DeploymentA
Read-onlyIdempotent

Get a single deployment (state, environment, deployed commit).

Requires the deployment OAuth scope.

Args: repo_slug: Repository slug deployment_uuid: Deployment UUID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Deployment details (state, status, environment, commit)

Inputs: repo_slug (required), deployment_uuid (required), workspace. Returns: result

get_effective_default_reviewersGet Default ReviewersA
Read-onlyIdempotent

Get effective default reviewers for a repository.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: List of default reviewers for the repository

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

get_environmentGet EnvironmentB
Read-onlyIdempotent

Get a single deployment environment.

Requires the deployment OAuth scope.

Args: repo_slug: Repository slug environment_uuid: Environment UUID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Environment details

Inputs: repo_slug (required), environment_uuid (required), workspace. Returns: result

get_file_contentGet File ContentA
Read-onlyIdempotent

Get the raw text content of a file at a given commit or branch.

A metadata pre-check rejects directories, oversized files (> max_bytes) and binary files before downloading, to protect the token budget.

Args: repo_slug: Repository slug commit: Commit hash (a simple branch/tag name also works; a branch name containing '/' is ambiguous on /src — resolve it to a hash first) path: File path within the repository workspace: Workspace name (optional, defaults to configured workspace) max_bytes: Maximum file size to return (default: 262144 = 256 KiB)

Returns: File content as text

Inputs: path (required), commit (required), repo_slug (required), max_bytes, +1 more. Returns: result

get_issueGet IssueA
Read-onlyIdempotent

Get details for a specific issue.

Args: repo_slug: Repository slug issue_id: Issue ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Issue details. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Inputs: issue_id (required), repo_slug (required), workspace. Returns: result

get_issue_commentGet Issue CommentA
Read-onlyIdempotent

Get a specific comment on an issue.

Args: repo_slug: Repository slug issue_id: Issue ID comment_id: Comment ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Issue comment details. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Inputs: issue_id (required), repo_slug (required), comment_id (required), workspace. Returns: result

get_issue_commentsGet Issue CommentsA
Read-onlyIdempotent

List comments on an issue with pagination support.

Args: repo_slug: Repository slug issue_id: Issue ID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10) max_items: Maximum total items to fetch (default: None)

Returns: Paginated list of issue comments. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: issue_id (required), repo_slug (required), max_items, max_pages, +2 more. Returns: result

get_pipeline_configGet Pipeline ConfigA
Read-onlyIdempotent

Get the repository pipelines configuration (enabled flag, next build number).

Note: this endpoint requires the admin:repository scope. A read-only token receives a 403 listing the missing privilege.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace)

Returns: Pipelines configuration (enabled, next_build_number)

Inputs: repo_slug (required), workspace. Returns: result

get_pipeline_runGet Pipeline RunA
Read-onlyIdempotent

Get details for a specific pipeline run.

Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Pipeline run details

Inputs: repo_slug (required), pipeline_uuid (required), workspace. Returns: result

get_pipeline_scheduleGet Pipeline ScheduleA
Read-onlyIdempotent

Get a single pipeline schedule.

Args: repo_slug: Repository slug schedule_uuid: Schedule UUID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Pipeline schedule

Inputs: repo_slug (required), schedule_uuid (required), workspace. Returns: result

get_pipeline_step_logsGet Pipeline Step LogsA
Read-onlyIdempotent

Get logs for a specific pipeline step.

Raw step logs are routinely multi-MB, so only the last max_bytes (100 KiB by default) are returned. Check the truncated flag in the response and page through the rest with start/end if you need more.

Reading the tail costs two requests: one to establish the log's size, one to fetch the tail. Passing an explicit start/end window skips the first.

Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID, e.g. "{adab6a1f-...}". Unlike get_pipeline_run, this endpoint is not documented to accept a build number — resolve the UUID first via get_pipeline_run if you only have a number. step_uuid: Step UUID (from get_pipeline_steps) workspace: Workspace name (optional, defaults to configured workspace) log_uuid: Optional log UUID. Omit for the main build container; pass a service container UUID to read that service's log instead. start: First byte to return (absolute, inclusive) end: Last byte to return (absolute, inclusive). start/end are an absolute byte window, not a "last N bytes" convention. max_bytes: Size of the trailing slice returned when no start/end is given (default: 100 KiB). Pass null for the whole log.

Returns: Dict with the log content, whether it was truncated, returned_bytes and total_bytes (null when the server did not disclose the full size)

Inputs: repo_slug (required), step_uuid (required), pipeline_uuid (required), end, +4 more. Returns: result

get_pipeline_stepsGet Pipeline StepsA
Read-onlyIdempotent

List steps for a pipeline run with pagination support.

Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: List of pipeline steps

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), pipeline_uuid (required), max_pages, page_size, +1 more. Returns: result

get_pipeline_variableGet Pipeline VariableA
Read-onlyIdempotent

Get a single repository-level pipeline variable.

Args: repo_slug: Repository slug variable_uuid: Variable UUID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Pipeline variable (value is null if secured)

Inputs: repo_slug (required), variable_uuid (required), workspace. Returns: result

get_pull_requestGet Pull RequestA
Read-onlyIdempotent

Get details for a specific pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Pull request details with comment statistics: - comment_stats: Object containing: - total (int): Total number of comments - resolved (int): Number of resolved comments - unresolved (int): Number of unresolved comments - source_commit / destination_commit (string or null): full 40-character hash of the PR head and of the destination branch tip, unlike the 12-character hashes elsewhere. null when the commit cannot be resolved (e.g. a deleted source branch, or a fork outside the allowed workspaces). Only this tool returns them. - participants[].state (string or null): "approved", "changes_requested" or null — the participant's current review status

Inputs: repo_slug (required), pull_request_id (required), workspace. Returns: result

get_pull_request_activityGet Pull Request ActivityA
Read-onlyIdempotent

Get activity log for a pull request with pagination support.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Activity log with all events. Each entry has a type: update, comment, approval, changes_requested (date + user) or unknown. The log is history: a participant's current review status is participants[].state from get_pull_request. Comment objects enriched with resolution status: - is_resolved (bool): True if comment is resolved - resolved_by (string or null): User display name who resolved the comment - resolved_on (string or null): Timestamp when comment was resolved

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), pull_request_id (required), max_pages, page_size, +1 more. Returns: result

get_pull_request_commentGet Pull Request CommentA
Read-onlyIdempotent

Get a specific comment on a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID comment_id: Comment ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Comment details with resolution status

Inputs: repo_slug (required), comment_id (required), pull_request_id (required), workspace. Returns: result

get_pull_request_commentsGet Pull Request CommentsA
Read-onlyIdempotent

List comments on a pull request with pagination support.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) unresolved_only: If true, returns only unresolved comments (default: False) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: List of comments enriched with resolution status: - is_resolved (bool): True if comment is resolved - resolved_by (string or null): User display name who resolved the comment - resolved_on (string or null): Timestamp when comment was resolved

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), pull_request_id (required), max_pages, page_size, +2 more. Returns: result

get_pull_request_commitsGet Pull Request CommitsA
Read-onlyIdempotent

Get commits on a pull request with pagination support.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: List of commits

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), pull_request_id (required), max_pages, page_size, +1 more. Returns: result

get_pull_request_diffGet Pull Request DiffA
Read-onlyIdempotent

Get diff for a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) path: Filter diff to a specific file path to reduce token usage (optional). Example: "src/middlewares/authorizationMiddleware.ts"

Returns: Unified diff as string

Inputs: repo_slug (required), pull_request_id (required), path, workspace. Returns: result

get_pull_request_diffstatGet Pull Request DiffstatA
Read-onlyIdempotent

Get file modification statistics for a pull request with pagination support.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Statistics with lines added/removed per file Each file entry contains: - status: modified, added, removed, renamed - lines_added: Number of lines added - lines_removed: Number of lines removed - new.path: File path after changes

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), pull_request_id (required), max_pages, page_size, +1 more. Returns: result

get_pull_request_review_summaryGet Pull Request Review SummaryA
Read-onlyIdempotent

Get a comprehensive review summary for a pull request.

Fetches PR details first, then aggregates diffstat, unresolved comments, and CI statuses in parallel for efficient AI-assisted code review.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Structured summary with pr details, diffstat, unresolved comments, CI statuses, and review readiness assessment. review_readiness: merged | declined | draft | ci_failing | ci_pending | has_unresolved_comments | ready

Inputs: repo_slug (required), pull_request_id (required), workspace. Returns: result

get_pull_requestsGet Pull RequestsA
Read-onlyIdempotent

Get pull requests for a repository with pagination support.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) state: Pull request state (OPEN, MERGED, DECLINED, SUPERSEDED) (default: OPEN) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of pull requests

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), state, max_pages, page_size, +1 more. Returns: result

get_pull_requests_pending_reviewList Pull Requests Pending ReviewA
Read-onlyIdempotent

Get open pull requests where the current user is a reviewer.

Use this to find PRs that need your review attention.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of pull requests pending your review

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

get_pull_request_statusesGet Pull Request StatusesA
Read-onlyIdempotent

Get build/CI statuses for a pull request with pagination support.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: List of build statuses (Jenkins, CI/CD, tests, etc.) Each status contains: - state: SUCCESSFUL, FAILED, INPROGRESS, STOPPED - key: Unique identifier for the build - name: Build name/description - url: Link to the build details - created_on: Timestamp of the status

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), pull_request_id (required), max_pages, page_size, +1 more. Returns: result

get_pull_request_taskGet Pull Request TaskA
Read-onlyIdempotent

Get a specific task on a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID task_id: Task ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Task details with state, content, creator, resolution info

Inputs: task_id (required), repo_slug (required), pull_request_id (required), workspace. Returns: result

get_pull_request_tasksGet Pull Request TasksA
Read-onlyIdempotent

List tasks on a pull request with pagination support.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10, max recommended: 100) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of tasks with state, content, creator info

Inputs: repo_slug (required), pull_request_id (required), max_pages, page_size, +1 more. Returns: result

get_repositoryGet RepositoryA
Read-onlyIdempotent

Get repository details.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace)

Returns: Repository information

Inputs: repo_slug (required), workspace. Returns: result

get_repository_tagsGet Repository TagsA
Read-onlyIdempotent

List repository tags ordered by most recent target date.

Note: "target date" is the date of the tag's target commit, not the tag creation date — a tag placed on an old commit will not sort first.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 10) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of repository tags

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

get_workspace_memberGet Workspace MemberA
Read-onlyIdempotent

Get a single workspace member.

Requires the account scope.

Args: member_id: Member account_id or brace-wrapped uuid (not a username) workspace: Workspace name (optional, defaults to configured workspace)

Returns: Workspace membership details

Inputs: member_id (required), workspace. Returns: result

list_branch_restrictionsList Branch RestrictionsA
Read-onlyIdempotent

List branch restrictions (branch protection rules) for a repository.

Requires the repository scope (or repository:admin depending on the repo configuration).

Args: repo_slug: Repository slug kind: Optional filter by restriction type (e.g. push, require_approvals_to_merge) workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of branch restrictions

Inputs: repo_slug (required), kind, max_pages, page_size, +1 more. Returns: result

list_commitsList CommitsA
Read-onlyIdempotent

List commits for a repository, optionally scoped to a revision or path.

Args: repo_slug: Repository slug revision: Branch, tag or commit hash to start from (optional; defaults to all branches). A branch name containing '/' is ambiguous here — resolve it to a commit hash first (e.g. via get_branch) if listing fails. workspace: Workspace name (optional, defaults to configured workspace) path: Restrict history to commits touching this file/directory path include: Only commits reachable from this ref exclude: Exclude commits reachable from this ref page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of commits

Inputs: repo_slug (required), path, exclude, include, +4 more. Returns: result

list_deploymentsList DeploymentsA
Read-onlyIdempotent

List deployments for a repository (deployment history, most recent first).

The Bitbucket API cannot filter deployments by environment server-side; filter on the environment field of the returned items instead. Requires the deployment OAuth scope.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of deployments

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

list_deployment_variablesList Deployment VariablesA
Read-onlyIdempotent

List the variables of a deployment environment.

Secured variables never expose their value (returned as null). Requires the deployment OAuth scope.

Args: repo_slug: Repository slug environment_uuid: Environment UUID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of deployment variables

Inputs: repo_slug (required), environment_uuid (required), max_pages, page_size, +1 more. Returns: result

list_directoryList DirectoryA
Read-onlyIdempotent

List the entries (files and sub-directories) of a directory at a commit/branch.

Args: repo_slug: Repository slug commit: Commit hash (a simple branch/tag name also works) path: Directory path within the repository (empty = repository root) workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 50) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated directory listing (path, type, size, mimetype per entry)

Inputs: commit (required), repo_slug (required), path, max_pages, +2 more. Returns: result

list_environmentsList EnvironmentsA
Read-onlyIdempotent

List deployment environments (staging, production, etc.) for a repository.

Requires the deployment OAuth scope.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of environments

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

list_issuesList IssuesA
Read-onlyIdempotent

List issues in a repository's issue tracker, with filtering and pagination.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) state: Filter by state (new, open, resolved, on hold, invalid, duplicate, wontfix, closed) kind: Filter by kind (bug, enhancement, proposal, task) priority: Filter by priority (trivial, minor, major, critical, blocker) assignee: Filter by assignee uuid q: Raw BBQL query, combined with the other filters using AND (e.g. 'created_on > 2024-01-01'). Passed through verbatim (not escaped). sort: Sort field (default: -created_on for most recent first) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10) max_items: Maximum total items to fetch (default: None)

Returns: Paginated list of issues. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), q, kind, sort, +7 more. Returns: result

list_pipeline_cachesList Pipeline CachesA
Read-onlyIdempotent

List pipeline caches for a repository.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of pipeline caches

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

list_pipeline_runsList Pipeline RunsA
Read-onlyIdempotent

List pipeline runs for a repository with pagination support.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) status: Filter pipelines by status (PENDING, IN_PROGRESS, SUCCESSFUL, FAILED, ERROR, STOPPED) target_branch: Filter pipelines by target branch page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: List of pipeline runs

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: repo_slug (required), status, max_pages, page_size, +2 more. Returns: result

list_pipeline_schedule_executionsList Schedule ExecutionsA
Read-onlyIdempotent

List the executions of a pipeline schedule.

Args: repo_slug: Repository slug schedule_uuid: Schedule UUID workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of schedule executions

Inputs: repo_slug (required), schedule_uuid (required), max_pages, page_size, +1 more. Returns: result

list_pipeline_schedulesList Pipeline SchedulesA
Read-onlyIdempotent

List pipeline schedules for a repository.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of pipeline schedules

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

list_pipeline_variablesList Pipeline VariablesA
Read-onlyIdempotent

List repository-level pipeline variables.

Secured variables never expose their value (returned as null).

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 20) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of pipeline variables

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

list_repositoriesList RepositoriesA
Read-onlyIdempotent

List repositories in workspace with pagination support.

Args: workspace: Workspace name (optional, defaults to configured workspace) name: Filter by repository name (partial match supported) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of repositories

Note: Fetching more than 10 pages or 300 items will trigger a warning.

Inputs: name, max_pages, page_size, workspace. Returns: result

list_repository_permissionsList Repository PermissionsA
Read-onlyIdempotent

List the user permissions for a specific repository in the workspace.

Requires the account scope.

Args: repo_slug: Repository slug workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of repository permissions (permission + user)

Inputs: repo_slug (required), max_pages, page_size, workspace. Returns: result

list_workspace_membersList Workspace MembersA
Read-onlyIdempotent

List the members of a workspace.

The members endpoint carries no per-user permission — use list_workspace_permissions for roles. Requires the account scope.

Args: workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of workspace memberships

Inputs: max_pages, page_size, workspace. Returns: result

list_workspace_permissionsList Workspace PermissionsA
Read-onlyIdempotent

List the user permissions (roles) of a workspace.

Requires the account scope.

Args: workspace: Workspace name (optional, defaults to configured workspace) page_size: Items per page (default: 30) max_pages: Maximum pages to fetch (default: 1, max recommended: 10)

Returns: Paginated list of workspace permissions (permission + user)

Inputs: max_pages, page_size, workspace. Returns: result

publish_draft_pull_requestPublish Draft Pull RequestA
Idempotent

Publish a draft pull request (convert DRAFT to OPEN).

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Updated pull request details

Inputs: repo_slug (required), pull_request_id (required), workspace. Returns: result

reopen_pull_request_commentReopen Pull Request CommentB
Idempotent

Reopen (unresolve) a comment on a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID comment_id: Comment ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Success message

Inputs: repo_slug (required), comment_id (required), pull_request_id (required), workspace. Returns: result

request_changes_pull_requestRequest Changes on Pull RequestA
Idempotent

Request changes on a pull request (sets reviewer status to 'needs work').

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Participant details with updated state

Inputs: repo_slug (required), pull_request_id (required), workspace. Returns: result

resolve_pull_request_commentResolve Pull Request CommentB
Idempotent

Resolve a comment on a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID comment_id: Comment ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Resolution details

Inputs: repo_slug (required), comment_id (required), pull_request_id (required), workspace. Returns: result

run_pipelineRun PipelineA

Trigger a new pipeline run on a branch.

Args: repo_slug: Repository slug branch: Branch name to run the pipeline on workspace: Workspace name (optional, defaults to configured workspace)

Returns: Created pipeline run details

Inputs: branch (required), repo_slug (required), workspace. Returns: result

submit_pull_request_batch_reviewSubmit Batch ReviewA

Submit a batch review on a pull request: post multiple comments and optionally approve or request changes.

Note: Bitbucket API does not support pending/draft comments in batch. Each comment is posted immediately.

Args: repo_slug: Repository slug pull_request_id: Pull request ID comments: List of comment objects. Each comment has: - content (str, required): Comment text in markdown - inline (dict, optional): For inline comments: {"path": str, "to": int, "from": int} review_action: Action after posting comments: "approve", "request_changes", or "comment_only" (default: "comment_only") review_message: General review message posted as a top-level comment (optional) workspace: Workspace name (optional, defaults to configured workspace)

Returns: Summary with comments_posted count, action taken, and PR details

Inputs: comments (required), repo_slug (required), pull_request_id (required), workspace, +2 more. Returns: result

suggest_pull_request_reviewersSuggest Pull Request ReviewersA
Read-onlyIdempotent

Suggest reviewers for a pull request based on default reviewers and recent PR history.

Combines default reviewers with frequent approvers from recently merged PRs to suggest the most relevant reviewers.

Args: repo_slug: Repository slug pull_request_id: Pull request ID max_suggestions: Maximum number of reviewer suggestions (default: 5) workspace: Workspace name (optional, defaults to configured workspace)

Returns: Suggested reviewers with scores and reasons, already-assigned reviewers, and data sources

Inputs: repo_slug (required), pull_request_id (required), workspace, max_suggestions. Returns: result

unapprove_pull_requestUnapprove Pull RequestA
Idempotent

Remove approval from a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Success message

Inputs: repo_slug (required), pull_request_id (required), workspace. Returns: result

unrequest_changes_pull_requestWithdraw Change RequestA
Idempotent

Remove 'request changes' status from a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace)

Returns: Success message

Inputs: repo_slug (required), pull_request_id (required), workspace. Returns: result

update_issueUpdate IssueA
Idempotent

Update an issue (only the provided fields are changed).

Args: repo_slug: Repository slug issue_id: Issue ID title: New title (optional) content: New description in markdown (optional) state: New state: new, open, resolved, on hold, invalid, duplicate, wontfix, closed (optional) kind: New kind: bug, enhancement, proposal, task (optional) priority: New priority: trivial, minor, major, critical, blocker (optional) assignee: New assignee uuid (optional) workspace: Workspace name (optional, defaults to configured workspace)

Returns: Updated issue details. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Inputs: issue_id (required), repo_slug (required), kind, state, +5 more. Returns: result

update_issue_commentUpdate Issue CommentB
Idempotent

Update a comment on an issue.

Args: repo_slug: Repository slug issue_id: Issue ID comment_id: Comment ID content: New comment content in markdown workspace: Workspace name (optional, defaults to configured workspace)

Returns: Updated issue comment details. If the repository has no issue tracker, returns {"error": "issue_tracker_disabled", ...}.

Inputs: content (required), issue_id (required), repo_slug (required), comment_id (required), +1 more. Returns: result

update_pull_requestUpdate Pull RequestA
Idempotent

Update a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID workspace: Workspace name (optional, defaults to configured workspace) title: New pull request title (optional) description: New pull request description (optional) reviewers: Complete list of reviewer UUIDs to set on the PR (optional). WARNING: this REPLACES the entire reviewer list — include all existing reviewers you want to keep, plus any new ones. Use get_pull_request first to retrieve current reviewer UUIDs. Pass [] to clear all reviewers.

Returns: Updated pull request details

Inputs: repo_slug (required), pull_request_id (required), title, reviewers, +2 more. Returns: result

update_pull_request_commentUpdate Pull Request CommentA
Idempotent

Update a comment on a pull request.

Args: repo_slug: Repository slug pull_request_id: Pull request ID comment_id: Comment ID content: New comment content in markdown format workspace: Workspace name (optional, defaults to configured workspace)

Returns: Updated comment details

Inputs: content (required), repo_slug (required), comment_id (required), pull_request_id (required), +1 more. Returns: result

update_pull_request_taskUpdate Pull Request TaskA
Idempotent

Update a pull request task (content and/or state).

Args: repo_slug: Repository slug pull_request_id: Pull request ID task_id: Task ID content: New task content in markdown format (optional) state: New task state: UNRESOLVED or RESOLVED (optional) workspace: Workspace name (optional, defaults to configured workspace)

Returns: Updated task details

Inputs: task_id (required), repo_slug (required), pull_request_id (required), state, +2 more. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 74 tools

    Disambiguation4/5

    Despite 74 tools, most have a distinct resource+action target (PRs, issues, commits, files, pipelines, deployments, permissions). A few overlap: create_draft_pull_request is a subset of create_pull_request's draft flag, get_pull_request_comment(s) singular/plural are easy to mix up, and submit_pull_request_batch_review partially duplicates add_pull_request_comment + approve_pull_request, though its aggregation purpose is documented.

    Naming Consistency3/5

    The dominant pattern is verb_noun (create_pull_request, resolve_pull_request_comment), which is followed widely. However, list operations are inconsistently named: list_repositories/list_commits/list_issues vs get_repository_tags/get_pull_request_comments/get_commit_comments/get_effective_default_reviewers, which all return collections. The get_/list_ distinction becomes unreliable for selection.

    Tool Count2/5

    74 tools is far beyond the 25+ threshold and is a very heavy surface for an agent to navigate, even given Bitbucket's broad domain. Several niche areas (deployment variables, pipeline caches, schedule executions, branch restrictions) each consume tool slots, increasing selection cost.

    Completeness3/5

    Read coverage is excellent across PRs, issues, commits, files, pipelines, deployments, and permissions, but the write surface has notable gaps: there is no merge_pull_request (only decline), no repository/branch create-update-delete, and pipeline variables/schedules/environments are read-only. These omissions block common lifecycle workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to interact with Bitbucket Cloud repositories, allowing users to manage pull requests, comments, tasks, and branches through natural language commands.
      5,856 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to programmatically manage Bitbucket Cloud resources, including pull requests, repositories, and branches, automating code review workflows.
      16 npm
      MIT