Enable AI Agents to fix build failures from CircleCI.
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.
This lets you use Cursor IDE, or any MCP Client, to use natural language to accomplish things with CircleCI, e.g.:
Find the latest failed pipeline on my branch and get logs
https://github.com/CircleCI-Public/mcp-server-circleci/wiki#circleci-mcp-server-with-cursor-idehttps://github.com/user-attachments/assets/3c765985-8827-442a-a8dc-5069e01edb74
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 - required for on-prem customers only
}
}
}
}
See the guide below for more information on using MCP servers with cursor: https://docs.cursor.com/context/model-context-protocol#configuring-mcp-servers
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 - required for on-prem customers only
}
}
}
}
To find/create this file, first open your claude desktop settings. Then click on "Developer" in the left-hand bar of the Settings pane, and then click on "Edit Config"
This will create a configuration file at:
See the guide below for more information on using MCP servers with Claude Desktop: https://modelcontextprotocol.io/quickstart/user
After installing Claude Code, run the following command:
claude mcp add circleci-mcp-server -e CIRCLECI_TOKEN=your-circleci-token -- npx -y @circleci/mcp-server-circleci
See the guide below for more information on using MCP servers with Claude Code: https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp
Add the MCP server to your settings.json under mcp -> servers
:
"circleci-mcp-server": {
"command": "npx",
"args": ["-y", "@circleci/mcp-server-circleci"],
"env": {
"CIRCLECI_TOKEN": "your-circleci-token",
"CIRCLECI_BASE_URL": "https://circleci.com" // Optional - required for on-prem customers only
}
}
See the guide below for more information on using MCP servers with VS Code: https://code.visualstudio.com/docs/copilot/chat/mcp-servers
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 - required for on-prem customers only
}
}
}
}
See the guide below for more information on using MCP servers with windsurf: https://docs.windsurf.com/windsurf/mcp
get_build_failure_logs
Retrieves detailed failure logs from CircleCI builds. This tool can be used in two ways:
Using CircleCI URLs:
Using Local Project Context:
The tool returns formatted logs including:
This is particularly useful for:
find_flaky_tests
Identifies flaky tests in your CircleCI project by analyzing test execution history. This leverages the flaky test detection feature described here: https://circleci.com/blog/introducing-test-insights-with-flaky-test-detection/#flaky-test-detection
This tool can be used in two ways:
Using CircleCI Project URL:
Using Local Project Context:
The tool returns detailed information about flaky tests, including:
This helps you:
config_helper
Assists with CircleCI configuration tasks by providing guidance and validation. This tool helps you:
The tool provides:
This helps you:
Clone the repository:
git clone https://github.com/CircleCI-Public/mcp-server-circleci.git
cd mcp-server-circleci
Install dependencies:
pnpm install
Build the project:
pnpm build
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 terminal
In a separate terminal, launch the inspector:
pnpm inspector
Configure the environment:
CIRCLECI_TOKEN
to the Environment Variables section in the inspector UIhttps//circleci.com
Run the test suite:
pnpm test
Run tests in watch mode during development:
pnpm test:watch
For more detailed contribution guidelines, see CONTRIBUTING.md
Retrieving and analyzing issues from Sentry.io
Create crafted UI components inspired by the best 21st.dev design engineers.
ALAPI MCP Tools,Call hundreds of API interfaces via MCP
APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.
Flag features, manage company data, and control feature access using Bucket
Query and analyze your Opik logs, traces, prompts and all other telemtry data from your LLMs in natural language.
Run code in secure sandboxes hosted by E2B
Tool platform by IBM to build, test and deploy tools for any data source
Run Python in a code sandbox.
Interact with any other SaaS applications on behalf of your customers.