← All news

FDE Times: Build a fake MCP server that injects timeouts, 429s and schema changes to test agents offline

A 4 November FDE Times guide shows FDEs how to fake a customer MCP tool with a deterministic FAULTS script—429 with retry-after, spend-cap 429, hang, missing tool, schema drift—so reliability demos run offline without stacking agent retries on top of SDK retries (one 429 can become 12 HTTP calls).

Demo agents look fine until a customer CRM rate-limits, hangs for 30 seconds, or renames a field. FDE Times’ 4 November guide builds a fake MCP server (Python + FastMCP) that exposes the same tool names as production but fails on a fixed FAULTS script—so tests need no network and stay repeatable.

Under the MCP spec, tool failures travel two channels: JSON-RPC protocol errors (e.g. unknown tool, -32602) and execution errors with isError: true. The minimum fault set covers a 429 with retry-after, a spend-cap 429 without retry-after, a hung tool cancelled by timeout, a misspelled tool name, and schema drift (e.g. order_id → orderId, number → string) that returns success on neither error channel.

The arithmetic trap: Claude SDKs already retry transient errors twice by default; if your agent loop also retries three times, one 429 can become 12 requests on an overloaded API. Put retry logic in one layer, wait on retry-after when present, and stop instead of looping forever on a spend-cap style failure.

In week one without staging access, match the customer’s rate-limit docs and build the suite in parallel; each real incident should add another FAULTS line. On a CV, cite the number of scenarios and bugs caught before production—not just “built agents with MCP.”

Source: fdetimes.net