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, Windsurf, Copilot, or any MCP supported 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
For NPX installation:
For Docker installation:
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
}
}
}
}
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 - required for on-prem customers only
}
}
}
}
Add the following to your cursor MCP config:
{
"inputs": [
{
"type": "promptString",
"id": "circleci-token",
"description": "CircleCI API Token",
"password": true
}
],
"servers": {
"circleci-mcp-server-remote": {
"url": "http://your-circleci-remote-mcp-server-endpoint:8080/mcp"
}
}
}
To install CircleCI MCP Server for VS Code in .vscode/mcp.json
:
{
// 💡 Inputs are prompted on first server start, then stored securely by VS Code.
"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": {
// https://github.com/ppl-ai/modelcontextprotocol/
"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}"
}
}
}
}
To install CircleCI MCP Server for VS Code in .vscode/mcp.json
using Docker:
{
// 💡 Inputs are prompted on first server start, then stored securely by VS Code.
"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": {
// https://github.com/ppl-ai/modelcontextprotocol/
"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}"
}
}
}
}
To install CircleCI MCP Server for VS Code in .vscode/mcp.json
using a self-managed remote MCP server:
{
"servers": {
"circleci-mcp-server-remote": {
"type": "sse",
"url": "http://your-circleci-remote-mcp-server-endpoint:8080/mcp"
}
}
}
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 locate this file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
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 - 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
Create a wrapper script first
Create a script file such as 'circleci-remote-mcp.sh':
#!/bin/bash
export CIRCLECI_TOKEN="your-circleci-token"
npx mcp-remote http://your-circleci-remote-mcp-server-endpoint:8080/mcp --allow-http
Make it executable:
chmod +x circleci-remote-mcp.sh
Then add the following to your claude_desktop_config.json:
{
"mcpServers": {
"circleci-remote-mcp-server": {
"command": "/full/path/to/circleci-remote-mcp.sh"
}
}
}
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
After installing Claude Code, run the following command:
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
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
After installing Claude Code, run the following command:
claude mcp add circleci-mcp-server -e CIRCLECI_TOKEN=your-circleci-token -- npx mcp-remote http://your-circleci-remote-mcp-server-endpoint:8080/mcp --allow-http
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 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
}
}
}
}
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 - required for on-prem customers only
}
}
}
}
Add the following to your windsurf mcp_config.json:
{
"mcpServers": {
"circleci": {
"command": "npx",
"args": [
"mcp-remote",
"http://your-circleci-remote-mcp-server-endpoint:8080/mcp",
"--allow-http"
],
"disabled": false,
"alwaysAllow": []
}
}
}
See the guide below for more information on using MCP servers with windsurf: https://docs.windsurf.com/windsurf/mcp
To install CircleCI MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @CircleCI-Public/mcp-server-circleci --client claude
MCP client configuration in Amazon Q Developer is stored in JSON format, in a file named mcp.json.
Amazon Q Developer CLI supports two levels of MCP configuration:
Global Configuration: ~/.aws/amazonq/mcp.json - Applies to all workspaces
Workspace Configuration: .amazonq/mcp.json - Specific to the current workspace
Both files are optional; neither, one, or both can exist. If both files exist, Amazon Q Developer reads MCP configuration from both and combines them, taking the union of their contents. If there is a conflict (i.e., a server defined in the global config is also present in the workspace config), a warning is displayed and only the server entry in the workspace config is used.
Edit your global configuration file ~/.aws/amazonq/mcp.json or create a new one in the current workspace .amazonq/mcp.json with the following content:
{
"mcpServers": {
"circleci-local": {
"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
},
"timeout": 60000
}
}
}
Create a wrapper script first
Create a script file such as 'circleci-remote-mcp.sh':
#!/bin/bash
export CIRCLECI_TOKEN="your-circleci-token"
npx mcp-remote http://your-circleci-remote-mcp-server-endpoint:8080/mcp --allow-http
Make it executable:
chmod +x circleci-remote-mcp.sh
Then add it:
q mcp add --name circleci --command "/full/path/to/circleci-remote-mcp.sh"
Edit your global configuration file ~/.aws/amazonq/mcp.json or create a new one in the current workspace .amazonq/mcp.json with the following content:
{
"mcpServers": {
"circleci-local": {
"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
},
"timeout": 60000
}
}
}
Create a wrapper script first
Create a script file such as 'circleci-remote-mcp.sh':
#!/bin/bash
npx mcp-remote http://your-circleci-remote-mcp-server-endpoint:8080/mcp --allow-http
Make it executable:
chmod +x circleci-remote-mcp.sh
Then add it to the Q Developer in your IDE:
Access the MCP configuration UI (https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/mcp-ide.html#mcp-ide-configuration-access-ui).
Choose the plus (+) symbol.
Select the scope: global or local.
If you select global scope, the MCP server configuration is stored in ~/.aws/amazonq/mcp.json and available across all your projects. If you select local scope, the configuration is stored in .amazonq/mcp.json within your current project.
In the Name field, enter the name of the CircleCI remote MCP server (e.g. circleci-remote-mcp).
Select the transport protocol (stdio).
In the Command field, enter the shell command created previously that the MCP server will run when it initializes (e.g. /full/path/to/circleci-remote-mcp.sh).
Click the Save button.
get_build_failure_logs
Retrieves detailed failure logs from CircleCI builds. This tool can be used in three ways:
Using Project Slug and Branch (Recommended Workflow):
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 three ways:
Using Project Slug (Recommended Workflow):
Using CircleCI Project URL:
Using Local Project Context:
The tool can be used in two ways:
FILE_OUTPUT_DIRECTORY
environment variable to be set)
The tool returns detailed information about flaky tests, including:
This helps you:
get_latest_pipeline_status
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 Workflow):
Using CircleCI Project URL:
Using Local Project Context:
The tool returns a formatted status of the latest pipeline:
Example output:
---
Workflow: build
Status: success
Duration: 5 minutes
Created: 4/20/2025, 10:15:30 AM
Stopped: 4/20/2025, 10:20:45 AM
---
Workflow: test
Status: running
Duration: unknown
Created: 4/20/2025, 10:21:00 AM
Stopped: in progress
This is particularly useful for:
get_job_test_results
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 Workflow):
Using CircleCI URL:
Using Local Project Context:
The tool returns detailed test result information:
This is particularly useful for:
Note: The tool requires that test metadata is properly configured in your CircleCI config. For more information on setting up test metadata collection, see: https://circleci.com/docs/collect-test-data/
config_helper
Assists with CircleCI configuration tasks by providing guidance and validation. This tool helps you:
The tool provides:
This helps you:
create_prompt_template
Helps generate structured prompt templates for AI-enabled applications based on feature requirements. This tool:
The tool provides:
This helps you:
recommend_prompt_template_tests
Generates test cases for prompt templates to ensure they produce expected results. This tool:
The tool provides:
This helps you:
list_followed_projects
Lists all projects that the user is following on CircleCI. This tool:
The tool returns a formatted list of projects, example output:
Projects followed:
1. my-project (projectSlug: gh/organization/my-project)
2. another-project (projectSlug: gh/organization/another-project)
This is particularly useful for:
Note: The projectSlug (not the project name) is required for many other CircleCI tools, and will be used for those tool calls after a project is selected.
run_pipeline
Triggers a pipeline to run. This tool can be used in three ways:
Using Project Slug and Branch (Recommended Workflow):
Using CircleCI URL:
Using Local Project Context:
The tool returns a link to monitor the pipeline execution.
This is particularly useful for:
rerun_workflow
Reruns a workflow from its start or from the failed job.
The tool returns the ID of the newly-created workflow, and a link to monitor the new workflow.
This is particularly useful for:
analyze_diff
Analyzes git diffs against cursor rules to identify rule violations.
This tool can be used by providing:
Git Diff Content:
git diff --cached
git diff
git diff HEAD
Repository Rules:
.cursorrules
file in your repository root.cursor/rules
directory---
separatorThe tool provides:
Example usage scenarios:
This is particularly useful for:
The tool integrates with your existing cursor rules setup and provides immediate feedback on code quality, helping you catch issues early in the development process.
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
You can build the Docker container locally using:
docker build -t circleci:mcp-server-circleci .
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:
docker run --rm -i -e CIRCLECI_TOKEN=your-circleci-token -e CIRCLECI_BASE_URL=https://circleci.com circleci:mcp-server-circleci
To run the container as a self-managed remote MCP server:
docker run --rm -i -e CIRCLECI_TOKEN=your-circleci-token -e CIRCLECI_BASE_URL=https://circleci.com circleci:mcp-server-circleci -e start:sse
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
connects QGIS Desktop to Claude AI through the MCP. This integration enables prompt-assisted project creation, layer loading, code execution, and more.
ALAPI MCP Tools,Call hundreds of API interfaces via MCP
A Binary Ninja plugin, MCP server, and bridge that seamlessly integrates Binary Ninja with your favorite MCP client.
MCP Server to control and interact with Unity3d Game Engine for game development
Integrates Zeek network analysis with conversational AI clients. Requires an external Zeek installation.
Provides seamless integration with SonarQube Server or Cloud, and enables analysis of code snippets directly within the agent context
Access and control local iTerm2 terminal sessions.
A service framework supporting the Model Context Protocol (MCP) to integrate enterprise systems and AI platforms via RESTful, gRPC, and Dubbo protocols.
Obtains latest dependency details for Clojure libraries.
Generates placeholder images from various providers like placehold.co and lorem-picsum.