MCP Went Stateless: Running MCP Servers Behind a Plain Load Balancer

The 2026-07-28 MCP specification removed sessions, the initialize handshake and server-initiated requests. What replaced them, how requests now route on headers, how a tool asks the user a question without holding a stream, and what breaks when you upgrade.

Rahul Bisht

Founder, CrawlPilot

·
Nov 12, 2026
·
Verified Nov 12, 2026
·Engineering·
18 min read
·
MCP Went Stateless: Running MCP Servers Behind a Plain Load Balancer
Key takeaway
MCP's 2026-07-28 revision deletes the session. Every request now carries its own protocol version, client identity and capabilities, so any server instance can answer it. Questions to the user ride inside results and come back on a retry, and gateways can route and rate-limit on headers without reading the JSON. If your server kept anything in the session, that state needs a new home before you upgrade.

Put an MCP server built to the 2025-11-25 spec on three pods behind a round-robin load balancer and the second request a client sends has roughly a two-in-three chance of reaching a pod that has never seen its session. Under that spec a server assigns the session ID in the response to initialize, the client must send it on every later request, and a request carrying a session the server no longer has gets an HTTP 404. A client that receives that 404 must start over with a fresh initialize, and the new session lands on whichever pod the balancer picks next. Step through it:

MCP clientPod APod Binitialize1Mcp-Session-Id: 9f2c…2tools/call (session 9f2c…)3404 Not Found4

4 messages. Press Play, or pick one, to see exactly what is sent.

An MCP client against pods behind a round-robin balancer under the 2025-11-25 spec, with no shared session store; the balancer picks each pod (illustrative)

Teams worked around this with sticky sessions or a shared session store, and both carried a cost: sticky routing defeats the point of a balancer when one pod is hot, and a shared store is one more stateful system to run. The 2026-07-28 specification takes the problem away instead. Its maintainers call it the largest revision since launch, and it does break things. This post goes through the parts that matter if you run MCP servers anywhere other than your laptop.

What the Session Was Holding

The session was never just an ID. In 2025-11-25 it anchored five things, and each one moved somewhere different:

2025-11-25: kept per session
  • Protocol version and capabilities, agreed once in initialize
  • Mcp-Session-Id on every request after the handshake
  • A standalone GET stream for server-initiated requests
  • Resumable SSE streams via Last-Event-ID
  • Log level set once with logging/setLevel
2026-07-28: carried by each request
  • Version, client info and capabilities in every request's _meta
  • No session; any instance can answer
  • Questions to the client returned inside results (MRTR)
  • No resumption; a broken stream means re-issuing the request
  • Log level per request, in _meta

Verdict: The protocol keeps no memory between requests. Anything your tools need to remember is now your application's state, not the transport's.

Where each piece of per-connection state went between the two revisions

Each row is spelled out in the changelog: sessions and Mcp-Session-Id removed, the initialize handshake removed, ping and logging/setLevel removed, the GET endpoint replaced, and SSE resumability dropped. The sections below take them in the order you will hit them.

Every Request Carries Its Own Papers

With no handshake, the facts initialize used to settle travel with each call. The changelog puts the protocol version and client capabilities in _meta under io.modelcontextprotocol/protocolVersion and io.modelcontextprotocol/clientCapabilities. Clients should also send io.modelcontextprotocol/clientInfo, and servers should name themselves in each result's _meta. On HTTP the version is mirrored into a header, and the transport spec requires the two to match. A call to a tool that searches a product catalogue looks like this:

http
POST /mcp HTTP/1.1 Content-Type: application/json Accept: application/json, text/event-stream MCP-Protocol-Version: 2026-07-28 Mcp-Method: tools/call Mcp-Name: search_products { "jsonrpc": "2.0", "id": 7, "method": "tools/call", "params": { "name": "search_products", "arguments": { "query": "running shoes", "limit": 20 }, "_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28", "io.modelcontextprotocol/clientInfo": { "name": "my-agent", "version": "2.3.0" }, "io.modelcontextprotocol/clientCapabilities": { "elicitation": {} } } } }

A client that wants to know what a server supports before calling anything uses server/discover, which every server must implement. If the client asks for a version the server doesn't speak, the server answers 400 with an UnsupportedProtocolVersionError listing the versions it does support. Nothing is negotiated and remembered; the client just sends the version it chose on every request.

The cost is a little extra metadata on every request, a few hundred bytes at a rough estimate. What you get is that every pod can serve every call, so you can scale out, drain and redeploy pods without a client noticing.

A Load Balancer That Reads Headers, Not JSON

Removing the session lets any pod answer. The new routing headers let the layer in front decide which pool should answer and how much traffic to let through. Every Streamable HTTP POST must carry Mcp-Method, and tools/call, resources/read and prompts/get must also carry Mcp-Name, the tool, prompt or resource being used. A tool can also mark a parameter with x-mcp-header in its input schema, and clients must then copy that argument into an Mcp-Param-{Name} header. The transport spec's own example mirrors a database region this way.

