AI D-A-M-N/Anthropic Unveils Streamable HTTP Upgrade for MCP Protocol

Anthropic Unveils Streamable HTTP Upgrade for MCP Protocol

Anthropic has introduced a significant update to its Model Context Protocol (MCP), transitioning from the traditional HTTP+SSE (Server-Sent Events) method to a new Streamable HTTP transmission mechanism. This overhaul aims to address key limitations in MCP's remote transmission while retaining its core advantages.

The update fundamentally restructures the MCP data transmission process, making it more flexible, user-friendly, and compatible with modern infrastructure. Previously, MCP relied on persistent connections similar to a customer service call, where the connection had to remain open. The new approach, however, operates like sending messages and waiting for replies as needed, utilizing regular HTTP requests with optional streaming capabilities.

Core Changes in the Update

The upgrade introduces five major changes:

  1. Removal of the /sse endpoint: The server no longer maintains a separate SSE endpoint.
  2. Unified /message endpoint: All client-to-server messages are transmitted through this single endpoint.
  3. Dynamic HTTP-to-SSE upgrades: The server can upgrade HTTP requests to SSE streams when necessary for notifications or requests.
  4. Mcp-Session-Id via Header: Clients provide session IDs via headers, allowing servers to decide whether to store session information.
  5. Stateless server operation: The system supports completely stateless servers, eliminating the need for persistent connections.

Addressing Limitations of HTTP+SSE

The shift from HTTP+SSE was driven by several shortcomings:

  • Lack of connection resumption after disconnection, forcing clients to restart sessions.
  • High server availability requirements to maintain continuous SSE connections.
  • Unidirectional communication (server to client) in SSE, which hindered flexible bidirectional interaction.

The new Streamable HTTP method resolves these issues, significantly enhancing system scalability and flexibility.

Benefits for Developers

This update offers several advantages for developers:

  • Simplified server implementation: Only a regular HTTP server is required, eliminating the need for a dedicated SSE server.
  • Easier deployment: Compatible with cloud platforms like Vercel, Cloudflare, and AWS Lambda that do not support persistent connections.
  • Improved compatibility: Seamlessly integrates with CDNs, API gateways, and load balancers due to its standard HTTP foundation.
  • Enhanced scalability: Supports stateless operation and dynamically upgrades to SSE when needed.

Impact on Infrastructure

The new approach also brings transformative changes to server architecture:

  • Stateless servers: Eliminates the need for servers to continuously store client session information.
  • Microservice compatibility: Easily integrates with REST APIs, GraphQL, load balancers, and CDNs.
  • Higher resource utilization: Resources are released after request processing, making it ideal for high-concurrency scenarios.

Why Not WebSocket?

Despite the issues with SSE, Anthropic opted not to use WebSocket as an alternative due to several reasons:

  • WebSocket requires persistent connections, which contradicts MCP's RPC-like model where each request is independent.
  • WebSocket cannot transmit HTTP header information, complicating authentication processes.
  • It only supports GET upgrades and is incompatible with MCP's primary use of POST requests. Instead, Anthropic chose to continue using HTTP while giving servers the ability to upgrade to SSE as needed.

Conclusion

This update makes MCP lighter and more flexible by allowing servers to autonomously decide whether to support streaming. It simplifies deployment processes significantly while improving compatibility with various network infrastructures. Additionally, it enhances server resource utilization and supports larger-scale concurrent requests. These changes pave the way for more efficient communication between AI models and applications.

Key Points

  1. Anthropic replaces persistent connections in MCP with Streamable HTTP for greater flexibility.
  2. The update removes the /sse endpoint and introduces a unified /message endpoint.
  3. Servers can dynamically upgrade HTTP requests to SSE streams as needed.
  4. The new approach supports stateless operation and simplifies deployment on cloud platforms.