This CircleCI MCP Server enables interaction with CircleCI pipelines and projects using natural language through MCP-supported clients. Key capabilities include:
Debug build failures: Retrieve detailed failure logs from CircleCI builds
Identify flaky tests: Analyze test execution history to find problematic tests
Check pipeline status: Get latest pipeline status for specific branches or projects
Retrieve test results: Fetch test metadata including detailed failure analysis
Validate CircleCI config: Provide configuration guidance and validation
List followed projects: Display all projects you're following with projectSlugs
Run pipelines: Trigger pipeline executions for specific branches
Create prompt templates: Generate structured templates for AI-enabled applications
Recommend prompt tests: Generate test cases to ensure expected results
Integrates with CircleCI to retrieve build failure logs and identify flaky tests. Supports accessing logs via CircleCI URLs or local project context, and analyzing test execution history to detect unreliable tests in a project's test suite.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-circlecishow me the status of my latest pipeline"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CircleCI MCP Server
Model Context Protocol (MCP) is a new, standardized protocol for managing context between large language models (LLMs) and external systems. In this repository, we provide an MCP Server for CircleCI.
Use Cursor, Windsurf, Copilot, Claude, or any MCP-compatible client to interact with CircleCI using natural language — without leaving your IDE.
Tools
Tool | Description |
Retrieve detailed failure logs from CircleCI builds | |
Identify flaky tests by analyzing test execution history | |
Get the status of the latest pipeline for a branch | |
Retrieve test metadata and results for CircleCI jobs | |
Validate and get guidance for your CircleCI configuration | |
Generate structured prompt templates for AI applications | |
Generate test cases for prompt templates | |
List all CircleCI projects you're following | |
Trigger a pipeline to run | |
Trigger a rollback for a project | |
Rerun a workflow from start or from the failed job | |
Analyze git diffs against cursor rules for violations | |
List all versions for a CircleCI component | |
Download usage data from the CircleCI Usage API | |
Find jobs with underused compute resources |
Related MCP server: Enhanced Interactive Feedback MCP Server
Installation
Prerequisites:
NPX: Node.js >= v18 and pnpm
Docker: Docker
Using NPX in a local MCP Server
Add the following to your Cursor MCP config:
CIRCLECI_BASE_URLis optional — required for on-prem customers only.MAX_MCP_OUTPUT_LENGTHis optional — maximum output length for MCP responses (default: 50000).
Using Docker in a local MCP Server
Add the following to your Cursor MCP config:
Using a Self-Managed Remote MCP Server
Add the following to your Cursor MCP config:
Prerequisites:
NPX: Node.js >= v18 and pnpm
Docker: Docker
Using NPX in a local MCP Server
Add the following to .vscode/mcp.json in your project:
💡 Inputs are prompted on first server start, then stored securely by VS Code.
Using Docker in a local MCP Server
Add the following to .vscode/mcp.json in your project:
Using a Self-Managed Remote MCP Server
Add the following to .vscode/mcp.json in your project:
Prerequisites:
NPX: Node.js >= v18 and pnpm
Docker: Docker
Using NPX in a local MCP Server
Add the following to your claude_desktop_config.json:
Using Docker in a local MCP Server
Add the following to your claude_desktop_config.json:
Using a Self-Managed Remote MCP Server
Create a wrapper script (e.g. circleci-remote-mcp.sh):
Make it executable:
Then add the following to your claude_desktop_config.json:
To find or create your config file, open Claude Desktop settings, click Developer in the left sidebar, then click Edit Config. The config file is located at:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
For more information: https://modelcontextprotocol.io/quickstart/user
Prerequisites:
NPX: Node.js >= v18 and pnpm
Docker: Docker
Using NPX in a local MCP Server
Using Docker in a local MCP Server
Using a Self-Managed Remote MCP Server
For more information: https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp
Prerequisites:
NPX: Node.js >= v18 and pnpm
Docker: Docker
Using NPX in a local MCP Server
Add the following to your Windsurf mcp_config.json:
Using Docker in a local MCP Server
Add the following to your Windsurf mcp_config.json:
Using a Self-Managed Remote MCP Server
Add the following to your Windsurf mcp_config.json:
For more information: https://docs.windsurf.com/windsurf/mcp
Prerequisites:
MCP client configuration in Amazon Q Developer is stored in JSON format in a file named mcp.json. Two levels of configuration are supported:
Global:
~/.aws/amazonq/mcp.json— applies to all workspacesWorkspace:
.amazonq/mcp.json— specific to the current workspace
If both files exist, their contents are merged. In case of conflict, the workspace config takes precedence.
Using NPX in a local MCP Server
Edit ~/.aws/amazonq/mcp.json or create .amazonq/mcp.json with the following:
Using a Self-Managed Remote MCP Server
Create a wrapper script (e.g. circleci-remote-mcp.sh):
Make it executable and add it:
Prerequisites:
Using NPX in a local MCP Server
Edit ~/.aws/amazonq/mcp.json or create .amazonq/mcp.json with the following:
Using a Self-Managed Remote MCP Server
Create a wrapper script (e.g. circleci-remote-mcp.sh):
Make it executable, then add it via the MCP configuration UI:
Choose the + symbol
Select scope: global or local
Enter a name (e.g.
circleci-remote-mcp)Select transport protocol: stdio
Enter the command path to your script
Click Save
To install CircleCI MCP Server for Claude Desktop automatically via Smithery:
Demo
Example: "Find the latest failed pipeline on my branch and get logs" — see the wiki for more examples.
https://github.com/user-attachments/assets/3c765985-8827-442a-a8dc-5069e01edb74
Tool Details
Retrieves detailed failure logs from CircleCI builds. This tool can be used in three ways:
Using Project Slug and Branch (Recommended):
First use
list_followed_projectsto get your projects, then:Example: "Get build failures for my-project on the main branch"
Using CircleCI URLs:
Provide a failed job URL or pipeline URL directly
Example: "Get logs from https://app.circleci.com/pipelines/github/org/repo/123"
Using Local Project Context:
Works from your local workspace by providing workspace root, git remote URL, and branch name
Example: "Find the latest failed pipeline on my current branch"
The tool returns formatted logs including:
Job names
Step-by-step execution details
Failure messages and context
Identifies flaky tests in your CircleCI project by analyzing test execution history. Leverages the flaky test detection feature in CircleCI.
This tool can be used in three ways:
Using Project Slug (Recommended):
First use
list_followed_projectsto get your projects, then:Example: "Get flaky tests for my-project"
Using CircleCI Project URL:
Example: "Find flaky tests in https://app.circleci.com/pipelines/github/org/repo"
Using Local Project Context:
Works from your local workspace by providing workspace root and git remote URL
Example: "Find flaky tests in my current project"
Output modes:
Text (default): Returns flaky test details in text format
File (requires
FILE_OUTPUT_DIRECTORYenv var): Creates a directory with flaky test details
Retrieves the status of the latest pipeline for a given branch. This tool can be used in three ways:
Using Project Slug and Branch (Recommended):
Example: "Get the status of the latest pipeline for my-project on the main branch"
Using CircleCI Project URL:
Example: "Get the status of the latest pipeline for https://app.circleci.com/pipelines/github/org/repo"
Using Local Project Context:
Works from your local workspace by providing workspace root, git remote URL, and branch name
Example output:
Retrieves test metadata for CircleCI jobs, allowing you to analyze test results without leaving your IDE. This tool can be used in three ways:
Using Project Slug and Branch (Recommended):
Example: "Get test results for my-project on the main branch"
Using CircleCI URL:
Job URL:
https://app.circleci.com/pipelines/github/org/repo/123/workflows/abc-def/jobs/789Workflow URL:
https://app.circleci.com/pipelines/github/org/repo/123/workflows/abc-defPipeline URL:
https://app.circleci.com/pipelines/github/org/repo/123
Using Local Project Context:
Works from your local workspace by providing workspace root, git remote URL, and branch name
The tool returns:
Summary of all tests (total, successful, failed)
Detailed info on failed tests: name, class, file, error message, duration
List of successful tests with timing
Filter by test result
Test metadata must be configured in your CircleCI config. SeeCollect Test Data for setup instructions.
Assists with CircleCI configuration tasks by providing guidance and validation.
Validates your
.circleci/config.ymlfor syntax and semantic errorsProvides detailed validation results and configuration recommendations
Example: "Validate my CircleCI config"
Generates structured prompt templates for AI-enabled applications based on feature requirements.
Transforms user requirements into optimized prompt templates
Returns a structured template and a context schema defining required input parameters
Example: "Create a prompt template for generating bedtime stories by age and topic"
Generates test cases for prompt templates to ensure they produce expected results.
Creates diverse test scenarios based on your prompt template and context schema
Returns an array of recommended test cases with various parameter combinations
Example: "Generate tests for my bedtime story prompt template"
Lists all projects that the user is following on CircleCI.
Shows all projects you have access to with their
projectSlugExample: "List my CircleCI projects"
Example output:
TheprojectSlug (not the project name) is required for many other CircleCI tools.
Triggers a pipeline to run. This tool can be used in three ways:
Using Project Slug and Branch (Recommended):
Example: "Run the pipeline for my-project on the main branch"
Using CircleCI URL:
Pipeline URL, Workflow URL, Job URL, or Project URL with branch
Example: "Run the pipeline for https://app.circleci.com/pipelines/github/org/repo/123"
Using Local Project Context:
Works from your local workspace by providing workspace root, git remote URL, and branch name
The tool returns a link to monitor the pipeline execution.
Triggers a rollback for a CircleCI project. The tool interactively guides you through:
Project Selection — lists followed projects for you to choose from
Environment Selection — lists available environments (auto-selects if only one)
Component Selection — lists available components (auto-selects if only one)
Version Selection — displays available versions; you select the target for rollback
Rollback Mode Detection — checks if a rollback pipeline is configured
Execute Rollback — two options:
Pipeline Rollback: triggers the rollback pipeline
Workflow Rerun: reruns a previous workflow using its workflow ID
Confirmation — summarizes and confirms before execution
Reruns a workflow from its start or from the failed job.
Returns the ID of the newly-created workflow and a link to monitor it.
Analyzes git diffs against cursor rules to identify rule violations.
Provide:
Git diff content (e.g.
git diff --cached,git diff HEAD)Repository rules from
.cursorrulesor.cursor/rules
Returns detailed violation reports with confidence scores and explanations.
Useful for:
Pre-commit code quality checks
Ensuring consistency with team coding standards
Catching rule violations before code review
Lists all versions for a specific CircleCI component in an environment. Includes deployment status, commit information, and timestamps.
The tool will prompt you to select the component and environment if not provided.
Useful for:
Identifying which version is currently live
Selecting target versions for rollback operations
Getting deployment details (pipeline, workflow, job)
Downloads usage data from the CircleCI Usage API for a given organization. Accepts flexible date input (e.g., "March 2025" or "last month"). Cloud-only feature.
Option 1: Start a new export job by providing:
orgId,startDate,endDate(max 32 days),outputDir
Option 2: Check/download an existing export job by providing:
orgId,jobId,outputDir
Returns a CSV file with CircleCI usage data for the specified time frame.
Usage data can be fed into thefind_underused_resource_classes tool for cost optimization analysis.
Analyzes a CircleCI usage data CSV file to find jobs with average or max CPU/RAM usage below a given threshold (default: 40%).
Provide a CSV file obtained from download_usage_api_data.
Returns a markdown list of underused jobs organized by project and workflow — useful for identifying cost optimization opportunities.
Troubleshooting
Most common issues:
Clear package caches:
npx clear-npx-cache npm cache clean --forceForce latest version: Add
@latestto your config:"args": ["-y", "@circleci/mcp-server-circleci@latest"]Restart your IDE completely (not just reload window)
Invalid token errors: Verify your
CIRCLECI_TOKENin Personal API TokensPermission errors: Ensure the token has read access to your projects
Environment variables not loading: Test with
echo $CIRCLECI_TOKEN(Mac/Linux) orecho %CIRCLECI_TOKEN%(Windows)
Base URL: Confirm
CIRCLECI_BASE_URLishttps://circleci.comCorporate networks: Configure npm proxy settings if behind a firewall
Firewall blocking: Check if security software blocks package downloads
Node.js version: Ensure >= 18.0.0 with
node --versionUpdate Node.js: Consider latest LTS if experiencing compatibility issues
Package manager: Verify npm/pnpm is working:
npm --version
Config file location: Double-check the path for your OS
Syntax errors: Validate JSON syntax in your config file
Console logs: Check the IDE developer console for specific errors
Try a different IDE: Test in another supported editor to isolate the issue
Hanging processes — kill existing MCP processes:
Port conflicts: Restart your IDE if the connection seems blocked.
Test package directly:
npx @circleci/mcp-server-circleci@latest --helpVerbose logging:
DEBUG=* npx @circleci/mcp-server-circleci@latestDocker fallback: Try Docker installation if npx fails consistently
Still need help?
Check GitHub Issues for similar problems
Include your OS, Node version, and IDE when reporting issues
Share relevant error messages from the IDE console
Development
Getting Started
Clone the repository:
git clone https://github.com/CircleCI-Public/mcp-server-circleci.git cd mcp-server-circleciInstall dependencies:
pnpm installBuild the project:
pnpm build
Building Docker Container
You can build the Docker container locally using:
This will create a Docker image tagged as circleci:mcp-server-circleci that you can use with any MCP client.
To run the container locally:
To run the container as a self-managed remote MCP server, add start=remote and optionally specify the port (default: 8000):
Development with MCP Inspector
The easiest way to iterate on the MCP Server is using the MCP inspector. You can learn more about the MCP inspector at https://modelcontextprotocol.io/docs/tools/inspector
Start the development server:
pnpm watch # Keep this running in one terminalIn a separate terminal, launch the inspector:
pnpm inspectorConfigure the environment:
Add your
CIRCLECI_TOKENto the Environment Variables section in the inspector UIThe token needs read access to your CircleCI projects
Optionally set your CircleCI Base URL (defaults to
https://circleci.com)
Testing
Run the test suite:
pnpm testRun tests in watch mode during development:
pnpm test:watch
For more detailed contribution guidelines, see CONTRIBUTING.md