AI Personal Learning
and practical guidance
CyberKnife Drawing Mirror

MCP Protocol Gets Major Update: Goes Completely Stateless, Simplifies HTTP Communication

Core Points: MCP By introducing the "Streaming HTTP" transport scheme, the protocol achieves complete statelessness and simplifies communication, laying the groundwork for a wider range of future applications.


A key proposed technical improvement to the Message Channel Protocol (MCP) has been approved, signaling a broader future for this emerging protocol. At the heart of this update is a revolution in the way MCP transfers data, making it completely stateless and simplifying communication to the normal HTTP protocol.

 

Background: Limitations of HTTP+SSE

Previously, the MCP protocol used HTTP plus SSE (Server Sent Events) to transfer data. This approach had some limitations:

  • Disconnect and reconnect is not supported
  • Servers need to maintain long connections to ensure stability
  • Server messages can only be sent via SSE

Innovative Solution: Streaming HTTP

To address these issues, the community has proposed the "Streaming HTTP" transport scheme. This scheme contains the following key adjustments:

  • Eliminate the /sse interface: all client-to-server messages are transmitted uniformly through the /message (or similar) interface.
  • Request Escalation to SSE: The server can escalate a client request to an SSE connection for real-time push notifications or data.
  • Session ID Management: The client provides a session ID in the HTTP request header, which the server can optionally use to identify the session.
  • Initiate SSE Stream: The client can send a null GET request to the /message interface to establish an SSE stream.

These improvements enable MCP servers to be completely stateless, eliminating the need for constant connectivity and significantly reducing server complexity and resource consumption. At the same time, the use of the pure HTTP protocol improves the compatibility of MCP, allowing it to better integrate into existing network infrastructure and middleware.

 

Positive community response

This proposed enhancement has been widely welcomed and received positive feedback from the MCP community. shopify, Pydantic, Cloudflare, LangChain, Vercel, and Anthropic The team and many other organizations and individuals have contributed to this.

 

The Multiple Benefits of Statelessness

Statelessness is the central highlight of this MCP protocol update, and it brings multiple advantages to MCP:

  • Simplified Deployment and Maintenance: No need to deal with session data persistence and synchronization, easier server deployment and expansion.
  • Enhance system stability: single server failure does not affect the overall operation of the system, easier to achieve high availability.
  • Reduced Resource Consumption: Eliminates the need to maintain long connections and session state, reducing server resource consumption and costs.

 

Application Scenario Outlook

The implementation of stateless MCP opens up new possibilities for many application scenarios:

  • Stateless Tool Server: A completely stateless MCP server can be built to provide only language modeling tool functionality without state management, simplifying the tool invocation process.
  • Stateless Servers with Streaming Response Support: Even stateless servers can utilize SSE to provide streaming responses, such as pushing progress information in real time during tool execution.

 

Why Streaming HTTP over WebSocket?

WebSocket was also considered in the transport scheme selection, but ultimately the community chose "Streaming HTTP" based on the following considerations:

  • Overhead for RPC scenarios: For simple RPC (Remote Procedure Call) scenarios, mandatory use of WebSocket introduces an unnecessary operational and network burden.
  • Browser compatibility: WebSocket is not as flexible as SSE in terms of HTTP request header settings and third-party library implementations in the browser environment.
  • Protocol upgrade complexity: WebSocket only supports GET request upgrade, POST request upgrade process is complex and increases latency.
  • Streamlined protocol specification: The MCP protocol specification tends to limit the variety of official transport protocols to avoid compatibility issues.

 

Exploration of safety

While statelessness offers many advantages, it also raises discussions about security, particularly in the area of session ID management and authorization.

Some developers have pointed out that if a server uses the Mcp-Session-Id request header to manage sessions, it should bind the session ID to the authorization environment to prevent it from being misused in different authorization environments. This means that the session ID should be associated with a specific user or client session, rather than being globally common.

For developers seeking a minimalist server, complex authentication mechanisms may not be applicable. In the stateful model, the HTTP request itself can be considered the session boundary. However, in the stateless model, there are still concerns about how to securely manage the session without HTTP-only cookies.

Some developers suggest introducing HTTP-only cookies to manage client sessions, and assigning a unique ID to each client session, and then managing multiple MCP session IDs under it to realize hierarchical session management, taking security and flexibility into account.

 

Summary and outlook

The evolution of the MCP protocol to statelessness is an important step towards practicality and ease of use. The adoption of the "streaming HTTP" scheme is expected to lower the threshold of MCP deployment and attract more developers and application scenarios. Although there is still room for discussion on security, we believe that as the community continues to improve, the future of the MCP protocol is worth looking forward to.

 

Related proposals

[RFC] Replace HTTP+SSE with new "Streamable HTTP" transport #206 Proposed Link: [RFC] Replace HTTP+SSE with new "Streamable HTTP" transport #206

May not be reproduced without permission:Chief AI Sharing Circle " MCP Protocol Gets Major Update: Goes Completely Stateless, Simplifies HTTP Communication

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish