Purpose
mcp-server-bitbucket is an MCP (Model Context Protocol) server for performing Bitbucket API operations. It enables MCP-compatible clients (such as Claude Code, Claude Desktop, Cursor) to directly manage Bitbucket repositories and related resources.
Main Capabilities
The server provides 58 tools, covering the following areas:
- Repositories: get, create, delete, list, update (move to project, rename)
- Pull requests: create, get, list, merge, approve, decline, request changes, comment, diff
- Pipelines: trigger, get status, list, view logs, stop
- Branches: list, get
- Projects: list, get
- Commits: list, get details, compare/diff
- Commit statuses: get build status, 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 and 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
Usage
The repository contains both TypeScript and Python implementations, both with the same functionality. The TypeScript version is used for Smithery deployment.
Installation and configuration:
- The complete installation guide includes API token creation, permission settings, and troubleshooting.
- If you do not want to run the server yourself, Fronteir AI provides a hosted deployment.
- Environment variables: regarding authentication modes, Bitbucket Cloud has two types of credentials, and the authentication schemes differ. Using Basic authentication with an access token returns 401, so the server automatically selects the mode: when BITBUCKET_AUTH_TYPE is set, it always takes precedence; otherwise, when BITBUCKET_OAUTH_TOKEN is set or BITBUCKET_EMAIL is not configured, bearer is used; otherwise basic is used (the default method for personal API tokens).
- Protecting remote servers (OAuth): The stdio server runs locally, uses its own credentials, and requires no protection. Remote deployment is different: it holds shared credentials and serves all visitors, so /mcp can be gated by bearer tokens issued by an external authorization server (Microsoft Entra ID, Okta, Auth0, etc.). Protection is enabled only when both MCP_OAUTH_ISSUER and MCP_OAUTH_AUDIENCE are set. Once enabled, the server returns 401 for unauthenticated /mcp requests along with a WWW-Authenticate header pointing to /.well-known/oauth-protected-resource; serves that metadata document (RFC 9728); validates the JWT on every request (signature, iss, aud, expiration), and returns 403 insufficient_scope when a valid token lacks the required scope; /health remains open. Note: this controls who can use the server; calls still reach Bitbucket using the server's own credentials and are not attributed to individual users.
- Claude Code CLI configuration: add to ~/.cursor/mcp.json.
Create a Bitbucket API token: in Bitbucket, go to the repository, navigate to Repository settings > Access tokens, click Create Repository Access Token, select permissions (Repository: Read, Write, Admin, Delete; Pull requests: Read, Write; Pipelines: Read, Write), and copy the token immediately.
When to use
Suitable for development teams that need to automate management of Bitbucket repositories, pull requests, CI/CD pipelines, deployments, webhooks, tags, and branch protection rules through an MCP client. Also suitable for scenarios where you want to connect internal systems to MCP or need help passing a security review.
Limitations
The material does not provide more information about fees, pricing, platform compatibility details, effectiveness, or performance. The automatic authentication mode selection logic and the OAuth protection mechanism are clearly explained, but other limitations are not yet provided.