home / mcp / test coverage mcp server
Provides token-efficient, LCOV-based test-coverage data for any language via an MCP server.
Configuration
View docs{
"mcpServers": {
"goldbergyoni-test-coverage-mcp": {
"command": "npx",
"args": [
"-y",
"test-coverage-mcp"
]
}
}
}You can equip your coding and testing agents with instant, token-efficient test coverage data for any programming language using an MCP server. It provides reliable LCOV-based coverage summaries, file-specific insights, and baseline tracking to measure progress within a session, helping you maintain or improve coverage while you code.
You will connect your MCP-enabled AI tool to the Test Coverage MCP server to query coverage data and track changes during a development session. Use the provided tool endpoints to fetch overall project coverage, file-specific coverage, and to establish a session baseline for incremental progress checks.
Prerequisites: ensure you have Node.js and npm installed on your machine.
Install the MCP server package globally using npm.
npm install -g test-coverage-mcpConfigure your MCP client to connect to the Test Coverage MCP server. The examples below show a standard local setup using npx to start the MCP server for your AI coding tool:
{
"mcpServers": {
"test-coverage": {
"command": "npx",
"args": ["-y", "test-coverage-mcp"]
}
}
}The server exposes four core tools you can call from your MCP client. Use them to check coverage, inspect specific files, start a session baseline, and compute changes against that baseline.
If coverage data cannot be found, verify your LCOV file path and that the coverage step ran before querying. If a baseline is missing, ensure you called the baseline start function before requesting differences.
Install dependencies, build, and run tests to validate the MCP server in your environment.
Get overall project coverage from an LCOV file. Input: lcovPath (optional, defaults to ./coverage/lcov.info). Output: linesCoveragePercentage and branchesCoveragePercentage.
Get coverage for a specific file. Input: lcovPath (optional, defaults to ./coverage/lcov.info), filePath (required). Output: path, linesCoveragePercentage, branchesCoveragePercentage.
Record current coverage as a baseline. Input: lcovPath (required). Output: a confirmation string indicating recording started.
Compare current coverage against the recorded baseline. Input: lcovPath (required). Output: linesPercentageImpact and branchesPercentageImpact indicating improvements or regressions.