MCP Hub
Back to servers

Bitbucket MCP

Bitbucket Cloud MCP in Go: complete API auto-generated from spec, customizable prompts.

Registry
Stars
2
Updated
Apr 6, 2026
Validated
Apr 8, 2026

bitbucket-cli

CI GitHub Release Terraform Registry Sonar Quality Gate Sonar Maintainability Rating Sonar Vulnerabilities Sonar Technical Debt Sonar Security Rating

Low-maintenance Bitbucket Cloud tooling built from the live OpenAPI spec: a CLI for software engineers, an MCP server for AI agents, and a Terraform provider for DevSecOps teams.

[!IMPORTANT] https://github.com/FabianSchurig/bitbucket-cli is the canonical repository. If you found this project through the terraform-provider-bitbucket mirror, watch, star, file issues, and contribute in bitbucket-cli.

Start here

AudienceBest fitStart here
DevSecOps engineersTerraform providerTerraform Registry, generated provider docs, example: bitbucket_tags
Software engineers / computer scientistsbb-cliCLI usage guide
AI agents / agent platform usersbb-mcpMCP usage guide

Quick links

Install

Homebrew (macOS and Linux)

brew tap FabianSchurig/tap
brew install bitbucket-cli

APT (Debian / Ubuntu)

Download the .deb package from the latest release and install it. Supported architectures: amd64, arm64.

VERSION=$(curl -s https://api.github.com/repos/FabianSchurig/bitbucket-cli/releases/latest | jq -r .tag_name | sed 's/^v//')
ARCH=$(dpkg --print-architecture)
curl -LO "https://github.com/FabianSchurig/bitbucket-cli/releases/download/v${VERSION}/bb-cli_${VERSION}_${ARCH}.deb"
sudo dpkg -i "bb-cli_${VERSION}_${ARCH}.deb"

Replace bb-cli with bb-mcp to install the MCP server instead.

RPM (Fedora / RHEL / CentOS)

Download the .rpm package from the latest release and install it. Supported architectures: amd64, arm64.

VERSION=$(curl -s https://api.github.com/repos/FabianSchurig/bitbucket-cli/releases/latest | jq -r .tag_name | sed 's/^v//')
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
curl -LO "https://github.com/FabianSchurig/bitbucket-cli/releases/download/v${VERSION}/bb-cli_${VERSION}_${ARCH}.rpm"
sudo rpm -i "bb-cli_${VERSION}_${ARCH}.rpm"

Replace bb-cli with bb-mcp to install the MCP server instead.

Scoop (Windows)

scoop bucket add bitbucket https://github.com/FabianSchurig/scoop-bucket
scoop install bb-cli
scoop install bb-mcp

Winget (Windows)

winget install FabianSchurig.bb-cli
winget install FabianSchurig.bb-mcp

Install script

curl -fsSL https://raw.githubusercontent.com/FabianSchurig/bitbucket-cli/main/install.sh | sh

See install.sh options for version selection, binary choice (bb-cli, bb-mcp, or all), and custom install directories.

Other methods

MethodCommand
Go installgo install github.com/FabianSchurig/bitbucket-cli/cmd/bb-cli@latest
Dockerdocker pull ghcr.io/fabianschurig/bitbucket-cli:latest
Download binariesGitHub Releases

For full installation details see the CLI usage guide and the MCP usage guide.

What this project is

This repository keeps Bitbucket Cloud tooling maintainable by generating most of the surface area from the live Bitbucket OpenAPI spec.

  • One API description, three user-facing tools: CLI, MCP, and Terraform all come from the same schema pipeline.
  • Thin hand-written runtime: auth, dispatch, output, and Terraform runtime stay generic instead of growing per-endpoint glue.
  • Fast spec adoption: new Bitbucket endpoints flow in through generation instead of large manual rewrites.
  • Maintenance-first design: the main development effort goes into the shared generators and runtime, not duplicated endpoint code.

Architecture

flowchart LR
    A[Live Bitbucket OpenAPI spec] --> B[enrich_spec.py]
    B --> C[partition_spec.py]
    C --> D[schema/*-schema.yaml]
    D --> E[oapi-codegen models]
    D --> F[CLI generator]
    D --> G[MCP generator]
    D --> H[Terraform generator]
    E --> I[Shared generated types]
    F --> J[bb-cli]
    G --> K[bb-mcp]
    H --> L[terraform-provider-bitbucket]
    I --> J
    I --> K
    I --> L
    M[Hand-written runtime\nauth, dispatch, output, MCP handler, TF runtime] --> J
    M --> K
    M --> L

In practice:

  • CLI exposes Bitbucket operations as terminal commands.
  • MCP exposes the same operations as tool calls for AI agents.
  • Terraform maps operation groups into generic resources and data sources.
  • Hand-written code stays small on purpose; generated code handles endpoint coverage.

CI pipelines

flowchart TD
    A[push / pull_request] --> B[ci.yml]
    A --> C[terraform-tests.yml]
    D[schedule / manual] --> E[schema-sync.yml]
    E --> F[Fetch live spec]
    F --> G[Regenerate code and docs]
    G --> H[Build and test]
    H --> I[Tag new version]
    I --> J[release.yml]
    J --> K[docker.yml]
    I --> L[terraform-release.yml]
    K --> M[Publish to MCP Registry]
  • ci.yml: builds, lints, vets, runs Go tests, and sends analysis to SonarQube Cloud.
  • terraform-tests.yml: runs mock-based Terraform acceptance and terraform test suites, plus real API tests when credentials exist.
  • schema-sync.yml: daily/manual sync that fetches the live Bitbucket spec, regenerates generated artifacts, rebuilds docs, tests everything, and tags a release when the schema changed.
  • release.yml: publishes tagged binary releases via GoReleaser.
  • docker.yml: builds multi-arch container images for bb-cli and bb-mcp, pushes them to GHCR, and publishes the bb-mcp server to the MCP Registry.
  • terraform-release.yml: mirrors the tagged source into terraform-provider-bitbucket and publishes the Terraform provider release.

How this differs from DrFaust92/terraform-provider-bitbucket

AspectDrFaust92/terraform-provider-bitbucketFabianSchurig/bitbucket
Maintenance modelHand-written provider resourcesMostly generated from the live Bitbucket OpenAPI spec
ScopeTerraform provider onlyTerraform provider + CLI + MCP server in one canonical repo
API coverage modelCurated, typed resourcesBroad endpoint coverage through grouped generic resources/data sources
Update flowManual feature work per resourceSchema sync pipeline regenerates code and docs
Resource shapeResource-specific typed fieldsGeneric params, response fields, and raw API response
Best fitOpinionated Terraform workflowsTeams that want fast Bitbucket API coverage and shared tooling across Terraform, shells, and AI agents

This project optimizes for breadth, maintenance, and shared infrastructure across interfaces. If you want a heavily hand-modeled Terraform UX, the DrFaust92 provider may feel more familiar. If you want one maintained pipeline that keeps Terraform, CLI, and MCP aligned with Bitbucket Cloud, this repository is designed for that.

Documentation map

Use the short guides on this first page to get started, then switch to the detailed docs for the interface you need.

The Terraform documentation under docs/ is generated. The root README stays focused on orientation, links, architecture, maintenance, and contribution entry points.

Maintenance and contributions

  • Read CONTRIBUTING.md before changing generators or runtime code.
  • Do not hand-edit generated files; fix the generator or schema source instead.
  • Prefer changes that improve the shared pipeline or hand-written runtime across all endpoints.
  • Open issues and pull requests in the canonical bitbucket-cli repository.

Reviews

No reviews yet

Sign in to write a review