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.
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.
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.
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:
Configuration file locations:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
For more details, see the MCP servers guide for Claude Desktop.
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.
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.
To automatically install CircleCI MCP Server for Claude Desktop via Smithery:
npx -y @smithery/cli install @CircleCI-Public/mcp-server-circleci --client claude
Retrieves detailed failure logs from CircleCI builds either by:
Get logs from https://app.circleci.com/pipelines/github/org/repo/123
Find the latest failed pipeline on my current branch
The tool returns formatted logs with job names, execution details, and failure messages.
Identifies flaky tests in your CircleCI project by analyzing test execution history:
Find flaky tests in https://app.circleci.com/pipelines/github/org/repo
Find flaky tests in my current project
Returns detailed information about flaky tests, including names, file locations, and failure contexts.
Retrieves the status of the latest pipeline for a branch:
Get the status of the latest pipeline for https://app.circleci.com/pipelines/github/org/repo
Get the status of the latest pipeline for my current project
Returns workflow names, status, duration, and timestamps.
Retrieves test metadata for CircleCI jobs:
Get test results for https://app.circleci.com/pipelines/github/org/repo/123/workflows/abc-def
Get test results for my current project on the main branch
Returns test summaries, failed test details, and successful test information.
Assists with CircleCI configuration tasks:
Validate my CircleCI config
Provides validation results and configuration recommendations.
Helps generate structured prompt templates for AI applications:
Create a prompt template for generating bedtime stories by age and topic
Returns a structured prompt template and context schema.
Generates test cases for prompt templates:
Generate tests for my bedtime story prompt template
Returns an array of recommended test cases with various parameter combinations.
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.
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"
]
}
}
}
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.
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.