Go code coverage analysis tool with MCP server for AI-powered coverage workflows
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Agent-loop coverage governance for all sorts of languages β coverage your AI coding agent calls before commit, not a dashboard you read after CI.
Works with Python, TypeScript/JavaScript, Java, Rust, Go, C#, C/C++, PHP, Ruby, Swift, Dart, Scala, Elixir, and Shell β one .coverctl.yaml, one MCP surface. Not a Go cover tool.
Get started β Β· Languages β Β· What it looks like β Β· MCP tools β Β· CLI reference β Β· Why this exists β Β· Community β
"Our AI agents ship code fast, but they're blind to coverage policy while editing. We only see breakage in CI, after context is gone, and the same agent then guesses its way to a fix."
Same policy model on every language: auto-detect the runner, group paths into domains, enforce mins before commit. Mock-heavy or exotic layouts may need an explicit domains: block in .coverctl.yaml.
coverctl is not a Go cover CLI: it is policy + MCP over each language's native coverage runner (vs go test -cover / pytest --cov).
Wire into Claude Code (~/.config/claude-code/mcp.json):
Ask the agent: "Run coverctl check and tell me which domains regressed."
For Cursor / Cline / Claude Desktop / Aider / Continue / OpenCode and other MCP clients, see docs/src/content/docs/mcp.mdx. All MCP-capable clients work; coverctl mcp serve runs in agent mode by default (3 tools: check, suggest, debt). Use --mode=ci for the full nine-tool surface.
Validate the install end-to-end:
Rendered for clarity β your client may format tool-calls differently.
The regression that used to surface in CI 8 minutes later is fixed in the same agent turn.
The agent does well: reads check output verbatim, calls suggest to find uncovered files, calls debt to rank smallest fixes, re-runs check to confirm.
Watch for: agents lowering thresholds in .coverctl.yaml to "fix" a failure (it's not a fix). Agents claiming coverage rose without a new check call (hallucination). Agents ignoring rejection error_code and retrying with the same input.
coverctl returns deterministic structured signals; the agent's fix still needs a human reading. The full contract is in docs/src/content/docs/mcp.mdx.
AI coding agents write code blind to coverage. They edit, you commit, the regression surfaces in CI minutes or hours later β too late to course-correct in the same session. Dashboards (Codecov, Coveralls) and raw language runners (go test -cover, pytest --cov, nyc) target humans reading numbers after the fact β not agents enforcing policy mid-edit.
coverctl is built for the agent loop (and is not a replacement for Go's cover tooling):
.coverctl.yaml enforces per-domain thresholds across 15 languages. On Go repos it may invoke go test the way it invokes pytest elsewhere β then applies the same domain policy. Agents touch any language; coverage governance must too.The CLI and MCP server are Apache-2.0 licensed and stay free. A hosted layer for cross-repo coverage history is on the roadmap (see docs/strategy/monetization-decision.md) β additive, not a paywall.
Agent mode advertises three tools (check, suggest, debt) for reliable agent tool selection. CI mode (--mode=ci) adds the rest.
| Tool | Mode | Purpose |
|---|---|---|
check | agent + ci | Run tests with coverage and enforce policy. Returns per-domain pass/fail, files, warnings. |
suggest | agent + ci | Recommend thresholds (current / aggressive / conservative). |
debt | agent + ci | Coverage gap per domain β where to spend effort, ranked. |
init | ci | Auto-detect project structure and create .coverctl.yaml with domain policies. |
report | ci | Analyze an existing coverage profile without running tests. |
record | ci | Record current coverage to history for trend tracking. |
compare | ci | Diff two coverage profiles. Returns delta, improved/regressed files, domain changes. |
badge | ci | Generate SVG coverage badge. |
pr-comment | ci | Post coverage report to GitHub / GitLab / Bitbucket PR. |
| URI | Content |
|---|---|
coverctl://debt | Coverage debt as JSON. |
coverctl://trend | Trend over recorded history. |
coverctl://suggest | Threshold suggestions. |
coverctl://config | Detected project config. |
coverctl treats MCP traffic as untrusted in both directions, per the Lethal Trifecta threat model.
--rootdir, --cov-config, -D, -I, --require, --init-script, --node-options, ...) are rejected when they come from MCP. Rejection responses use a stable schema with error_code and agent-actionable remediation. CLI invocations from a human terminal are not sanitized; the human is the trust boundary there.pr-comment) are canonicalized before return. Prevents return-trip prompt injection through a hostile PR or attacker-named test file.coverctl is local-first. The default install transmits nothing β no telemetry, no analytics, no source data. An opt-in --mcp-telemetry flag emits structured tool-call events to stderr for users who want to instrument their own pipelines (format documented in docs/design/mcp-metrics-spec.md). Adversarial + happy-path evals (85+ scenarios under internal/eval/scenarios/) gate every release on rejection-schema integrity and prompt-injection resistance.
Full threat model + residual risk: docs/security/mcp-threat-model.md.
The CLI is the substrate behind the MCP server; humans can use it directly.
| Command | Purpose |
|---|---|
init / i | Interactive wizard, auto-detects language and domains. --no-interactive for CI. |
check / c | Run coverage and enforce policy. -o json for machine output, --fail-under N, --ratchet, --from-profile. |
run / r | Produce coverage artifacts without policy evaluation. |
watch / w | Re-run coverage on file change during development. |
report | Evaluate an existing profile. -o html, --uncovered, --diff <ref>, --merge <profile>. |
detect | Auto-detect domains and write config. --dry-run to preview. |
badge | SVG coverage badge. --style flat-square. |
compare | Diff two profiles. |
debt | Coverage debt report. |
trend | Coverage trend from recorded history. |
record | Append current coverage to history. --commit, --branch for CI. |
suggest | Threshold suggestions. --write-config to apply. |
pr-comment | Post coverage to GitHub/GitLab/Bitbucket PR. |
ignore | Show configured excludes and tracked domains. |
mcp serve | Start MCP server (stdio). --mode=agent|ci|auto. |
mcp doctor | First-run validation: PASS/FAIL per step with remediation. |
survey | Sean Ellis 40% PMF prompt; appends to ~/.coverctl/survey.jsonl. |
Global flags: -q/--quiet, --no-color, --ci (combines quiet + GitHub Actions annotations).
check, run, record accept toolchain flags forwarded to the underlying test runner:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/coverctl-2)<a href="https://allmcps.com/mcp/coverctl-2"><img src="https://allmcps.com/api/badge/coverctl-2?style=directory" alt="Coverctl on AllMCPs" /></a>