The Model Context Protocol (MCP)'s own published security guidance documents a specific set of named attack classes — including confused deputy, token passthrough, server-side request forgery (SSRF), and local-server compromise — each with a MUST- or SHOULD-level mitigation, because MCP is an open, vendor-neutral protocol that lets AI applications connect to external data sources, tools and workflows through a single standardized interface rather than a custom integration per connector. The official site's own analogy: "MCP is like a USB-C port for AI applications" — a single standard connector instead of a separate cable for every device. Anthropic introduced MCP on 25 November 2024 and open-sourced it; the official docs now list support across Claude, ChatGPT, Visual Studio Code, Cursor and other AI applications and development tools. Any AI application, device or product that lets an AI agent reach outside tools or data through an MCP server inherits this security model, which has grown more detailed and versioned as the protocol has matured — the subject of this guide.
Key takeaways
- MCP's own architecture documentation defines three participants.
- The Tools specification answers this directly: its Security Considerations give servers four MUST-level duties and clients a set of SHOULDs, and its definition of the Tool data type adds one client MUST.
- Authorization is optional in MCP, but the Authorization specification says HTTP-based implementations SHOULD conform to it, while stdio implementations SHOULD NOT and instead take credentials from the environment.
- Because the protocol draws no boundary around it.
What are hosts, clients and servers?
MCP's own architecture documentation defines three participants. The host is the AI application that coordinates one or more connections — Claude Code or a code editor extension, for example. For each server it connects to, the host creates a dedicated client, which "maintains a dedicated connection with its corresponding MCP server." The server itself is "a program that provides context to MCP clients," and can run locally (typically over the stdio transport, talking to one client) or remotely (typically over Streamable HTTP, able to serve many clients at once). The distinction matters for security: a local server runs with the same privileges as the client process on the user's machine, while a remote server is reached over the network and authenticated more like a conventional web API.
A server can expose three primitives to a client, per the specification:
| Primitive | What it is |
|---|---|
| Tools | "Executable functions that AI applications can invoke to perform actions" |
| Resources | "Data sources that provide contextual information to AI applications" |
| Prompts | "Reusable templates that help structure interactions with language models" |
Tools are the primitive with the sharpest security edge: the specification states plainly that "tools represent arbitrary code execution and must be treated with appropriate caution," that tool-behavior descriptions "should be considered untrusted, unless obtained from a trusted server," and that hosts "must obtain explicit user consent before invoking any tool."
What security principles does the protocol itself set?
MCP's specification dedicates a "Security and Trust & Safety" section to three stated principles: User Consent and Control ("users must explicitly consent to and understand all data access and operations"), Data Privacy ("hosts must obtain explicit user consent before exposing user data to servers" and "must not transmit resource data elsewhere without user consent"), and Tool Safety (as above). Notably, the specification is explicit that these are design-level principles the protocol cannot itself enforce: "while MCP itself cannot enforce these security principles at the protocol level," implementors SHOULD build consent and authorization flows, document security implications, and apply access controls themselves. Security in MCP is therefore mostly an implementation responsibility, not something guaranteed by using the protocol.
What must an MCP server check on every tool call?
The Tools specification answers this directly: its Security Considerations give servers four MUST-level duties and clients a set of SHOULDs, and its definition of the Tool data type adds one client MUST.
| Side | Requirement level | What the spec lists |
|---|---|---|
| Server | MUST | Validate all tool inputs; implement proper access controls; rate limit tool invocations; sanitize tool outputs |
| Client | SHOULD | Prompt for user confirmation on sensitive operations; show tool inputs to the user before calling the server; validate tool results before passing them to the LLM; implement timeouts; log tool usage for audit |
| Client | MUST | Consider tool annotations (optional behaviour hints such as readOnlyHint in the protocol schema) untrusted unless they come from trusted servers |
The last row matters for anyone building a server: a hint that a tool is harmless is advice to the client, not a control. The server still has to enforce access on its own side.
What does the authorization spec require of a remote server?
Authorization is optional in MCP, but the Authorization specification says HTTP-based implementations SHOULD conform to it, while stdio implementations SHOULD NOT and instead take credentials from the environment. When a remote server does use it, the core rules are:
Act as an OAuth 2.1 resource serverThe server MUST publish OAuth 2.0 Protected Resource Metadata (RFC 9728) so clients can discover its authorization server. Validate the audienceServers MUST validate that access tokens were issued specifically for them, and MUST only accept tokens valid for their own resources. Expect a resource indicatorClients MUST send the RFC 8707 resourceparameter naming the server's canonical URI in both authorization and token requests — this is what lets an authorization server mint a token bound to one MCP server.Never pass tokens throughServers MUST NOT accept or transit any other tokens; forwarding a client's token to a downstream API is the token-passthrough anti-pattern described below. Reject cleanlyInvalid or expired tokens MUST receive HTTP 401, and tokens MUST NOT appear in the URI query string. Bind responses to the issuerClients MUST record the expected issuer before redirecting and validate a returned issvalue per RFC 9207 before redeeming the authorization code — the defence against mix-up attacks.
Which attack classes does the official guidance document?
MCP's official Security Best Practices page — which the protocol's own authors describe as "complementing the MCP Authorization specification" — documents several named attack classes, each with a specific, often MUST-level mitigation:
| Attack class | What goes wrong | Core mitigation |
|---|---|---|
| Confused deputy | An MCP proxy using a static third-party OAuth client ID lets an attacker skip user consent via a leftover consent cookie | Proxy servers MUST implement per-client consent, checked before forwarding to the third-party authorization server |
| Token passthrough | A server accepts a token not issued for it and forwards it downstream unvalidated, which can itself trigger the confused-deputy problem | Servers MUST NOT accept any token that was not explicitly issued for that server |
| Server-Side Request Forgery (SSRF) | A malicious server supplies OAuth-discovery URLs pointing at internal IPs or cloud metadata endpoints | Clients SHOULD enforce HTTPS and block private/link-local IP ranges when following discovery URLs |
| State handle hijacking | An attacker guesses or steals an application-level state handle on MCP's stateless protocol and reuses another user's state | Servers MUST verify all inbound requests and MUST NOT treat possession of a handle as authentication; they SHOULD use random, expiring handles bound server-side to the authenticated user |
| Local MCP server compromise | A malicious startup command or payload runs with the client's full privileges on the user's own machine | Clients that offer one-click local setup MUST show an explicit, untruncated consent dialog before running the command, and SHOULD sandbox the server |
| OAuth authorization URL validation | An unvalidated javascript: or shell-interpretable URL from a malicious server causes XSS or remote code execution |
Clients MUST allow-list only http(s):// schemes and MUST NOT open URLs via a shell |
| Scope minimization | An over-broad, upfront token increases blast radius and audit noise if leaked | Clients and servers SHOULD use progressive, least-privilege scopes with step-up authorization rather than one omnibus grant |
This list is not exhaustive — the same page also covers mix-up attacks between multiple authorization servers, localhost redirect-URI impersonation for native clients, and stdio privilege escalation in proxy architectures — but it covers the attack classes most relevant to anyone standing up or integrating an MCP server today. Its "common mistakes" list for scopes is a quick review aid: publishing every scope in scopes_supported, wildcard scopes such as * or full-access, and treating scopes claimed in a token as sufficient without server-side authorization logic.
Why is a local stdio server a different threat model?
Because the protocol draws no boundary around it. MCP's Local Server Security guide says a local server "inherits your environment variables, can read anything your account can read" and "can open outbound network connections to anywhere," and that "the client and a stdio server share one trust domain" — "the stdio transport is not a sandbox." It lists five threats:
- A malicious server — typosquatted names, lookalike repositories or a project taken over by a new publisher.
- An overcollecting server — a legitimate server reading more than its job needs, or steered there by prompt injection in untrusted content.
- A compromised dependency somewhere in the server's package tree.
- A poisoned tool catalog — directives hidden in tool names and descriptions that steer how the agent uses other servers' tools ("tool shadowing"), or definitions changed after approval (a "rug pull"), which "a one-time consent dialog and package pinning do not cover."
- A vulnerable server or bridge — a legitimate component with a flaw reachable from a malicious endpoint or a web page.
The guide's own conclusion is that "no check proves what a server will do," so it recommends treating any third-party local server "as untrusted code with exactly the privileges you hand it" and preferring the remote version of a server where one exists. The same prompt-injection mechanics show up in devices with voice or chat front ends; see prompt injection in AI-enabled IoT devices.
What changed in revision 2026-07-28 that affects security?
The Key Changes page for revision 2026-07-28 lists several changes that move security work around:
| Change | Security consequence |
|---|---|
Protocol-level sessions and the Mcp-Session-Id header removed; servers mint explicit handles passed as tool arguments |
Session hijacking guidance gives way to state-handle rules: bind handles to the verified user |
initialize handshake removed; every request carries protocol version and client capabilities in _meta |
Servers check version and capabilities per request, not once per connection |
Authorization servers SHOULD send iss; clients MUST validate a present iss (RFC 9207) |
Mix-up attacks get a protocol-level defence |
| Client credentials bound to the issuing authorization server; clients MUST NOT reuse them elsewhere | Limits credential reuse across authorization servers |
| Roots, Sampling and Logging deprecated | Servers that relied on them need another design |
How would a device maker expose a device through MCP?
Worked example — synthetic, for illustration only. A maker of building-automation controllers wants an AI assistant to read alarm history and acknowledge alarms through a remote MCP server that fronts its cloud device API.
| Design decision | Choice in this example | Rule it follows |
|---|---|---|
| Transport | Remote Streamable HTTP server; nothing installed on operator laptops | Local Server Security: prefer remote where it exists |
| Tools | list_alarms (read) and ack_alarm (write); no firmware update or setpoint tools |
Least functionality; scope minimization |
| Scopes | alarms:read by default; alarms:ack requested by step-up challenge on first use |
Progressive scopes |
| Tokens | Server validates audience = its own canonical URI; calls the device API with its own service credential | Audience validation; no token passthrough |
| Inputs | ack_alarm checks the alarm ID belongs to the caller's site before acting |
Validate inputs; access control; state not keyed on client-supplied IDs alone |
| Limits and logs | Rate limit per user; every acknowledgement logged with user, alarm and time | Rate limiting; audit logging |
| Output | Alarm text from devices escaped and length-limited before it reaches the model | Sanitize tool outputs (device data can carry injected instructions) |
The point of the example is the shape: a narrow set of tools, the device API behind a server-owned credential, and every write action traceable to a person.
What are the common pitfalls?
- Trusting tool annotations. A "read-only" hint from an unvetted server is not enforcement.
- Forwarding the user's token downstream. It is explicitly forbidden and breaks the audit trail.
- Exposing everything as tools. Each extra tool widens what a prompt-injected agent can reach.
- Pinning versions and stopping there. Tool definitions can change after approval; review them on change.
- Assuming stdio means isolated. A local server has your account's access unless you sandbox it.
- Citing an older revision's session rules. Session-ID guidance applies to 2025-11-25 and earlier.
Where should a team start?
Treat every tool description as untrusted inputunless it comes from a server you have independently vetted — a tool's name and description are exactly as trustworthy as the server that supplied them, and MCP's own spec says so directly. Never forward a token you didn't validate was issued for youToken passthrough is the single mitigation MCP's own guidance states unconditionally (MUST NOT), because it undermines every downstream security control at once. Sandbox local servers by defaultA locally-run MCP server executes with the client's own privileges; require explicit, fully visible consent before launching one, and restrict its filesystem and network access where the client supports it. Implement the four server MUSTs from the Tools spec— input validation, access control, rate limiting and output sanitizing — before adding a second tool. Re-check the live specification before shippingMCP is a young, fast-moving protocol — this guide cites protocol revision 2026-07-28; confirm which revision your SDK and servers implement, since security-relevant behavior (such as session versus state-handle semantics) has already changed between revisions.
For the agent-level threats around MCP, see OWASP's agentic AI threats and mitigations and MITRE ATLAS; for the model itself, the OWASP Machine Learning Security Top 10; and for the device firmware an MCP server ends up controlling, the OWASP firmware security testing methodology.
SoftWSP's device and firmware assessments cover the firmware side of such a product — SBOM extraction and matching of its components against NVD, CISA KEV, FIRST EPSS and CISA CSAF ICS advisories, with a cited report for engineer review: see device firmware security.
This guide summarises public Model Context Protocol and Anthropic publications as checked on 11 November 2026 (protocol revision 2026-07-28); it does not constitute security or compliance advice.
Put this guide to work
Frequently asked questions
What is the Model Context Protocol (MCP)?
MCP is an open protocol for connecting AI applications to external data sources, tools and workflows. The official site describes it as "an open-source standard for connecting AI applications to external systems," using the analogy that "MCP is like a USB-C port for AI applications" — a single standardized connector instead of a one-off integration per data source. Anthropic's own 25 November 2024 announcement, which introduced the protocol, frames the problem it solves as fragmented, custom integrations: the goal was to replace "fragmented integrations with a single protocol" rather than maintaining "separate connectors for each data source." MCP is now implemented by multiple vendors beyond Anthropic; the official docs list support in Claude, ChatGPT, Visual Studio Code, Cursor and others.
What are MCP hosts, clients and servers, and what can a server expose?
Per MCP's own architecture documentation: the **host** is the AI application that coordinates connections (for example Claude Code or a VS Code extension); the host creates one **client** per server, and each client "maintains a dedicated connection with its corresponding MCP server"; the **server** is "a program that provides context to MCP clients" and can run locally (commonly over the stdio transport) or remotely (commonly over Streamable HTTP). A server can expose three primitives to a client: **Tools** ("executable functions that AI applications can invoke to perform actions"), **Resources** ("data sources that provide contextual information"), and **Prompts** ("reusable templates that help structure interactions with language models"). MCP's own specification separately states that "tools represent arbitrary code execution and must be treated with appropriate caution" and that hosts "must obtain explicit user consent before invoking any tool."
What is the "confused deputy" problem, and why is "token passthrough" forbidden?
Both are attack classes documented in MCP's own Security Best Practices page. The **confused deputy** problem affects MCP proxy servers that sit between a client and a third-party API using a single, static OAuth client ID: the page describes an attack where "malicious clients [can] obtain authorization codes without proper user consent by exploiting the combination of static client IDs, dynamic client registration, and consent cookies," and states that proxy servers **MUST** implement per-client consent before forwarding to third-party authorization to prevent it. **Token passthrough** is a related anti-pattern where "an MCP server accepts tokens from an MCP client without validating that the tokens were properly issued *to the MCP server*" and forwards them unmodified downstream; the page states it is "explicitly forbidden" in MCP's own authorization specification because it bypasses downstream security controls, breaks audit trails, and can enable the confused-deputy problem above. The page's mitigation is unconditional: MCP servers "**MUST NOT** accept any tokens that were not explicitly issued for the MCP server."
What other attack classes does MCP's official security guidance cover?
The same Security Best Practices page documents several more, each with MUST/SHOULD-level mitigations: **Server-Side Request Forgery (SSRF)**, where a malicious server feeds a client attacker-controlled URLs during OAuth metadata discovery to reach internal IPs or cloud-metadata endpoints (mitigation: enforce HTTPS, block private/link-local IP ranges); **state handle hijacking**, where an attacker guesses or steals an application-level state handle on MCP's stateless protocol (mitigation: bind handles server-side to the authenticated user, never treat possession of a handle as authentication); **local MCP server compromise**, where a malicious startup command or payload runs with the client's privileges on the user's machine (mitigation: explicit, untruncated consent dialogs plus sandboxing); **OAuth authorization URL validation**, where an unvalidated `javascript:` or shell-interpretable URL from a malicious server leads to XSS or remote code execution (mitigation: strict scheme allow-listing, never opening URLs via a shell); and **scope minimization**, where an over-broad token increases the blast radius of a compromise (mitigation: progressive, least-privilege scope requests with step-up authorization).
Sources
- Model Context Protocol: What is MCP? (official site)
- Anthropic: Introducing the Model Context Protocol (25 Nov 2024 announcement)
- Model Context Protocol: Architecture overview (hosts, clients, servers, transports, primitives)
- Model Context Protocol: Specification (latest) — overview and Security and Trust & Safety principles
- Model Context Protocol: Security Best Practices (confused deputy, token passthrough, SSRF, and more)
- Model Context Protocol: Local Server Security (stdio trust model, local threat list)
- Model Context Protocol specification 2026-07-28: Authorization
- Model Context Protocol specification 2026-07-28: Tools (Security Considerations)
- Model Context Protocol specification 2026-07-28: Key Changes
- IETF RFC 8707: Resource Indicators for OAuth 2.0
About this guide
SoftWSP Firmware Security Desk
Covers the Firmware vulnerabilities & fixes cluster: 131 guides.

In this cluster
Questions about this page?