Routing and metering MCP traffic from headers
EDGESERVER POOLSPOST + Mcp-* headers1cheap tools2costly tools2header ≠ body3AgentMCP clientGatewayreads headers onlySearch podsMcp-Name: search_*Browser podsMcp-Name: open_page400 HeaderMismatchcode -32020
  1. The agent sends a tool call. The method, the tool name and any parameters marked with x-mcp-header are copied into headers.
  2. The gateway routes on Mcp-Name: cheap search tools to one pool, tools that drive a real browser to a smaller, costlier pool with its own rate limit. It never parses the JSON body.
  3. The pod that processes the body must confirm the headers match it. If they don't, it rejects the request with 400 and HeaderMismatch, so a client can't route on one tool name and execute another.

3 steps. Press Play to walk through them, or click any part of the diagram.

A gateway reads Mcp-Method, Mcp-Name and Mcp-Param headers to route, rate-limit and authorize, and the pod checks the headers against the body

Two details keep this safe. First, a server that processes the body must reject any request whose headers don't match it, with 400 Bad Request and JSON-RPC error -32020 (HeaderMismatch). That stops a request routed and rate-limited as a cheap tool from running as an expensive one. Second, the spec says an intermediary enforcing policy on these headers should reject requests whose MCP-Protocol-Version is older than the version that requires validation, or missing, rather than trust headers nobody checked. Values that aren't plain ASCII travel Base64-encoded between =?base64? and ?=, and servers decode them before comparing.

For a crawling or browser-automation server this is the useful part. Tools that open a real browser cost far more than tools that read a cache, and you can now give them separate pools and separate limits in the gateway's config.

Asking the User a Question Without Holding a Stream

Under 2025-11-25 a server that needed the user mid-call sent its own request, such as elicitation/create, down an open stream and waited. That only works if the stream, and the pod at its end, stay put. The multi round-trip request pattern (MRTR) turns it around. The server finishes the call with a result whose resultType is "input_required", listing what it needs in inputRequests and, optionally, its own context in an opaque requestState. The client gathers the answers and retries the original call with a new JSON-RPC ID, the answers in inputResponses and the requestState echoed back unchanged. Step through a checkout tool that needs a shipping choice:

UserMCP clientPod APod Ctools/call place_order (id 1)1input_required2Standard or express?3express4tools/call place_order (id 2)5resultType: complete6

6 messages. Press Play, or pick one, to see exactly what is sent.

A multi round-trip request; the retry lands on a different pod and still completes (illustrative)

The same pattern carries sampling/createMessage and roots/list, and it replaces server-initiated requests completely: the spec calls the old way unsupported and the change breaking. Only tools/call, resources/read and prompts/get may answer with input_required, and a server may only ask for what the client declared in its capabilities.

requestState Is Attacker Input

requestState travels through the client, so the spec tells servers to treat it as attacker-controlled. If it affects authorization, resource access or business logic, its integrity must be protected (an HMAC or authenticated encryption), and state that fails verification must be rejected. To limit replay, the server should also seal in the authenticated user, a short expiry and an identifier for the original request, such as the method plus a digest of its key arguments, and check each one on the retry. Turn each protection off below to see what an attacker could do without it:

Your requestState can't be forged or replayed. Every check below is on. One-time actions still need a server-side record (see the note under this widget).

  1. Integrityhandled

    Without it: The client edits the blob, say changing the order total or the account it applies to. What to seal in or check: HMAC or AEAD over the whole state; reject on failure.

  2. Bound to the userhandled

    Without it: A state issued to one user is replayed by another. What to seal in or check: the authenticated principal, compared on retry.

  3. Short expiryhandled

    Without it: An old state is replayed hours later, after prices or permissions changed. What to seal in or check: an expiry timestamp, rejected once lapsed.

  4. Bound to the requesthandled

    Without it: A state from one tool call is attached to a different call. What to seal in or check: method name plus a digest of the key arguments.

The checks the MRTR section of the spec asks servers to run on a returned requestState. Turn one off to see the attack it stops.
Warning
Those checks shorten the replay window and stop cross-user and cross-request reuse, but the spec says plainly they don't make a state single-use. If an action must happen at most once, such as redeeming a voucher or charging a card, record that it happened on the server and check that record on retry.

State You Still Need Goes in a Handle

Some tools really do need memory between calls. A browser-automation server opens a page, clicks, reads, clicks again. The changelog's answer is explicit: servers that need cross-call state use server-minted handles passed as ordinary tool arguments. The release post argues this works better than hidden session state, because the model can see the handle and keep two of them apart.

For the browser case it looks like this. open_page starts a browser on whichever pod receives the call, stores where that browser lives in a shared store, and returns {"browser": "brs_4kq…"}. Every later tool takes browser as an argument. Whichever pod gets click looks up the handle and forwards the command to the browser that owns it. The browser itself is still stateful, of course. What changed is that the state is now owned by your application and named in the conversation, not tied to a TCP connection and an HTTP header.

Treat a handle like any other credential an agent holds: unguessable, scoped to the user who created it, and with an expiry, the same rules as for requestState.

