
Test Coverage Mcp
io.github.goldbergyoniPublished by GitHub account goldbergyoniv1.1.0Updated Oct 24, 2026
Analyze test coverage from LCOV files - makes AI agents coverage-aware without wasting tokens
Overview
Local MCP server that reads LCOV coverage files so coding agents can check project or per-file coverage and track changes since a baseline.
- What you can do
- Read overall project coverage percentages from an LCOV file
- Read line and branch coverage for a single specified file
- Record the current coverage as a session baseline
- Compare current coverage against that baseline to see improvement or regression
- Parse standard LCOV variants, including line-only and branch data, and return compact JSON
- When to use it
- Useful when a coding or testing agent should know whether its changes improved or regressed test coverage, or when it needs to find uncovered areas without reading multi-megabyte LCOV files itself. Best for projects whose test suite already emits LCOV output.
- Requirements
- Runs as a local stdio process, installed from the npm package test-coverage-mcp (typically via npx) and configured in the client's MCP config. Node.js and npm are needed. An LCOV file must already exist, by default at ./coverage/lcov.info, with relative paths resolved from the working directory. No accounts, API keys or headers are declared.
Installation
In SourceWeft
- Open Test Coverage Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Test Coverage MCP
[npm version] [License: MIT] [Coverage] [CI] [Last Commit]
Make your agents coverage-aware as they code for you
“Hey, I’m a coding agent. I just created flashy nifty feature… but oops, I downgraded the coverage 🤓. How could I know that?”
“Hey, I’m a testing agent. I was tasked to cover some code with testing, but how can I find which areas are not covered?😳”
Give your coding and testing agent eyes: MCP server that provides instant, reliable, token-efficient test coverage data for any programming language (LCOV based)
__
🚀 Just launched (November 2025) ! I spend great time these days on polishing this library. If you find this valuable, a ⭐ star helps signal to other developers that this project is worth their attention
The Problem
When AI coding agents work on your code without proper coverage tooling, they face three critical issues:
- Coverage Blindness - They can't see if their changes improved or regressed test coverage
- Token Waste - They burn thousands of tokens trying to parse massive LCOV files (some exceed 10 MB)
- Unreliable Scripts - They improvise custom parsing scripts that often fail or produce incorrect results
The Solution
This MCP server solves all three problems by providing:
- Coverage Awareness - Agents can check coverage anytime with a simple tool call
- Token Efficiency - Get coverage summaries in <100 tokens instead of thousands
- Accuracy - Production-grade LCOV parsing that handles all format variations
- Baseline Tracking - Measure coverage progress within a session without keeping state in memory
Test Coverage: This project maintains 95% test coverage and we're targeting 100% soon.
Two Main Workflows
1. Query Coverage Summary
Ask for overall project coverage or coverage for specific files:
2. Baseline Tracking for Session Progress
Establish a baseline at session start, then measure your progress:
Why baseline tracking? Without it, agents would need to keep initial coverage in their stateful memory throughout the session, consuming valuable context window space.
Installation
Configuration
Add this MCP server to your AI coding tool's configuration:
Claude Desktop (Claude Code)
macOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: Edit %APPDATA%\Claude\claude_desktop_config.json
After updating, restart Claude Desktop.
Cursor IDE
Create or edit .cursor/mcp.json in your project root:
GitHub Copilot (VS Code)
Create or edit .vscode/mcp.json in your workspace:
Requires VS Code 1.99+ or Visual Studio 17.14+. Enterprise users need "MCP servers in Copilot" policy enabled.
Windsurf (Codeium IDE)
macOS: Edit ~/.codeium/windsurf/mcp_config.json
Windows: Edit %APPDATA%\Codeium\Windsurf\mcp_config.json
Linux: Edit ~/.codeium/windsurf/mcp_config.json
Or use the GUI: Settings → Advanced Settings → Cascade → Add Server
Available Tools
coverage_summary
Get overall project coverage from an LCOV file.
Input:
Output:
Example:
coverage_file_summary
Get coverage for a specific file.
Input:
Output:
Example:
start_recording
Record current coverage as a baseline for later comparison.
Input:
Output:
Example:
get_diff_since_start
Compare current coverage against the recorded baseline.
Input:
Output:
Example:
Usage Examples
Example 1: Check Coverage Before Starting Work
Example 2: Track Coverage Impact During Development
Example 3: Verify Specific File Coverage
How It Works
This MCP server:
- Parses LCOV files using a production-grade parser that handles all LCOV format variations
- Calculates coverage percentages for overall project or individual files
- Stores baselines in a temporary directory for session-based tracking
- Returns compact JSON responses that consume minimal tokens
LCOV Format Support
This server supports all standard LCOV file formats, including:
- Files with summary sections (
SF:,end_of_record) - Files with line-by-line data only (
DA:entries) - Files with branch coverage data (
BRDA:,BRF:,BRH:) - Mixed formats within the same file
Troubleshooting
"LCOV file not found"
- Ensure you've run your test suite with coverage enabled first
- Check that the path to your LCOV file is correct (relative paths are resolved from current working directory)
- Default path is
./coverage/lcov.info
"No coverage data found for file"
- Verify the file path matches exactly as it appears in the LCOV file
- Some test frameworks use absolute paths, others use relative paths
"No baseline recording found"
- You must call
start_recordingbefore callingget_diff_since_start - Baselines are stored in temporary storage and cleared when the system restarts
Development
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT © Yoni Goldberg
Links
Improvement ideas
- coverage_file_summary returns nested properties also declared as flat
- Start recording overrides other sessions files
- Improve record naming - setSessionBaseline, getDiffSinceBaseline
Source: README.md at commit 0d1478a
Tools
0Version history
1- v1.1.0LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.