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 |
|---|---|
analyze_diff | Analyze git diffs against cursor rules for violations |
config_helper | Validate and get guidance for your CircleCI configuration |
create_prompt_template | Generate structured prompt templates for AI applications |
download_usage_api_data | Download usage data from the CircleCI Usage API |
find_flaky_tests | Identify flaky tests by analyzing test execution history |
find_underused_resource_classes | Find jobs with underused compute resources |
get_build_failure_logs | Retrieve detailed failure logs from CircleCI builds |
get_job_test_results | Retrieve test metadata and results for CircleCI jobs |
get_latest_pipeline_status | Get the status of the latest pipeline for a branch |
list_artifacts | List artifacts produced by a CircleCI job |
list_component_versions | List all versions for a CircleCI component |
list_followed_projects | List all CircleCI projects you're following |
recommend_prompt_template_tests | Generate test cases for prompt templates |
rerun_workflow | Rerun a workflow from start or from the failed job |
run_evaluation_tests | Run evaluation tests on a CircleCI pipeline |
run_pipeline | Trigger a pipeline to run |
run_rollback_pipeline | Trigger a rollback for a project |
Installation
<details> <summary><strong>Cursor</strong></summary>Prerequisites:
- CircleCI Personal API token (learn more)
- NPX: Node.js >= v18 and pnpm
- Docker: Docker
Using NPX in a local MCP Server
Add the following to your Cursor MCP config:
{
"mcpServers": {
"circleci-mcp-server": {
"command": "npx",
"args": ["-y", "@circleci/mcp-server-circleci@latest"],
"env": {
"CIRCLECI_TOKEN": "your-circleci-token",
"CIRCLECI_BASE_URL": "https://circleci.com",
"MAX_MCP_OUTPUT_LENGTH": "50000"
}
}
}
}
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:
{
"mcpServers": {
"circleci-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"CIRCLECI_TOKEN",
"-e",
"CIRCLECI_BASE_URL",
"-e",
"MAX_MCP_OUTPUT_LENGTH",
"circleci/mcp-server-circleci"
],
"env": {
"CIRCLECI_TOKEN": "your-circleci-token",
"CIRCLECI_BASE_URL": "https://circleci.com",
"MAX_MCP_OUTPUT_LENGTH": "50000"
}
}
}
}Using a Self-Managed Remote MCP Server
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:8000/mcp"
}
}
}Prerequisites:
- CircleCI Personal API token (learn more)
- 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": [
{
"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": {
"circleci-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@circleci/mcp-server-circleci@latest"],
"env": {
"CIRCLECI_TOKEN": "${input:circleci-token}",
"CIRCLECI_BASE_URL": "${input:circleci-base-url}"
}
}
}
}💡 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:
{
"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": {
"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}"
}
}
}
}Using a Self-Managed Remote MCP Server
Add the following to .vscode/mcp.json in your project:
{
"servers": {
"circleci-mcp-server-remote": {
"type": "sse",
"url": "http://your-circleci-remote-mcp-server-endpoint:8000/mcp"
}
}
}Prerequisites:
- CircleCI Personal API token (learn more)
- NPX: Node.js >= v18 and pnpm
- Docker: Docker
Using NPX in a local MCP Server
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"circleci-mcp-server": {
"command": "npx",
"args": ["-y", "@circleci/mcp-server-circleci@latest"],
"env": {
"CIRCLECI_TOKEN": "your-circleci-token",
"CIRCLECI_BASE_URL": "https://circleci.com",
"MAX_MCP_OUTPUT_LENGTH": "50000"
}
}
}
}Using Docker in a local MCP Server
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",
"-e",
"MAX_MCP_OUTPUT_LENGTH",
"circleci/mcp-server-circleci"
],
"env": {
"CIRCLECI_TOKEN": "your-circleci-token",
"CIRCLECI_BASE_URL": "https://circleci.com",
"MAX_MCP_OUTPUT_LENGTH": "50000"
}
}
}
}Using a Self-Managed Remote MCP Server
Create a wrapper script (e.g. circleci-remote-mcp.sh):
#!/bin/bash
export CIRCLECI_TOKEN="your-circleci-token"
npx mcp-remote http://your-circleci-remote-mcp-server-endpoint:8000/mcp --allow-httpMake it executable:
chmod +x circleci-remote-mcp.shThen add the following to your claude_desktop_config.json:
{
"mcpServers": {
"circleci-remote-mcp-server": {
"command": "/full/path/to/circleci-remote-mcp.sh"
}
}
}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.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
For more information: https://modelcontextprotocol.io/quickstart/user
</details> <details> <summary><strong>Claude Code</strong></summary>Prerequisites:
- CircleCI Personal API token (learn more)
- NPX: Node.js >= v18 and pnpm
- Docker: Docker
Using NPX in a local MCP Server
claude mcp add circleci-mcp-server -e CIRCLECI_TOKEN=your-circleci-token -- npx -y @circleci/mcp-server-circleci@latestUsing Docker in a local MCP Server
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-circleciUsing a Self-Managed Remote MCP Server
claude mcp add circleci-mcp-server -e CIRCLECI_TOKEN=your-circleci-token -- npx mcp-remote http://your-circleci-remote-mcp-server-endpoint:8000/mcp --allow-httpFor more information: https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp
</details> <details> <summary><strong>Windsurf</strong></summary>Prerequisites:
- CircleCI Personal API token (learn more)
- NPX: Node.js >= v18 and pnpm
- Docker: Docker
Using NPX in a local MCP Server
Add the following to your Windsurf mcp_config.json:
{
"mcpServers": {
"circleci-mcp-server": {
"command": "npx",
"args": ["-y", "@circleci/mcp-server-circleci@latest"],
"env": {
"CIRCLECI_TOKEN": "your-circleci-token",
"CIRCLECI_BASE_URL": "https://circleci.com",
"MAX_MCP_OUTPUT_LENGTH": "50000"
}
}
}
}Using Docker in a local MCP Server
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",
"-e",
"MAX_MCP_OUTPUT_LENGTH",
"circleci/mcp-server-circleci"
],
"env": {
"CIRCLECI_TOKEN": "your-circleci-token",
"CIRCLECI_BASE_URL": "https://circleci.com",
"MAX_MCP_OUTPUT_LENGTH": "50000"
}
}
}
}Using a Self-Managed Remote MCP Server
Add the following to your Windsurf mcp_config.json:
{
"mcpServers": {
"circleci": {
"command":
…