Long Jobs, Notifications and Broken Streams

Tasks moved out of the core. Tasks shipped as an experimental core feature in November 2025. They now live in the io.modelcontextprotocol/tasks extension, with the blocking tasks/result replaced by polling through tasks/get, a new tasks/update for sending input to a running task, and tasks/list removed. A server can also hand back a task handle without the client opting in per request. Polling fits the stateless model: any pod can answer tasks/get as long as the task's status lives in a store they all share.

One opt-in stream for change notifications. The GET endpoint and resources/subscribe are replaced by subscriptions/listen, a single long-lived POST whose response stream carries only the notification types the client opted in to, such as toolsListChanged or resourceSubscriptions. Progress and log messages for a request still flow on that request's own response stream. The transport spec asks servers to send X-Accel-Buffering: no so proxies like nginx don't buffer the stream, and suggests SSE comment lines as keep-alives on quiet streams.

A dropped stream loses the request. Resumable streams and Last-Event-ID are gone. If a response stream breaks, the in-flight request is lost and the client must send it again with a new ID. Closing the stream also counts as cancelling the request. So a client that retries after a network blip may run a tool twice, and a tool with side effects needs an idempotency key it can check. That is the same discipline a durable agent runtime needs for replays.

Check yourself

Q1A client's retry after an input_required result lands on a pod that never saw the first call. What lets that pod finish the job?

Q2A gateway routes and rate-limits on Mcp-Name. What stops a client from labelling an expensive tool call as a cheap one?

Caching the Tool List

Agents call tools/list a lot, and a stateless server has no session to hang a cache on. The new CacheableResult fields fix that: results of tools/list, prompts/list, resources/list, resources/read and resources/templates/list must carry ttlMs, a freshness hint in milliseconds, and cacheScope, either "public" or "private", which says whether shared intermediaries may cache them. Servers should also return tools in a deterministic order. That sounds cosmetic, but the tool list sits near the top of the model's prompt, and a stable order keeps the client's prompt cache hitting across reconnects.

A practical split: a server whose tools are the same for every user marks the list public with a long ttlMs, and the gateway can then answer most tools/list calls itself. A server that shows different tools to different users marks it private.

What Breaks When You Upgrade

The release post says the TypeScript, Python, Go and C# SDKs support 2026-07-28, with Rust in beta, and that it carries a real migration cost, especially for apps built around session IDs. The items most likely to bite:

  • Anything you stored per session. Move it into handles (for app state), requestState (for a paused call), or a shared store (for tasks and handles).
  • Server-initiated requests. Code that sends elicitation/create or sampling/createMessage mid-call must return input_required instead.
  • Deprecated features. Roots, Sampling and Logging are deprecated: they still work for at least twelve months, but new code shouldn't use them. The changelog's suggested replacements are tool parameters or resource URIs instead of Roots, calling your LLM provider directly instead of Sampling, and stderr or OpenTelemetry instead of Logging. The old HTTP+SSE transport and Dynamic Client Registration are deprecated too, the latter in favour of Client ID Metadata Documents.
  • Auth checks. Clients must validate the iss parameter on authorization responses when it is present (RFC 9207), must keep credentials per authorization server, and must re-register when the server changes.
  • Error codes. The spec now reserves -32020 to -32099. HeaderMismatch is -32020, MissingRequiredClientCapability is -32021 and UnsupportedProtocolVersion is -32022, and "resource not found" moved from -32002 to -32602.
  • Old clients. A server that only speaks 2026-07-28 should answer GET or DELETE with 405, and ignore any Mcp-Session-Id or Last-Event-ID it receives. A client that supports both eras tries a modern request first and falls back to initialize only if a 400 body isn't a recognised modern error.
Cheat sheet
MCP 2026-07-28 for server operators

No sessions

  • No initialize and no Mcp-Session-Id; any pod can answer any request.
  • Version, client info and capabilities travel in each request's _meta.
  • server/discover lists versions and capabilities up front.

Routing headers

  • Mcp-Method on every POST; Mcp-Name on tools/call, resources/read, prompts/get.
  • x-mcp-header copies a tool argument into Mcp-Param-{Name}.
  • Header-body mismatch: 400 with HeaderMismatch (-32020).

Asking the user

  • Return resultType input_required with inputRequests.
  • The client retries with a new ID, inputResponses and the same requestState.
  • Seal requestState: integrity, user, expiry, request digest.

State you keep

  • Return handles from tools; take them back as arguments.
  • Keep handle targets and task status in a store every pod can reach.
  • One-time actions need a server-side record, not just a sealed state.

Streams and caching

  • subscriptions/listen is the one long-lived notification stream.
  • No Last-Event-ID: a broken stream means re-sending, so use idempotency keys.
  • tools/list carries ttlMs and cacheScope; keep the order deterministic.

If you already run a Puppeteer or Playwright MCP server like the one in our MCP and Puppeteer guide, the browser-handle pattern above is the change to make first. It's also the one that lets you put a second pod behind the balancer.

Sources