Bitbucket MCP Server

Bitbucket MCP Server

mcp-server-bitbucket•byjavimaligno

An MCP server that exposes Bitbucket API operations, such as repositories, pull requests, pipelines, and commits, to MCP-compatible clients.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides tools for managing Bitbucket repositories, including getting, creating, deleting, listing, and updating repositories.
  • •Supports pull request workflows such as creating, merging, approving, declining, requesting changes, commenting, and viewing diffs.
  • •Offers pipeline operations including triggering runs, checking status, listing pipelines, viewing logs, and managing pipeline variables.
  • •Includes MCP prompts for reusable workflow templates and browsable MCP resources for workspace data.

BEST FOR

  • •Developers using MCP-compatible clients who want to manage Bitbucket repositories and pull requests from their AI assistant.
  • •Teams that need to inspect and control Bitbucket Pipelines, including triggering builds and reviewing logs.
  • •Workflows that benefit from reusable MCP prompts for code review, release notes, pipeline debugging, and repository summaries.

ABOUT MCP-SERVER-BITBUCKET

Bitbucket MCP Server is cataloged as an MCP server attributed to javimaligno. An MCP server that exposes Bitbucket API operations, such as repositories, pull requests, pipelines, and commits, to MCP-compatible clients. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Bitbucket MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does this server support both basic authentication and workspace access tokens?

Yes. It uses basic auth with an email and Atlassian API token, or bearer auth with a workspace, project, or repository access token, auto-detecting the mode.

Can a remote deployment of this server be protected with OAuth?

Yes. When both the OAuth issuer and audience are set, the server gates /mcp on bearer tokens issued by an external authorization server and verifies each request's JWT.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 796d43c5143f · 采集于 2026-11-13 10:52:46 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

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:

VersionDirectoryStatusInstallation
TypeScript/typescript✅ Recommended (Smithery)npm install -g mcp-server-bitbucket
Python/python✅ Stablepipx 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.

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

VariableRequiredDescription
BITBUCKET_WORKSPACE✅Bitbucket workspace slug
BITBUCKET_EMAIL✅ (basic auth)Account email for Basic Auth
BITBUCKET_API_TOKEN✅Atlassian API token (Basic auth)
BITBUCKET_OAUTH_TOKENAccess token sent as Authorization: Bearer
BITBUCKET_AUTH_TYPEForce auth mode: basic or bearer (auto-detected)
API_TIMEOUTRequest timeout in seconds (default: 30)
MAX_RETRIESMax retry attempts for rate limiting (default: 3)

Authentication modes

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

CredentialHeaderConfiguration
Atlassian API token (ATATT...), tied to a personal accountAuthorization: Basic base64(email:token)BITBUCKET_EMAIL + BITBUCKET_API_TOKEN
Workspace / project / repository access token (ATCTT...), owned by the workspaceAuthorization: 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…).

VariableDescription
MCP_OAUTH_ISSUERToken issuer, e.g. https://login.microsoftonline.com/<tenant>/v2.0
MCP_OAUTH_AUDIENCEExpected aud claim, e.g. api://bitbucket-mcp
MCP_OAUTH_JWKS_URISigning keys (derived from the issuer when omitted)
MCP_OAUTH_REQUIRED_SCOPEScope the token must carry, e.g. mcp.access
MCP_PUBLIC_URLPublic 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

ToolDescription
list_repositoriesList and search repositories
get_repositoryGet repository details
create_repositoryCreate a new repository
delete_repositoryDelete a repository
update_repositoryUpdate repo settings

Pull Requests

ToolDescription
list_pull_requestsList PRs
get_pull_requestGet PR details
create_pull_requestCreate a new PR
merge_pull_requestMerge a PR
approve_prApprove a PR
unapprove_prRemove approval
request_changes_prRequest changes
decline_prDecline a PR
list_pr_commentsList comments
add_pr_commentAdd comment
get_pr_diffGet the diff

Pipelines

ToolDescription
list_pipelinesList recent runs
get_pipelineGet status
get_pipeline_logsView logs
trigger_pipelineTrigger a run (supports custom pipelines and commit triggers)
stop_pipelineStop pipeline
list_pipeline_variablesList variables
get_pipeline_variableGet variable
create_pipeline_variableCreate variable
update_pipeline_variableUpdate variable
delete_pipeline_variableDelete variable

trigger_pipeline Parameters

ParameterTypeDescription
repo_slugstringRepository slug (required)
branchstringBranch to run on (default: main). Mutually exclusive with commit
commitstringCommit hash to run on. Mutually exclusive with branch
custom_pipelinestringName from custom: section in bitbucket-pipelines.yml
variablesarrayVariables 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

ToolDescription
list_branchesList branches
get_branchGet branch details
list_commitsPaginated history with revision include/exclude and path filters
get_commitGet commit details
compare_commitsPaginated changed-file statistics from base to head
get_commit_diffRaw diff, optionally by file, with explicit chunk continuation
get_merge_baseBest common ancestor of two revisions
get_file_historyPaginated file history with paths reported across renames
get_commit_statusesGet build statuses
create_commit_statusReport CI status
list_tagsPaginated tags with filtering and configurable sorting
get_tagResolve an exact tag to its full target commit hash
create_tagCreate a tag
delete_tagDelete 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:

PromptDescription
code_reviewComprehensive PR code review
release_notesGenerate changelog between versions
pipeline_debugDebug failed CI/CD pipelines
repo_summaryComplete repository status overview

MCP Resources

Browsable workspace data:

Resource URIDescription
bitbucket://repositoriesList all repos
bitbucket://repositories/{repo}Repository details
bitbucket://repositories/{repo}/branchesBranch list
bitbucket://repositories/{repo}/pull-requestsOpen PRs
bitbucket://projectsList 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

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Bitbucket MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-server-bitbucket)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools