Securing MCP in an Agentic World
Written by Om-Shree-0709 on .
- Securing Model Context Protocol (MCP): A Developer's Checklist
- Attack Surfaces in MCP
- Example Threat: Tool Prompt Injection
- Best Practices for MCP Security
- Defense in Depth
- Final Thoughts
- Acknowledgements
- References
Securing Model Context Protocol (MCP): A Developer's Checklist
As Model Context Protocol (MCP) evolves, so do the risks. While it unlocks powerful capabilities—LLMs that can call tools, retrieve context, and act autonomously—it also introduces new attack surfaces developers must secure from day one.1
This article outlines key security threats across the MCP lifecycle and presents actionable mitigation strategies developers can use immediately.
Attack Surfaces in MCP
There are three primary areas where MCP is vulnerable:
1. MCP Supply Chain
Includes MCP servers, tool registries, installers, and repositories. Attackers can tamper with how tools are published, fetched, or installed.1
2. Client-Server Connections
The communication layer between the LLM client and the MCP server can be intercepted, spoofed, or manipulated if not properly secured.1
3. Tool Execution Layer
When LLMs invoke tools, they may pass unsafe inputs, leak internal prompts, or execute malicious payloads if tools are poorly validated.1
Example Threat: Tool Prompt Injection
A malicious actor can manipulate tool descriptions to extract internal variables or modify agent behavior.1
This exploits LLM interpolation by poisoning tool descriptions with sensitive references like {{ conversation_history }}
.
Best Practices for MCP Security
1. Enforce Strict Tool Schemas
Use JSON Schema validation to prevent arbitrary inputs and ensure all tool parameters are predictable.2
2. Sign and Verify Tools
Digitally sign each tool and verify authenticity before executing them.2
3. Contextual Whitelisting
Restrict tool access based on user identity or session context.
4. Rate Limit and Log Tool Calls
Mitigate misuse by tracking and limiting tool invocations.
5. Sandboxed Tool Execution
Run tools in isolated environments using containers or VMs.3
Defense in Depth
Security in MCP is not a one-time action. Apply layered protection:
- Schema validation
- Signature verification
- Context checks
- Logging
- Isolation
Even if one control fails, others should prevent full exploitation.2
Final Thoughts
As agentic systems gain autonomy, securing the interface between LLMs and tools becomes mission-critical. MCP’s flexibility makes it powerful, but also demands careful, proactive security practices from developers.
Secure-by-design isn’t just an ideal—it’s a necessity.2
Acknowledgements
This guide is based on Arjun Sambamoorthy's session at the MCP Summit – "Securing MCP in an Agentic World". His analysis of real-world security threats and defenses in MCP ecosystems provided the foundation for this checklist.
Special thanks to Arjun, the Cisco AI team, and the wider MCP security community for their work in building resilient, secure foundations for LLM-native tooling.
References
Footnotes
Written by Om-Shree-0709 (@Om-Shree-0709)