MCP Security

Model Context Protocol Transport Security: SSE vs stdio vs HTTP

MCP's three transports carry fundamentally different security models: stdio has no network exposure but relies entirely on OS-level process isolation and environment-based credentials; legacy HTTP+SSE introduced remote network exposure without mandatory authentication; and current Streamable HTTP adds OAuth 2.1 authorization but still leaves origin validation, token scoping, and session security to the implementer. None of the three transports enforce audit logging or least-privilege access by default, so enterprises must layer compensating controls regardless of which transport they deploy.

Three Transports, Three Trust Boundaries

Each MCP transport places the trust boundary in a different place, which changes what an attacker needs to compromise and what an implementer is responsible for securing.

stdio

Local process pipes, no network layer, no native authentication.

HTTP+SSE (legacy)

Dual-endpoint remote transport, superseded March 2025, no mandatory auth.

Streamable HTTP

Current spec, single endpoint, OAuth 2.1 authorization support.

What MCP Transports Actually Do

The Model Context Protocol defines how an MCP client, typically an AI agent or orchestrator, communicates with an MCP server that exposes tools, data, or actions. That communication has to happen over some transport mechanism, and the transport choice determines where the trust boundary sits, what authentication is possible, and what an attacker would need to compromise to intercept or manipulate a session. The original specification defined two transports: stdio and HTTP with Server-Sent Events (SSE). In March 2025, the specification was revised to replace HTTP+SSE with a new Streamable HTTP transport that consolidates communication into a single HTTP endpoint capable of returning either a direct JSON response or an SSE stream. Security engineers evaluating MCP deployments need to know which transport a given server implementation actually supports, because the answer changes what security work is required before that server goes into production.

stdio: Local Trust, No Network Layer

The stdio transport operates over standard input and output pipes between processes running on the same machine. There is no network protocol involved, which eliminates an entire category of remote attack surface: no listening port, no TLS negotiation, no HTTP headers to spoof. The tradeoff is that stdio has no concept of authentication in the network sense. The specification is explicit that its OAuth 2.1-based authorization framework does not apply to stdio; instead, credentials are expected to come from the environment the process runs in. This means the entire security posture of a stdio-based MCP server depends on OS-level controls: which user account runs the process, what file and environment variable permissions that account has, and whether the host itself is properly isolated. Stdio is often treated as the "safe default" for MCP because it avoids network exposure, but that safety is conditional on rigorous local process hygiene, not on anything the protocol enforces.

Legacy HTTP+SSE: Remote Exposure Without Mandatory Auth

Before the March 2025 revision, MCP's remote transport used HTTP combined with Server-Sent Events, split across two separate endpoints: one for the SSE stream and one for HTTP POST requests. This design introduced real network exposure, meaning MCP servers using this transport could be reached over a network the way any web service can, but the specification did not mandate authentication for it. That combination of remote reachability and optional authentication is the core reason this transport was superseded. It also required implementers to correlate state across two endpoints, adding session-handling complexity that increased the chance of implementation errors around session identity and hijacking.

Streamable HTTP: The Current Spec, With Real but Partial Guardrails

The current Streamable HTTP transport simplifies the architecture to a single HTTP endpoint and adds an authorization framework based on OAuth 2.1, including support for resource indicators as defined in RFC 8707. Resource indicators help prevent a scenario where a malicious or compromised server obtains a token intended for a different downstream service, one of the confused deputy risks the specification calls out directly alongside token passthrough and session hijacking. Streamable HTTP also supports an optional session ID mechanism, and a server can be implemented as either stateless or stateful. The word "optional" matters here: because session ID usage is not mandatory, whether a given server implementation resists session fixation or hijacking depends on how that specific implementation chose to build it, not on a guarantee from the protocol itself.

Transport Security Comparison

The table below summarizes how the three transports differ on the properties that matter most for a security review.

Property stdio HTTP+SSE (legacy) Streamable HTTP (current)
Network exposure None (local pipes) Remote, dual endpoints Remote, single endpoint
Authentication model Not applicable; relies on host environment Not mandatory OAuth 2.1 supported, not automatic
Token misuse protection Not applicable Not addressed Resource indicators (RFC 8707) available
Session ID handling Not applicable State split across two endpoints Optional, implementer-defined
Audit logging Not specified Not specified Not specified

Spec-Recommended Mitigations That Are Not Automatic

The specification recommends a set of mitigations for HTTP-based transports, but none of them are enforced by default. Implementers have to build them in deliberately:

  • Validate the Origin header on all incoming connections to HTTP-based transports to mitigate DNS rebinding attacks.
  • Bind servers to localhost rather than all network interfaces when the server is only meant to be reached locally.
  • Implement OAuth 2.1 authorization explicitly; it is not enabled by default on HTTP-based servers.
  • Scope and validate tokens before forwarding them downstream rather than passing client-supplied tokens through unchecked.
  • Treat session ID handling as a deliberate design decision, since the spec leaves it optional for Streamable HTTP.

Why This Falls to the Enterprise, Not the Protocol

The MCP specification consistently places responsibility for authentication, session management, and transport hardening on the server implementer rather than enforcing a single mechanism across all deployments. This is a reasonable design choice for a protocol meant to support diverse deployment models, but it means two MCP servers using the same transport can have meaningfully different security postures depending on how carefully each one was built. For enterprises, this shifts the real work from "which transport did we pick" to "what did we verify about how that transport was implemented and what compensating controls sit around it." Audit logging is a clear example: no MCP transport specifies logging behavior, so any audit trail an enterprise relies on for access review or incident response has to be built and enforced independently of the protocol.

Where Runtime Governance Fits

Because MCP's specification leaves origin validation, token scoping, session binding, and audit logging to implementers, enterprises running MCP servers at scale need a consistent way to enforce these controls across every server and transport in use, rather than trusting each implementation to have gotten it right. Trussed AI provides runtime governance for AI agents and MCP deployments, including runtime policy enforcement, agent identity and permissions, tool approval workflows, and audit logging, applied as a control layer independent of which transport a given MCP server uses. This does not replace the need to correctly implement transport-level mitigations described in the specification; it addresses the gap between what the protocol recommends and what individual server implementations actually enforce in production.

Frequently Asked Questions

Is stdio inherently more secure than HTTP-based MCP transports?

Stdio removes network attack surface, but it is not inherently more secure. It shifts all security responsibility to OS-level process isolation and environment variable handling, with no protocol-level authentication at all. Whether it is safer depends on how well the local host is secured.

Does Streamable HTTP fix the security gaps from legacy HTTP+SSE?

It addresses some gaps by adding OAuth 2.1 authorization and resource indicator support, and simplifies the architecture to one endpoint. It does not fully close the gaps, since origin validation, token scoping, and session ID usage remain implementation choices rather than protocol requirements.

Can enterprises rely on the MCP spec alone for audit logging and access review?

No. The specification does not define logging or audit behavior for any transport. Enterprises need to implement logging, monitoring, and access review as compensating controls layered on top of whichever transport they deploy.

Standardize MCP Security Controls Across Every Transport

Transport choice is only part of the security picture. Enterprises need consistent runtime enforcement, identity, and audit controls regardless of whether an MCP server runs over stdio, legacy SSE, or Streamable HTTP.

Explore MCP Security