Docs / Chaos testing
Testing mode
Chaos monkey
Inject protocol-aware faults into MCP tool traffic so clients and servers prove they degrade gracefully — not packet-level network chaos.
Marker
@marker tags=["chaos"]
Faults
delay · 503 · truncate · drift
Report
Chaos panel in HTML
delay
503
truncate
schema drift
Fault injection via markers
from mcp_test_harness import marker, assert_tool_call
@marker(tags=["chaos"], chaos_faults=["delay", "truncate"])
async def test_echo_survives_chaos(mcp_server):
# Harness wraps the session with protocol-aware fault injection
result = await assert_tool_call(mcp_server, "echo", {"text": "ping"})
assert result is not None
Typical faults
| Fault | What it does |
|---|---|
delay | Inject latency before tool responses |
503 | Simulate unavailable / overloaded tool path |
truncate | Return partial tool result payloads |
drift / schema | Perturb response shape for schema resilience |
CI
mcp-test -m chaos --report-format html --report-output report.html
HTML reports surface a Chaos monkey toolkit card and related test rows. Pair with Resiliency experiments for reconnect / crash / degrade scenarios.