BU

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.

Quick Install
npx -y @buildkite/buildkite-mcp-server

Overview

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):

git clone https://github.com/buildkite/buildkite-mcp-server.git
cd buildkite-mcp-server
# build binary (requires Go)
go build ./cmd/mcp-server
./mcp-server --help

Run with environment variables (example):

export BUILDKITE_TOKEN="your_buildkite_api_token"
export LISTEN_ADDR="0.0.0.0:8080"   # default listen address
export LOG_LEVEL="info"

./mcp-server

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:
docker run -e BUILDKITE_TOKEN="$BUILDKITE_TOKEN" \
  -p 8080:8080 \
  --read-only \
  --rm \
  buildkite/mcp-server:latest

Kubernetes Deployment (snippet):

apiVersion: apps/v1
kind: Deployment
metadata: { name: buildkite-mcp-server }
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:

ResourceDescriptionExample fields
PipelineBuildkite pipeline metadata and configurationid, slug, name, repository, branch rules
BuildIndividual build run metadataid, number, state, created_at, started_at, finished_at
JobJob/step within a buildid, name, state, agent_query_rules, exit_status
TestTest 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:

    1. Extension requests “latest failed tests for pipeline X”.
    2. MCP server returns test objects with links to job logs and commit hashes.
    3. 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:

    1. Query pipeline and recent builds as MCP objects.
    2. 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).