Skip to content

CircleCI MCP Server

Connect your AI assistant to your CircleCI data to debug failures, analyze test results, and improve pipelines using natural language.

CI/CD context for AI tools

The CircleCI MCP server makes your build system understandable by AI tools like Cursor, Claude Code, Windsurf, and more. It’s built on the Model Context Protocol (MCP), a lightweight standard that allows LLM-powered agents to fetch structured data from external systems.

By connecting to the CircleCI MCP Server, agents gain real-time visibility into:

  • Build logs and test outputs
  • Pipeline statuses
  • Recent configuration changes
  • Workflow performance metrics

That means instead of digging through job logs or dashboard UIs, you can ask:

why did my last build fail?

and get all the context you need to fix the issue and keep moving without breaking stride.

Turn build data into action

Once installed, the MCP server makes your CI/CD data accessible through natural language. LLM-based tools can:

  • Diagnose failing builds
    Get structured error summaries and logs.

  • Trace failures to recent changes
    Connect regressions to commits, diffs, or workflows.

  • Spot flaky tests
    Surface instability patterns from test history.

  • Recommend improvements
    Suggest config or timing optimizations in context.

  • Bring CI data into your editor
    Use LLM tools to reason through builds without switching tabs.

With access to both code and build context, these tools can help you fix bugs faster, ship changes with confidence, and stay focused on the work that matters.

Recommended setup

For local editors — use the CircleCI CLI. The MCP server is built directly into the CLI, which is the recommended way to connect Cursor, VS Code, Claude Desktop, and similar tools to CircleCI.

For web-hosted agents like Claude.ai, or if company policy prefers — use the hosted MCP server, which connects via OAuth2 and requires no local install.

Both can be active at the same time.

Note for current standalone MCP server users: Our original standalone MCP server is in maintenance mode and is no longer recommended. If you need to stay on the standalone server for now, use version 0.19.0 or later. Installs that use the @latest tag pick this up automatically; if you pin a specific version, point your configuration at @circleci/mcp-server-circleci@0.19.0.

Get started with MCP

Prerequisites

