Open-source MCP testing · Rust · Hegel · Antithesis

Autonomous fuzzing for MCP servers.

Point Blofeld at an MCP URL. It discovers every tool, resource, and prompt, chains returned IDs across calls, checks protocol and custom invariants, and shrinks any failure to a minimal replayable trace.

cargo install blofeld
blofeld https://your-mcp-server.example.com/mcp
Shadowy faceless mastermind seated in a red wingback chair ominously patting a smug white cat

Minimal counterexamples

Finds stateful bugs. Shrinks the trace and the payload.

Designed to run the same way you use Bombadil for UIs—and powered by Hegel's native Rust engine (libhegel)—Blofeld reduces chaotic 40-step tool sessions down to the exact minimal reproducer, even when your server issues fresh UUIDs or sequential IDs every run.

blofeld http://localhost:3000/mcp --save-trace failure.trace.json exit 1
FAIL  property 'no_http_5xx' violated on run 1 (seed=7)
      server returned HTTP 500 on tools/call(delete_item, Valid, {"id":"item-1"})

Minimal counterexample (3 step(s), shrunk from 28):
  1. tools/call(create_item, Valid, {"name":"a"})
  2. tools/call(lock_item,   Valid, {"id":"item-1"})
  3. tools/call(delete_item, Valid, {"id":"item-1"})

Saved redacted counterexample trace to failure.trace.json
Replay deterministically: blofeld http://localhost:3000/mcp --replay failure.trace.json

Architecture

Built for the Antithesis & Hegel stack.

Designed to work like Bombadil does for web and terminal UIs: point it at a live MCP server, explore autonomously, check invariants continuously, and shrink counterexamples—using Hegel and the Antithesis SDK underneath.

01 · Zero-config discovery

One URL, full coverage

Speaks Streamable HTTP (JSON and SSE) and --stdio. Runs MCP discovery, bootstraps zero-argument read-only tools like businesses or list_*, and feeds harvested IDs and slugs into downstream calls automatically.

02 · Native Hegel engine

Schema-guided fuzzing & shrinking

Embeds hegeltest (libhegel) directly in Rust for valid, boundary, and malformed JSON Schema generation—including formats and pattern regexes—plus simultaneous trace, payload, and symbolic-ID shrinking.

03 · Local, CI & Antithesis

Same binary everywhere

Run locally with deterministic --seed and --replay, log assertions via ANTITHESIS_SDK_LOCAL_OUTPUT, or flip --antithesis to draw directly from libvoidstar.so and emit triage properties natively.

Zero-config checks

Built-in protocol invariants.

Every step of every session checks these properties automatically—no test harness required.

Built-in MCP protocol and safety invariants checked by Blofeld
Property What it catches
no_transport_error Dropped connections, unexpected EOF / child crashes, timeouts, or unparseable HTTP/SSE bodies.
no_http_5xx HTTP 500–599 internal server errors under valid, boundary, or malformed tool arguments.
valid_jsonrpc_envelope Missing jsonrpc: "2.0", mismatched request/response IDs, or responses with both/neither result and error.
valid_tool_result Successful tools/call responses missing a valid MCP content array or malformed content blocks.
output_schema_conformance Tools declaring outputSchema that omit structuredContent or return data violating the declared schema.
stdout_hygiene Stray non-JSON-RPC log bytes written to stdout by stdio MCP servers.
no_internal_error_leak Raw Rust panics, Python tracebacks, unhandled promise rejections, or segfault signatures leaked on 2xx or 4xx responses.

Authentication

Agent-friendly token handling

Keep login outside the fuzzer. Pass a token directly, via environment variable, or straight from an OAuth login JSON file (accessToken, access_token, or token).

blofeld https://localhost:8787/mcp -k \
  --token-file .context/auth.json \
  --read-only

Saved traces automatically redact Authorization, Cookie, and API key/token headers so counterexamples are safe to share or commit.

Declarative YAML

Custom rules with --rules

Layer project-specific invariants on top of the built-in protocol checks without writing Rust.

rules:
  - name: no-sql-errors
    never_contains: "SQLITE_ERROR"
  - name: fast-reads
    max_latency_ms: 1500
  - name: businesses-always-succeeds
    tool: businesses
    valid_calls_succeed: true

Coding agents

Hand Blofeld to your agent.

Install the skill directly into Claude Code, Codex, Cursor, or Antigravity, or paste the prompt below—your agent fetches https://blofeld.dev/skill.md and runs the full fuzz, shrink, replay, and fix loop.

npx skills add economico/blofeld
Follow https://blofeld.dev/skill.md to fuzz our local MCP server, save any failing trace, confirm it replays red, fix the root cause, and re-run a clean campaign.

Questions

Before you point it at a server

Is it safe to run against staging or production?
Pass --read-only to restrict calls to tools annotated with readOnlyHint: true, or narrow scope with --only <tool> and --exclude <tool>. For full read/write fuzzing, run against an isolated local instance.
How does it work with OAuth-protected MCP servers?
If a server rejects initialize with HTTP 401, Blofeld prints the WWW-Authenticate / resource_metadata hint and tells you (or your agent) to obtain a bearer token and pass --token-file or BLOFELD_TOKEN.
Does it require Python or an external Hegel process?
No. Blofeld links hegeltest's native Rust engine (libhegel) directly into a single static-feeling Rust binary with zero Python or runtime sidecars.
Can I test local stdio MCP servers too?
Yes—run blofeld --stdio node server.js. Blofeld spawns the process per session, checks JSON-RPC framing, catches crashes/EOFs, and flags non-JSON stdout pollution.