CircleCI MCP server

Enables agents to talk to CircleCI. Fetch build failure logs to fix issues.
Back to servers
Setup instructions
Provider
CircleCI
Release date
Apr 06, 2025
Language
TypeScript
Package
Stats
19.7K downloads
63 stars

The CircleCI MCP Server integrates CircleCI with AI tools through the Model Context Protocol, allowing you to interact with CircleCI using natural language in supported IDEs and applications.

Installation Requirements

  • CircleCI Personal API Token - generate one through CircleCI's user token settings
  • For NPX installation: pnpm package manager and Node.js >= v18.0.0
  • For Docker installation: Docker

Installation Options

For Cursor IDE

Using NPX

Add this to your Cursor MCP config:

{
  "mcpServers": {
    "circleci-mcp-server": {
      "command": "npx",
      "args": ["-y", "@circleci/mcp-server-circleci@latest"],
      "env": {
        "CIRCLECI_TOKEN": "your-circleci-token",
        "CIRCLECI_BASE_URL": "https://circleci.com"
      }
    }
  }
}

Using Docker

{
  "mcpServers": {
    "circleci-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "CIRCLECI_TOKEN",
        "-e",
        "CIRCLECI_BASE_URL",
        "circleci:mcp-server-circleci"
      ],
      "env": {
        "CIRCLECI_TOKEN": "your-circleci-token",
        "CIRCLECI_BASE_URL": "https://circleci.com"
      }
    }
  }
}

For VS Code

Create .vscode/mcp.json with the following:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "circleci-token",
      "description": "CircleCI API Token",
      "password": true
    },
    {
      "type": "promptString",
      "id": "circleci-base-url",
      "description": "CircleCI Base URL",
      "default": "https://circleci.com"
    }
  ],
  "servers": {
    "circleci-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@circleci/mcp-server-circleci@latest"],
      "env": {
        "CIRCLECI_TOKEN": "${input:circleci-token}",
        "CIRCLECI_BASE_URL": "${input:circleci-base-url}"
      }
    }
  }
}

For Claude Desktop

Add to your Claude Desktop config file (location varies by OS):

{
  "mcpServers": {
    "circleci-mcp-server": {
      "command": "npx",
      "args": ["-y", "@circleci/mcp-server-circleci@latest"],
      "env": {
        "CIRCLECI_TOKEN": "your-circleci-token",
        "CIRCLECI_BASE_URL": "https://circleci.com"
      }
    }
  }
}

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

For Claude Code

Run this command after installing Claude Code:

claude mcp add circleci-mcp-server -e CIRCLECI_TOKEN=your-circleci-token -- npx -y @circleci/mcp-server-circleci@latest

For Windsurf

Add to your Windsurf mcp_config.json:

{
  "mcpServers": {
    "circleci-mcp-server": {
      "command": "npx",
      "args": ["-y", "@circleci/mcp-server-circleci@latest"],
      "env": {
        "CIRCLECI_TOKEN": "your-circleci-token",
        "CIRCLECI_BASE_URL": "https://circleci.com"
      }
    }
  }
}

For Amazon Q Developer CLI

Edit ~/.aws/amazonq/mcp.json or .amazonq/mcp.json with:

{
  "mcpServers": {
    "circleci-local": {
      "command": "npx",
      "args": [
        "-y",
        "@circleci/mcp-server-circleci@latest"
      ],
      "env": {
        "CIRCLECI_TOKEN": "YOUR_CIRCLECI_TOKEN",
        "CIRCLECI_BASE_URL": "https://circleci.com"
      },
      "timeout": 60000
    }
  }
}

Supported Tools and Features

get_build_failure_logs

Retrieves detailed failure logs from CircleCI builds using project slug and branch, CircleCI URLs, or local project context.

find_flaky_tests

Identifies flaky tests in your CircleCI project by analyzing test execution history.

get_latest_pipeline_status

Retrieves the status of the latest pipeline for a given branch.

get_job_test_results

Retrieves test metadata for CircleCI jobs, including test failures and performance metrics.

config_helper

Assists with CircleCI configuration tasks by providing guidance and validation.

list_followed_projects

Lists all projects that the user is following on CircleCI.

run_pipeline

Triggers a pipeline to run for a specific project and branch.

run_rollback_pipeline

Triggers a rollback for a project, either using a dedicated rollback pipeline or by rerunning a previous workflow.

rerun_workflow

Reruns a workflow from its start or from the failed job.

list_component_versions

Lists all versions for a specific CircleCI component in an environment.

download_usage_api_data

Downloads usage data from the CircleCI Usage API for a given organization.

find_underused_resource_classes

Analyzes CircleCI usage data to find jobs with low resource utilization.

Troubleshooting

Quick Fixes

  • Clear package caches: npx clear-npx-cache and npm cache clean --force
  • Force latest version: add @latest to your config
  • Restart your IDE completely

Authentication Issues

  • Verify your CircleCI token is valid
  • Ensure token has proper permissions
  • Check environment variables are properly set

Connection Issues

  • Confirm base URL is correct
  • Check network proxy settings if behind a firewall

System Requirements

  • Ensure Node.js version ≥ 18.0.0
  • Verify npm/pnpm is working properly

For more complex issues, try running with verbose logging:

DEBUG=* npx @circleci/mcp-server-circleci@latest

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "circleci-mcp-server" '{"command":"npx","args":["-y","@circleci/mcp-server-circleci"],"env":{"CIRCLECI_TOKEN":"your-circleci-token","CIRCLECI_BASE_URL":"https://circleci.com"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "circleci-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@circleci/mcp-server-circleci"
            ],
            "env": {
                "CIRCLECI_TOKEN": "your-circleci-token",
                "CIRCLECI_BASE_URL": "https://circleci.com"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "circleci-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@circleci/mcp-server-circleci"
            ],
            "env": {
                "CIRCLECI_TOKEN": "your-circleci-token",
                "CIRCLECI_BASE_URL": "https://circleci.com"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later