2026-11-26 15:40 UTC

Open-source MCP workflow fuzzer reports findings in four server tests

state: seedheat: mediumuncertainty: mediumrelevance: highmcp-security protocol-testing agent-toolingSnowyLumiere

What is this?

MCP-CrashTest is an MIT-licensed tool by GitHub maintainer SnowyLumiere for stateful, multi-step testing of Model Context Protocol (MCP) servers. The GitHub README describes random-walk testing, sandbox rollback and minimal JSON-RPC reproducers, and reports a v0.2.1 audit of four servers on 2026-11-20. Its results are maintainer-reported, not independently confirmed here. The README gives source-install instructions and says the PyPI quick-start works “once published”; a web result does surface a PyPI project listing, but the supplied evidence does not confirm its current installability.

Why it matters

As agents increasingly chain tools, bugs can emerge between individually valid calls—for example, one tool’s output may not match the next tool’s expected input, or a failed operation may be reported as successful. A stateful fuzzer targets that gap and could help developers find reproducible integration failures before deployment. The reported audit includes serious-looking error-reporting issues, but one maintainer’s tests do not establish how widespread these problems are.

Current assessment

New: SnowyLumiere announced MCP-CrashTest via Show HN, linking to an MIT-licensed GitHub project. The README says it explores multi-step workflows using inferred tool dependencies, fuzzed inputs, rollback and minimized reproducers; it supports stdio only, with HTTP/SSE on the roadmap. It reports testing four named servers on 2026-11-20: SQLite, Git, filesystem and memory. The report labels SQLite cases where SQL errors return `isError: false` as protocol violations, and says Git tool output such as `* main` breaks downstream operations; filesystem and memory findings are categorized mostly as contract or consistency issues. Distinguish these categories: the README does not claim all four servers had protocol violations. The reported audit used 15 walks, depth 6 and seed 42; results are the maintainer’s claims, not independent validation. The web search surfaces a PyPI listing, but availability is uncertain because the README’s own quick-start qualifies PyPI use as “once published”; installing from source is documented. Significance: this offers a practical way to test cross-tool behavior that single-call checks can miss, potentially improving reliability of agent-facing infrastructure. Scope and real-world prevalence remain unknown; the project’s current transport limitation is stdio.

Measured heat

