Skip to content

MCP Tools Reference

The bbkt MCP server exposes 9 core, multiplexed tools plus the bitbucket_api passthrough. Every multiplexed tool relies on an action enum property to select discrete API operations.

bbkt mcp supports two transports:

  • Stdio (default) — bbkt mcp. Use for local MCP clients (Claude Desktop, Cursor, Zed).
  • HTTP Streamable — bbkt mcp --port <n>. SSE-based; for clients that cannot spawn a process.
  • Loopback by default. The server binds 127.0.0.1:<port>. Change the address with --host. Binding a non-loopback address (e.g. --host 0.0.0.0) is refused unless you also pass --allow-remote and set BBKT_MCP_HTTP_TOKEN.
  • Bearer token always required. Every request must send Authorization: Bearer <token>; anything else gets 401. The token comes from BBKT_MCP_HTTP_TOKEN (at least 16 characters). On loopback, if it is unset, bbkt generates a random 32-byte token and prints it once to stderr at startup.
  • Cleartext. The transport is plain HTTP with no TLS. A remote bind prints a warning; put anything beyond loopback behind a TLS-terminating reverse proxy.
  • The MCP SDK’s DNS-rebinding and cross-origin protections stay enabled, and idle sessions close after 30 minutes.
Terminal window
# Local: token is generated and printed to stderr
bbkt mcp --port 8080
# Stable token
export BBKT_MCP_HTTP_TOKEN="$(openssl rand -hex 32)"
bbkt mcp --port 8080
# Remote (cleartext, so terminate TLS in front of it)
bbkt mcp --port 8080 --host 0.0.0.0 --allow-remote

Token introspection: At startup the server calls Bitbucket’s /user endpoint and reads the X-OAuth-Scopes response header to discover the granted scopes of the credential in use. A tool is dropped only when the credential lacks that tool’s read scope (repository, pullrequest, pipeline, issue).

If scope introspection fails at startup, the server refuses to start. Set BBKT_SKIP_SCOPE_CHECK=1 to start anyway; with no scope list to filter on, every tool is registered. This may be needed for repository and workspace access tokens, which are not tied to a user; Bitbucket still enforces the token’s own permissions.

Explicit denial: BITBUCKET_DISABLED_TOOLS (comma-separated) removes tools outright, regardless of scopes. Valid names are manage_workspaces, manage_repositories, manage_refs, manage_commits, manage_pull_requests, manage_pr_comments, manage_source, manage_pipelines, manage_issues and bitbucket_api. Unknown names are rejected at startup, so a typo cannot silently leave a tool enabled.

Terminal window
export BITBUCKET_DISABLED_TOOLS="manage_repositories,manage_pipelines,bitbucket_api"

Get and list Bitbucket workspaces you have access to.

  • Actions: list, get

Manage repositories across your workspaces.

  • Actions: list, get, create, delete
  • Optional params: role, language, is_private, project_key
  • Required scope: repository

Interact with repository branches and tags.

  • Actions: list-branches, create-branch, delete-branch, list-tags, create-tag
  • Required params: name, target (for creations)
  • Required scope: repository

Explore commit history, diffs, and diffstats.

  • Actions: list, get, diff, diffstat
  • Optional params: path (filter by directory)
  • Required scope: repository

Interact with source code files and directory graphs directly through the Bitbucket API, bypassing local Git clones.

  • Actions: read_file, list_directory, get_history, search, write_file, delete_file
  • Required params: path, content (for writing)
  • Required scope: repository

End-to-end pull request management integration.

  • Actions: list, get, create, update, merge, approve, unapprove, decline, get-diff, get-diffstat, get-commits
  • Optional params: source_branch, destination_branch, merge_strategy, draft
  • Required scope: pullrequest

Interact directly with your team inside active pull requests.

  • Actions: list, create, update, delete, resolve, unresolve
  • Optional params: line_from, line_to, file_path (for inline comments)
  • Required scope: pullrequest

Trigger and monitor standard Bitbucket pipelines integration tests and deployments.

  • Actions: list, get, trigger, stop, list-steps, get-step-log
  • Required scope: pipeline

Interact with the repository Issue Tracker.

  • Actions: list, get, create, update
  • Required scope: issue

Authenticated passthrough to any Bitbucket Cloud REST API v2 endpoint the typed tools don’t cover (webhooks, branch restrictions, pipeline config, …). Returns the raw HTTP status and JSON body.

  • Params: path (required), method (default GET), body (raw JSON), paginate, max_pages (default 10)
  • Writes: only GET/HEAD are allowed by default. POST/PUT/PATCH/DELETE are rejected unless the server runs with BBKT_API_ALLOW_WRITE=1. Enabling it lets the agent call any write endpoint the credential permits.
  • Required scope: none (always registered; disable it with BITBUCKET_DISABLED_TOOLS=bitbucket_api)