Test Coverage MCP logo

Test Coverage MCP

Reads LCOV reports and gives AI agents compact project, file, and coverage-difference data.

Install Test Coverage MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "test-coverage-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "test-coverage-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio test-coverage-mcp -- npx -y test-coverage-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

npx -y test-coverage-mcp

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The test-coverage-mcp MCP server reads LCOV files and exposes compact coverage data through MCP tools. Agents can inspect overall line and branch coverage, check an individual file, or compare current results with a recorded baseline. It defaults to ./coverage/lcov.info for summary queries and stores baselines in temporary storage. Reach for it when coding or testing agents need coverage feedback without parsing large LCOV files directly.

Use cases

  • Check project coverage before changing code
  • Inspect coverage for a modified source file
  • Record a baseline before adding tests
  • Measure line and branch coverage changes

Key features

  • Parse standard LCOV reports
  • Return project line and branch coverage
  • Report coverage for individual files
  • Record temporary coverage baselines
  • Compare coverage changes since a baseline
  • Resolve a default ./coverage/lcov.info path

Tools4

What Test Coverage MCP lets your agent do. Expand a tool for its parameters.

Self-reported~67 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

19/19 checks healthy over the last 89d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · test-coverage-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars42Stargazers on the source repository.
npm downloads307Package downloads in the last 30 days.
Last commit10mo agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Tools exposed4Callable tools this server registers over MCP.

How Test Coverage MCP works

What test-coverage-mcp does

test-coverage-mcp MCP server connects an MCP-compatible coding or testing agent to LCOV coverage reports. It provides project-level line and branch percentages, file-specific coverage results, and session-level changes from a saved baseline. The server is intended for repositories that already generate LCOV output from their test tooling.

Coverage results are returned as compact JSON rather than exposing the full report to the agent. This lets an agent check whether a change improved or reduced coverage without spending context on the complete LCOV file.

How it works

The server parses standard LCOV records, including summary fields, line execution entries, and branch data. It can handle reports containing only line data, reports with branch records, and files that mix these formats.

For a direct status check, an agent calls coverage_summary. The tool reads ./coverage/lcov.info unless another path is supplied and returns line and branch coverage percentages for the project. coverage_file_summary uses the same default and accepts a required file path to report coverage for one source file.

Baseline comparison uses two calls. start_recording reads the current LCOV report and saves its coverage as a baseline. Later, get_diff_since_start reads the current report and returns the percentage impact on lines and branches. Positive values indicate improvement; negative values indicate regression. The baseline is kept in temporary storage rather than in the agent's conversational state.

Setup and configuration

Install the package globally with npm:

Terminal
npm install -g test-coverage-mcp

The server can also be launched through npx, as shown in the client configuration examples. The command is npx -y test-coverage-mcp.

Claude Desktop uses its claude_desktop_config.json file, Cursor uses .cursor/mcp.json, and VS Code with GitHub Copilot uses .vscode/mcp.json. Windsurf uses mcp_config.json in its Codeium configuration directory or its server-management interface. The VS Code setup requires version 1.99 or later, or Visual Studio 17.14 or later; enterprise installations also need the relevant MCP server policy enabled.

No environment variables are documented. Relative LCOV paths are resolved from the current working directory, so the agent's launch context must make the configured report path available.

Tools and capabilities

The test-coverage-mcp MCP server exposes four tools:

  • coverage_summary: Returns overall line and branch coverage. lcovPath is optional and defaults to ./coverage/lcov.info.
  • coverage_file_summary: Returns the selected file path and its line and branch percentages. filePath is required; lcovPath is optional.
  • start_recording: Saves the current report as a comparison baseline. lcovPath is required.
  • get_diff_since_start: Compares a current report with the saved baseline and returns line and branch percentage impact. lcovPath is required.

These tools support workflows such as checking coverage before editing code, verifying a modified file, and measuring the effect of newly added tests during one development session.

Limitations and notes

The server requires an LCOV file produced by a test or coverage command; it does not generate coverage data itself. If the report is missing, the test suite must be run with coverage enabled and the path must be checked. File-level queries require the requested path to match the path recorded in LCOV, which may be absolute or relative depending on the test framework.

get_diff_since_start cannot provide a comparison until start_recording has been called. Temporary baseline data is cleared when the system restarts, so a new baseline is needed for a later session. The project README identifies the package as MIT licensed.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Test Coverage MCP

test-coverage-mcp is an MCP server that connects AI coding and testing agents to LCOV coverage files. Its main tools return project coverage, file coverage, a recorded baseline, and line or branch coverage changes since that baseline, using compact results instead of requiring agents to parse full reports.

Install it with `npm install -g test-coverage-mcp`, then add an MCP server entry that runs `npx -y test-coverage-mcp`. The README provides configuration examples for Claude Desktop, Cursor, VS Code, and Windsurf.

Yes, test-coverage-mcp works with Cursor through a `.cursor/mcp.json` configuration file. Add a server entry using the `npx` command and `test-coverage-mcp` argument, then make sure the LCOV report is available from the working directory.

Call `start_recording` with the current LCOV path before making the change, then call `get_diff_since_start` with the updated LCOV path. The result reports line and branch percentage impact; positive values mean improvement and negative values mean regression.

The LCOV file is missing when the report was not generated, the path is incorrect, or the server's working directory differs from expected. Run the test suite with coverage enabled, verify the path, and remember that summary tools default to `./coverage/lcov.info`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewTest Coverage MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/test-coverage-mcp?style=directory)](https://allmcps.com/mcp/test-coverage-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/test-coverage-mcp"><img src="https://allmcps.com/api/badge/test-coverage-mcp?style=directory" alt="Test Coverage MCP on AllMCPs" /></a>