MCP Security

Model Context Protocol Streamable HTTP: Security Implications for Enterprise AI Agents

MCP Streamable HTTP replaces the legacy HTTP+SSE transport with a single endpoint model where session state is carried via a server-issued session ID header. The specification requires Origin validation and recommends cryptographically secure session IDs, but it explicitly warns that session IDs must not be used as authentication. Enterprise risk centers on session hijacking, unauthorized stream resumption, and inconsistent implementation of these recommendations, which means production deployments require independent verification of session handling plus runtime authorization and policy enforcement layered above the transport itself.

What Changed With Streamable HTTP

Four structural shifts define the new transport model and set the context for the security discussion below.

Single Endpoint

One HTTP endpoint handles POST requests and optional SSE upgrades, replacing the prior dual-endpoint model.

Server-Issued Sessions

Session state is tracked via an Mcp-Session-Id header assigned at initialization, not cookies or bearer tokens.

Optional Resumability

Clients can reconnect and resume a broken stream from the last received event ID.

Separate Authorization Layer

Session IDs identify a connection, not an authenticated user; authorization is defined separately via OAuth 2.1.

Trust Boundaries to Map Before Production Deployment

  1. 1

    Streamable HTTP Centralizes Transport Logic

    Streamable HTTP centralizes more transport logic in the server than the legacy model, which changes where trust boundaries sit between the AI agent, the MCP server, and downstream tools.

Implementation Points to Verify Before Approving an MCP Server

  • Session IDs are generated using a cryptographically secure random source and never accepted from client input at initialization
  • Origin header validation is enforced on all Streamable HTTP endpoints, with local binding restricted where external exposure is not required
  • Authorization checks, such as OAuth 2.1 token validation, are enforced independently on every request rather than inferred from session ID validity
  • Stream resumption logic scopes replayed events strictly to the originating session and identity
  • MCP servers sit behind infrastructure capable of enforcing TLS termination, rate limiting, and consistent header validation

What Streamable HTTP Is and Why It Replaced HTTP+SSE

Model Context Protocol originally used a dual-endpoint HTTP+SSE transport, where a client opened a persistent Server-Sent Events connection for server-to-client messages and sent a separate HTTP POST for client-to-server messages. Streamable HTTP consolidates this into a single HTTP endpoint that accepts POST requests directly and can optionally upgrade to an SSE stream when the server needs to push multiple messages back to the client. This simplifies deployment behind standard HTTP infrastructure such as load balancers and API gateways, since teams no longer need to manage two coordinated endpoints with shared session context. The tradeoff is that more transport logic, including session tracking and stream state, now lives inside a single server-side implementation surface, which concentrates risk if that implementation is incomplete.

Session Handling: A Different Model Than Web Session Security

During initialization, an MCP server may assign a session ID, which the client must then include in subsequent requests via the Mcp-Session-Id HTTP header. This is a different pattern than the cookie-based or bearer-token session models most enterprise security teams already have tooling for, and it does not automatically inherit protections like HttpOnly flags, SameSite enforcement, or standard token expiry semantics unless the server implementation adds them explicitly. The specification recommends generating session IDs using cryptographically secure random number generators to reduce guessability, and it states that servers should never accept a client-supplied session ID at initialization. Security teams evaluating an MCP server should treat session ID generation as a control to verify directly rather than assume.

Where Session Hijacking and Replay Risk Enter the Picture

The core risk documented in specification guidance and independent security analysis is that a session ID, if leaked or predictable, can be used to hijack an active MCP session. This risk is amplified because Streamable HTTP supports optional resumability: clients can reconnect using a last-seen event ID to continue a broken SSE stream. If server-side resumption logic does not correctly scope replayed events to the originating session and identity, a resumed connection could receive messages intended for a different session. Available research does not document confirmed real-world exploits of this specific pattern, but it identifies the architectural conditions under which such an exploit would be possible, and notes inconsistent enforcement of Origin validation and session ID randomness across early community and vendor implementations.

Authentication and Authorization Are Not the Same as a Session ID

The MCP specification is explicit that session identifiers should not be used for authentication purposes. Authorization for HTTP-based transports is instead defined through an OAuth 2.1-based framework that includes authorization server metadata discovery and dynamic client registration, allowing MCP servers to integrate with existing enterprise identity providers rather than relying on protocol-native credentials. This separation matters operationally: a server that correctly implements the specification will validate an OAuth token independently on every request, regardless of whether the session ID is valid. A server that conflates the two, treating a valid session as sufficient proof of identity, creates a direct hijacking path. Enterprises should confirm which model an MCP server actually implements rather than assuming specification compliance.

Governance Above the Transport Layer

The MCP specification defines transport and authorization mechanisms, but it does not define fine-grained authorization for individual tool invocations, and it leaves several security recommendations as guidance rather than mandatory enforcement points. This creates a practical gap for enterprises: two MCP servers can both claim specification compliance while differing meaningfully in session ID entropy, Origin validation rigor, or authorization integration. Closing this gap requires runtime governance layered above the base protocol, including logging and monitoring of session activity, approval workflows for tool calls, and policy enforcement that does not depend solely on the MCP server's self-reported behavior. This is the area where Trussed AI's runtime governance capabilities apply, providing agent identity, least-privilege permissions, tool approval workflows, and audit logging as a control layer independent of any single MCP server implementation. Organizations exposing MCP servers to third-party agents should also establish explicit requirements confirming OAuth 2.1 authorization is implemented as specified, since adoption is inconsistent across the ecosystem.

Frequently Asked Questions

Does Streamable HTTP require authentication by default?

No. The specification defines an OAuth 2.1-based authorization framework for HTTP transports, but implementing it is a server-side decision. A session ID alone does not constitute authentication, and the specification explicitly warns against treating it as such.

Is Streamable HTTP inherently less secure than HTTP+SSE?

Not inherently. It consolidates transport logic into one endpoint, which simplifies deployment but concentrates more security-relevant behavior in a single server implementation, making implementation quality more consequential than the transport model itself.

Can stream resumption leak data across sessions?

It can if server-side resumption logic fails to scope replayed events to the correct session and identity. This is an implementation risk rather than a specification flaw, since the spec does not mandate a specific scoping mechanism.

What should security teams verify first when evaluating an MCP server?

Session ID generation method, Origin header validation enforcement, and whether authorization is checked independently of session validity on every request. These are the three areas where specification guidance is most often inconsistently implemented.

Evaluate MCP Deployments With Runtime Governance in Place

Streamable HTTP shifts more session and trust logic into the MCP server itself. Runtime policy enforcement, agent identity, and audit logging provide a governance layer that does not depend solely on how any single server implements the specification.

Explore Runtime Governance