Skip to content
md1qamarPublic

About

Zero-LLM protocol fuzzer, capability-matrix verifier, schema auditor, and breaking-change differ for local MCP servers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mcpprobe

mcpprobe — MCP Protocol Fuzzer & Contract Gate

Zero-LLM protocol fuzzer, capability-matrix verifier, schema auditor, and breaking-change differ for local MCP servers.

Zero runtime dependencies. 100% local execution. No API keys required.

License: MIT Node.js >= 20 Agent Skills Standard Zero Runtime Deps SARIF 2.1.0


Why mcpprobe?

Model Context Protocol (MCP) servers frequently pass unit tests yet fail silently once connected to Cursor, Claude Code, Antigravity, or Gemini CLI:

  1. Broken stdio framing — a stray console.log() or print() written to stdout corrupts newline-delimited JSON-RPC framing.
  2. Missing expected capabilities — integrating an email or ticket MCP server only to discover it exposes read and search, while missing send or create.
  3. Strict LLM schema rejections — array parameters missing items, required keys absent from properties, contradictory minimum/maximum bounds, or missing descriptions.
  4. Unsafe tool annotations — destructive or mutating tools (delete_user, send_email) falsely flagged readOnlyHint: true, bypassing client confirmation policies.
  5. Boundary crashes & silent PR regressions — edge inputs ("", whitespace, wrong JSON types) crash child processes, or unreviewed schema edits break downstream agents.

mcpprobe End-to-End Verification Pipeline


Quick Start

git clone https://github.com/md1qamar/mcpprobe.git
cd mcpprobe
npm install
npm run build

Run a full live probe with safe read-only fuzzing and domain capability checks:

node dist/cli.js test --fuzz --preset email -- node test/fixtures/healthy-server.mjs

mcpprobe Verified CLI Runs: Healthy vs. Broken MCP Server

Verified CLI output: Healthy paginated server (PASS 100/100)
mcpprobe report: PASS (score 100/100)
Server: healthy-mail-mcp v1.2.0 | MCP 2025-03-26 | 329ms
Command: node test/fixtures/healthy-server.mjs
Surface: 6 tools, 1 resources, 1 prompts | Schema budget: 1010 B (~334 tokens)
Protocol: init=ok, ping=ok, unknownMethod=ok(-32601), stdoutViolations=0
Fuzzing: 11 cases run (11 passed, 0 failed, 3 skipped)

Capability Expectations:
  [OK] read -> Covered by read_message
  [OK] list -> Covered by list_messages
  [OK] search -> Covered by search_messages
  [OK] send -> Covered by send_message
  [OK] create -> Covered by create_draft

No issues detected.

Probe a misbehaving server to catch stdout leaks, annotation contradictions, broken schemas, missing capabilities, and runtime crashes:

node dist/cli.js test --fuzz --expect read,send -- node test/fixtures/broken-server.mjs
Verified CLI output: Broken server diagnostics (FAIL 0/100)
mcpprobe report: FAIL (score 0/100)
Server: broken-mcp v0.0.1 | MCP 2025-03-26 | 348ms
Command: node test/fixtures/broken-server.mjs
Surface: 3 tools, 0 resources, 0 prompts | Schema budget: 308 B (~100 tokens)
Protocol: init=ok, ping=unsupported, unknownMethod=ok(-32601), stdoutViolations=1
Fuzzing: 2 cases run (1 passed, 1 failed, 4 skipped)

Capability Expectations:
  [OK] read -> Covered by read_inbox
  [MISSING] send -> No exposed tool provides capability "send".

Findings (11: critical=3, high=4, medium=0, low=3, info=1):
  INFO     [protocol] ping (PROTOCOL_PING_UNSUPPORTED)
  LOW      [schema] upload_tags (TOOL_VAGUE_DESCRIPTION)
  HIGH     [schema] upload_tags (SCHEMA_REQUIRED_MISSING_PROPERTY)
  LOW      [schema] upload_tags (SCHEMA_MISSING_PARAM_DESCRIPTIONS)
  HIGH     [schema] upload_tags:$.tags (SCHEMA_ARRAY_MISSING_ITEMS)
  CRITICAL [annotations] delete_user (ANNOTATION_READONLY_CONTRADICTION)
  HIGH     [annotations] delete_user (ANNOTATION_DESTRUCTIVE_CONTRADICTION)
  LOW      [annotations] upload_tags (ANNOTATIONS_MISSING)
  HIGH     [capability] send (CAPABILITY_MISSING)
  CRITICAL [fuzz] read_inbox [boundary-edge] (FUZZ_SERVER_CRASHED)
  CRITICAL [framing] stdout:1 (FRAMING_STDOUT_POLLUTION)

CLI Reference

Command Purpose
mcpprobe test [options] -- <cmd> [args...] Live handshake, framing, schema, annotation, capability, and fuzz audit
mcpprobe inspect [options] -- <cmd> [args...] Inventory exposed tools, annotations, resources, prompts, and context token cost
mcpprobe snapshot --out <file> -- <cmd> [args...] Capture a normalized ServerSnapshot contract JSON
mcpprobe diff <baseline.json> [<target.json> | -- <cmd>] Detect breaking schema, enum, annotation, and tool contract changes
mcpprobe audit-config [path] [--live] Audit .mcp.json / .cursor/mcp.json for secrets, unpinned npx -y, shell wrappers, and live health

Key Options

