Your MCP Server Still Holds Session State the Spec Deleted
The 2026-07-28 MCP spec removed protocol-level sessions, the Mcp-Session-Id header, and the initialize handshake. Servers that kept per-connection state, an auth snapshot, a cursor, a half-built upload, now get requests with nothing binding them together, landing on whichever replica answers first.
An MCP server that remembered too much
A team I was helping ran an internal MCP server that wrapped a reporting warehouse. It worked for months. A tool call opened a query, the server held the compiled plan and a cursor in memory keyed by the connection, and follow-up calls paged through results against that cursor. Then they put two replicas behind a load balancer for a routine capacity bump, and roughly half of all paging calls started returning an empty page with no error. The agent, seeing an empty page, concluded the report was finished and wrote a summary that silently dropped most of the rows.
Nothing in their code had changed. What changed was that the second request in a pair now sometimes reached a replica that had never seen the first. The cursor lived in one process. The next call asked a different process for it. That is the failure the 2026-07-28 MCP revision forces every server author to confront, because the spec removed the one mechanism that had been hiding it.
What the 2026-07-28 revision actually removed
The revision makes three cuts that matter here. It removes protocol-level sessions and the Mcp-Session-Id header from the Streamable HTTP transport. It removes the initialize and notifications/initialized handshake. And it declares the base protocol to be built on stateless, self-contained requests. The changelog states the first cut plainly: it removes protocol-level sessions and the session header, and says that servers that need cross-call state use explicit, server-minted handles passed as ordinary tool arguments.
The second cut is just as consequential. Before this revision, a client opened a connection, sent initialize, received the server's capabilities and identity once, and every later request assumed that negotiated context. Now every request carries its protocol version and client capabilities in its own _meta. There is no connection-scoped snapshot to lean on. The transports overview is explicit that earlier revisions established a connection-scoped session with a handshake and that this one does not.
If you have read the companion piece on how per-request version negotiation breaks the half of your fleet that still worked, this is the same spec change seen from the other side. That essay is about version skew between client and server. This one is about the state your server was quietly keeping on the connection, and where it has to go now.
Why connection-scoped state was always a trap
It is tempting to read the change as the spec breaking your working server. It is closer to the truth that the spec stopped pretending your server was safe. Connection-scoped state has three problems that sticky sessions only hid.
The first is horizontal scaling. The moment you run more than one replica, in-process state turns a stateless-looking HTTP service into a stateful one that demands session affinity. You cannot add a replica, drain one for a deploy, or lose a pod without stranding whatever those connections were holding.
The second is restarts. A rolling deploy, an autoscaler scale-in, or an OOM kill wipes every in-memory session with no warning to the client. The agent has no way to tell a dropped cursor from a finished one, which is exactly how the reporting bug produced a confident, wrong summary. This is the same class of silent-truncation problem that makes outcome verification by reading the side effect back worth the extra call.
The third is correctness under retries. A stateless transport means a client, a gateway, or a proxy can retry a request freely, and the same logical call can arrive more than once on different replicas. State kept in one process gives you no way to make that safe. State kept in a shared store, keyed by something the caller carries, does. It is the same discipline behind idempotency keys for retry-safe side effects, applied one layer down.
Externalize state into server-minted handles
The spec's own prescription is the right one: when a tool genuinely needs state across calls, the server mints a handle, stores the state somewhere both replicas can read, and returns the handle to the client as a tool result. The client passes it back as a normal argument. Nothing about the connection is load-bearing anymore.
Concretely, the reporting server stops holding the cursor and starts handing one out.
# Opening a query returns a handle, not a connection-bound cursor.
import secrets, time, json, redis
store = redis.Redis() # any store both replicas can read
TTL = 900 # 15 minutes, matched to the agent's task horizon
def open_report(query: str, caller_id: str) -> dict:
plan = compile_plan(query) # pure, no side effect
handle = "rpt_" + secrets.token_urlsafe(18)
record = {"caller": caller_id, "plan": plan, "offset": 0,
"created": time.time()}
store.set(f"report:{handle}", json.dumps(record), ex=TTL)
return {"handle": handle, "page_size": 500}
The next call names the handle instead of relying on the socket. Any replica can serve it, because the state is in the store, not the process.
def next_page(handle: str, caller_id: str) -> dict:
raw = store.get(f"report:{handle}")
if raw is None:
raise ToolError("expired_handle",
"Report handle is unknown or expired. Call open_report again.")
rec = json.loads(raw)
if rec["caller"] != caller_id: # scope check, fail closed
raise ToolError("forbidden", "Handle does not belong to this caller.")
rows, done = run_page(rec["plan"], rec["offset"])
rec["offset"] += len(rows)
store.set(f"report:{handle}", json.dumps(rec), ex=TTL) # slide the window
return {"rows": rows, "done": done, "next": handle if not done else None}
The important detail is the done flag. An empty page and a finished report are now distinct values the agent can reason about, instead of both looking like "nothing came back."
Making handles safe to hand around
A handle is a capability. If it is guessable, scoped to nobody, or immortal, you have replaced a transport session with a worse one. Four properties keep it honest.
Make it unguessable. A handle minted from a cryptographic random source, not an incrementing integer or a predictable hash, cannot be enumerated by a confused or hostile caller. Scope it to the caller. Store who the handle was issued to and check on every use, so one agent cannot page through another agent's report by passing a borrowed id. Bound it with an expiry. A TTL tied to the task horizon means a forgotten handle cleans itself up and a replayed one eventually fails closed rather than resurrecting stale state. Validate on every use. Because any replica might serve the call, the validation has to live with the state, not in the memory of the process that minted it.
{
"handle": "rpt_Xk7mPq2sVt9wLz0aBc4dEf",
"caller": "agent:billing-reconciler",
"scope": ["report:read"],
"created": 1764252000,
"expires": 1764252900
}
This is the record the store holds, not something the agent sees. The agent only ever carries the opaque string. Keep the metadata server-side so you can revoke, audit, and expire without trusting the client to report its own scope. When a handle represents work rather than a cursor, this is the same shape the spec already uses for long-running tool calls that return a task handle you poll, so a server that adopts one adopts the other cheaply.
Auth and the snapshot you no longer get
The quietest casualty of removing initialize is the authorization context you used to capture once per connection. Many servers read a token at connect time, resolved the caller's identity and scopes, and cached that for the life of the session. With no session, there is no "once." Every request has to carry and re-establish its own authorization, because the request that arrives might be the first this replica has seen from this caller.
In practice that means your auth check moves from a connection hook to a per-request step, and it needs to be cheap enough to run on every call. Token introspection with a short-lived local cache, keyed by a hash of the token rather than by the connection, is the usual answer. The payoff is that per-request trust composes correctly with the stateless transport and with distributed tracing, since each request is now a self-contained unit that carries its own context rather than inheriting it from a socket. If you propagate trace context the same way, through the request body rather than connection state, you avoid the broken span tree that stateless transports produce when context rides the connection.
For state that must outlive any single task and survive a full restart, a store with a TTL is the floor, not the ceiling. Work that has to resume exactly where it left off after a crash belongs in a durable execution checkpoint rather than a cache, with the handle naming the workflow instance instead of a Redis key.
The parts that bite
The store becomes a hard dependency on the request path. If it is slow or unavailable, every stateful tool call is slow or unavailable, so it needs the same latency budget and failover thinking you would give any inline dependency. A handle TTL that is shorter than the agent's task horizon produces a maddening intermittent failure where long conversations die mid-report; a TTL that is too long leaks records and widens the window for a replayed handle. Tie the TTL to how long the task realistically runs and slide it on use.
Migration is the other sharp edge. A client on an older revision still sends initialize and still expects a session header back. Until your whole fleet speaks 2026-07-28, your server has to serve both shapes: honor the handshake for legacy callers while treating modern per-request calls statelessly. Pick the version off each request's _meta and branch, rather than assuming the transport told you at connect time. And watch for the subtle correctness trap: a tool that used to return an empty result on a lost session now needs to return a typed "expired handle" error instead, or you reintroduce exactly the silent-truncation bug that started this, just with a new cause.
Finally, do not turn every tool stateful because handles are now easy. Most tools should stay pure functions of their arguments. A handle is for genuine cross-call state, a cursor, an upload in progress, a multi-step transaction. Reach for it there and nowhere else.
The takeaway
The 2026-07-28 revision did not take a feature away so much as it removed a crutch. Connection-scoped session state was always a scaling and correctness liability; sticky sessions and a session header let you ignore it. With both gone, the server author owns the state explicitly, which is where it belonged. The work is mechanical: find every place the connection was quietly remembering something, mint a handle for it, move the state to a shared store with a scope and an expiry, and have the agent pass the handle back as an argument. Your server gets to scale sideways and restart without stranding work, and the silent empty-page failure goes away because an expired handle now says so.
If your MCP servers still assume a session the spec deleted, the fix is usually a day of mechanical work and a clear picture of what state each tool actually needs between calls. If you want a second set of eyes on where connection-scoped state is hiding in your servers, I am happy to take a look with you.
Questions this essay answers
01What did the MCP 2026-07-28 spec change about sessions?
The 2026-07-28 revision removes protocol-level sessions and the Mcp-Session-Id header from the Streamable HTTP transport, and it removes the initialize and notifications/initialized handshake. MCP is now stateless: every request carries its own protocol version and client capabilities in a namespaced _meta field, and the server serves each request independently. Servers that need state across calls are expected to mint explicit handles and have the client pass them back as ordinary tool arguments, rather than relying on the transport to remember anything about a connection.
02Why does per-connection state break on a stateless MCP transport?
Without a session binding, two requests from the same agent can land on two different server replicas behind a load balancer. If the first request stored a cursor, an auth snapshot, or a partly built object in the memory of replica A, the second request arriving at replica B finds nothing. On the old transport a sticky session papered over this. With sessions gone, any state you kept in process is invisible to the next call, so the tool either errors or silently acts on an empty object. State has to live somewhere both replicas can read.
03What is a server-minted handle in MCP?
A server-minted handle is an opaque identifier the server generates, backs with a record in a shared store, and returns to the client as a tool result. The agent then passes that identifier back as an argument on later tool calls. It replaces the implicit connection-scoped session: instead of the transport remembering which upload or cursor belongs to this connection, the handle names the state explicitly. Good handles are unguessable, scoped to the caller, bounded by an expiry, and validated on every use so a stale or forged handle fails closed.
04Do I need sticky sessions to run MCP servers now?
No, and that is the point of the change. Sticky routing was a workaround for state the protocol should never have implied. Once state lives in a shared store keyed by a handle, any replica can serve any request, so you can scale horizontally, deploy without draining connections, and lose a replica without losing in-flight work. You still need the store to be fast and consistent, but you no longer need the load balancer to pin an agent to one process for the life of a conversation.
