
Bamboo MCP Server
io.github.hmdmph由 GitHub 帳號 hmdmph 發布v0.1.2更新於 Oct 24, 2026
Read-only MCP server for self-hosted Atlassian Bamboo CI/CD
概覽
唯讀 MCP 伺服器,讓助理查詢自架的 Atlassian Bamboo CI/CD:專案、計畫、建置與部署。
- 可以做什麼
- 檢視伺服器與專案:版本資訊、健康檢查、專案清單與詳細資料
- 瀏覽計畫與分支:列出、搜尋計畫,讀取計畫或分支計畫詳細資料
- 檢視建置:最新與近期結果、含變更/產出物/階段的詳細結果、儲存庫與提交、建置佇列
- 追蹤部署:部署專案、環境、部署歷程與結果、版本及其在各環境的狀態
- 透過本機計畫情境設定,把人類可讀的引用解析成 Bamboo 鍵、解釋環境名稱,並可熱重載該設定
- 在本機儲存 Bitbucket 儲存庫憑證(選用,其他工具並未使用)
- 適用情境
- 適合仍在執行自架 Bamboo 的團隊,讓助理回答「什麼部署到哪裡、是誰部署的、建置為何失敗」,不必在 Bamboo 介面中逐頁點選。它為唯讀設計,適合排查與狀態查詢,而非變更流程。
- 執行需求
- 以本機程序執行(Go 二進位檔或 GHCR 容器映像),透過 stdio 連線,或作為 SSE HTTP 服務執行。需要 BAMBOO_URL 與具備讀取權限的 Bamboo 個人存取權杖 BAMBOO_TOKEN;由用戶端啟動容器時 MCP_TRANSPORT 必須為 stdio。選用:BAMBOO_PROXY 供企業代理、BITBUCKET_URL 用於原始碼連結、VERBOSE 用於記錄。需要能連線至 Bamboo 伺服器的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Bamboo MCP Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Bamboo MCP Server
A Model Context Protocol server that exposes a self-hosted Atlassian Bamboo instance to AI assistants — Claude Desktop, Claude Code, Cursor, Windsurf, or any other MCP client.
Ask "who deployed CHECKOUT to staging and did it pass?" instead of clicking through the Bamboo UI.
Read-only by design. Every tool is registered behind a policy engine that enforces a GET-only floor. This server cannot trigger a build, start a deployment, or change anything in Bamboo.
[M8ven Verified]
⚠️ About self-hosted Bamboo
Atlassian has announced the end of support for Bamboo Data Center in 2029. If you are starting a new CI/CD project, you should be looking at a supported platform instead — check Atlassian's end-of-life policy for the current dates.
That said, plenty of organisations are still running Bamboo Server / Data Center today and will be for years, often with hundreds of plans and deployment projects accumulated over a decade. This project exists for those teams: if you are living with Bamboo until the migration lands, this makes the day-to-day "what's deployed where, and who broke it" questions a lot cheaper to answer.
Contributions are welcome, but be aware you are building on a platform with a known sunset.
Contents
- Features
- Quick start
- Configuration
- Connecting an MCP client
- Plan context — teaching it your conventions
- Security model
- Example prompts
- Important points & known limitations
- Development
- License
Features
31 read-only Bamboo tools
Server & projects (5)
Plans & branches (5)
Builds (7)
Deployments (8)
Plan context — the "smart" tools (6)
These are what make the server useful rather than just a REST wrapper. They read a YAML file describing your plan-key and environment naming conventions, so the model can go from a human reference to a Bamboo key without you spelling it out.
Bitbucket credential storage (4) — optional, see limitations
bitbucket_add_repo, bitbucket_get_repo, bitbucket_list_repos, bitbucket_delete_repo.
Stores repository URL/username/token in ~/.bamboo-mcp/bitbucket.json (mode 0600, tokens masked on read). Nothing else in the server consumes this — Bitbucket links in build results are built from the BITBUCKET_URL environment variable. See limitations.
35 tools total. The full surface — names, descriptions and JSON Schemas — is
generated into tools.json, and bamboo-mcp --list-tools prints
the same payload without needing a Bamboo connection. See
the tool manifest.
9 prompt templates
MCP prompts give the model a structured plan for common workflows, so you get consistent output instead of ad-hoc tool flailing.
* = required
Other
- Two transports —
stdiofor desktop clients,sse(HTTP) for containers and remote access. - Startup validation — config completeness, URL format, network reachability, token validity, transport sanity. Skippable with
SKIP_VALIDATION=true. - Security layer — GET-only floor, per-tool rate limits, result caps, response size limits, prompt-injection scanning. See Security model.
- Proxy support —
BAMBOO_PROXYfor corporate networks. - Declared tool surface —
tools.jsonand--list-tools, generated from the catalog and verified in CI, with a test that calls every declared tool. See Tests.
Quick start
Requires Go 1.23+ and a Bamboo personal access token.
Getting a token: Bamboo → your profile → Personal access tokens → create. Read permission on the projects you care about is enough; this server never writes.
Docker / Podman
Prebuilt multi-arch images (linux/amd64, linux/arm64) are published to GHCR on every release:
Tags: latest, 1, 1.2, 1.2.3. Or build it yourself:
Behind a corporate CA? The Dockerfile has commented-out lines near the top for copying your own PEM files into the image — drop them in certs/ and uncomment.
Configuration
All configuration is environment variables. Copy .env.example to .env.dev to keep them out of git.
Note on logging: in stdio mode, stdout carries the MCP protocol stream. All logging goes to stderr — never add
fmt.Printlnto a handler.
Connecting an MCP client
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Claude Code
Cursor / Windsurf
Same shape as Claude Desktop, in the client's MCP settings file.
Remote (SSE)
The SSE server exposes /sse and /message. It has no authentication of its own — see limitations.
Plan context — teaching it your conventions
This is the part worth spending ten minutes on.
Most Bamboo estates encode meaning in their plan keys and environment names — something like PROJ-CHECKOUTAPP with environments called staging_network_checkout_deploy. Out of the box an AI assistant has no idea what any of that means. context.yaml tells it.
On first run a starter file is written to ~/.bamboo-mcp/context.yaml. It ships deliberately generic placeholders — the feature only becomes useful once you describe your own conventions. A fully commented, worked example lives in examples/context.yaml.
How environment names are parsed. environment_format drives everything:
- Each
<placeholder>consumes one underscore-separated segment. - The last placeholder absorbs the remainder, so
<action>correctly matchesrestart_all_in_ns. <module>is matched greedily against your declaredmodules, so module names containing underscores (load_balancer) parse correctly.- A literal segment in the format — the
nodegroupin<env>_nodegroup_<action>— is matched as-is and reported back asmarker. - If
fixed_deploymentsis set,environment_formatis ignored and names are matched exactly.
Edit the file, then call bamboo_reload_context — no restart needed.
Security model
An MCP server is a privileged bridge: it holds a CI/CD credential and hands its output to a language model that will act on what it reads. Bamboo build logs, plan descriptions, branch names and commit messages are all attacker-influenceable text — anyone who can open a pull request can put words into a build log. This server treats every byte Bamboo returns as hostile input.
Guardrails are enforced in the internal/security package and applied uniformly by middleware, not scattered through handlers.
Guardrails at a glance
1. The read-only floor
This is the load-bearing guarantee, and it holds at two independent levels:
- Transport level —
internal/bamboo/client.goonly ever callsdoRequest("GET", …). There is no code path that issues a POST, PUT, PATCH or DELETE to Bamboo. No write method exists to be reached. - Policy level — every tool is registered as
w(name, "GET", handler, …)and the policy engine rejects any other method before the handler runs. Even if a write method were added, it would be denied unless someone also editedallowed_methods.
Notably, the floor is re-asserted after config load: if security.yaml sets an empty method list, the loader forces it back to ["GET"]. You cannot accidentally configure this server into being write-capable. Making it write-capable is a deliberate code change — that friction is the point.
2. Every tool goes through the same gate
PolicyEngine.Wrap() composes each handler as:
All 35 of 35 registered tools are wrapped. There is no "trusted" tool and no bypass path — a denial returns a structured error to the model rather than throwing, so the assistant sees why it was blocked and can explain it to you instead of silently retrying.
3–5. Blast-radius limits
Three independent caps stop a single call — or a runaway agent loop — from draining your Bamboo instance into a model context window:
- Rate limits are per-tool sliding one-minute counters. Broad-export tools are deliberately throttled harder than lookups:
bamboo_list_all_projectsis 10/min against a default of 120/min. - Result caps inspect
maxResults,max_results,max-results,limitandmaxResult, take the largest, and deny if it exceeds the tool's ceiling. Asking for 10,000 build results is refused, not silently truncated. - Response size is capped at 512 KB per call, with an explicit
[RESPONSE TRUNCATED]marker so the model knows it is looking at partial data.
6–7. Prompt-injection defence
Every response is scanned against 23 regex patterns in 8 families:
Matches are redacted to [REDACTED:LABEL] and the response is prefixed with a header naming what was found:
The header is prepended even when nothing is found, so the model is consistently told the payload is remote data rather than instruction. That consistency matters more than the pattern list: it removes the case where clean-looking content reads as trusted.
ScanText() is also exported for detection without mutation if you want to log rather than redact.
Redaction is destructive and over-eager on some legitimate CI content — see limitations before turning it off with
sanitize_responses: false.
8–10. Environment guardrails
The failure mode this addresses: you ask "how's the deployment looking?" and the model helpfully picks production.
- Tools in
env_sensitive_toolsrequire an explicitenvironmentargument. Absent it, the call is denied with a message stating the environment is never inferred from context or prompt text. denied_environmentsblocks named environments per tool — a hard "this tool may never touch prod".allowed_environmentsinverts it into an allowlist.disabled: trueremoves a tool entirely without recompiling.
11. Credential handling
- The Bamboo token is read from the environment, sent only as an
Authorization: Bearerheader, and never written to logs — verbose logging prints method, URL, status and timing, never headers. - Any token surfaced through a tool is masked to its last 4 characters, and masking is length-safe (short tokens are masked entirely rather than sliced).
- Files under
~/.bamboo-mcp/are written0600inside a0700directory. - Nothing is persisted that wasn't explicitly stored by you.
12–13. Deployment hardening
Startup validation refuses to serve on missing config, a malformed URL, an unreachable host or an invalid token — you find out at launch, not on the first tool call. The container runs as a non-root mcp user on a minimal alpine:3.20 base, with a static binary and no shell tooling beyond BusyBox.
Configuration
All of it is tunable via ~/.bamboo-mcp/security.yaml, auto-created with safe defaults on first run:
Per tool: allowed_methods, max_results, rate_limit_per_minute, require_environment, allowed_environments, denied_environments, disabled.
Defaults fail closed. A missing, unreadable or partial config falls back to the built-in safe defaults rather than to "no restrictions".
What these guardrails do not cover
Being explicit about the gaps is part of the model:
- The SSE transport has no authentication. Network reachability to
:8080is full access. Put it behind an authenticating proxy or use stdio. - Your token's permissions are the real data boundary. The policy engine constrains what kind of call is made, not what the token can see. Scope the token to the projects the assistant should have.
- The Bitbucket tools sit outside the read-only guarantee — they have local side effects yet are registered as
GET. Delete them if unused. - No audit log. Denials are logged, but only when
VERBOSE=true. - The sanitizer is defence in depth, not a proof. Regex filtering raises the cost of injection; it does not eliminate it. The untrusted-content labelling is the more robust half.
Example prompts
Deployment status
Understanding your estate
Builds
Housekeeping
Important points & known limitations
Read this before deploying it anywhere shared.
Read-only, and it means it. No triggering builds, no starting deployments, no editing plans. If you need write operations you will have to add them deliberately and loosen the policy engine — which is the intended friction.
The SSE transport has no authentication. Anyone who can reach :8080 gets full use of your Bamboo token, with your permissions. Do not expose it to an untrusted network. Put it behind an authenticating reverse proxy, or bind it to localhost, or just use stdio.
Your token's permissions are the real security boundary. The policy engine limits what kind of call is made, not what data is visible. Issue a token scoped to the projects you actually want the assistant to see.
The sanitizer rewrites response text. Redaction is destructive and some patterns fire on legitimate CI content — Helm templates ({{ .Values.x }}), shell expansions in build logs ($(date)), HTML in plan descriptions. If the model reports mangled or unparseable output, sanitize_responses: false is the escape hatch; you are then trading injection resistance for fidelity.
The Bitbucket tools are vestigial. They store credentials but nothing else in the server reads them; source links are built from BITBUCKET_URL. They are also the only tools with local side effects, yet they are registered as GET, so the read-only floor does not constrain them. If you are not using them, delete registerBitbucketTools from cmd/server/main.go — you lose nothing and shed a credential-handling surface.
The container healthcheck is a TCP probe. The MCP SSE library in use exposes only /sse and /message with no health endpoint, so the Dockerfile checks that the port accepts connections. It confirms the process is alive, not that Bamboo is reachable.
Errors are quiet unless VERBOSE=true. The logger short-circuits when verbose logging is off — including for errors. Turn it on while you are setting things up.
bamboo_get_deploy_status makes N+1 calls. One request per environment, sequentially. On a deployment project with many environments it is noticeably slow; use the environment filter.
Tested against Bamboo Server / Data Center only. It targets /rest/api/latest/. Bamboo Cloud is a different product and is not supported.
make validate doesn't do what it looks like. It passes a --validate-only flag the binary never parses, so it just starts the server. Startup validation runs on every launch anyway.
Development
Never hardcode credentials in the Makefile — it reads them from the environment or an untracked .env.dev.
The binary takes no arguments in normal operation; these flags run one thing and exit:
Project structure
Tests
Every tool in the catalog is exercised. internal/tools/catalog_test.go walks
Catalog() and calls each tool through its registered handler against a fake
Bamboo REST server (helpers_test.go), so a tool that is declared but broken,
unrouted, or untested fails the build — there is no way to add a tool without a
test. Alongside that, the suite covers required-argument handling, upstream
error propagation, the plan-context resolution and environment parsing, and
token masking in the credential store.
.github/workflows/ci.yml runs gofmt, go vet and
go test -race on every push and pull request; the release pipeline repeats the
same gate before anything ships.
Adding a tool
- Add the API method to
internal/bamboo/client.go. - Add a handler in
internal/tools/bamboo_tools.go. - Declare the tool in
internal/tools/catalog.go— both in the relevant*Catalog()function and inHandlers():
- Add a case to
toolCasesininternal/tools/catalog_test.go. - Run
make tools-manifestto regeneratetools.json.
cmd/server/main.go registers whatever Catalog() returns, each one wrapped by
the policy engine — there is no way to expose a tool that bypasses the security
layer. Startup aborts if a declared tool has no handler, TestEveryDeclaredToolIsExercised
fails if it has no test, and TestToolsJSONIsCurrent fails if tools.json is stale.
The tool manifest
tools.json is the full tool surface — names, descriptions and
JSON Schemas — in exactly the shape an MCP client receives from tools/list. It
is generated from the catalog, not hand-maintained, and the binary can print it
without credentials or a reachable Bamboo:
Releasing
Releases are cut by pushing a version tag — everything else is automated by
.github/workflows/release.yml:
That triggers, in order:
- Test gate —
gofmtcheck,go vet,go test -race. Nothing ships if this fails. - Container image →
ghcr.io/<owner>/bamboo-mcp, multi-arch, tagged1.0.0,1.0,1andlatest, with build provenance attestation. - GitHub Release — cross-compiled binaries for linux/darwin (amd64 + arm64) and windows/amd64, plus
SHA256SUMSand auto-generated notes.
A tag containing a hyphen (v1.0.0-rc1) is published as a pre-release and does not move latest.
No secrets to configure — the workflow authenticates to GHCR with the built-in GITHUB_TOKEN. One-time setup: the first release creates the package as private, so make it public under Packages → bamboo-mcp → Package settings if you want anonymous pulls.
The version is stamped into the binary at build time via -ldflags -X main.version=, so VERBOSE=true logs report the exact release. Local builds report git describe output instead.
Adding a plan type
Append to plan_types in ~/.bamboo-mcp/context.yaml, then call bamboo_reload_context. No rebuild, no restart. See examples/context.yaml for every supported field.
Troubleshooting
Contributing
Issues and pull requests welcome. Please run make all before opening a PR.
- Fork, then branch from
main - Make your change
make all(fmt, vet, test, build)- Open a PR
License
Apache License 2.0 — see LICENSE.
Roadmap
- YAML-driven plan context knowledge
- Smart plan resolution and deployment status
- Deployment history and version tracking
- SSE/HTTP transport, Docker build
- Startup validation
- MCP prompt templates
- Security layer: policy engine + injection sanitizer
- Authentication for the SSE transport
- Concurrent environment fetching in
bamboo_get_deploy_status - Response caching
- Multiple Bamboo instances
來源:README.md,提交 cd0037c
工具
0版本歷史
1- v0.1.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
