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