MTMCP Test Harness5.2.0

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

FaultWhat it does
delayInject latency before tool responses
503Simulate unavailable / overloaded tool path
truncateReturn partial tool result payloads
drift / schemaPerturb 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.

Example: example_chaos_testing.md · Platform QA pack: platform-qa · Handbook: feature map