MCP Pitfall Lab: Exposing Developer Pitfalls in MCP Tool Server Security under Multi-Vector Attacks
Run Hao, Zhuoran Tan · 2026
Read MCP Pitfall Lab: Exposing Developer Pitfalls in MCP Tool Server Security under Multi-Vector Attacks by Run Hao, Zhuoran Tan (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-21477.txt.
Introduction
Run Hao and Zhuoran Tan probe security pitfalls in Model Context Protocol tool servers, where third-party tools expand supply-chain risk. Their MCP Pitfall Lab models developer pitfalls as reproducible scenarios validated from traces, not agent self-report, and introduces a semantic bill-of-materials enriching component inventory with security-relevant tool semantics. Across 2,579 validator-completed runs over four models, attacks succeed 31.9 percent of the time overall, with multi-modal injection strongest at about 39 percent. Hardening cuts BOM-backed findings from 27 to 16.
Catalog record
| CREATOR | Run Hao, Zhuoran Tan |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 53332 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2604.21477
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
MCP Pitfall Lab: Exposing Developer Pitfalls in MCP Tool Server Security under Multi-Vector Attacks Run Hao, Zhuoran Tan Abstract Model Context Protocol (MCP) is increasingly adopted for tool-integrated LLM agents, but its multi-layer design and third-party server ecosystem expand risks across tool metadata, untrusted outputs, cross-tool flows, multimodal inputs, and supply-chain vectors. Existing MCP benchmarks largely measure robustness to malicious inputs but offer limited remediation guidance. We present MCP Pitfall Lab, a protocol-aware security testing framework that operationalizes developer pitfalls as reproducible scenarios and validates outcomes with MCP traces and objective validators (rather than agent self-report). We instantiate three workflow challenges (email, document, crypto) with six server variants (baseline/hardened) and model three attack families—tool-metadata poisoning, puppet servers, and multimodal image-to-tool chains—in a unified, trace-grounded evaluation. In Tier-1 static analysis over six variants (36 binary labels), our analyzer achieves F1=1.0 on four statically checkable pitfall classes (P1/P2/P5/P6) and flags cross-tool forwarding and image-to-tool leakage (P3/P4) as trace/dataflow-dependent. Applying recommended hardening eliminates all Tier-1 findings (29 → \to 0) and reduces the framework risk score (10.0 → \to 0.0) at a mean cost of 27 lines of code (LOC). Finally, in a preliminary 19-run corpus from the emailsystem challenge (tool poisoning + puppet), agent narratives diverge from trace evidence in 63.2% of runs and 100% of sink-action runs, motivating trace-based auditing and regression testing. Overall, Pitfall Lab enables practical, end-to-end assessment and hardening of MCP tool servers under realistic multi-vector conditions. 1 Introduction LLM agents are increasingly used for tool orchestration and automation, turning natural-language instructions into API calls and real system actions. This shift moves many security and privacy risks from the model alone to the surrounding agent pipeline : developers must configure a control plane, connect high-privilege tools (e.g., email, files, shells, cloud credentials), and integrate an evolving ecosystem of third-party tool servers and “skills”. As a result, modern agent threats span not only prompt injection and data leakage, but also supply-chain risks such as malicious or compromised third-party components and manipulated registries. Correspondingly, OWASP has begun to systematize agent-centric threats (with supply-chain risks) in its Top 10 for LLM [ 4 ] . To standardize agent-to-tool integration, Anthropic introduced the Model Context Protocol (MCP) as an open protocol and released official SDKs. MCP has seen rapid adoption—by late 2025, the official Python/TypeScript SDKs reportedly reached 97M+ monthly downloads [ 1 ] . However, secure deployments remain easy to get wrong in practice: developers must make security-critical choices about tool exposure (e.g., reverse proxies and network boundaries), input handling (e.g., untrusted content and attachments), and tool mediation (e.g., parameter validation and allowlisting). The ClawdBot incident [ 12 ] illustrates how an agent with real operational privileges can be compromised through ordinary developer decisions. Moreover, MCP’s surrounding ecosystem amplifies risk: untrusted content can steer tool invocation, and third-party tool/skill registries can be manipulated to promote malicious components. These failures are best understood as developer pitfalls across multiple layers —protocol, tool server, and agent configuration—that are difficult to detect with model-only evaluations. This motivates a protocol-aware, reproducible testbed that helps developers identify , diagnose , and fix issues before deployment. Limitations of Existing Approaches We identify two limitations in existing evaluations of MCP-based agent security. (L1) Coverage gaps for multi-vector, multi-input, and ecosystem threats. Most LLM safety evaluations emphasize model-level prompt injection and jailbreak robustness [ 3 , 18 , 9 , 7 , 8 ] , while fewer studies target protocol- and tool-level risks [ 19 , 17 , 21 , 20 ] . Even MCP-focused benchmarks (e.g., MCPTox [ 17 ] ) tend to center on single-vector, text-only settings and provide limited coverage for common deployments where attacks chain across tools, modalities, and model providers [ 11 ] . In practice, agents frequently ingest images (screenshots, scanned documents, email attachments) and act on extracted content [ 2 , 16 ] , creating image-to-tool injection opportunities that are not captured by text-only benchmarks [ 2 , 5 ] . (L2) Limited diagnostic insight and developer-actionable remediation. Existing benchmarks often report aggregate success rates but provide limited guidance on why failures occur and how developers should harden tool servers. Many evaluations rely on model outputs or agent self-report, which can diverge from actual tool actions in complex pipelines. As a result, developers lack a trace-grounded, reproducible workflow for auditing end-to-end behavior, localizing the pitfall to specific protocol/tool interactions, and validating mitigations through regression testing. Contributions To close this gap, we propose MCP Pitfall Lab , a “range-like” evaluation suite that operationalizes common developer pitfalls as modular, reproducible scenarios for testing MCP-compatible tool servers and agent pipelines before deployment . Our core contributions are: • Pitfall Lab and a developer-centric pitfall taxonomy. We introduce MCP Pitfall Lab , a protocol-aware security testing framework for MCP tool servers, and present a six-class pitfall taxonomy (P1–P6). We distinguish Tier-1 statically checkable pitfalls from trace/dataflow-dependent pitfalls targeted by Tier-2 validators, preventing taxonomy–detector scope mismatches. • Fast Tier-1 static analysis with trace-grounded escalation. We build a lightweight static analyzer suitable for CI, achieving F1=1.0 on the Tier-1 statically checkable classes (P1/P2/P5/P6) with millisecond-level runtime, while flagging cross-tool forwarding and image-to-tool leakage (P3/P4) for trace/dataflow-based validation rather than claiming static detection. • Actionable hardening and evidence-based evaluation (scoped). Across three workflow challenges and six server variants (3 scenarios \times {baseline, hardened}), we show that recommended hardening removes all Tier-1 findings (29 \to 0) at low implementation cost (mean 27 LOC) and reduces the framework risk score (10.0 \to 0.0). Finally, in a preliminary 19-run emailsystem corpus (tool poisoning + puppet), we quantify trace–narrative divergences (63.2% overall; 100% for sink-action runs), motivating trace-based auditing and regression testing. The framework supports extensible attack surfaces including tool metadata poisoning, content injection, cross-tool forwarding, and multimodal inputs, though the current evaluation focuses primarily on server-side pitfall detection and mitigation effectiveness. The source code 1 1 1 https://anonymous.4open.science/r/mcp-attack-suite-4806 is available to facilitate reproducibility and further research. 2 Background & Developer Workflow 2.1 Threat surfaces considered (overview) MCP agent pipelines expand the attack surface beyond user prompts to (i) tool metadata consumed during discovery and planning, (ii) untrusted tool outputs that can carry indirect prompt injections, and (iii) multimodal inputs such as images whose extracted text can steer downstream tool calls. Recent work has shown tool-metadata tool poisoning vulnerabilities in real-world MCP servers [ 17 ] , demonstrated puppet MCP servers as a practical supply-chain vector in the MCP ecosystem [ 11 ] , and established image-based indirect instruction injection against multimodal LLMs [ 2 ] . We therefore focus on three corresponding attack families in our evaluation (Tool Poisoning, Puppet servers, and Image-to-tool chains). 2.2 MCP-based agent pipelines MCP standardizes how an agent discovers and invokes tools hosted by MCP servers. In typical deployments, an agent runtime (control plane) maintains a registry of MCP servers, queries each server for available tools (names, parameter schemas, and descriptions), and then performs tool calls as part of a planning/execution loop. This architecture shifts risk from the LLM alone to the surrounding pipeline: tool metadata becomes part of the agent’s decision context, and tool outputs become inputs that can influence subsequent actions. 2.3 Where developer pitfalls arise While MCP lowers integration friction, secure deployments are easy to