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
7.0K downloads
54 stars

The CircleCI MCP Server implements the Model Context Protocol (MCP), allowing LLM-powered tools like Cursor IDE, Copilot, and Windsurf to interact with your CircleCI projects using natural language commands.

Requirements

  • CircleCI Personal API Token - generate one through the CircleCI dashboard at app.circleci.com/settings/user/tokens
  • For NPX installation: pnpm package manager and Node.js ≥ v18.0.0
  • For Docker installation: Docker installed on your system

Installation Options

Cursor IDE

Using NPX

Add the following to your Cursor MCP config:

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

Using Docker

Add the following to your Cursor MCP config:

{
  "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" // Optional - for on-prem only
      }
    }
  }
}

VS Code

Using NPX

Create or edit .vscode/mcp.json:

{
  "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"],
      "env": {
        "CIRCLECI_TOKEN": "${input:circleci-token}",
        "CIRCLECI_BASE_URL": "${input:circleci-base-url}"
      }
    }
  }
}

Using Docker

Create or edit .vscode/mcp.json:

{
  "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": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "CIRCLECI_TOKEN",
        "-e",
        "CIRCLECI_BASE_URL",
        "circleci:mcp-server-circleci"
      ],
      "env": {
        "CIRCLECI_TOKEN": "${input:circleci-token}",
        "CIRCLECI_BASE_URL": "${input:circleci-base-url}"
      }
    }
  }
}

Claude Desktop

Using NPX

Add the following to your claude_desktop_config.json:

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

File location:

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

Using Docker

Add the following to your claude_desktop_config.json:

{
  "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" // Optional - for on-prem only
      }
    }
  }
}

Claude Code

Using NPX

After installing Claude Code, run:

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

Using Docker

After installing Claude Code, run:

claude mcp add circleci-mcp-server -e CIRCLECI_TOKEN=your-circleci-token -e CIRCLECI_BASE_URL=https://circleci.com -- docker run --rm -i -e CIRCLECI_TOKEN -e CIRCLECI_BASE_URL circleci:mcp-server-circleci

Windsurf

Using NPX

Add the following to your windsurf mcp_config.json:

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

Using Docker

Add the following to your windsurf mcp_config.json:

{
  "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" // Optional - for on-prem only
      }
    }
  }
}

Amazon Q Developer

Edit your global configuration file ~/.aws/amazonq/mcp.json or create a new one in the current workspace .amazonq/mcp.json:

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

Quick Install via Smithery

To install CircleCI MCP Server for Claude Desktop automatically:

npx -y @smithery/cli install @CircleCI-Public/mcp-server-circleci --client claude

Supported Features

Getting Build Failure Logs

Retrieves detailed failure logs from CircleCI builds:

  1. Using Project Slug and Branch (Recommended):

    • First: "List my CircleCI projects"
    • Then: "Get build failures for my-project on the main branch"
  2. Using CircleCI URLs:

  3. Using Local Project Context:

    • "Find the latest failed pipeline on my current branch"

Finding Flaky Tests

Identifies flaky tests in your CircleCI project:

  1. Using Project Slug (Recommended):

    • First: "List my CircleCI projects"
    • Then: "Get flaky tests for my-project"
  2. Using CircleCI Project URL:

  3. Using Local Project Context:

    • "Find flaky tests in my current project"

Getting Pipeline Status

Retrieves the status of the latest pipeline:

  1. Using Project Slug and Branch (Recommended):

    • First: "List my CircleCI projects"
    • Then: "Get the status of the latest pipeline for my-project on the main branch"
  2. Using CircleCI Project URL:

  3. Using Local Project Context:

    • "Get the status of the latest pipeline for my current project"

Getting Test Results

Retrieves test metadata for CircleCI jobs:

  1. Using Project Slug and Branch (Recommended):

    • First: "List my CircleCI projects"
    • Then: "Get test results for my-project on the main branch"
  2. Using CircleCI URL:

  3. Using Local Project Context:

    • "Get test results for my current project on the main branch"

Configuration Helper

Assists with CircleCI configuration tasks:

  • "Validate my CircleCI config"

Running Pipelines

Triggers a pipeline to run:

  1. Using Project Slug and Branch (Recommended):

    • First: "List my CircleCI projects"
    • Then: "Run the pipeline for my-project on the main branch"
  2. Using CircleCI URL:

  3. Using Local Project Context:

    • "Run the pipeline for my current project on the main branch"

Rerunning Workflows

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

  • "Rerun the workflow from its failed job"

Listing Projects

Lists all projects that you're following on CircleCI:

  • "List my CircleCI projects"

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