The Model Context Protocol (MCP) enables large language models (LLMs) to dynamically discover and invoke third-party tools, significantly expanding agent capabilities while introducing a distinct security landscape. Unlike prompt-only interactions, MCP exposes pre-execution artifacts, shared context, multi-turn workflows, and third-party supply chains to adversarial influence across independently operated components. While recent work has identified MCP-specific attacks and evaluated defenses, existing studies are largely attack-centric or benchmark-driven, providing limited guidance on where mitigation responsibility should reside within the MCP architecture. This is problematic given MCP's multi-party design and distributed trust boundaries. We present a defense-placement-oriented security analysis of MCP, introducing a layer-aligned taxonomy that organizes attacks by the architectural component responsible for enforcement. Threats are mapped across six MCP layers, and primary and secondary defense points are identified to support principled defense-in-depth reasoning under adversaries controlling tools, servers, or ecosystem components. A structured mapping of existing academic and industry defenses onto this framework reveals uneven and predominantly tool-centric protection, with persistent gaps at the host orchestration, transport, and supply-chain layers. These findings suggest that many MCP security weaknesses stem from architectural misalignment rather than isolated implementation flaws.
Figures & tables
Figure 1. Primary and secondary defense layers for a rug pull attack.
Aspect
MCPSec Bench ( Yang et al., 2025b )
MSB ( Zhang et al., 2025 )
MCP-Safety Bench ( Zong et al., 2025 )
MCPLib ( Guo et al., 2025a )
When MCP Servers Attack ( Zhao et al., 2025b )
MCIP ( Jing et al., 2025 )
MCP-DPT (This Work)
Primary focus
Security benchmark
Attack benchmark
Safety benchmark
Attack library/ taxonomy
Malicious MCP servers
Safety-enhanced protocol
Defense placement
Taxonomy type
Attack-surface
Pipeline-stage attack
Safety-scenario
Attack-method taxonomy
Server-component attack
Unsafe-behavior/ lifecycle taxonomy
Defense-placement taxonomy
Attack-centric
✓
✓
✓
✓
✓
∼
×
Control-/defense-centric
∼
×
×
×
∼
✓
✓
Maps attacks → defenses
×
×
×
×
∼
∼
✓
Assigns enforcement responsibility
×
×
×
×
×
×
✓
Table 1. Comparison of MCP security benchmarks and analyses with respect to defense placement and enforcement responsibility. ✓ = fully supported; ∼ = partially supported; × = not supported.
Figure 2. Defense placement taxonomy of attacks.
Attack
MCP-Scan
MCIP-Guardian
Cisco MCP Scanner
MCP-Gateway
MCP Guardian (eqtylab)
MCP-Defender
MCP-Guard
Prisma AIRS
MCPScan.ai
MCP-Shield
ToolHive
MindGuard
AIM-Guard-MCP
Model Provider / LLM Alignment
Prompt Injection
∙
∙
∙
∘
∘
∙
∙
∙
∘
∙
∘
∘
∙
Tool/Service Misuse (“Confused AI”)
∘
∙
∘
∘
∙
∙
∙
∙
∘
∘
∘
∘
∙
Jailbreak Attacks
∘
∘
∘
∘
∘
∘
∙
∙
∘
∘
∘
∘
∘
Hallucination Attacks
∘
∙
∘
∘
∘
∘
∙
∙
∘
∘
∘
∘
∘
Prompt Leakage
∙
∙
∙
∘
∘
∘
∙
∙
∘
∙
∘
∘
∘
Table 2. Capability-based defense coverage across all 49 taxonomy attacks and 13 defense mechanisms, organized by the primary MCP architectural layer responsible for enforcement. ∙ = covered; ∘ = not covered.
Defense Mechanism
Static / Pre-Exec.
Behavior / Runtime
Isolation / Architect.
Decision Level
MCP-Scan (Invariant Labs)
∙
∘
∘
∘
MCPScan.ai
∙
∘
∘
∘
MCIP-Guardian
∘
∙
∘
∘
AegisMCP
∘
∙
∘
∘
MCP-Defender
∘
∙
∘
∘
MCP-Gateway / Lasso
∘
∘
∙
∘
Table 3. Categorical mapping of representative MCP defense mechanisms across four orthogonal defense types. ∙ = supported; ∘ = not supported.
Defense Mechanism
MP/LA
MH/A
R/M&SC
MC/S
MS/TE
T/N
MCP-Scan
11%
8%
83%
9%
33%
0%
MCIP-Guardian
44%
8%
0%
0%
17%
0%
Cisco MCP
11%
0%
17%
0%
0%
0%
MCP-Gateway
22%
38%
0%
9%
33%
50%
MCP-Guardian
33%
8%
0%
36%
50%
0%
MCP-Defender
11%
31%
0%
36%
33%
0%
Table 4. Defense Coverage Across MCP Ecosystem Layers
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
The Model Context Protocol (MCP) is a new and emerging technology that extends the functionality of large language models, improving workflows but also exposing users to a new attack surface. Several studies have highlighted related security flaws, but MCP attack detection remains underexplored. To address this research gap, this study develops and evaluates a range of supervised machine learning approaches, including both traditional and deep-learning models. We evaluated the systems on the detection of malicious MCP tool descriptions in two scenarios: (1) a binary classification task distinguishing malicious from benign tools, and (2) a multiclass classification task identifying the attack type while separating benign from malicious tools. In addition to the machine learning models, we compared a rule-based approach that serves as a baseline. The results indicate that several of the developed models achieved 100% F1-score on the binary classification task. In the multiclass scenario, the SVC and BERT models performed best, achieving F1 scores of 90.56% and 88.33%, respectively. Confusion matrices were also used to visualize the full distribution of predictions often missed by traditional metrics, providing additional insight for selecting the best-fitting solution in real-world scenarios. This study presents an addition to the MCP defence area, showing that machine learning models can perform exceptionally well in separating malicious and benign data points. To apply the solution in a live environment, a middleware was developed to classify which MCP tools are safe to use before execution, and block the ones that are not safe. Furthermore, the study shows that these models can outperform traditional rule-based solutions currently in use in the field.
Tobias Mattsson, Samuel Nyberg, Anton Borg +1
Blekinge Institute of Technnology, Sweden · Department of Computer Science, Blekinge Institute of Technology, Sweden · Ericsson, Sweden +1
The Model Context Protocol (MCP) introduces a structurally distinct attack surface that existing threat frameworks, designed for traditional software systems or generic LLM deployments, do not adequately cover. This paper presents MCP-38, a protocol-specific threat taxonomy consisting of 38 threat categories (MCP-01 through MCP-38). The taxonomy was derived through a systematic four-phase methodology: protocol decomposition, multi-framework cross-mapping, real-world incident synthesis, and remediation-surface categorization. Each category is mapped to STRIDE, OWASP Top 10 for LLM Applications (2025, LLM01--LLM10), and the OWASP Top 10 for Agentic Applications (2026, ASI01--ASI10). MCP-38 addresses critical threats arising from MCP's semantic attack surface (tool description poisoning, indirect prompt injection, parasitic tool chaining, and dynamic trust violations), none of which are adequately captured by prior work. MCP-38 provides the definitional and empirical foundation for automated threat intelligence platforms.