Buildkite MCP Server for Pipelines and Builds
Expose Buildkite pipelines, builds, jobs, and tests via an MCP server for seamless AI tooling and editor integration.
npx -y @buildkite/buildkite-mcp-serverOverview
The Buildkite MCP Server exposes Buildkite data (pipelines, builds, jobs, tests) through a Model Context Protocol (MCP) compatible HTTP API. By translating Buildkite concepts into MCP objects, it makes CI/CD context consumable by AI tools, editor integrations, and other automation that understand the MCP schema.
For developers this means you can surface live pipeline state, historical builds, job metadata, and test results into language-model agents, code assistants, or custom dashboards without bespoke scraping of the Buildkite API. The server is intended to run alongside your tooling (locally, in CI, or in a cluster) and securely bridge Buildkite and MCP-aware clients.
Features
- Exposes Buildkite entities as MCP objects: pipelines, builds, jobs, and tests
- Translates Buildkite metadata into a standardized MCP schema for downstream tools
- Lightweight Go server with an exported (unstable) Go API for embedding or extension
- Container-friendly image and recommendations for running unprivileged
- Configuration via environment variables for tokens, listen address, and logging
- Designed for editor/AI integrations that require contextual model inputs
Installation / Configuration
Prerequisites:
- Buildkite API token with read access to required pipelines/builds.
- Go toolchain if building from source, or Docker to run a container image.
Clone and build (example):
# build binary (requires Go)
Run with environment variables (example):
# default listen address
Docker (recommended for isolation):
- Example Dockerfile (build your image):
FROM golang:1.20 AS builder
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /mcp-server ./cmd/mcp-server
FROM cgr.dev/chainguard/static:latest
COPY --from=builder /mcp-server /mcp-server
USER 65532:65532
ENTRYPOINT ["/mcp-server"]
- Run container:
Kubernetes Deployment (snippet):
apiVersion: apps/v1
kind: Deployment
metadata:
spec:
replicas: 1
template:
spec:
containers:
- name: mcp-server
image: buildkite/mcp-server:latest
env:
- name: BUILDKITE_TOKEN
valueFrom:
secretKeyRef:
name: bk-token
key: token
ports:
- containerPort: 8080
securityContext:
runAsUser: 65532
runAsNonRoot: true
Security recommendations:
- Run the server in a container and avoid exposing it publicly.
- Store BUILDKITE_TOKEN in a secrets manager or Kubernetes Secret.
- Limit token scope to read-only where possible.
- Use network policies and firewall rules to restrict access to MCP consumers.
Available Resources
The server maps Buildkite concepts to MCP object types. Typical exposed resources include:
| Resource | Description | Example fields |
|---|---|---|
| Pipeline | Buildkite pipeline metadata and configuration | id, slug, name, repository, branch rules |
| Build | Individual build run metadata | id, number, state, created_at, started_at, finished_at |
| Job | Job/step within a build | id, name, state, agent_query_rules, exit_status |
| Test | Test result annotations (when available) | name, status, duration, file, line |
Clients communicate with the server over the MCP HTTP API. The server provides MCP-compliant JSON-LD payloads so AI agents and editors that understand MCP can consume these objects directly.
Use Cases
Editor assistant: An editor extension queries the MCP server to show the latest failing tests and relevant build logs inline while authoring a fix. Example flow:
- Extension requests “latest failed tests for pipeline X”.
- MCP server returns test objects with links to job logs and commit hashes.
- Assistant synthesizes a short fix suggestion with context from the step script.
AI tooling: A model-driven automation uses MCP to get pipeline topology (jobs and dependencies) and suggests optimizations (e.g., parallelizable steps). Example:
- Query pipeline and recent builds as MCP objects.
- Analyze job durations and concurrency to recommend parallelization.
CI dashboard: A custom dashboard aggregates MCP objects to display historical pass rates, flaky tests, and slowest steps without custom scraping of Buildkite endpoints.
Local development/testing: Run a local MCP server to provide reproducible contexts to model-based unit tests or to simulate CI state for tooling development.
Developer notes
- The exported Go API is considered unstable and may change; for production integrations prefer using the MCP HTTP API over internal libraries.
- Full documentation and API details are available in the repository and Buildkite docs:
- GitHub: https://github.com/buildkite/buildkite-mcp-server
- MCP intro: https://modelcontextprotocol.io/introduction
- Buildkite docs: https://buildkite.com/docs/apis/mcp-server
Contributing & License
See DEVELOPMENT.md in the repo for contributing guidelines. The project is MIT licensed (SPDX: MIT).