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.
Transports
Section titled “Transports”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.
HTTP transport
Section titled “HTTP transport”- 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-remoteand setBBKT_MCP_HTTP_TOKEN. - Bearer token always required. Every request must send
Authorization: Bearer <token>; anything else gets401. The token comes fromBBKT_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.
# Local: token is generated and printed to stderrbbkt mcp --port 8080
# Stable tokenexport 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-remoteSecurity & Introspection
Section titled “Security & Introspection”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.
export BITBUCKET_DISABLED_TOOLS="manage_repositories,manage_pipelines,bitbucket_api"Multiplexed Tools
Section titled “Multiplexed Tools”manage_workspaces
Section titled “manage_workspaces”Get and list Bitbucket workspaces you have access to.
- Actions:
list,get
manage_repositories
Section titled “manage_repositories”Manage repositories across your workspaces.
- Actions:
list,get,create,delete - Optional params:
role,language,is_private,project_key - Required scope:
repository
manage_refs
Section titled “manage_refs”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
manage_commits
Section titled “manage_commits”Explore commit history, diffs, and diffstats.
- Actions:
list,get,diff,diffstat - Optional params:
path(filter by directory) - Required scope:
repository
manage_source
Section titled “manage_source”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
manage_pull_requests
Section titled “manage_pull_requests”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
manage_pr_comments
Section titled “manage_pr_comments”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
manage_pipelines
Section titled “manage_pipelines”Trigger and monitor standard Bitbucket pipelines integration tests and deployments.
- Actions:
list,get,trigger,stop,list-steps,get-step-log - Required scope:
pipeline
manage_issues
Section titled “manage_issues”Interact with the repository Issue Tracker.
- Actions:
list,get,create,update - Required scope:
issue
Passthrough
Section titled “Passthrough”bitbucket_api
Section titled “bitbucket_api”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(defaultGET),body(raw JSON),paginate,max_pages(default 10) - Writes: only
GET/HEADare allowed by default.POST/PUT/PATCH/DELETEare rejected unless the server runs withBBKT_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)