GoCD MCP Server GoCD MCP Server is a production-grade Model Context Protocol server that exposes GoCD pipelines over Streamable HTTP with per-user authentication via GoCD Personal Access Tokens, enabling MCP-capable agents to inspect and operate pipelines while enforcing GoCD's own RBAC. The server offers 17 tools across three risk tiers, including read-only, safe actions, and config editing, gated by a single TOOLSET switch, and includes an audit log, health probes, and typed compact outputs. A production-grade Model Context Protocol https://modelcontextprotocol.io MCP server that exposes GoCD https://www.gocd.org/ over Streamable HTTP , authenticated per-user with GoCD Personal Access Tokens PAT . It lets MCP-capable agents Claude Code, Claude Desktop, IDE extensions, … inspect and operate GoCD pipelines β€” list and trigger pipelines, read statuses/history/console logs, pause/cancel, and optionally edit pipeline configuration β€” while GoCD's own RBAC is enforced for every call, because the server acts strictly as the authenticated user. Protocol: MCP revision 2025-11-25 , Streamable HTTP transport SDK: official modelcontextprotocol/go-sdk Language: Go 1.25+ Target: a single GoCD instance verified against GoCD 25.4.0 Features features Tools & resources tools--resources Requirements requirements Installation installation Configuration configuration Authentication & authorization authentication--authorization Running the server running-the-server Connecting an MCP client connecting-an-mcp-client Toolsets risk tiers toolsets-risk-tiers Architecture architecture Security security Logging & observability logging--observability Development development Troubleshooting troubleshooting Contributing contributing License license - πŸ” Per-user identity β€” the MCP client presents a GoCD PAT as a bearer token; the server validates it and acts as that user, so GoCD RBAC applies automatically. No shared service account. - 🧰 17 tools across three risk tiers β€” read-only, safe actions, and config editing β€” gated by a single TOOLSET switch. - 🧱 Typed, compact outputs β€” focused projections of GoCD's responses to keep token usage low. - πŸ““ Audit log β€” every mutating operation is logged login, action, target ; tokens are never logged. - 🩺 Health probes β€” /healthz liveness and /readyz checks GoCD reachability . - πŸ§ͺ Well-tested β€” unit domain , contract GoCD client via httptest , and end-to-end MCP over the real SDK client tests. Mutating tools carry MCP annotations destructiveHint / idempotentHint so the host can ask for user confirmation before running them. | Tool | Toolset | Kind | Description | |---|---|---|---| whoami | all | read | Authenticated GoCD login verifies the token | list pipelines | all | read | Dashboard pipelines with latest run status, pause/lock state optional group filter | get pipeline status | all | read | Pause / lock / schedulable state of a pipeline | get pipeline history | all | read | Past runs paginated via offset with stage statuses | get pipeline instance | all | read | One run's detail incl. per-stage and per-job state/result | get job console log | all | read | Console log of a job run last tail lines , default 200 | list agents | all | read | Build agents and their config/runtime state | get pipeline config | all | read | Full pipeline config + ETag needed to update | trigger pipeline | actions, full | action | Schedule a pipeline run | pause pipeline | actions, full | action | Pause a pipeline reason required | unpause pipeline | actions, full | action | Resume a paused pipeline | cancel stage | actions, full | action | Cancel a running stage | comment on pipeline | actions, full | action | Comment on a pipeline instance | update pipeline config | full | destructive | Replace a pipeline config optimistic locking via ETag/If-Match | create pipeline | full | destructive | Create a new pipeline in a group | update agent | full | destructive | Patch an agent enable/disable, resources, environments | delete pipeline | full | destructive | Delete a pipeline irreversible | Read-only mirrors of dashboard data, addressable by URI for a user/app to attach as context: gocd://dashboard β€” all pipelines and latest status gocd://agents β€” all build agents gocd://pipeline/{name}/config β€” a pipeline's configuration gocd://pipeline/{name}/history β€” a pipeline's recent runs - Go 1.25+ to build , or Docker - Network access to a GoCD server, and its URL GOCD BASE URL β€” required , no default - A GoCD Personal Access Token per user see below - TLS certificate/key for production or a TLS-terminating proxy php go install github.com/ivinco/gocd-mcp/cmd/gocd-mcp@latest - $GOBIN/gocd-mcp git clone https://github.com/ivinco/gocd-mcp.git cd gocd-mcp go build -o gocd-mcp ./cmd/gocd-mcp The image is multi-stage and runs on distroless/static as a non-root user nonroot , uid 65532 . It carries no configuration of its own: mount the config file and TLS certificates , and pass any overrides via environment variables . docker build -t gocd-mcp . Recommended: config file + certs mounted, secrets/overrides via env. Prepare a config.yaml see config.example.yaml /Ivinco/gocd-mcp/blob/master/config.example.yaml and your TLS material, then mount them read-only and point CONFIG FILE at the mounted path: docker run --rm -p 8443:8443 \ -v /etc/gocd-mcp/config.yaml:/etc/gocd-mcp/config.yaml:ro \ -v /etc/gocd-mcp/certs:/etc/gocd-mcp/certs:ro \ -e CONFIG FILE=/etc/gocd-mcp/config.yaml \ gocd-mcp Because the file wins over the environment, you can ship a baseline config.yaml and still override a single value at runtime only for keys the file omits β€” keep environment-specific or sensitive values out of the file and inject them with -e e.g. from your secret store : docker run --rm -p 8443:8443 \ -v /etc/gocd-mcp/config.yaml:/etc/gocd-mcp/config.yaml:ro \ -v /etc/gocd-mcp/certs:/etc/gocd-mcp/certs:ro \ -e CONFIG FILE=/etc/gocd-mcp/config.yaml \ -e LOG LEVEL=debug \ gocd-mcp Note: the file takes priority, so a key set in config.yaml cannot be overridden by -e . Put values you want to override at runtime in the environment and omit them from the file. Env-only no file β€” omit CONFIG FILE and pass everything as environment variables: docker run --rm -p 8443:8443 \ -e GOCD BASE URL=https://gocd.example.com \ -e TLS CERT FILE=/certs/tls.crt -e TLS KEY FILE=/certs/tls.key \ -e TOOLSET=readonly \ -v /etc/gocd-mcp/certs:/certs:ro \ gocd-mcp Each MCP user still authenticates with their own GoCD PAT via the Authorization: Bearer header see Authentication authentication--authorization ; the container holds no GoCD credential of its own. The server can be configured from environment variables , from a YAML config file , or both. Precedence is: built-in default < environment variable < YAML file the file wins A key present in the file overrides the matching environment variable; a key omitted from the file falls back to the env var, then to the default. The file is loaded only when CONFIG FILE points at it otherwise configuration is env-only, as before . | Variable | YAML key | Description | Default | |---|---|---|---| CONFIG FILE | β€” | Path to a YAML config file enables file-based config | β€” | GOCD BASE URL | gocd base url | GoCD server root URL β€” required | β€” | LISTEN ADDR | listen addr | Address to listen on | :8443 | TLS CERT FILE | tls cert file | TLS certificate set together with key | β€” | TLS KEY FILE | tls key file | TLS key set together with cert | β€” | MCP ENDPOINT PATH | mcp endpoint path | Path of the MCP endpoint | /mcp | GOCD REQUEST TIMEOUT | gocd request timeout | Per-request timeout to GoCD | 30s | TOKEN CACHE TTL | token cache ttl | How long a validated PAT is cached | 60s | TOOLSET | toolset | readonly | actions | full | full | LOG LEVEL | log level | debug | info | warn | error | info | LOG FILE | log file | Log destination; empty β†’ stderr, else append JSON to this file | β€” | GOCD BASE URL is the only required setting β€” the server refuses to start without it, from either source. Everything else has a working default. See config.example.yaml /Ivinco/gocd-mcp/blob/master/config.example.yaml for a fully annotated sample. Durations use Go syntax 30s , 2m , 1h .The MCP client sends the user's GoCD PAT as a bearer token on every request: Authorization: Bearer