Contents
Introduction to the Model Context Protocol (MCP)
The Model Context Protocol (MCP) is an open standard based on JSON-RPC that defines a structured way for AI clients-such as virtual assistants, integrated development environments, and web applications-to interface with servers. These servers expose three core components: tools, resources, and prompts. Communication occurs over specified channels, primarily stdio for local connections and Streamable HTTP for remote interactions. MCP’s design enhances security by making interactions between agents and tools transparent and auditable, with strict authorization requirements that can be programmatically verified. This framework supports precise blast-radius control over tool usage, enables reproducible red-team testing at well-defined trust boundaries, and facilitates enforceable policy compliance-assuming organizations treat MCP servers as sensitive connectors subject to rigorous supply-chain scrutiny.
Core Components and Communication Methods of MCP
MCP servers publish three distinct interfaces:
- Tools: Schema-defined actions that the AI model can invoke.
- Resources: Data objects accessible for reading and injecting into the model’s context.
- Prompts: Parameterized, reusable message templates typically initiated by users.
Separating these elements clarifies control dynamics: tools are model-driven, resources are managed by the application, and prompts originate from users. This distinction is crucial for threat modeling-for instance, prompt injection attacks usually target model-controlled pathways, while vulnerabilities in output handling often arise where application logic processes model outputs.
Communication Channels: MCP specifies two primary transport mechanisms: stdio (Standard Input/Output) for local, network-isolated environments, and Streamable HTTP for remote or multi-client scenarios, supporting resumable streams. Selecting the appropriate transport acts as a security measure-local stdio minimizes network exposure, while remote HTTP connections should implement standard authentication, authorization, and logging practices.
Client-Server Interaction: MCP standardizes how clients discover server capabilities, negotiate sessions, and exchange messages. This uniformity allows security teams to instrument communication flows, capture structured logs, and enforce pre- and post-conditions without needing custom adapters for each integration.
Authorization Mechanisms and Security Controls
MCP enforces a rigorous authorization model uncommon in integration protocols, including:
- Prohibition of token forwarding: MCP servers must not relay tokens received from clients. Instead, clients acquire audience-specific tokens from authorization servers using RFC 8707 resource indicators, ensuring tokens are bound to the intended server. This prevents confused-deputy attacks and maintains upstream audit and rate-limiting controls.
- Audience validation: Servers must verify that the access token’s audience matches their identity before processing requests. This prevents tokens issued for one service from being misused on another, a critical defense that red teams should actively test.
This authorization framework positions MCP servers as autonomous principals with their own credentials, scopes, and audit trails, rather than mere pass-through entities for user tokens.
Practical Security Benefits of MCP
Defined Trust Boundaries: The client-server interface forms a clear, inspectable security boundary. This allows integration of consent dialogs, scoped prompts, and detailed logging at the edge. Many client implementations prompt users to approve specific server tools and resources before activation, supporting least-privilege principles and auditability.
Enforced Least Privilege: Treating servers as distinct principals enables minimal upstream permissions. For example, a secrets management server can issue ephemeral credentials and expose narrowly scoped tools (e.g., “retrieve secret by policy label”) instead of broad vault access. Public MCP servers from security vendors exemplify this approach.
Predictable Attack Surfaces: Typed tool schemas and replayable transports allow red teams to create test fixtures simulating adversarial inputs at tool boundaries. This supports reproducible testing for vulnerabilities such as prompt injection, insecure output handling, and supply-chain compromises, aligned with established threat taxonomies.
Illustrative Incident: The First Documented Malicious MCP Server
In September 2025, security researchers uncovered a compromised postmark-mcp npm package masquerading as a legitimate Postmark email MCP server. Starting with version 1.0.16, this trojanized package covertly BCC’d every outgoing email to an attacker-controlled address. The package was promptly removed from repositories, and users were advised to uninstall the affected version and rotate credentials. This incident highlights the high trust MCP servers command and the necessity of strict vetting and version pinning for these privileged connectors.
Key operational lessons include:
- Maintain a strict allowlist of approved MCP servers with pinned versions and cryptographic hashes.
- Require code provenance through signed releases and Software Bill of Materials (SBOMs) for production deployments.
- Monitor for unusual outbound traffic patterns indicative of data exfiltration.
- Implement regular credential rotation and “bulk disconnect” drills to rapidly revoke compromised access.
This real-world breach underscores that over-trusting MCP server code in routine workflows can lead to significant security incidents.
Leveraging MCP for Red-Team Security Assessments
Security teams can structure red-team exercises around MCP’s architecture:
- Prompt Injection and Output Validation: Develop adversarial datasets injected via resources to coerce unsafe tool invocations. Verify client-side sanitization and server-side enforcement of constraints such as allowed hostnames or file paths. Map these tests to known vulnerabilities like prompt injection (LLM01) and insecure output handling (LLM02).
- Token Misuse and Confused Deputy Testing: Attempt to trick servers into using client-issued tokens or tokens intended for other services. Properly implemented servers must reject such requests, making any successful exploit a critical priority.
- Session and Stream Robustness: For remote transports, test reconnection, session resumption, and concurrent client handling to identify session fixation or hijacking risks. Validate that session identifiers are non-predictable and that sessions expire or rotate promptly.
- Supply-Chain Attack Simulations: Introduce benignly marked trojanized servers in controlled environments to verify detection mechanisms such as allowlists, signature verification, and egress monitoring. Measure detection speed and response effectiveness.
- Baseline Testing with Trusted Public Servers: Utilize vetted MCP servers like Google’s Data Commons MCP, which provides stable public datasets, or Delinea’s MCP server, which demonstrates least-privilege secret access. These serve as reliable platforms for repeatable security and policy enforcement tests.
Security Hardening Checklist for MCP Implementations
Client-Side Recommendations
- Clearly display the exact commands or configurations used to launch local MCP servers. Require explicit user consent and enumerate enabled tools and resources, persisting approvals with fine-grained scope control. This approach is exemplified by clients like Claude Desktop.
- Enforce an allowlist of trusted servers with pinned versions and checksums; block unknown or unverified servers by default.
- Log every tool invocation and resource fetch with detailed metadata, including caller identity and authorization decisions, to enable comprehensive forensic analysis.
Server-Side Best Practices
- Implement OAuth 2.1 resource server behavior rigorously: validate tokens and audiences, and never forward client tokens upstream.
- Adopt minimal scopes and short-lived credentials, encoding policy constraints directly into capabilities (e.g., “fetch secret by label” rather than unrestricted read access).
- For local deployments, prefer stdio communication within sandboxed containers with restricted filesystem and network permissions. For remote servers, use Streamable HTTP secured with TLS, rate limiting, and structured audit logging.
Detection and Incident Response
- Set up alerts for anomalous server egress patterns, such as unexpected destinations or suspicious email BCC activity, and monitor for sudden capability changes across versions.
- Develop automated “break-glass” procedures to revoke client approvals and rotate upstream credentials swiftly upon detection of compromised servers, minimizing incident impact.
Alignment with Security Frameworks and Governance
MCP’s architecture-separating clients as orchestrators and servers as scoped principals with typed capabilities-aligns closely with authoritative frameworks such as NIST’s AI Risk Management Framework (AI RMF) and OWASP’s Large Language Model (LLM) Top 10. These frameworks emphasize access control, comprehensive logging, and rigorous red-team testing to mitigate risks like prompt injection, unsafe output handling, and supply-chain threats. Leveraging these standards can strengthen security reviews and establish clear acceptance criteria for MCP deployments.
Current MCP Implementations and Ecosystem Examples
- Anthropic/Claude: MCP is integral to Claude’s architecture for connecting external tools and data sources, with extensive community resources following the protocol’s three-primitive model. This facilitates permissioning and audit logging at the client interface.
- Google’s Data Commons MCP: Launched in September 2025, this server standardizes access to public datasets with a stable schema, serving as a reliable “truth source” for red-team validation and fact-based tasks.
- Delinea MCP: An open-source server integrating with Delinea’s Secret Server and platform, focusing on policy-driven secret access and OAuth compliance, exemplifying least-privilege tool exposure.
Conclusion: MCP as a Foundation for Secure AI Agent Systems
MCP is not a turnkey security solution but a protocol that equips security and red-team professionals with enforceable controls: audience-restricted tokens, explicit client-server boundaries, typed tool schemas, and instrumentable transports. These features enable organizations to (1) tightly restrict agent capabilities, (2) monitor actual behavior, and (3) reliably reproduce adversarial scenarios. Given the privileged nature of MCP servers, rigorous vetting, version pinning, and continuous monitoring are essential, as attackers are already targeting these components. When implemented with these safeguards, MCP provides a robust foundation for secure, agentic AI systems and dependable red-team evaluation frameworks.
