get_annotated_source
Returns the source file content annotated line-by-line with coverage status ([COVERED], [NOT COV], [NO DATA]). Provides the full picture so the agent can understand the logic around uncovered regions.
Read an lcov report as something actionable: which files are worst, exactly which lines and branches are uncovered, and the source annotated line by line.
LABSCO SUMMARY
A percentage says a file needs tests and a list of line numbers says where, but neither says what the untested branch does. get_annotated_source marks each line COVERED, NOT COV or NO DATA across a range, which puts the gap and its surrounding logic in front of the model together. NO DATA is worth reading as its own state rather than as zero, since it marks lines the report says nothing about. The merging inside list_uncovered_regions is what keeps this workable — ranges rather than a column of individual line numbers.
A coverage reader with three tools over an lcov file — aggregated and per-file statistics, uncovered regions for one file, and source annotated with per-line coverage status.
An lcov report and the project root it was generated against — lcov_path and project_root are parameters on all three tools, with additional_roots and source_root for source that sits elsewhere.
One command — npx -y @sofia-open-source/analyze-coverage-mcp
USE CASES
A directory filter and a threshold turn a whole-project report into a shortlist, sorted by whichever coverage dimension matters.
Consecutive uncovered lines come back as ranges rather than as a column of numbers, which is what makes the list readable.
The annotated source shows the uncovered lines inside the logic that surrounds them, marked COVERED, NOT COV or NO DATA.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
get_annotated_sourceReturns the source file content annotated line-by-line with coverage status ([COVERED], [NOT COV], [NO DATA]). Provides the full picture so the agent can understand the logic around uncovered regions.
get_coverage_overviewReturns aggregated and per-file coverage statistics (lines, functions, branches %). Use this to identify files or directories with low coverage and prioritise testing efforts.
list_uncovered_regionsReturns uncovered lines and branches for a specific file. Consecutive uncovered lines are merged into ranges ({startLine, endLine}). Use this as a GPS to pinpoint exactly what code paths are missing tests.
BEFORE YOU INSTALL
3 tools when we connected.
npx on PATH
CONTEXT COST
Rated by the size of the 3 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
Add the block to your client, or run the command directly.
{
"mcpServers": {
"analyze-coverage-mcp": {
"command": "npx",
"args": [
"-y",
"@sofia-open-source/analyze-coverage-mcp"
]
}
}
}npx -y @sofia-open-source/analyze-coverage-mcp