codecov — Claude Code MCP server: what it does, how to install
This MCP server lets an agent query Codecov coverage for files, commits, repositories, and pull requests. It also works with self-hosted Codecov.
claude mcp add --env CODECOV_TOKEN=<CODECOV_TOKEN> --env CODECOV_BASE_URL=<CODECOV_BASE_URL> --transport stdio codecov -- npx -y mcp-server-codecovWhat codecov does
codecov exposes tools for reading coverage data through an MCP connection. An agent can inspect line-level results for a file, retrieve coverage for a commit or repository, review a pull request’s coverage impact, and compare two branches, tags, or commits. That gives code review a direct way to check coverage changes.
The server runs with npx and reads CODECOV_TOKEN plus CODECOV_BASE_URL. Use the URL variable when the Codecov instance is self-hosted. The token must be a Codecov API token rather than an upload token; an upload token is for sending reports and will not provide the required read access.
What it helps with
- inspect coverage for a repository file
- check coverage for a specific commit
- review coverage changes in a pull request
- compare coverage across two Git references
- spot files that lack coverage before merging
Example prompts for the agent
- Show line-level coverage for
src/index.tsinowner/repoon themainbranch. - Check the coverage impact of pull request
123inowner/repo. - Compare coverage between
mainandfeature-branchinowner/repo.
How to install codecov
Platform CLI
claude mcp add --env CODECOV_TOKEN=<CODECOV_TOKEN> --env CODECOV_BASE_URL=<CODECOV_BASE_URL> --transport stdio codecov -- npx -y mcp-server-codecovReplace <…> with your own values
Platform CLI
codex mcp add codecov --env CODECOV_TOKEN=<CODECOV_TOKEN> --env CODECOV_BASE_URL=<CODECOV_BASE_URL> -- npx -y mcp-server-codecovReplace <…> with your own values
Config file
{
"mcpServers": {
"codecov": {
"command": "npx",
"args": [
"-y",
"mcp-server-codecov"
],
"env": {
"CODECOV_TOKEN": "<CODECOV_TOKEN>",
"CODECOV_BASE_URL": "<CODECOV_BASE_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"codecov": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-server-codecov"
],
"env": {
"CODECOV_TOKEN": "<CODECOV_TOKEN>",
"CODECOV_BASE_URL": "<CODECOV_BASE_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e CODECOV_TOKEN=<CODECOV_TOKEN> -e CODECOV_BASE_URL=<CODECOV_BASE_URL> codecov npx -y mcp-server-codecovReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about codecov
How do I install codecov in Claude Code?
Set a Codecov API token, then run claude mcp add --env CODECOV_TOKEN=<CODECOV_TOKEN> --env CODECOV_BASE_URL=<CODECOV_BASE_URL> --transport stdio codecov -- npx -y mcp-server-codecov.
What does the codecov MCP server do?
It lets an agent query Codecov coverage for files, commits, repositories, and pull requests. It can also compare results across branches, tags, and commits.
Which token does codecov require?
Use a Codecov API token, not an upload token. CODECOV_BASE_URL selects a self-hosted Codecov instance when needed.