CircleCI MCP server

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

The CircleCI MCP Server implements the Model Context Protocol, allowing AI assistants to interact with your CircleCI projects. This integration enables natural language interactions for retrieving build logs, finding flaky tests, checking pipeline statuses, and more—all without leaving your IDE.

Requirements

Installation Options

Cursor IDE

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 customers only
      }
    }
  }
}

For more details, see the Cursor MCP configuration guide.

VS Code

Create or edit .vscode/mcp.json with the following content:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "circleci-token",
      "description": "CircleCI API Token",
      "password": true
    }
  ],
  "servers": {
    "circleci-mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@circleci/mcp-server-circleci"],
      "env": {
        "CIRCLECI_TOKEN": "${input:circleci-token}"
      }
    }
  }
}

For more details, see the VS Code MCP servers guide.

Claude Desktop

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 customers only
      }
    }
  }
}

To find/create this file:

  1. Open Claude Desktop settings
  2. Click "Developer" in the left sidebar
  3. Click "Edit Config"

Configuration file locations:

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

For more details, see the MCP servers guide for Claude Desktop.

Claude Code

After installing Claude Code, run:

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

For more details, see the Claude Code MCP guide.

Windsurf

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 customers only
      }
    }
  }
}

For more details, see the Windsurf MCP guide.

Smithery Installation

To automatically install CircleCI MCP Server for Claude Desktop via Smithery:

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

Available Features

Get Build Failure Logs

Retrieves detailed failure logs from CircleCI builds either by:

  • Using a CircleCI URL: Get logs from https://app.circleci.com/pipelines/github/org/repo/123
  • Using local context: Find the latest failed pipeline on my current branch

The tool returns formatted logs with job names, execution details, and failure messages.

Find Flaky Tests

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

  • Using a CircleCI project URL: Find flaky tests in https://app.circleci.com/pipelines/github/org/repo
  • Using local context: Find flaky tests in my current project

Returns detailed information about flaky tests, including names, file locations, and failure contexts.

Get Latest Pipeline Status

Retrieves the status of the latest pipeline for a branch:

  • Using a CircleCI project URL: Get the status of the latest pipeline for https://app.circleci.com/pipelines/github/org/repo
  • Using local context: Get the status of the latest pipeline for my current project

Returns workflow names, status, duration, and timestamps.

Get Job Test Results

Retrieves test metadata for CircleCI jobs:

  • Using a CircleCI URL: Get test results for https://app.circleci.com/pipelines/github/org/repo/123/workflows/abc-def
  • Using local context: Get test results for my current project on the main branch

Returns test summaries, failed test details, and successful test information.

Config Helper

Assists with CircleCI configuration tasks:

  • Validate configuration: Validate my CircleCI config

Provides validation results and configuration recommendations.

Create Prompt Template

Helps generate structured prompt templates for AI applications:

  • Example: Create a prompt template for generating bedtime stories by age and topic

Returns a structured prompt template and context schema.

Recommend Prompt Template Tests

Generates test cases for prompt templates:

  • Example: Generate tests for my bedtime story prompt template

Returns an array of recommended test cases with various parameter combinations.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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