test-coverage-mcp — Claude Code MCP server: test coverage
Feeds your coding agent real coverage numbers from an LCOV file, so it can tell whether its edits helped or hurt the tests.
claude mcp add test-coverage-mcp -- npx -y test-coverage-mcpWhat test-coverage-mcp does
The server parses LCOV and hands the agent percentages instead of a giant report. Four tools are exposed: coverage_summary for the whole project, coverage_file_summary for one file, start_recording to snapshot the current numbers, and get_diff_since_start to compare against that snapshot. The LCOV path goes in lcovPath, and it falls back to ./coverage/lcov.info.
Recording a baseline keeps the starting figures out of the agent's context. It saves them once at the top of a session, then asks for the delta later and gets the gain or drop in percentage points. Answers are short, so the context window stays free.
Any language works as long as your test runner can emit LCOV. The lcov.info file has to exist when a tool is called — otherwise there is nothing to read. Install with npm install -g test-coverage-mcp, then register the server in your editor's config.
What it helps with
- see whether an agent's edits dropped coverage
- locate files with no test coverage before touching them
- compare coverage against the start of a session
- get project-wide percentages without opening the full LCOV
- check one file's coverage before refactoring it
Example prompts for the agent
- Check the current test coverage with
coverage_summary - Record a baseline with
start_recording, then show me the diff - What's the coverage for
src/utils/parser.ts? Usecoverage_file_summary
How to install test-coverage-mcp
Platform CLI
claude mcp add test-coverage-mcp -- npx -y test-coverage-mcpPlatform CLI
codex mcp add test-coverage-mcp -- npx -y test-coverage-mcpConfig file
{
"mcpServers": {
"test-coverage-mcp": {
"command": "npx",
"args": [
"-y",
"test-coverage-mcp"
]
}
}
}Config file
{
"servers": {
"test-coverage-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"test-coverage-mcp"
]
}
}
}Platform CLI
gemini mcp add test-coverage-mcp npx -y test-coverage-mcpStep 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 test-coverage-mcp
How do I install test-coverage-mcp in Claude Code?
Run npm install -g test-coverage-mcp, then claude mcp add test-coverage-mcp -- npx -y test-coverage-mcp.
What does test-coverage-mcp do?
It reads an LCOV file and returns line and branch coverage for the project or a single file. It can also snapshot a baseline and report the delta.
Which languages does the server support?
Any language whose test tooling produces an LCOV report. It parses the format, not the source code.