Flag Description
--cmd "<command>" Alternative quoted command string instead of -- <cmd> [args...]
--fuzz Run boundary, missing-required, wrong-type, and path-traversal canary probes on readOnlyHint: true tools
--allow-mutating Opt in to live fuzzing of write/destructive tools (off by default for safety)
--expect <caps> Comma-separated expected verbs or tool names (e.g., read,search,send)
--preset <name> Curated capability matrix preset: email, filesystem, database, git, issue-tracker
--contract <file.json> Enforce custom contract rules (requiredTools, forbiddenTools, maxTools, maxSchemaBytes, requireAnnotations)
--min-score <0-100> Minimum passing probe score (default 70)
--timeout <ms> Per-request JSON-RPC timeout in milliseconds (default 5000)
--format <fmt> Output format: text, json, markdown, or sarif
--allow-breaking Exit 0 during diff even when breaking contract changes are present
--live In audit-config, also launch and probe every enabled stdio server

Checks & Rule IDs

Category Representative Rule IDs What It Catches
Framing FRAMING_STDOUT_POLLUTION, FRAMING_LSP_FRAMING, FRAMING_INVALID_JSONRPC Non-JSON stdout logs, unexpected Content-Length headers, invalid JSON-RPC envelopes
Protocol PROTOCOL_INITIALIZE_FAILED, PROTOCOL_DUPLICATE_TOOL_NAME, PROTOCOL_UNKNOWN_METHOD_SUCCEEDED Handshake failures, duplicate tool names across pages, missing -32601 error on unknown methods
Schema SCHEMA_ARRAY_MISSING_ITEMS, SCHEMA_REQUIRED_MISSING_PROPERTY, SCHEMA_CONTRADICTORY_BOUNDS, SCHEMA_ENUM_TYPE_MISMATCH Strict LLM schema errors, mismatched required[] entries, unannotated parameters, schema bloat
Annotations ANNOTATION_READONLY_CONTRADICTION, ANNOTATION_DESTRUCTIVE_CONTRADICTION, ANNOTATIONS_MISSING Destructive/write verbs claiming readOnlyHint: true, missing MCP safety hints
Capabilities CAPABILITY_MISSING, CONTRACT_REQUIRED_TOOL_MISSING, CONTRACT_FORBIDDEN_TOOL_EXPOSED Missing expected domain verbs (send, create, delete), violated contract budgets
Fuzzing FUZZ_SERVER_CRASHED, FUZZ_TOOL_TIMEOUT, FUZZ_INVALID_TOOL_RESULT_SHAPE Child crashes, hung RPC calls, malformed tools/call payloads
Config CONFIG_HARDCODED_SECRET, CONFIG_UNPINNED_NPX, CONFIG_SHELL_WRAPPER, CONFIG_MISSING_LOCAL_SCRIPT Embedded ghp_/sk-/AKIA tokens, unpinned npx -y, shell wrappers, broken script paths

PR Contract Diff & Config Security

mcpprobe Contract Diff and Config Security Audit Flows

Snapshot your MCP surface before a refactor and block breaking tool regressions in CI:

node dist/cli.js snapshot --out .mcp-baseline.json -- node dist/server.js
node dist/cli.js diff .mcp-baseline.json -- node dist/server.js

Audit local MCP client configs (.mcp.json, .cursor/mcp.json, claude_desktop_config.json) statically and live:

node dist/cli.js audit-config .cursor/mcp.json --live

Enforce custom capability and schema budgets with --contract:

{
  "requiredCapabilities": ["read", "search", "send"],
  "requiredTools": ["send_message"],
  "forbiddenTools": ["exec_shell"],
  "maxTools": 12,
  "maxSchemaBytes": 8192,
  "requireAnnotations": true
}

CI & AI Coding Agent Integration

Generate SARIF v2.1.0 findings for GitHub Code Scanning or Markdown summaries for Pull Requests:

node dist/cli.js test --fuzz --format sarif --out mcpprobe.sarif -- node dist/server.js
node dist/cli.js test --fuzz --format markdown --out mcp-report.md -- node dist/server.js

mcpprobe also ships with SKILL.md following the Agent Skills open standard so coding agents can verify MCP servers automatically before finishing edits.


Architecture

  • src/stdio-client.ts — Zero-dependency NDJSON-RPC 2.0 stdio transport with stdout framing violation capture, nextCursor pagination, timeout traps, and cross-platform child process cleanup.
  • src/schema-auditor.ts — JSON inputSchema validator, schema byte/token profiler, and deterministic boundary/negative fuzz generator.
  • src/annotation-auditor.ts — Semantic intent classifier detecting readOnlyHint / destructiveHint contradictions and gating safe read-only fuzzing.
  • src/capability-auditor.ts — Verb-synonym matcher, domain presets, and JSON contract evaluator.
  • src/contract-diff.ts — Breaking-change detector across ServerSnapshot contracts.
  • src/config-auditor.ts — Secret scanner and command-safety auditor for MCP client configurations.
  • src/probe-runner.ts — Live probe orchestrator, deterministic scoring (0–100), and PASS/WARN/FAIL verdict engine.
  • src/reporters.ts & src/cli.ts — text, json, markdown, and SARIF v2.1.0 reporters plus CLI entrypoint.

Development

npm run typecheck
npm test

License

MIT © 2026 md1qamar

About

Zero-LLM protocol fuzzer, capability-matrix verifier, schema auditor, and breaking-change differ for local MCP servers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages