MCP-RepairBench: Repair Patterns & Automated Debugging for MCP Servers

MCP-RepairBench (arXiv:2611.39113) studies 221 verified Model Context Protocol (MCP) server fixes—classifying 197 repairs into 10 groups and 60 action patterns (median 2 files, 59 LOC)—and introduces a 60-task offline benchmark across 25 repositories where an MCP-aware agent raises pass@1 from 30.0% to 56.7% and pass@3 from 43.3% to 68.3%.
MCP-RepairBench: Repair Patterns & Automated Debugging for MCP Servers: MCP-RepairBench (arXiv:2611.39113) studies 221 verified Model Context Protocol (MCP) server fixes—classifying 197 repairs into 10 groups and 60 action patterns (median 2 files, 59 LOC)—and introduces a 60-task offline benchmark across 25 repositories where an MCP-aware agent raises pass@1 from 30.0% to 56.7% and pass@3 from 43.3% to 68.3%. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Empirical Taxonomy of 197 Real MCP Fixes: Maps 10 repair groups and 60 action patterns led by Startup & Environment (22.3%) and Tool Execution (16.2%).
- 60 Reproducible Offline Benchmark Tasks: Pinned buggy/fixed revisions across 25 Python MCP servers (Atlassian, dbt, Neo4j, ClickHouse, Milvus, Qdrant).
- Nearly 2x Higher pass@1 Resolution: An MCP-aware repair agent with evaluator feedback solves 34/60 (56.7%) at pass@1 and 41/60 (68.3%) at pass@3 vs 18/60 and 26/60 baseline.
- 5.5x Jump on Startup & Environment Bugs: Solves 11/24 startup tasks at pass@1 (vs 2/24 baseline) and 6/6 Tool Schema & Discovery issues.
import { createAgent } from '@smoke-monkey/harness';const mcpRepairAgent = createAgent({agentId: 'mcp-server-repair-specialist',provider: 'openai',model: 'gpt-5.4-mini',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},mcpServers: {inspector: {command: 'npx',args: ['-y', '@modelcontextprotocol/inspector', '--cli'],},},});async function diagnoseMcpServer(repoPath: string) {const result = await mcpRepairAgent.run(`Inspect ${repoPath} for MCP startup, tool signature, and JSON-RPC response schema mismatches. Patch only the minimal repair scope and verify via behavioral handshake tests.`);console.log('MCP Repair Result:', result.summary);}diagnoseMcpServer('./servers/mcp-clickhouse').catch(console.error);
Watch: Related Video Guides
Model Context Protocol Clearly Explained | MCP Beyond the Hype
You have been using MCP Wrong! Model Context Protocol Gateway
What Is MCP-RepairBench? Taxonomy of 221 Real MCP Fixes
MCP-RepairBench (arXiv:2611.39113) is an empirical study and 60-task offline software-repair benchmark built from 25 genuine Python MCP server repositories (filtered from 13,875 MCPCorpus records). Analyzing 221 fix-bearing issues (226 fix artifacts, median 2 files and 59 lines changed), researchers categorized 197 repairs into 10 repair groups and 60 fine-grained action patterns.
| Repair Group (197 Coded Fixes) | Issue Count | Share | Median LOC | Median Files |
|---|---|---|---|---|
| Startup & Environment | 44 | 22.3% | 16.5 | 2.0 |
| Tool Execution | 32 | 16.2% | 32.5 | 2.0 |
| Tool Schema & Discovery | 29 | 14.7% | 77.0 | 3.0 |
| Documentation | 28 | 14.2% | 12.0 | 1.0 |
| External Service Integration | 19 | 9.6% | 67.0 | 3.0 |
| Connection & Transport | 13 | 6.6% | 97.0 | 3.0 |
| Tool Response Handling | 13 | 6.6% | 54.0 | 2.0 |
| Runtime State Management | 5 | 2.5% | 180.0 | 5.0 |
The top single action patterns are tool signature corrections (15 fixes), installation guidance clarifications (10), configuration example fixes (9), dependency version updates (8), startup configuration handling (8), and startup path/resource setup (8).
MCP-Aware Agent vs Baseline Performance Across Coverage Groups
Unlike generic SWE benchmarks where bugs fail unit assertions inside pure Python functions, MCP bugs fail across stdio/SSE transport framing, environment variable initialization, and strict JSON-RPC schema expectations. Feeding structured MCP evaluator diagnostics back into an MCP-aware repair agent raises pass@1 from 18/60 (30.0%) to 34/60 (56.7%) and pass@3 from 26/60 (43.3%) to 41/60 (68.3%).
| MCP Coverage Group (60 Tasks) | Agent pass@1 | Baseline pass@1 | Agent pass@3 | Baseline pass@3 |
|---|---|---|---|---|
| Startup & Environment (24) | 11 / 24 | 2 / 24 | 15 / 24 | 5 / 24 |
| Tool Execution (14) | 10 / 14 | 7 / 14 | 11 / 14 | 9 / 14 |
| Tool Schema & Discovery (6) | 6 / 6 (100%) | 3 / 6 | 6 / 6 (100%) | 5 / 6 |
| Tool Response Handling (6) | 2 / 6 | 2 / 6 | 3 / 6 | 2 / 6 |
| Logging & Protocol Hygiene (4) | 2 / 4 | 1 / 4 | 2 / 4 | 2 / 4 |
| Connection & Transport (3) | 1 / 3 | 1 / 3 | 2 / 3 | 1 / 3 |
| Total Resolved (60 Tasks) | 34 / 60 (56.7%) | 18 / 60 (30.0%) | 41 / 60 (68.3%) | 26 / 60 (43.3%) |
Using GPT-5.4-mini (knowledge cutoff 2025-08-31), resolution rate reaches 68.0% pass@1 (80.0% pass@3) on pre-cutoff issues versus 48.6% pass@1 (60.0% pass@3) on post-cutoff bugs—proving that behavioral protocol evaluators remain essential for unseen SDK changes.
Prioritize Startup & Schema Checks Before Editing Tool Handlers
Startup & Environment (22.3%) and Tool Schema & Discovery (14.7%) account for over one-third of all MCP server failures. Validating entrypoint imports, env vars, and Pydantic tool signatures first resolves 17/30 tasks in those two groups alone.
Running Offline Behavioral Handshake & Schema Checks
Replicate MCP-RepairBench's verification discipline locally by pairing npx @modelcontextprotocol/inspector --cli with strict schema and stdio startup assertions before merging any MCP server patch.
# 1. Verify stdio server startup and tools/list schema discovery offline
npx @modelcontextprotocol/inspector --cli python -m mcp_server_qdrant --method tools/list
# 2. Assert zero stdout pollution (only valid JSON-RPC frames allowed on stdout)
python -m mcp_server_qdrant < /dev/null 2>/tmp/mcp_stderr.log | jq -e . >/dev/null || echo "Invalid JSON-RPC stdout"
# 3. Run behavioral + preservation tests inside isolated venv
uv run pytest -q tests/test_tools_schema.py tests/test_transport_startup.pySelf-Healing MCP Tool Registries in Smoke Monkey Harness
Because Smoke Monkey Harness orchestrates stdio and HTTP MCP servers directly inside its Explore-Plan-Edit-Verify-Recover loop, failed tools/list handshakes or schema validation errors automatically feed structured protocol stderr back to the repair subagent—allowing autonomous agents to fix broken dependency pins, startup paths, and Pydantic tool schemas without manual intervention.
Frequently Asked Questions
Q:What are the most common failure categories in real-world MCP servers?
Across 197 coded fixes in arXiv:2611.39113, the largest groups are Startup & Environment (22.3%), Tool Execution (16.2%), Tool Schema & Discovery (14.7%), Documentation (14.2%), and External Service Integration (9.6%).
Q:How big is a typical MCP server bug fix?
Across 221 verified MCP fixes, developers changed a median of 2 files and 59 lines of code, though Runtime State Management repairs are larger (median 5 files and 180 LOC).
Q:How much does MCP-aware evaluator feedback improve repair success?
On the 60-task MCP-RepairBench suite, an MCP-aware agent resolves 34/60 tasks at pass@1 (56.7%) and 41/60 at pass@3 (68.3%), compared with 18/60 (30.0%) and 26/60 (43.3%) for a generic baseline.
Q:Why do repair agents still fail on the remaining 19 MCP-RepairBench tasks?
Remaining failures typically stem from multi-file coordinated changes (up to 5 files in state management), strict packaging/dependency locks, external configuration dependencies, and exact response-shape requirements.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.