modelcontextprotocol / modelcontextprotocol/servers
Bring all servers to the 90% per-file coverage gate; reintroduce the rule to AGENTS.md
Open
@cliffhall is already working on this.
Since Jul 4, 2026.
v2
- Dominant language
- TypeScript
- Stars
- 90.5k
- Forks
- 11.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 5
Description
Goal
Bring every server up to the ≥ 90% per-file test-coverage gate used in the inspector repo, enforce it in tooling, and then reintroduce the rule into AGENTS.md — #4473 deliberately deferred it so the rule wouldn't be aspirational fiction on day one. Once this issue lands, the rule is true and stays true.
The gate (per the inspector v2/main reference)
- Per-file threshold of ≥ 90 on all four dimensions: lines, statements, functions, branches
- Genuinely-unreachable branches are not waved through by lowering the gate — they get a justified inline ignore at the source (
/* v8 ignore ... -- <reason> */for TS;# pragma: no cover # <reason>for Python) - Coverage is a separate, deliberate command (
npm run coverage), not baked into the fastvalidateloop — mirroring inspector's split (validate = fast unit tests; coverage = instrumented gate)
Scope
TypeScript servers (vitest + @vitest/coverage-v8 already in place):
everything,filesystem,memory,sequentialthinking- Configure per-file thresholds (
coverage.thresholdswithperFile: true, 90 across lines/statements/functions/branches) in each server's vitest config - Root
npm run coveragechaining the per-workspace coverage runs (companion to #4473'svalidatechain)
Python servers (pytest + pyright + ruff in place; coverage tooling TBD):
fetch,git,time- Add
pytest-cov/coverage.py; note coverage.py'sfail_underis global, not per-file — pick the per-file enforcement mechanism as part of this work (e.g.coverage json+ a small check script, matching the TS gate's semantics) uv run coverageequivalent documented per server
Tasks
- Audit current coverage per server — record the baseline in a comment on this issue (some servers may be far from 90; the audit sizes the work)
- Write the missing tests, server by server (each server can be its own PR — independent, reviewable chunks)
- Annotate genuinely-unreachable branches with justified ignores instead of gate-lowering
- Enforce: per-file 90/90/90/90 thresholds in each TS vitest config; per-file mechanism for Python
- Root
coveragescript (TS chain) + per-server Python invocation - Decide CI posture and document it: inspector runs
validatein CI and keeps the coverage gate local-only — adopt the same unless there's a reason not to - Reintroduce the rule into
AGENTS.md("Always test new or modified code" section): per-file ≥ 90 on all four dimensions, justified-ignore policy,coveragevsvalidatesplit — wording adapted from the inspector reference
Dependencies
- Builds on #4473 (AGENTS.md + validate script must exist first — this issue extends both)
Acceptance
- Every TS server passes its per-file 90% gate via
npm run coverage - Every Python server passes the equivalent gate
- Gates are enforced by configuration, not convention
-
AGENTS.mdstates the rule, and the rule is true on the day it's stated
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.