CAT
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Cross AI Tools

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by @mertduzgun

Independent project, not affiliated with Anthropic

Dotnet Coverage Mcp

hyeonu-cha/dotnet-coverage-mcp
STDIOregistry active
Summary

Wraps the .NET test coverage toolchain so Claude can run dotnet test, parse Cobertura XML, and identify untested branches without you leaving the chat. Exposes eight tools: GetSourceFiles to discover code and batch by line budget, RunTestsWithCoverage to collect XPlat coverage, GetCoverageSummary for method level stats, GetFileCoverage to check per file targets, GetUncoveredBranches to find missing conditionals, GetCoverageDiff to compare runs, AppendTestCode to insert new test methods atomically, and CleanupSession to remove artifacts. Supports concurrent sessions via sessionId isolation and filesystem sandboxing through COVERAGE_MCP_ALLOWED_ROOT. Requires .NET 9 SDK and the reportgenerator global tool. Designed for batch workflows where you run tests once then parse coverage for many files to minimize test overhead.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

dotnet-coverage-mcp

build NuGet License: MIT

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.

Purpose

This server lets an AI assistant run unit tests, collect coverage data, and analyse results — all without leaving the chat. Instead of manually running dotnet test and parsing reports, the AI can call the server's tools directly to:

  • Discover source files and build smart batches by line budget
  • Run a filtered set of tests and collect coverage
  • Read compact, AI-optimised coverage summaries (method-level line/branch rates)
  • Check per-file coverage against a configurable target rate (default 80%)
  • Identify uncovered branches as structured JSON
  • Diff coverage between runs to see only what changed
  • Append new test code to an existing test file with atomic writes

How It Works

The server starts as a console process and communicates over stdio using the MCP protocol. An MCP-compatible client (Claude Code, Gemini CLI, etc.) launches the process and calls its tools as if they were functions.

AI Client  <--stdio/MCP-->  dotnet-coverage-mcp  <--shell-->  dotnet test + reportgenerator

Available Tools

ToolDescription
GetSourceFilesDiscover .cs files from a file, folder, or .csproj project. Returns file metadata (lines, method count) and smart batches grouped by lineBudget.
RunTestsWithCoverageRun 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.
GetCoverageSummaryParse Summary.json into structured class/method coverage data sorted by branch coverage ascending (lowest first).
GetFileCoverageGet 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.
GetUncoveredBranchesFind uncovered branch conditions for methods matching a given name. Returns all matching methods with partial name support. Supports sessionId.
GetCoverageDiffCompare current Cobertura XML against baseline. Shows method-level changes including new and removed methods. Supports sessionId for concurrent isolation.
AppendTestCodeInsert 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.
CleanupSessionRemove session state files and TestResults/coveragereport directories. Pass sessionId to scope, or omit to clean artifacts older than maxAgeMinutes (default 120).

Batch Workflow

For projects with many source files, the recommended workflow is:

  1. Discover — Call GetSourceFiles on a folder or .csproj to get all files and smart batches
  2. Run once — Call RunTestsWithCoverage with a broad filter (e.g., *) to collect coverage across all files
  3. Check per-file — Call GetFileCoverage for each file in the current batch (instant XML parsing, no test re-run)
  4. Focus — Pick the 3 lowest branch-coverage methods and call GetUncoveredBranches for each
  5. Write tests — Use AppendTestCode to add test methods
  6. Re-run and diff — Run tests once, call GetCoverageDiff to verify improvement
  7. Repeat — Continue until batch files meet the target rate (default 80%) or 3 cycles with no improvement, then move to next batch

This minimises dotnet test invocations (the main bottleneck) while still tracking per-file progress.

Concurrency

Multiple AI agents can safely run in parallel against the same repository by passing a sessionId to each tool call:

  • Isolated output directories — RunTestsWithCoverage creates TestResults-{hash}/ and coveragereport-{hash}/ per session, preventing one agent from deleting another's XML mid-parse
  • Scoped state files — Coverage state is written to .mcp-coverage/.coverage-state-{hash}, so ResolveCoberturaPath resolves to the correct XML for each session
  • Scoped baselines — GetCoverageDiff stores baselines as .coverage-prev-{hash}.xml per session
  • Atomic writes — All file writes (state files and test code) use write-to-temp-then-rename to prevent corruption from race conditions or process crashes

Without sessionId, tools use shared defaults — safe for single-agent use.

