
Bitbucket MCP
io.github.FabianSchurig由 GitHub 账号 FabianSchurig 发布v0.20.2更新于 Oct 24, 2026
Bitbucket Cloud MCP in Go: complete API auto-generated from spec, customizable prompts.
概览
一个本地 MCP 服务器,将 Bitbucket Cloud 操作以工具调用的形式提供给 AI 助手,接口由 Bitbucket OpenAPI 规范自动生成。
- 可以做什么
- 以 MCP 工具形式调用 Bitbucket Cloud API 操作,覆盖由实时 OpenAPI 规范生成的各端点分组,也包括通过手工编写 schema 支持的部分内部/未公开端点。通过项目 CLI 和 Terraform 提供者所用的同一套生成操作,处理仓库、项目、标签等 Bitbucket 资源。使用 Bitbucket API 令牌或 OAuth2 访问令牌认证,Basic 认证时可选提供用户名。
- 适用场景
- 当希望 AI 助手直接读取或操作 Bitbucket Cloud 数据(仓库、项目、标签及相关端点)时使用。适合已在使用该项目 CLI 或 Terraform 提供者、并希望在智能体工作流中获得相同 API 覆盖的团队。
- 运行要求
- 以本地进程方式运行(stdio),通过容器镜像以及 Homebrew、APT、RPM、Scoop、Winget 和安装脚本分发。需要 Bitbucket Cloud 账户和 BITBUCKET_TOKEN 环境变量;Basic 认证需要 BITBUCKET_USERNAME,使用工作区/仓库访问令牌时则省略。需要访问 Bitbucket Cloud 的网络连接。
安装
在 SourceWeft 中
- 打开 控制台中的 Bitbucket MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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-cliis the canonical repository. If you found this project through theterraform-provider-bitbucketmirror, watch, star, file issues, and contribute inbitbucket-cli.
Start here
Quick links
- Canonical GitHub repository
- Terraform Registry:
FabianSchurig/bitbucket - Mirror repository:
terraform-provider-bitbucket - GitHub Releases
- SonarQube Cloud
- Contributing guide
Install
Homebrew (macOS & Linux)
To install the CLI tool via our custom tap, tap the repository and explicitly trust the formula to reduce supply chain risks:
Or to install the MCP server:
(Note: If you previously tapped the old cask, you can safely untap via brew untap fabianschurig/tap before running the command).
APT (Debian / Ubuntu)
Download the .deb package from the latest release and install it. Supported architectures: amd64, arm64.
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.
Replace bb-cli with bb-mcp to install the MCP server instead.
Scoop (Windows)
Winget (Windows)
Install script
See install.sh options for version selection, binary choice (bb-cli, bb-mcp, or all), and custom install directories.
Other methods
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
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
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. See docs/e2e-coverage.md for the current list of endpoints exercised by the real-API tests.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, publishes their SBOM and CVE reports (see Supply chain: SBOM and CVE reports), and publishes thebb-mcpserver to the MCP Registry.terraform-release.yml: mirrors the tagged source intoterraform-provider-bitbucketand publishes the Terraform provider release.
Schema sync safety
The live OpenAPI document is treated as an input, not as an authority to delete a working API group because of a transient omission. Three mechanisms keep the daily sync from breaking published surface or itself:
- Group preservation: when a group extracts with no paths,
partition_spec.pypreserves its existing populated schema; a genuinely empty or new group is still written normally. - Stable operationIds: ids are recorded in the committed lockfile
schema/operation-ids.json, keyed by"<method> <path>". An operation keeps its id forever, and ids of removed operations stay reserved — so a sibling endpoint can never inherit an id and silently rename a shipped CLI command, MCP tool, orCRUDConfigreference. - Operation retention: Atlassian regularly removes deprecated but still
functional endpoints from the published spec. Rather than dropping commands
in an automatic patch release,
partition_spec.pycarries such operations forward verbatim from the committed schema, annotatedx-bb-cli-retained: trueso the schema diff shows exactly what upstream stopped publishing. Retiring one for good is a deliberate act: delete it fromschema/*-schema.yaml, and the invariant tests then flag any hand-maintained mapping (for example inCRUDConfig) that still references it.
Acceptance tests in internal/tfprovider/acceptance_test.go are hand-written and
are never deleted by schema generation. Generated Terraform fixtures are
regenerated from the surviving resource groups, while the schema-sync build and
test gate, including the mock Terraform acceptance suites, must pass before any
change is committed or released. The generated
real-API coverage report makes missing group coverage
visible without requiring manual bookkeeping.
Supply chain: SBOM and CVE reports
Every released container image ships with a Software Bill of Materials and a vulnerability report in standard formats. Both are produced from the exact image digest that was pushed to GHCR.
The SBOM is also attached to the image as a signed, digest-bound GitHub attestation, so consumers can verify and fetch it without any access to this repository:
Runtime images are built FROM scratch and contain only the static binary plus CA certificates, so the SBOM is deliberately small and there is no OS package surface to patch.
Vulnerability scan results are additionally uploaded to GitHub code scanning (categories docker-bitbucket-cli and docker-bitbucket-mcp) for maintainers, and the Go module tree is checked by govulncheck in security.yml.
How this differs from DrFaust92/terraform-provider-bitbucket
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
- Real-API E2E test coverage: docs/e2e-coverage.md — auto-generated list of which resource groups are exercised by
TestAccRealAPI_*tests, and which are still missing coverage.
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.
来源:README.md,提交 fc0acf5
工具
0版本历史
1- v0.20.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分