# test-coverage-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/goldbergyoni/test-coverage-mcp  
**GitHub Stars:** 42  
**npm Downloads (last month):** 307  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/test-coverage-mcp

## Description
Analyze test coverage from LCOV files - makes AI agents coverage-aware without wasting tokens

## Tools
Capabilities this server exposes over MCP:

- **coverage_summary** — Get overall project coverage from an LCOV file.
- **coverage_file_summary** — Get coverage for a specific file.
- **start_recording** — Record current coverage as a baseline for later comparison.
- **get_diff_since_start** — Compare current coverage against the recorded baseline.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "test-coverage-mcp": {
    "command": "npx",
    "args": ["-y","test-coverage-mcp"]
  }
}
```

## Documentation

## 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:

```bash
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.

_Full upstream README: https://allmcps.com/mcp/test-coverage-mcp/readme_