Requirements

  • .NET 9.0 SDK (or later) — https://dotnet.microsoft.com/download

  • reportgenerator global tool — the server shells out to it to render coverage reports (installed in the Install step below)

  • An MCP-compatible client (Claude Code, Gemini CLI, etc.)

  • COVERAGE_MCP_ALLOWED_ROOT — recommended. Set to your repository root to restrict every tool's filesystem access to that subtree. Any path passed by the client outside this root is rejected with pathNotAllowed. When unset, the server logs a warning once and accepts any path (backward-compatible, but not recommended for shared environments).

    export COVERAGE_MCP_ALLOWED_ROOT=/path/to/your/repo
    

Install

Install the server as a global .NET tool from NuGet:

dotnet tool install --global dotnet-coverage-mcp

The server depends on the reportgenerator global tool to render coverage reports — install it too:

dotnet tool install --global dotnet-reportgenerator-globaltool

After install, the dotnet-coverage-mcp command is on your PATH.

Build & Run (from source)

cd <path-to-dotnet-coverage-mcp>

# Restore dependencies
dotnet restore

# Build
dotnet build

# Run
dotnet run

The server will start and wait for MCP messages over stdin/stdout.

MCP Client Configuration

After installing the global tool (dotnet tool install --global dotnet-coverage-mcp), register the server with your MCP client. Set COVERAGE_MCP_ALLOWED_ROOT to the repository you want the server to operate on.

Claude Code

claude mcp add coverage --env COVERAGE_MCP_ALLOWED_ROOT=/path/to/your/repo -- dotnet-coverage-mcp

Claude Desktop

