MCP server for .NET coverage: run tests, parse Cobertura, find uncovered branches, append tests.
Dotnet MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. MCP server for .NET coverage: run tests, parse Cobertura, find uncovered branches, append tests.
An MCP (Model Context Protocol) server that gives AI assistants — Claude Code, Gemini CLI, and others — direct access to .NET test-coverage tooling. Run dotnet test, parse Cobertura XML, identify uncovered branches, diff coverage between runs, and append test code — all over stdio.
Once Dotnet is connected, these are the calls the assistant has available:
GetSourceFiles — Discover .cs files from a file, folder, or .csproj project. Returns file metadata (lines, method count) and smart batches grouped by lineBudgetRunTestsWithCoverage — Run dotnet test with XPlat Code Coverage, generate a JSON summary via reportgenerator. Returns paths to Summary.json and coverage.cobertura.xmlGetCoverageSummary — Parse Summary.json into structured class/method coverage data sorted worst-first by branch coverage. Optional belowTarget/topN/methodsPerClassGetFileCoverage — Get coverage for a single source file from Cobertura XML. Returns allMeetTarget (true when all classes meet the configured targetRate for both lineGetUncoveredBranches — Find uncovered branch conditions for methods matching a given name. Returns all matching methods with partial name support. Supports sessionIdGetCoverageDiff — Compare current Cobertura XML against baseline. Shows method-level changes including new and removed methods. Supports sessionId for concurrentAppendTestCode — Insert or append C# test code into a test file. Supports anchor-based insertion with whitespace-tolerant fallback matching. Uses atomic writes toCleanupSession — Remove session state files and TestResults/coveragereport directories. Pass sessionId to scope, or omit to clean artifacts older than maxAgeMinutesCursor — The Cursor tool exposed by this serverYou will need one environment variable: COVERAGE_MCP_ALLOWED_ROOT. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
COVERAGE_MCP_ALLOWED_ROOT — recommended. Set to your repository root to restrictSetup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.
This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Dotnet's toolset — GetSourceFiles, RunTestsWithCoverage, GetCoverageSummary and 6 more — is a fair guide to whether it matches your workflow. It is maintained by Hyeonu-Cha; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Dotnet's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| GetSourceFiles | Discover .cs files from a file, folder, or .csproj project. Returns file metadata (lines, method count) and smart batches grouped by lineBudget. |
| RunTestsWithCoverage | Run dotnet test with XPlat Code Coverage, generate a JSON summary via reportgenerator. Returns paths to Summary.json and coverage.cobertura.xml. Supports forceRestore and sessionId for concurrent isolation. |
| GetCoverageSummary | Parse Summary.json into structured class/method coverage data sorted worst-first by branch coverage. Optional belowTarget/topN/methodsPerClass filters trim the response to what still needs work. |
| GetFileCoverage | Get coverage for a single source file from Cobertura XML. Returns allMeetTarget (true when all classes meet the configured targetRate for both line and branch coverage; default 0.8). Supports sessionId. |
| GetUncoveredBranches | Find uncovered branch conditions for methods matching a given name. Returns all matching methods with partial name support. Supports sessionId. |
| GetCoverageDiff | Compare current Cobertura XML against baseline. Shows method-level changes including new and removed methods. Supports sessionId for concurrent isolation. |
| AppendTestCode | Insert or append C# test code into a test file. Supports anchor-based insertion with whitespace-tolerant fallback matching. Uses atomic writes to prevent file corruption. |
| CleanupSession | Remove session state files and TestResults/coveragereport directories. Pass sessionId to scope, or omit to clean artifacts older than maxAgeMinutes (default 120). |
| Cursor | The Cursor tool exposed by this server. |
COVERAGE_MCP_ALLOWED_ROOT — recommended. Set to your repository root to restrict| Variable | Description | Required |
|---|---|---|
| COVERAGE_MCP_ALLOWED_ROOT | Configuration value read at startup. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.