Enable AI Agents to fix build failures from CircleCI.
Harness the power of Large Language Models (LLMs) within your CircleCI workflows using the Model Context Protocol (MCP). This repository provides an MCP Server, enabling seamless integration between LLMs and CircleCI, allowing you to leverage natural language for tasks like retrieving logs and identifying flaky tests.
The CircleCI MCP Server can be integrated with various MCP clients. Below are instructions for some popular options:
Open your Cursor IDE settings.
Locate the MCP configuration.
Add the following configuration block:
{ "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 } } } }
Replace "your-circleci-token"
with your actual CircleCI API token. For on-premise CircleCI installations, configure the CIRCLECI_BASE_URL
accordingly.
Refer to the Cursor documentation for further details.
Open Claude Desktop settings.
Navigate to "Developer" in the left-hand bar.
Click "Edit Config" to open or create the claude_desktop_config.json
file. The file is typically located at:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add the following configuration block:
{ "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 } } } }
Replace "your-circleci-token"
with your actual CircleCI API token. For on-premise CircleCI installations, configure the CIRCLECI_BASE_URL
accordingly.
Open your VS Code settings (settings.json).
Add the following configuration block under the mcp -> servers
section:
"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 } }
Replace "your-circleci-token"
with your actual CircleCI API token. For on-premise CircleCI installations, configure the CIRCLECI_BASE_URL
accordingly.
Refer to the VS Code documentation for further details.
Locate your Windsurf mcp_config.json
file.
Add the following configuration block:
{ "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 } } } }
Replace "your-circleci-token"
with your actual CircleCI API token. For on-premise CircleCI installations, configure the CIRCLECI_BASE_URL
accordingly.
Refer to the Windsurf documentation for further details.
The CircleCI MCP Server provides the following tools:
get_build_failure_logs
This tool retrieves detailed failure logs from CircleCI builds, enabling faster debugging and issue resolution.
Usage:
Using CircleCI URLs: Provide a direct link to a failed job or pipeline.
"Get logs from https://app.circleci.com/pipelines/github/org/repo/123"
Using Local Project Context: Execute the command from your local workspace, providing the workspace root path, Git remote URL, and branch name.
"Find the latest failed pipeline on my current branch"
Output: The tool returns formatted logs, including job names, step-by-step execution details, and failure messages.
find_flaky_tests
This tool identifies flaky tests in your CircleCI project by analyzing test execution history, leveraging CircleCI's flaky test detection feature.
Usage:
Using CircleCI Project URL: Provide the project URL directly from CircleCI.
"Find flaky tests in https://app.circleci.com/pipelines/github/org/repo"
Using Local Project Context: Execute the command from your local workspace, providing the workspace root path and Git remote URL.
"Find flaky tests in my current project"
Output: The tool returns detailed information about flaky tests, including test names, file locations, and failure messages.
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 MCP Inspector provides an interactive environment for developing and testing MCP Servers.
Start the development server:
pnpm watch # Keep this running in one terminal
Launch the inspector:
pnpm inspector
Configure the environment:
CIRCLECI_TOKEN
to the Environment Variables section in the inspector UI.https://circleci.com
.Run the test suite:
pnpm test
Run tests in watch mode:
pnpm test:watch
For detailed contribution guidelines, refer to CONTRIBUTING.md.
๐ โ tool to automate the registration of functions and classes from a python package into a FastMCP instance.
๐ Provides MCP tool calling support in LangChain, allowing for the integration of MCP tools into LangChain workflows.
๐ โ๏ธ Allows AI clients to manage records and notes in Attio CRM
Tools to the query and execute of Dify workflows