Add to claude_desktop_config.json (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "coverage": {
      "command": "dotnet-coverage-mcp",
      "env": {
        "COVERAGE_MCP_ALLOWED_ROOT": "/path/to/your/repo"
      }
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

{
  "mcpServers": {
    "coverage": {
      "command": "dotnet-coverage-mcp",
      "env": {
        "COVERAGE_MCP_ALLOWED_ROOT": "/path/to/your/repo"
      }
    }
  }
}

VS Code (GitHub Copilot)

Add to .vscode/mcp.json:

{
  "servers": {
    "coverage": {
      "type": "stdio",
      "command": "dotnet-coverage-mcp",
      "env": {
        "COVERAGE_MCP_ALLOWED_ROOT": "/path/to/your/repo"
      }
    }
  }
}

Run from source

To run from source instead of the global tool, use dotnet run:

{
  "mcpServers": {
    "coverage": {
      "command": "dotnet",
      "args": ["run", "--project", "<path-to-dotnet-coverage-mcp>"],
      "transport": "stdio"
    }
  }
}

Or point directly at the compiled executable:

{
  "mcpServers": {
    "coverage": {
      "command": "<path-to-dotnet-coverage-mcp>\\bin\\Debug\\net9.0\\DotNetCoverageMcp.exe",
      "transport": "stdio"
    }
  }
}

Tool Parameters

GetSourceFiles

ParameterTypeRequiredDescription
pathstringYesPath to a .cs file, folder, or .csproj project
lineBudgetintNoMax total lines per batch (default: 300). Small files are grouped together; large files get their own batch.

RunTestsWithCoverage

ParameterTypeRequiredDescription
testProjectPathstringYesFull path to the .csproj test project
filterstringYesTest filter string (matched against FullyQualifiedName). Use * or , for broad runs across multiple test classes.
workingDirstringNoWorking directory; defaults to the project directory
forceRestoreboolNoWhen true, skips the --no-restore flag. Use after scaffolding a new test project or adding NuGet packages.
sessionIdstringNoIsolates output directories (TestResults-{hash}/, coveragereport-{hash}/) and state files for concurrent multi-agent use.
includeClassstringNoRestrict coverage collection to types matching this name. Forwarded to coverlet as /p:Include=[*]*{includeClass}. Always honored when set, independent of filter — pass an explicit value to scope coverage; omit it to collect coverage for everything the run touches.

GetCoverageSummary

ParameterTypeRequiredDescription
summaryJsonPathstringYesFull path to the generated Summary.json file

GetFileCoverage

ParameterTypeRequiredDescription
coberturaXmlPathstringYesPath to coverage.cobertura.xml (falls back to .mcp-coverage/.coverage-state if not found)
sourceFileNamestringYesSource file name to look up (e.g., ExampleService.cs)
sessionIdstringNoResolves session-scoped state file for concurrent isolation.
targetRatedoubleNoCoverage threshold (0.0–1.0) used to compute allMeetTarget. Default 0.8.

GetUncoveredBranches

ParameterTypeRequiredDescription
coberturaXmlPathstringYesPath to coverage.cobertura.xml (falls back to .mcp-coverage/.coverage-state if not found)
methodNamestringYesMethod name to inspect (partial match supported; returns all matching methods)
sessionIdstringNoResolves session-scoped state file for concurrent isolation.

GetCoverageDiff

ParameterTypeRequiredDescription
coberturaXmlPathstringYesPath to the current coverage.cobertura.xml
workingDirstringNoDirectory for storing baseline; defaults to the XML's parent directory
sessionIdstringNoIsolates baseline as .coverage-prev-{hash}.xml and resolves session-scoped state file.

AppendTestCode

ParameterTypeRequiredDescription
testFilePathstringYesFull path to the target .cs test file
codeToAppendstringYesC# code to insert
insertAfterAnchorstringNoIf provided, inserts code after the last occurrence of this string (with whitespace-tolerant fallback). If omitted, appends before the last }.

CleanupSession

ParameterTypeRequiredDescription
workingDirstringYesProject working directory containing .mcp-coverage/ and TestResults artifacts
sessionIdstringNoWhen set, removes only state files and directories scoped to this session.
maxAgeMinutesintNoWhen sessionId is omitted, removes artifacts older than this many minutes. Default 120.

State Files

All state files are written to a .mcp-coverage/ subdirectory inside the working directory, keeping the project root clean. Add .mcp-coverage/ to the target repository's .gitignore.

FilePurpose
.coverage-stateDefault Cobertura XML path for single-agent use
.coverage-state-{hash}Session-scoped Cobertura XML path
.coverage-prev.xmlDefault coverage baseline for diff
.coverage-prev-{hash}.xmlSession-scoped coverage baseline

Plugin (Skills & Agent)

This repo includes a plugin/ directory with Claude Code skills and an agent definition for guided test coverage workflows:

plugin/
├── plugin.json
├── agents/
│   └── test-coverage.agent.md
└── skills/
    ├── scaffold-test-files/     — Create test directories and files mirroring source structure
    ├── run-coverage/            — Run tests and view coverage reports
    ├── analyze-coverage-gaps/   — Find uncovered branches and compare diffs
    └── improve-test-coverage/   — Iterative loop to reach 80% coverage

The skills support NUnit, xUnit, and MSTest with framework-agnostic reference docs in references/unit.md and references/integration.md.

Dependencies

PackageVersionPurpose
Microsoft.Extensions.Hosting10.0.7DI and hosting
ModelContextProtocol1.2.0MCP server framework
Microsoft.CodeAnalysis.CSharp5.3.0Roslyn AST for safe code insertion and accurate method counting (~15MB)

Security

dotnet-coverage-mcp runs as a local stdio process and validates every tool argument against COVERAGE_MCP_ALLOWED_ROOT to confine filesystem access. See SECURITY.md for the threat model, hardening recommendations, and how to report a vulnerability.

Contributing

Contributions are welcome. See CONTRIBUTING.md for development setup, pull request guidelines, and code conventions. Notable changes are tracked in CHANGELOG.md.

Releasing

Maintainer-only — release process, NuGet publishing, and MCP registry submission are documented in RELEASING.md.

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
Keep your Mac awake
Keep your Mac awake
Keep your Mac awake while Claude Code and 40+ AI agents run. Sleeps when they're idle.
One time payment $9 →
Context.devContext.dev
Context.dev
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
Make your agent a DeFi expert
Make your agent a DeFi expert
Agent, run crypto. Access onchain data & trade routes via 1inch.
Install now →
Make money from your Skills
Make money from your Skills
On Capafy, your Skill runs online 24/7 as an agent product, and you get paid every time someone uses it.
Start earning →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →

Configuration

COVERAGE_MCP_ALLOWED_ROOT

Restrict every tool's filesystem access to this subtree. Recommended for shared environments. When unset, the server logs a warning and accepts any path.

COVERAGE_MCP_DOTNET_TEST_TIMEOUT_MS

Override the dotnet test timeout in milliseconds. Default: 600000 (10 minutes).

Registryactive
Packagedotnet-coverage-mcp
TransportSTDIO
UpdatedMay 5, 2026
View on GitHub