Buildkite MCP Server is an official Model Context Protocol (MCP) server provided by Buildkite, used to expose Buildkite data (pipelines, builds, jobs, tests) to AI tools and editors. Full documentation is located at buildkite.com/docs/apis/mcp-server.
Purpose: to enable AI tools and editors to access Buildkite's build data, so as to create pipelines, diagnose and fix failures, trigger builds, monitor job queues, and more.
Main capabilities:
- Retries toolset (retries): supports investigating failures and retrying jobs under limited permissions, without the need for broader build write permissions. Includes list_builds, get_build, wait_for_build, list_jobs, get_job, search_logs, tail_logs, read_logs, retry_job, and retry_failed_jobs. Requires the read_builds, read_build_logs, and retry_builds scopes, rather than write_builds. retry_failed_jobs only retries infrastructure failures, and can use the dry_run option to inspect the proposed retries without executing them; retry_job retries a specific job. Both are mutating tools and are excluded by --read-only. This toolset does not expose create, rebuild, cancel, or unblock operations. Existing retry tools are still available in builds; choosing builds or all still requires write_builds for other mutations. The Buildkite API must have the RetryBuildsScope feature enabled for the token owner in order to accept retry_builds; existing write_builds tokens are still accepted. Hosted MCP OAuth can select this toolset at /mcp/x/retries after the hosted server adopts a version that includes the toolset. Selecting a toolset via request headers does not change the OAuth scopes of existing tokens. For library consumers, WithDisabledToolsets and the HTTP factory's disabled toolsets exclude all members of these toolsets, even when via reqThe same applies to nested groups. For example, disabling logs also removes the logging tool from retries; disabling retries removes its check and retry tools from other groups.
- Compare builds (compare_builds): a read-only tool in the investigations toolset that answers questions such as "What changed since the last successful build on main?" Requires org_slug, pipeline_slug, and a target build_number. It selects the most recently created earlier build on the same pipeline and exact branch that is currently passing. The baseline is not required to have been passing when the target started. A baseline_build_number can be provided to compare against a specific build in that pipeline, including failed builds or builds on other branches. The response identifies the baseline and selection rule, counts results across all jobs, and returns up to 100 job comparisons, prioritizing newly failing, recovered, and still-failing steps. Matching uses step keys, job type, matrix values, and parallel index/total. When both jobs lack keys, it falls back to exact non-empty name plus type, group key, matrix values, and parallel index/total, only if that combination is unique within each build. Matched pairs expose match_method: "step_key" or "name_fallback"; fallback matches carry a heuristic warning. Unnamed keyless jobs and duplicate identities remain unmatched. Explicit keys never fall back to names, even if keys are added, removed, or changed between builds. Additions/removals mean the job identity exists in only one build, so renaming a keyless job or changing matrix values or parallelism can also produce added/removed entries. Retry attempts are excluded; final attempt status and retry counts remain visible. Execution time and deltas cover only the final attempt. Scheduling time is from scheduled_at to started_at, not dependency or manual waits. These are not build wall-clock time comparisons or total retry costs. Missing or inconsistent timestamps omit the corresponding timing. Incomplete builds are explicitly identified as change snapshots. Any change in soft_failed is reported as state_changed: transitions between soft failure and hard failure, even if both jobs' status is failed, and transitions between passing and soft-failed jobs, which are never reported as newly failing or recovered, because soft failures do not block the build. A passing baseline build may contain soft-failed jobs. By default, up to three new blocking failures include their last 20Log entries: first new failing jobs, then state_changed jobs that are now hard failures, such as jobs that were soft failures in the baseline. Logs are limited to 8 KiB of log content each. Set include_logs: false to omit logs. Log errors do not discard the comparison, except for HTTP 401 authentication errors, which propagate through the server's reauthentication path. The tool requires the read_builds and read_build_logs scopes. Use get_build_failure_summary or tail_logs to investigate further; shared failing steps do not establish a shared root cause, nor do they make retries safe. Baseline discovery searches up to 500 candidates. If none is found, the response states that no comparison was performed and requires an explicit baseline. Job listings are limited to 1,000 jobs per build; larger listings return an error instead of misleading partial added/removed results. Output omissions are reported separately from full result counts.
Usage:
- The Go API exported by this module should be considered unstable and may have breaking changes as the project evolves.
- To ensure the MCP server runs in a secure environment, it is recommended to run it in a container. The image is built on cgr.dev/chainguard/static and runs as a non-privileged user.
- Identity header passthrough in HTTP mode: self-hosted HTTP deployments can forward selected headers from each inbound MCP request to the Buildkite API. Repeating --passthrough-http-header allows multiple headers, or set a comma-separated BUILDKITE_PASSTHROUGH_HTTP_HEADERS value. Only explicitly allowed headers are forwarded, and only to the origin configured by BUILDKITE_BASE_URL. They are removed from requests redirected elsewhere. To authenticate with each MCP request's own Buildkite API token, allow Authorization and omit the process-wide token. In this mode, each /mcp request must contain exactly one non-empty Authorization header. Missing credentials return HTTP 401; the server never falls back to a shared API token. The reverse proxy in front of the MCP server is responsible for authenticating callers and setting or validating any forwarded identity headers. Header passthrough is not available in stdio mode.Before serving job logs, the server verifies whether the current caller can access the job logs. This check is performed for every log tool request, including when the log data is already cached.
Use cases: suitable for developers and teams that need to integrate Buildkite build data into AI tools or editors, for scenarios such as pipeline management, build diagnostics, failure retries, and build comparison.
Limitations:
- The retry toolset does not expose create, rebuild, cancel, or unblock operations.
- Specific scopes are required (read_builds, read_build_logs, retry_builds), and the Buildkite API must have the RetryBuildsScope feature enabled.
- compare_builds baseline discovery searches up to 500 candidates, and job listings are limited to 1,000 jobs per build.
- Header passthrough is not available in stdio mode.
- The exported Go API is unstable and may have breaking changes.
- Running in a container is recommended for security.
See DEVELOPMENT.md for development guidelines. License: MIT Β© Buildkite, SPDX-License-Identifier: MIT.