Blog / Test MCP servers with agents

Is your MCP mock lying to you? Raising mock fidelity from 48% to 95%

Mocks are how you test write paths, spend paths and dozens of runs without touching production. But agents read every value. A mock that's wrong in small ways makes agents fail in ways your users never would, and you'll fix the wrong thing.

Leonid Bugaev · Published 21 Oct 2026

Why mock fidelity matters

Agents act on values. If the mock says a resource isn't admitted, a careful agent refuses to use it, and your test records a failure your users would never see. You then “fix” your server for a bug that only exists in your mock.

That happened to us. An early agent experiment on a mock of a 99-tool production server produced a striking before/after headline. When we traced every failure, most came from the mock and the scorer. We withdrew it.

How we measured fidelity

Replay every distinct live read call (30 calls, from the read-only proxy logs) against a fresh mock, and score 612 checks:

The test fails below 90%. Live data is never stored: only shapes and sizes, with synthetic look-alike fixtures.

Want a mock agents can't tell from your server?

We build a live-shaped mock of your MCP server, measure its fidelity against read-only live calls, and run agent tests on it, including write paths.

Talk to us

What the first mock got wrong

Reads, before
296/612 checks (48.4%)
Reads, after
580/612 (94.8%)
Writes, before → after
71.4% → 89.3% (28 checks)
CheckBeforeAfter
Shape keys14/2726/27
Text tokens ±10%7/2723/27
Enum values34/176168/176
Array lengths47/120117/120
Per-item tokens9/5139/51
Error guidance0/33/3

Values generated from types only produced things the real server never returns:

Across the earlier runs' 151 failed checks: 47 mock artifacts, 63 scorer or harness bugs, 41 agent variance, 0 real server issues. Scorer bugs are their own trap: validate your eval scorer.

What fixed it

With the fixed mock and scorer, the re-run (150 runs) gave 54/75 (61–81%) on the raw tool surface and 68/75 (82–95%) on the redesign.

Go deeper: Test against production read-only, Pass rates with ranges, The two-step confirm pattern.

What a mock still can't tell you

Back to testing MCP servers with agents.

How we measured

FAQ

How do I build a realistic mock of an MCP server for agent tests?

Start from a read-only capture of the live server: byte-identical tools/list and initialize, real response shapes, sizes (in tokens), enum mixes, array lengths, error texts and guidance. Fill it with synthetic look-alike data, then score the mock against live calls and fix until it passes a threshold.

What should mock fidelity checks cover?

Error class and text, response framing, keys and types, token size within about ±10%, array lengths, enum coverage, per-item size and the tool list itself. We used 612 checks over 30 live calls and a 90% pass bar.

Can a mock replace live testing?

No. It's a regression check built from the same probes, and write responses are partly inferred. Re-measure sizes and behaviours live, read-only, before quoting them.

Want a mock agents can't tell from your server?

We build a live-shaped mock of your MCP server, measure its fidelity against read-only live calls, and run agent tests on it, including write paths.

Talk to us