Bitbucket
Bitbucket Cloud MCP in Go: complete API auto-generated from spec, customizable prompts.
README
bitbucket-cli
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-cliis the canonical repository. If you found this project through theterraform-provider-bitbucketmirror, watch, star, file issues, and contribute inbitbucket-cli.
Start here
| Audience | Best fit | Start here |
|---|---|---|
| DevSecOps engineers | Terraform provider | Terraform Registry, generated provider docs, example: bitbucket_tags |
| Software engineers / computer scientists | bb-cli |
CLI usage guide |
| AI agents / agent platform users | bb-mcp |
MCP usage guide |
Quick links
- Canonical GitHub repository
- Terraform Registry:
FabianSchurig/bitbucket - Mirror repository:
terraform-provider-bitbucket - GitHub Releases
- SonarQube Cloud
- Contributing guide
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.
TAG_URL=$(curl -fsSIL -o /dev/null -w '%{url_effective}' https://github.com/FabianSchurig/bitbucket-cli/releases/latest)
VERSION=${TAG_URL##*/}
VERSION=${VERSION%%\?*}
VERSION=${VERSION%%\#*}
VERSION=${VERSION#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.
TAG_URL=$(curl -fsSIL -o /dev/null -w '%{url_effective}' https://github.com/FabianSchurig/bitbucket-cli/releases/latest)
VERSION=${TAG_URL##*/}
VERSION=${VERSION%%\?*}
VERSION=${VERSION%%\#*}
VERSION=${VERSION#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
| Method | Command |
|---|---|
| Go install | go install github.com/FabianSchurig/bitbucket-cli/cmd/bb-cli@latest |
| Docker | docker pull ghcr.io/fabianschurig/bitbucket-cli:latest |
| Download binaries | GitHub 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.
- Internal/undocumented endpoints supported the same way: schemas under
schema/can be hand-authored for endpoints that are not in Bitbucket's public OpenAPI spec (for example the project-level branch-restrictions endpoint exposed only viahttps://bitbucket.org/!api/internal/...). The generators and runtime treat them identically — schema paths may use absolute URLs and the dispatcher passes them through unchanged.
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 andterraform testsuites, 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 forbb-cliandbb-mcp, pushes them to GHCR, and publishes thebb-mcpserver to the MCP Registry.terraform-release.yml: mirrors the tagged source intoterraform-provider-bitbucketand publishes the Terraform provider release.
How this differs from DrFaust92/terraform-provider-bitbucket
| Aspect | DrFaust92/terraform-provider-bitbucket |
FabianSchurig/bitbucket |
|---|---|---|
| Maintenance model | Hand-written provider resources | Mostly generated from the live Bitbucket OpenAPI spec |
| Scope | Terraform provider only | Terraform provider + CLI + MCP server in one canonical repo |
| API coverage model | Curated, typed resources | Broad endpoint coverage through grouped generic resources/data sources |
| Update flow | Manual feature work per resource | Schema sync pipeline regenerates code and docs |
| Resource shape | Resource-specific typed fields | Generic params, response fields, and raw API response |
| Best fit | Opinionated Terraform workflows | Teams 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.
- CLI: docs/cli.md
- MCP: docs/mcp.md
- Terraform provider docs: docs/index.md and the Terraform Registry docs
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-clirepository.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。