Documentation

MCP (agents)

Same uncovered lines, flakes, and duration as the scorecard.

Coverage file first. Run your test runner with coverage, or tested run. tested run writes coverage even if tests fail. MCP reads that file. It does not invent coverage. Coverage is the only PR gate. Missing JUnit is a quiet miss. Node 24+.

@tested/mcp 0.1.3.

Install

npx @tested/mcp needs @tested/cli on disk (or tested / td on PATH). Install both.

pnpm add -D @tested/cli @tested/mcp

If TESTED_BIN is unset, the server resolves @tested/cli, then which tested. Do not paste placeholder TESTED_BIN paths.

Config sketch

Every tool needs cwd: an absolute path to a git repo. Default base is origin/main.

{
  "mcpServers": {
    "tested": {
      "command": "npx",
      "args": ["-y", "@tested/mcp"],
      "env": {
        "TESTED_ALLOWED_CWDS": "/absolute/path/to/your-git-repo"
      }
    }
  }
}

If @tested/mcp is already a project dep, use "command": "tested-mcp" and drop args.

Tools

ToolWhen
get_uncovered_diffRanges in the patch. cwd absolute + git. base defaults to origin/main
get_coverage_summaryRolled-up patch/project %
explain_lineOne file:line with excerpt
coverage_forpatch coverage for paths the agent touched
uncovered_branchesuncovered branches in the patch, not only lines
who_coverswhich tests execute this file:line
map_uncovered_to_testexisting test file an uncovered range should land in
get_flakesTests tab. Intra-run flakes and failures
get_failedname, file, message, duration, already-flaky
get_performancePerformance tab. Suite duration and slowest tests
duration_deltasuite/test duration vs main
new_since_mainnew flakes, newly slow tests, files that lost coverage vs base (informational)
write_and_verifyWrite a test file + re-run coverage + fresh diff
checktested check --json
pushtested push --json. Token. Optional junit
doctortested doctor --json

Skills

SkillWhen
triageCI red → doctor / get_failed / get_flakes / get_uncovered_diff
close-patchget_uncovered_diffmap_uncovered_to_test write_and_verifycheck

Security

  • Restrict TESTED_ALLOWED_CWDS to trusted project roots
  • Optional TESTED_BIN / TESTED_BIN_ALLOW_PREFIX only when you pin a real binary. No placeholders
  • Do not point MCP at world-writable paths

Human setup: Install