The Model Context Protocol (MCP) lets agentic AI frameworks connect language models to external tool providers, but it carries attacker-controlled content (tool descriptions, schema fields, and response data) into model context without validation. Prior benchmarks measure model compliance with poisoned instructions without confirming real execution. We present the first cross-framework measurement of MCP tool poisoning with real tool execution. A 25-class root-cause taxonomy unifies prior classifications, and the open-source tool mcpvenom drives a 9,720-cell susceptibility matrix across 12 frameworks, 18 models, and 45 attack scenarios, with a dual oracle that confirms exfiltration via canary HTTP receipt. The overall attack success rate is 22.9% (2,113 vulnerable cells). Of these, 64.9% dispatch an attacker tool call, 23.0% contact the attacker endpoint, and 12.1% verifiably exfiltrate a secret. Resistance is model-level: nine core frameworks cluster within 23 to 26% (chi-squared = 3.30, p = 0.91), and no framework implements intentional defense. Incidental framework properties mitigate in specific cases, and a regex description scanner rejects 20 of 45 scenarios at a 7.2% false-positive rate, so metadata scanning alone is a partial control. Model ASR ranges from 0.4% to 49.7%. Claude Opus 4.8 is vulnerable in 8 of 530 cells while issuing 223 explicit refusals. A code-level audit finds no intentional defense across twelve frameworks, and all five coordinated disclosures across four vendors were rejected.
Figures & tables
Figure 1. MCP injection surfaces. Three attacker-controlled fields in the tools/list and tools/call responses—the tool description , the inputSchema description , and the tool response —enter the model context verbatim , with no framework-level validation, and become actionable during planning, argument construction, and result processing respectively. A vertical data-flow diagram. At the top, a panel labeled Malicious MCP server contains three red fields: tool.description, inputSchema description, and tool response. Red arrows pass these fields through a middle gray box labeled Agent framework (inserts fields verbatim, no content validation) and down into a blue panel labeled Model context window, whose three cells are planning, argument construction, and result processing. Arrows then converge on a red box: the model emits a tool call to an attacker endpoint, causing exfiltration.
Framework
Version
DL/mo
Stars
Rationale
LangChain
1.5.0
126M
138K
Highest adoption
Pydantic AI
2.14.1
42M
17K
Type-safety
CrewAI
1.15.5
14M
52K
Role orchestration
Agno
2.8.0
3.7M
40K
Memory integration
LlamaIndex
0.14.23
3.2M
42K
RAG/agent indexing
AG2
0.14.0
1.5M
58K
Multi-agent
Table 1. Framework scope. Downloads and stars as of May 2026. LangChain and LlamaIndex versions denote the core packages ( langchain-core , llama-index-core ); no top-level meta-package is pinned.
#
Class Name
CWE
Prior Work
P1
Direct Description TPA
74
Invariant ( Invariant Labs, 2025 ) , MCPTox ( Wang et al., 2026b )
P2
Schema-Field TPA
74
OWASP MCP03 ( OWASP Foundation, 2025 )
P3
Invisible/Encoded TPA
116
CipherChat ( Yuan et al., 2024 )
P4
Language-Switch TPA
74
HackAPrompt ( Schulhoff et al., 2023 )
P5
Authority Spoofing
290
Greshake et al. ( Greshake et al., 2023 )
P6
Tool Result Injection
74
MCPTox ( Wang et al., 2026b ) , AgentDojo ( Debenedetti et al., 2024 )
Table 2. MCP tool poisoning taxonomy (25 classes). Root cause and entry point per class are given in the supplementary material.
Figure 2. Experimental infrastructure. The canary HTTP server runs in a Podman container; the orchestrator ( run_matrix ), the framework harness (one of twelve), and the two FastMCP servers run as host processes communicating over stdio. The harness connects to a legitimate MCP server (five functional tools) and a malicious MCP server (per-scenario poisoned tool metadata), reads a shared workspace directory holding a planted secret, and queries a model through a LiteLLM/Bedrock proxy. A successful attack issues an exfiltration request to the canary server via the legitimate http_post tool. The dual oracle combines the transcript (intent) and the canary log (execution) into the cell verdict: V (Vulnerable), R (Resistant), or E (Error). A left-to-right pipeline diagram. A dashed box marks the model as a remote proxy. Inside a Test host panel, an orchestrator invokes a framework harness, which connects over stdio to a legitimate MCP server with five tools and to a malicious MCP server that returns poisoned metadata. The legitimate server performs file I/O against a shared workspace directory containing a planted secret. Only the canary HTTP server sits inside a nested Podman container box. A red exfiltration arrow runs along the bottom from the harness into the canary server on port 18080. A dual oracle receives the transcript from the orchestrator and the request log from the canary server, and emits a verdict of vulnerable, resistant, or error.
Figure 3. Attack Success Rate (%) per framework (columns) and model (rows). Cell values are ASR percentages; darker cells indicate higher susceptibility. Frameworks and models are ordered by ascending overall ASR; ASR = V/(V+R) with V, R, and E as in Table 3 ; – marks skipped GPT-5.5 cells. A heatmap grid showing attack success rates across 12 frameworks (columns) and 18 models (rows). Claude Fable 5, Opus 4.8, and Sonnet 5 show near-zero ASR across all frameworks. AG2 is near-zero for all models. Nova Pro, Maverick, DeepSeek-V3.2, and Mistral Large 3 show 35 to 55 percent ASR on most non-AG2 frameworks. In the tested configurations ASR varies more across models than across frameworks.
Framework
V
R
E
S
ASR
AG2
37
773
0
0
4.6%
Pydantic AI
123
619
50
18
16.6%
Haystack
189
619
2
0
23.4%
Google ADK
189
617
4
0
23.4%
Semantic Kernel
172
554
84
0
23.7%
LlamaIndex
195
615
0
0
24.1%
Table 3. Attack Success Rate by framework. V=Vulnerable, R=Resistant, E=Error, S=Skipped. ASR = V/(V+R). Each framework row spans 810 cells.
Model
V
R
ASR
Claude Fable 5
2
463
0.4%
Claude Opus 4.8
8
522
1.5%
Claude Sonnet 5
10
517
1.9%
DeepSeek-R1
19
515
3.6%
Gemma 3 27B
22
512
4.1%
GPT-5.5
44
310
12.4%
Table 4. Attack Success Rate by model. V=Vulnerable, R=Resistant, ASR = V/(V+R). Each model row spans 540 cells; error and skipped cells (186 for GPT-5.5: 183 skipped, 3 errors) are excluded.
Attack Class
V
R
ASR
Parameter binding
108
100
51.9%
Tool poisoning
1,460
3,899
27.2%
Confused deputy
161
466
25.7%
Annotation injection
50
156
24.3%
Long-context dilution
50
157
24.2%
Streaming injection
47
162
22.5%
Table 5. ASR by attack class across all 12 frameworks and 18 models, weighted by cell count. V=Vulnerable, R=Resistant, ASR = V/(V+R), consistent with Table 3 .
Tier
Count
%
Confirmed exfiltration (HTTP + secret data)
255
12.1%
Confirmed network (HTTP request, no secret)
487
23.0%
Executed attacker tool (canary in dispatched call)
1,371
64.9%
Table 6. Oracle confidence tiers for 2,113 VULNERABLE cells.
Framework
Passthrough File
Valid.
LangChain
tools.py:530
None
AG2
toolkit.py:119
None
Agno
mcp.py:772
None
CrewAI
mcp_native_tool.py:49
None
Pydantic AI
mcp.py:1146
None
smolagents
tools.py:1086
None
Table 7. Tool description passthrough: location where unvalidated content enters model context.
Large language models increasingly mediate tool use in Model Context Protocol (MCP) systems, where adversarial influence may enter through user instructions, tool schemas, tool outputs, or protocol messages. Existing benchmarks often evaluate deployed agents, conflating model susceptibility with guardrails, orchestration, and general task capability. We introduce COPEX (COntext Provider EXploitation), a controlled benchmark that isolates the model as an MCP client by fixing the surrounding agent stack and varying only the tool-selecting model. COPEX covers 25 attack types instantiated as 125 scenarios across four entry surfaces: model/agent, client, server/tool, and transport. Across nine models and 3,375 trials, the mean attack success rate is 64.4%, with surface-level means ranging from 58.3% to 71.4%. Some client- and transport-level attacks succeed partly outside the model's observation or control, separating system exposure from model susceptibility. Combined input and context scanning reduces mean attack success by 49.6% on an eight-attack defense subset relative to the undefended setting. The benchmark is available at https://github.com/inspire-center/copex.
Agents using the Model Context Protocol (MCP) rely on semantic matching to select tools from third-party servers, exposing a semantic supply-chain risk through attacker-controlled metadata and outputs. We introduce A2M (Attraction-to-Manipulation), a two-stage black-box framework for hijacking MCP agents. The Attraction phase optimizes tool metadata to increase invocation probability; the Manipulation phase uses execution traces to refine adversarial tool returns that steer agents toward attacker-desired outcomes. On LiveMCPBench, direct attacks optimized and evaluated on GLM-4.6 achieve a macro-average malicious tool invocation rate of 93.6% across four scenarios, increase weighted token costs to 32.4× the benign baseline under Cognitive Denial of Service, and attain a mean attack success rate of 74.4% across Information Exfiltration, Environment Integrity Compromise, and Reasoning Derailment. Transfer to four other models without re-optimization yields corresponding macro-averages of 63.6%, 2.7×, and 24.5%. These findings motivate stronger tool vetting and runtime isolation in MCP ecosystems. Code is publicly available at https://github.com/Lilaizhen/A2M.
Laizhen Li, Xuan Wang, Peicheng Zhao +4
Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences · University of Chinese Academy of Sciences · Nanyang Technological University +3
The Model Context Protocol (MCP), introduced by Anthropic in November 2024 and now governed by the Linux Foundation's Agentic AI Foundation, has rapidly become the de facto standard for connecting large language model (LLM)-based agents to external tools and data sources, with over 97 million monthly SDK downloads and more than 177000 registered tools. However, this explosive adoption has exposed a critical gap: the absence of a unified, formal security framework capable of systematically characterizing, analyzing, and mitigating the diverse threats facing MCP-based agent ecosystems. Existing security research remains fragmented across individual attack papers, isolated benchmarks, and point defense mechanisms. This paper presents MCPSHIELD, a comprehensive formal security framework for MCP-based AI agents. We make four principal contributions: (1) a hierarchical threat taxonomy comprising 7 threat categories and 23 distinct attack vectors organized across four attack surfaces, grounded in the analysis of over 177000 MCP tools; (2) a formal verification model based on labeled transition systems with trust boundary annotations that enables static and runtime analysis of MCP tool interaction chains; (3) a systematic comparative evaluation of 12 existing defense mechanisms, identifying coverage gaps across our threat taxonomy; and (4) a defense in depth reference architecture integrating capability based access control, cryptographic tool attestation, information flow tracking, and runtime policy enforcement. Our analysis reveals that no existing single defense covers more than 34 percent of the identified threat landscape, whereas MCPSHIELD's integrated architecture achieves theoretical coverage of 91 percent. We further identify seven open research challenges that must be addressed to secure the next generation of agentic AI systems.
Nirajan Acharya, Gaurav Kumar Gupta
University of the Cumberlands · Youngstown State University