Skip to main content
Alan builds an app that talks to a remote MCP server. Every time his app sends a request, the server has forgotten everything about the last one. Until recently, the server could hand back a header called an MCP session ID, and the client returned it on every later request. In short, the server remembered you. That made several things easier: the handshake happened once, the server could build and cache a tool list, and an open database connection could be keyed to your session ID in the server’s memory.
A stylized infographic titled "The Server That Remembered" showing a laptop labeled "Alan's App" connecting through a cloud to an MCP Server. A session ID tag and a server memory panel illustrate stored session data like handshake, tool list, and DB connection.
Why is that behavior gone? Because that memory lived in a single process on a single machine. The session was implicitly tied to one process instance. For requests that used that session ID to work, each request had to be routed to that exact process on that exact machine — a pattern known as sticky sessions (session affinity). Sticky sessions cause several operational problems:
  • Load imbalance: the load balancer routes requests by identity instead of evenly, so a busy host stays busy while others are idle.
  • Fragility during deploys: restarting the process drops all sessions it held, breaking live work.
  • Ineffective scaling: adding servers doesn’t migrate existing sessions to new machines.
  • Operational burden to centralize session state (e.g., move to Redis), which requires pre-planning and extra implementation work across teams.
Sticky sessions increase operational complexity and make deployments brittle. Many deployments avoid them by removing session affinity from the protocol.
Instead of relying on process-local sessions, modern servers return short reference handles as ordinary data. The client stores and returns those handles as regular arguments; the server keeps any associated state keyed to the handle on its side. Because the handle itself travels inside the message, the server no longer requires sticky routing. Example: a server returns a cursor handle when paging through a long list:
On the next request the client passes that handle back as a normal parameter:
Use lightweight handles (cursors, references, or tokens) inside the message body to maintain continuity without requiring sticky sessions. This is more resilient and simplifies load balancing.
Compatibility: what happens when new and old components meet? There are four combinations to consider:
A dark-themed infographic titled "When Old Meets New" showing icons for Modern Client/Modern Server and Legacy Client/Legacy Server, with green check marks and red error boxes illustrating compatibility and an error code (-32001) when mixing legacy and modern components.
Handling mixed-era deployments Modern clients typically probe the server to determine its “era” and choose an appropriate code path. Common detection approaches:
  • Over standard input/output (stdio): send a server/discovery request and consider any response that is not recognized as a modern error to indicate a legacy server.
  • Over HTTP: inspect the body of a 400 (or similar) error to detect legacy-style error text such as the JSON-RPC “Method not found” code or a legacy HTTP error indicating a missing session.
Examples of legacy error bodies clients look for:
Clients cache the server-era verdict for the lifetime of that server instance because this behavior is an implementation property of the server process, not of individual requests. While older servers remain in deployments, modern clients keep both code paths available to interoperate with either era. Best practices and references This section covers tools, resources, and prompts.

Watch Video