CircleCI MCP Server – CI Pipeline Diagnostics
CircleCI's official MCP server gives AI coding agents structured access to CircleCI pipeline data and supported CI actions. Use it to diagnose failures, inspect test results, validate configuration, rerun workflows, trigger pipelines, investigate resource usage, and support rollback workflows.
Overview
CircleCI's official MCP server connects compatible AI coding assistants to
CircleCI pipelines. It converts CircleCI API responses into structured context
that an agent can use to diagnose build failures, analyze tests, inspect
pipeline status, and perform selected CI actions without requiring the user to
leave the development environment.
What the MCP server enables
CircleCI documents tools for pipeline diagnostics, testing, configuration,
workflow control, resource analysis, and deployment recovery. Depending on the
authenticated account and project access, an AI agent can:
- Retrieve structured build-failure logs from a job or pipeline.
- Find flaky tests and inspect job test results.
- Get the latest pipeline status for a project or branch.
- Validate and improve CircleCI configuration.
- Trigger pipelines and rerun workflows.
- List followed projects and job artifacts.
- Analyze diffs for CI-related rule violations.
- Download usage data and identify underused resource classes.
- List deployed component versions and run supported rollback pipelines.
- Run prompt-evaluation workflows and related tests.
When to use it
Use CircleCI MCP when an agent needs current CI/CD context or must perform an
authorized CircleCI action. Typical workflows include explaining why a pull
request build failed, retrieving the logs for a failed deploy, finding unstable
tests, validating a .circleci/config.yml file, rerunning a failed workflow,
triggering a pipeline from an editor, reviewing resource utilization, and
preparing or executing an approved rollback.
Connection and authentication
CircleCI provides an official local stdio server through the
@circleci/mcp-server-circleci npm package. It requires Node.js 18 or later and
a CircleCI personal API token in CIRCLECI_TOKEN.
CircleCI also publishes the official Docker image
circleci/mcp-server-circleci, which runs over stdio and receives the same
environment variables. For CircleCI Cloud, CIRCLECI_BASE_URL can be omitted
or set to https://circleci.com. It is required when connecting to CircleCI
Server and must point to that installation's base URL.
Key considerations
The MCP server operates with the permissions of the supplied personal API
token. Store the token in a secret manager or protected environment variable,
and never commit it to source control. Require human confirmation before
triggering pipelines, rerunning workflows, running rollbacks, or changing CI
configuration. Restart the MCP server or reload the client after CircleCI adds
tools so the latest capabilities are discovered. Use project-scoped workflows
and minimum access wherever possible.
Supported Transports
stdio
Command: npx
Args:
-y@circleci/mcp-server-circleci@latest
stdio
Command: docker
Args:
run--rm-i-eCIRCLECI_TOKENcircleci/mcp-server-circleci
Frequently Asked Questions
- When should an AI agent use the CircleCI MCP server?
- Use it when a workflow needs current CircleCI pipeline context or an authorized CI action, such as diagnosing a failed build, inspecting tests, checking pipeline status, validating configuration, rerunning a workflow, triggering a pipeline, analyzing resource use, or preparing a rollback.
- What does the CircleCI MCP server add to an AI agent's capabilities?
- It gives the agent structured access to live CircleCI logs, job metadata, test results, pipeline state, usage data, and supported workflow actions, instead of relying only on static model knowledge or manually copied build output.
- What can an AI agent access or manage through CircleCI MCP?
- Depending on token permissions and project access, the agent can retrieve failure logs, inspect test results, find flaky tests, check pipeline status, validate configuration, list projects and artifacts, trigger pipelines, rerun workflows, analyze resource use, and run supported rollback workflows.
- How is authentication configured for the CircleCI MCP server?
- The server requires a CircleCI personal API token in CIRCLECI_TOKEN. Store the token outside the YAML in a protected environment or secret manager. CIRCLECI_BASE_URL is required only for CircleCI Server installations and is optional for CircleCI Cloud.
- Which transport should be used for the CircleCI MCP server?
- Use stdio with the official npm package for a direct local setup, or use stdio with CircleCI's official Docker image when container isolation is preferred. CircleCI's standard documented client configurations use these local stdio options.