now 0 pts/hpeak 2 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 151h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-20 08:23 (minted)⭐ origin echo-reconstructedThe repository README is the project's original public artifact. It describes MCP-CrashTest as a “State-aware random walks with POSIX inode-
SnowyLumiere (GitHub account; individual identity not independently verified) on github (echo) · attributed from hn.story.50571498 · published time unknown
—
11-20 07:55first on hacker news · published · lag ?Show HN: MCP-CrashTest – Multi-step stateful contract fuzzer for MCP servers
SnowyLumiere
—
11-20 07:55amplified on hacker news 👑hn.story.50571498
SnowyLumiere
peak 1 · 0 comments · 103% of case engagement
11-20 08:20our radar first saw it · lag ?discovery anchor: hn.story.50571498—
pace: p14 vs 2105 stories at the 96h mark (now 151h old) — behind adobe-max-ai-agents-creative-tools-mcp (0.5x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: MCP-CrashTest – Multi-step stateful contract fuzzer for MCP servers
Retrieved article excerpt

Open article · Retrieved 2026-11-20T08:21:52.551350+00:00

# MCP-CrashTest

**Unit tests check single tool calls. Real agents fail on multi-step contracts.**

*State-aware random walks with POSIX inode-preserving rollback for Model Context Protocol (MCP) servers.*

[Version](https://github.com/snowyLumiere/mcp-crashtest/blob/main/pyproject.toml)
[Python](https://github.com/snowyLumiere/mcp-crashtest/blob/main/pyproject.toml)
[CI](https://github.com/SnowyLumiere/mcp-crashtest/actions/workflows/ci.yml)
[License: MIT](https://github.com/snowyLumiere/mcp-crashtest/blob/main/LICENSE)

[中文文档 (README\_CN.md)](https://github.com/snowyLumiere/mcp-crashtest/blob/main/README_CN.md)

---

## Why MCP-CrashTest?

Tools like MCP Inspector and standard unit tests validate **single-step static calls**. In production, AI agents execute **5–20 step tool chains** where outputs from discovery/list tools feed downstream mutations, entities collide, and `stdio` pipes hang.

Inspired by reversing the state-aware random walk paradigm from **ToolSpace** ([arXiv:2611.05036](https://arxiv.org/abs/2611.05036))—instead of keeping successful trajectories for model training and discarding rollbacks—`MCP-CrashTest` mines a dependency graph from `tools/list`, runs guided multi-step random walks inside ephemeral OS sandboxes, rolls back on failure to explore neighboring branches, prunes noisy intermediate steps, and outputs deduplicated **minimal JSON-RPC reproducers**.

### What It Catches in Real MCP Servers

1. **Masked Errors (`isError: false` on SQL/Runtime Failures) — Protocol Violation (`CRITICAL`)**  
   In `mcp-server-sqlite` (verified on **2026-11-20** with `MCP-CrashTest v0.2.1` in **both** `--adapter none` pure zero-shot mode and `--adapter auto`), SQL errors return `isError: false`, causing agents to treat error strings as valid query results (context poisoning):

   ```
   {
     "method": "tools/call",
     "params": {
       "name": "write_query",
       "arguments": {
         "query": "INSERT INTO users (id, name, email) VALUES (1, 'CollisionBob', '[email protected]');"
       }
     },
     "response": {
       "text": "Database error: UNIQUE constraint failed: users.id",
       "isError": false
     }
   }
   ```
2. **CLI Output Leaks Across Tools — Cross-Tool Contract Break (`HIGH`)**  
   In `mcp-server-git`, `git_branch` outputs human CLI formatting (`"* main"`). Passing that branch name directly to `git_checkout`, `git_diff`, `git_show`, or `git_merge` fails:

   ```
   [
     { "tool": "git_branch", "response": { "text": "* main", "isError": false } },
     { "tool": "git_merge", "arguments": { "source_branch": "* main" }, "response": { "text": "Error executing tool git_merge: Ref '* main' did not resolve to an object", "isError": true } }
   ]
   ```
3. **Silent State Corruption & Stdio Deadlocks — Protocol Violations (`CRITICAL`)**  
   Read-after-write verification catches tools that report `isError: false` without persisting state, as well as hung `stdio` buffers or severed child-process pipes (with automatic subprocess recycling).
4. **Agent Contract Smells — UX & Consistency Pitfalls (`MEDIUM` / `LOW` / `INFO`)**  
   Explicitly separated from protocol bugs: undocumented glob-only `search_files` matching, relative vs. parent-joined path contracts, no-upsert skip behavior (`create_entities`), and intra-server `isError` inconsistencies.

---

## Quick Start

Requires **Python >= 3.10**.

### 1. Run Immediately via `uvx` or `pip`

```
# Run directly without cloning (once published on PyPI)
uvx mcp-crashtest --target sqlite --walks 15 --depth 6

# Or install from source
git clone https://github.com/SnowyLumiere/mcp-crashtest.git
cd mcp-crashtest
pip install -e ".[dev]"
```

### 2. Test Any Custom MCP Server (Zero-Shot Generic Mode)

Use `--` to pass the server command cleanly without option collisions, and `--adapter none` to run **pure zero-shot generic stateful fuzzing** with zero domain-specific assumptions:

```
mcp-crashtest \
  --target my-server \
  --adapter none \
  --sandbox directory \
  --seed 42 \
  --walks 20 \
  --depth 6 \
  --fail-on-crash \
  --output reports/my_server_report.md \
  -- python3 -m my_mcp_server --root {sandbox}
```

For stateless/API-only servers, use `--sandbox none` (context-memory rollback and branch exploration still run):

```
mcp-crashtest \
  --target my-api-server \
  --adapter none \
  --sandbox none \
  --walks 20 \
  -- node dist/index.js --env test
```

### 3. Built-in Official Server Presets

Requires `npx` (`filesystem` / `memory`) or `uvx` + `git` (`sqlite` / `git`):

```
mcp-crashtest --target sqlite --walks 15 --depth 6 --output reports/sqlite_crash_report.md
mcp-crashtest --target git --walks 15 --depth 6 --output reports/git_crash_report.md
mcp-crashtest --target filesystem --walks 15 --depth 6 --output reports/filesystem_crash_report.md
mcp-crashtest --target memory --walks 15 --depth 6 --output reports/memory_crash_report.md
```

---

## Architecture: Generic Engine vs. Domain Adapters

`MCP-CrashTest` separates the **generic zero-shot stateful engine** from optional **domain contract adapters** (`mcp_crashtest/adapters/`):

| Capability | Generic Mode (`--adapter none`) | Built-in Domain Adapters (`--adapter auto`) |
| --- | --- | --- |
| **Schema Graph Mining** | Infers `CREATE`/`READ`/`MUTATE`/`DELETE` + `DATA`/`STATE`/`RETRY` edges from `tools/list`; handles Pydantic v2 `anyOf`/`oneOf`/`enum` and `properties: null` | Adds domain-specific edge bindings for `filesystem`, `sqlite`, `memory`, `git` |
| **Context Flow & Fuzzing** | Extracts IDs/keys/URIs/paths from args & JSON responses; injects boundary strings, traversal paths, extreme ints | Adds domain-specific probes (e.g. PK collisions, glob-vs-substring queries, raw `* main` branch passing) |
| **Post-Condition Probes** | Probe A (`RETRY_TRAP`), Generic Probe B (Read-After-Write on `id`/`key`/`uri`), Probe C (`SCHEMA_BREAK`), Probe D (`STDIO_DEADLOCK`) | Adds calibrated `CONTRACT_SMELL` checks (e.g. `search_files` glob pitfall, `describe_table` `[]`, `create_entities` no-upsert skip) |
| **Report Provenance** | Every finding is tagged with `source: generic` | Every adapter finding is explicitly tagged `source: adapter:<name>` |

### Sandbox Placeholders & Environment Injection

| `--sandbox` | CLI Placeholders | Injected Env Var | Seeded Initial Data |
| --- | --- | --- | --- |
| `directory` *(default)* | `{sandbox}`, `{work_dir}` | `MCP_SANDBOX_DIR` | `sample.txt`, `data_dir/config.json`, `data_dir/nested_note.txt` |
| `git` | `{sandbox}`, `{work_dir}` | `MCP_SANDBOX_DIR` | Initialized `main` branch + initial commit (`commit.gpgsign=false`) |
| `sqlite` | `{sandbox}`, `{db_path}` | `MCP_SANDBOX_DB_PATH` | `test_target.db` with seeded `users` table (2 rows) |
| `memory` | `{sandbox}`, `{memory_path}` | `MEMORY_FILE_PATH` | Isolated temp path `memory_graph.json` |
| `none` | — | — | No local filesystem sandbox (context rollback still active) |



---

## Live Audit Summary (v0.2.1 · 4 Official MCP Servers)

Verified on **2026-11-20** (`--walks 15 --depth 6 --rollbacks 3 --seed 42`, Python 3.12, `mcp` SDK v2.3.0 client with full v1.x/v2.x compatibility; pruned reports in [reports/](https://github.com/snowyLumiere/mcp-crashtest/blob/main/reports)):

| Server | Mode | Protocol Violations | Contract Smells | Headline Minimal Reproducers | Report |
| --- | --- | --- | --- | --- | --- |
| **`mcp-server-sqlite`** | `--adapter none` *(pure zero-shot)* | **`3`** (`CRITICAL`) | `0` | `write_query`, `create_table`, `read_query` return `"Error: ..."` with `isError: false` (1-step each, `source: generic`) | — |
| **`mcp-server-sqlite`** | `--adapter auto` | **`3`** (`CRITICAL`) | `1` (`MEDIUM`) | SQL errors return `isError: false` (×3, 1-step); `describe_table` returns `[]` on missing table (1-step) | [sqlite](https://github.com/snowyLumiere/mcp-crashtest/blob/main/reports/sqlite_crash_report.md) |
| **`mcp-server-git`** | `--adapter auto` | `0` | **`4`** (`HIGH` `SCHEMA_BREAK`) | `git_branch` leaks `'* main'`, breaking `git_checkout`, `git_diff`, `git_show`, `git_merge` (2-step each) | [git](https://github.com/snowyLumiere/mcp-crashtest/blob/main/reports/git_crash_report.md) |
| **`@modelcontextprotocol/server-filesystem`** | `--adapter auto` | `0` | `4` (`MEDIUM`) | `list_directory` bare filenames vs `read_file`/`read_text_file`/`get_file_info` (2-step); `search_files` glob-only miss (1-step) | [filesystem](https://github.com/snowyLumiere/mcp-crashtest/blob/main/reports/filesystem_crash_report.md) |
| **`@modelcontextprotocol/server-memory`** | `--adapter auto` | `0` | `3` (`LOW` / `INFO`) | `create_entities` skips existing entities with `isError: false` (2-step); `delete_*` idempotent `0` differs from `add_*` (1-step) | [memory](https://github.com/snowyLumiere/mcp-crashtest/blob/main/reports/memory_crash_report.md) |

> **Notes**:
>
> - The `sqlite` preset launches `uvx --with "mcp<2" mcp-server-sqlite` because upstream `mcp-server-sqlite` currently uses the `mcp 1.x` `@server.list_resources()` API and fails to boot under `mcp 2.x`. `MCP-CrashTest` itself supports both `mcp` SDK v1.x (`inputSchema`/`isError`) and v2.x (`input_schema`/`is_error`).
> - [reports/MCP\_CRASHTEST\_COMPREHENSIVE\_DIAGNOSIS\_20261106.md](https://github.com/snowyLumiere/mcp-crashtest/blob/main/reports/MCP_CRASHTEST_COMPREHENSIVE_DIAGNOSIS_20261106.md) is preserved as the historical v0.2.0 archive.

---

## 4 Contract Rules for Agent-Safe MCP Servers

1. **Strict `isError` Semantics**: Never return `isError: false` on SQL errors, constraint violations, or failed mutations.
2. **Cross-Tool I/O Symmetry**: Discovery/list tool outputs must be directly consumable by downstream tools without CLI decorations (`* main`) or stripped parent paths.
3. **Explicit Matching & Upsert Contracts**: Document glob vs. substring matching and provide explicit upsert/conflict errors instead of ambiguous `isError: false` skips.
4. **Actionable Errors & Pipe Backpressure**: Return offending parameter names and suggested corrective tools; paginate large responses to prevent `stdio` deadlocks.

---

## CLI Reference

| Flag | Default | Description |
| --- | --- | --- |
| `--target` | `"custom"` | Target label or built-in preset (`filesystem`, `sqlite`, `memory`, `git`) |
| `--adapter` | `"auto"` | Domain adapter mode: `auto`, `none` (pure generic), or explicit adapter name(s) |
| `--cmd` / `-- <cmd...>` | `None` | Server executable (prefer POSIX `--` passthrough to avoid flag clashes) |
| `--sandbox` | `"directory"` | `directory` | `sqlite` | `git` | `memory` | `none` |
| `--walks` | `15` | Number of random walk chains |
| `--depth` | `6` | Max step depth per walk |
| `--rollbacks` | `3` | Max rollback retries per walk |
| `--fuzz-ratio` | `0.25` | Boundary fuzzing probability (`0.0`–`1.0`) |
| `--timeout` | `8.0` | Per-step & `tools/list` timeout in seconds |
| `--init-timeout` | `20.0` | Session `initialize()` timeout in seconds |
| `--seed` | `None` | Local deterministic RNG seed (does not mutate global `random` state) |
| `--lang` | `"en"` | Report language: `en` | `zh` |
| `--fail-on-crash` | `False` | Exit with code `1` if findings matching `--fail-on` are detected (for CI gates) |
| `--fail-on` | `"any"` | CI failure scope: `any` (all findings) | `protocol` (`PROTOCOL_VIOLATION` only) |
| `--output` | `"reports/mcp_crash_report.md"` | Output Markdown report path |
| `--version` | — | Print version and exit |



---

## Known Limitations & Roadmap

- **Transport**: Currently supports **`stdio`** transport only. **Streamable HTTP / SSE** support is on the roadmap.
- **SQLite Sandbox**: In-place binary file rollback assumes per-call SQLite connections (such as `mcp-server-sqlite`). Long-lived connection pools with in-memory page caches require session restarts between walks.
- **Process Memory**: For servers keeping unpersisted in-process state, sandbox rollback restores disk state only.

---

## Python API & Running Tests

```
import asyncio
from mcp_crashtest.cli import run_crash
SnowyLumiere10
🟧 echo.github ⭐The repository README is the project's original public artifact. It describes MCP-CrashTest as a “State-aware random walks with POSIX inode-SnowyLumiere (GitHub account; individual identity not independently verified)——

Interpretation history

Decision trace