Hosted CircleCI MCP server:

  • An AI coding assistant / MCP host that supports remote MCP servers over streamable HTTP.
  • If your MCP host cannot complete an OAuth2 flow, a CircleCI personal API token (see Managing API Tokens.

CircleCI CLI MCP:

Install the CircleCI CLI, then run circleci auth login or set the CIRCLE_TOKEN environment variable.

Configuration instructions

Heads up: The old local MCP server installed with npx or Docker and a CIRCLECI_TOKEN is deprecated. If your AI assistant still has it configured, remove it before setting up the options below. For example, in Claude Code run claude mcp remove circleci-mcp-server.

Option 1 — Hosted MCP server

CircleCI hosts a remote MCP server at https://mcp.circleci.com/v1/mcp. Nothing to install. Authenticate with OAuth2 by signing in with your CircleCI account. If your MCP host cannot complete an OAuth2 flow (for example, headless or automated setups), see the fall back below.

Claude Code

Authenticate with OAuth2 (recommended):

  1. Add the server:
    claude mcp add --transport http circleci-mcp-server https://mcp.circleci.com/v1/mcp
  2. Run /mcp inside Claude Code and select circleci-mcp-server.
  3. Select Authenticate to complete the OAuth2 sign-in in your browser.

Authenticate with a personal API token (fallback):

claude mcp add --transport http circleci-mcp-server https://mcp.circleci.com/v1/mcp \
  --header "Authorization: Bearer <your-circleci-token>"

Claude Code MCP docs

Claude Desktop & claude.ai

Authenticate with OAuth2 (recommended):

  1. Go to Settings > Connectors.
  2. Select Add custom connector.
  3. Enter https://mcp.circleci.com/v1/mcp as the server URL.
  4. Select Add, then complete the OAuth2 sign-in in your browser.

Custom connectors docs

Cursor

Authenticate with OAuth2 (recommended):

  1. Use this link to add the server automatically: Add CircleCI MCP server to Cursor. This opens an install prompt in your Cursor settings.
  2. Select Install. The server shows a "Needs authentication" label with a Connect button.
  3. Select Connect to start the OAuth2 flow in your browser.

Or add this to your Cursor mcp.json file:

{
  "mcpServers": {
    "circleci-mcp-server": {
      "url": "https://mcp.circleci.com/v1/mcp"
    }
  }
}

Authenticate with a personal API token (fallback):

{
  "mcpServers": {
    "circleci-mcp-server": {
      "url": "https://mcp.circleci.com/v1/mcp",
      "headers": {
        "Authorization": "Bearer <your-circleci-token>"
      }
    }
  }
}

Cursor setup docs

VS Code

Authenticate with OAuth2 (recommended):

Use this link to add the server automatically: Add CircleCI MCP server to VS Code.

Or add this to your .vscode/mcp.json file:

{
  "servers": {
    "circleci-mcp-server": {
      "type": "http",
      "url": "https://mcp.circleci.com/v1/mcp"
    }
  }
}

Authenticate with a personal API token (fallback):

{
  "servers": {
    "circleci-mcp-server": {
      "type": "http",
      "url": "https://mcp.circleci.com/v1/mcp",
      "headers": {
        "Authorization": "Bearer <your-circleci-token>"
      }
    }
  }
}

VS Code setup docs

Windsurf

Authenticate with OAuth2 (recommended):

Add this to your Windsurf mcp_config.json file:

{
  "mcpServers": {
    "circleci-mcp-server": {
      "serverUrl": "https://mcp.circleci.com/v1/mcp"
    }
  }
}

Authenticate with a personal API token (fallback):

{
  "mcpServers": {
    "circleci-mcp-server": {
      "serverUrl": "https://mcp.circleci.com/v1/mcp",
      "headers": {
        "Authorization": "Bearer <your-circleci-token>"
      }
    }
  }
}

Windsurf setup docs

Need a personal API token? See Managing API tokens. Treat the token like a password — reference it through an environment variable or secret store where your MCP host supports it. Full instructions: Connecting to the CircleCI MCP server.

Option 2 — CircleCI CLI MCP (local)

The CircleCI CLI includes a built-in MCP server that runs locally on your machine using your existing CLI authentication. Use this if you prefer a fully local setup.

CircleCI CLI MCP

Prerequisites:

  • The CircleCI CLI installed.
  • An authenticated CLI session. Run circleci auth login, or set the CIRCLE_TOKEN environment variable.

Enable the MCP server for your AI assistant with one command:

circleci mcp claude enable    # Claude Desktop
circleci mcp cursor enable    # Cursor
circleci mcp vscode enable    # VS Code

To disable it, replace enable with disable.

Start the server manually over the default stdio transport, or stream it over HTTP:

circleci mcp start     # start over stdio
circleci mcp stream    # stream over HTTP

CLI MCP setup docs · CLI MCP command reference

Available tools

Each MCP exposes a different set of tools. The hosted server provides a curated set of CI/CD actions tuned for AI-driven development and agentic workflows, while the CLI MCP exposes the full CircleCI CLI. Whichever you connect, the tools give AI developers structured CI/CD context for faster, more reliable release cycles.

Hosted MCP server tools

Tool Uses
analyze_diffCatch rule violations in your diff before code review
config_helperFix config issues before they break your pipeline
create_prompt_templateGenerate prompts that support consistent AI behavior
download_usage_api_dataExport CircleCI usage data for cost and capacity analysis
find_flaky_testsIdentify and troubleshoot unstable tests
find_underused_resource_classesFind jobs with low CPU/RAM utilization for downsizing
get_build_failure_logsDebug and resolve failed builds faster
get_job_test_resultsUnderstand and fix test failures and performance issues
get_latest_pipeline_statusMonitor and act on pipeline health
list_artifactsFind and download artifacts produced by a job
list_component_versionsView deployed versions and pick rollback targets
list_followed_projectsFind projects you follow and their projectSlug
recommend_prompt_template_testsTest and improve prompt reliability
rerun_workflowRerun workflows from the beginning or from a failed job
run_evaluation_testsRun prompt evaluation tests on a CircleCI pipeline
run_pipelineTrigger builds while staying in your editor
run_rollback_pipelineRoll back faulty deployments with a single command

CLI MCP tools

The CLI MCP exposes the entire CircleCI CLI as tools, including:

  • Config authoring — validate, process, pack, and generate config YAML.
  • Org and project management — contexts, env vars, project/org settings.
  • Orb tooling — create, publish, validate, and diff orb versions.
  • Security policy — push, test, and evaluate Rego policies.
  • Self-hosted runners — manage runner resource classes and tokens.
  • iOS code signing — manage certificates and signing configs.
  • Deploy tracking — list and instrument deploys.
  • Docker Layer Cache — purge DLC.
  • Direct API access — call the CircleCI API directly via circleci api.

Learn more

Go deeper on the CircleCI MCP with docs, background reading, and the latest platform updates: