One Right Answer in Ten: The mcp/sdk 0.8 Session Race and the Case for a Stateless MCP Server in PHP A developer running a production MCP server on symfony/mcp-bundle 0.14.1 and mcp/sdk 0.8.1 traced cross-request tool-call corruption to a lost-update race on the SDK's per-client session store, where concurrent workers overwrote a shared outgoing queue. In a reproduction of 30 rounds of six parallel calls, the server returned 137 correct answers, 21 belonging to other requests and 22 empty under FrankenPHP worker mode, with similar results under php-fpm. The fix landed across three upstream pull requests and the 0.9.0 and 0.10.0 releases, and the developer's own mattleads/agent-publishing-bundle now runs a stateless MCP server that keeps no session at all. An MCP server I run in production behind FrankenPHP started answering tool calls with other tool calls' results. Not every time. An agent that fired six calls at once got most of them right, a few came back as an empty 202 Accepted , and a few carried the answer to a different request id. Thirty rounds of six parallel calls on one session gave 137 correct answers, 21 foreign ones and 22 empty under FrankenPHP worker mode, and 150, 17 and 13 under php-fpm. Nothing in the logs. The same calls one at a time never failed. The server ran symfony/mcp-bundle 0.14.1 on mcp/sdk 0.8.1, the official PHP SDK for the Model Context Protocol. The cause is a lost-update race on the session that the SDK kept for every Streamable HTTP client, and the fix upstream took three pull requests and two releases. This article walks through the race with the 0.8.1 code, reproduces it with ten parallel calls against php -S , shows what 0.9.0 and 0.10.0 changed, and explains why the MCP server in mattleads/agent-publishing-bundle keeps no session at all. PHP CLI SERVER WORKERS=8 php -S as the multi-process server for the reproduction. The race needs several workers and a session store they share; php-fpm and FrankenPHP worker mode behave the same. mcp/sdk 0.8.1 released 29 August 2026 , 0.9.0 18 October 2026 and 0.10.0 10 November 2026 , each cloned at its tag with composer install for the dev dependencies, which include nyholm/psr7 and laminas/laminas-httphandlerrunner . symfony/mcp-bundle 0.14.1, which requires mcp/sdk ^0.8.1 , and 0.15.0, which requires ^0.9 and adds a session.lock option. mattleads/agent-publishing-bundle 0.3.1 for the stateless server, with its demo app from The Streamable HTTP transport in the MCP specification revision 2025-06-18 is one HTTP endpoint. Every client message is a POST. A notification or a response gets 202 Accepted with no body. A request gets either Content-Type: application/json with one JSON-RPC object, or an SSE stream that eventually carries the response. The client may also open a GET for server-initiated messages. Sessions are optional on the server side. The spec says a server "MAY assign a session ID at initialization time" through an Mcp-Session-Id response header. If it does, the client must send that header on every later request, the server may end the session whenever it likes and answer 404 , and a client that sees 404 starts over with a new initialize . A server that never sends the header has no session, and the client has nothing to carry. What a session is for is the other direction of the conversation. If the server wants to ask the client something an elicitation, a sampling request , push a notifications/resources/updated , or let the client resume a stream after a disconnect, it needs somewhere to park those messages between HTTP requests. That somewhere is the session, keyed by the id in the header. A server that only answers tools/call has nothing to park. The 0.8.1 server parks everything there, including the answer to the request it is currently handling. The relevant pieces are in Mcp\Server\Protocol and Mcp\Server\Transport\StreamableHttpTransport . A POST arrives, Protocol::doProcessInput loads the session named by the header, handles each message, and saves the session once at the end: php // mcp/sdk 0.8.1, src/Server/Protocol.php, doProcessInput $session = $this- resolveSession $transport, $sessionId, $messages ; // ... foreach $messages as $message { // ... handleRequest / handleResponse / handleNotification } $session- save ; When a tool handler returns, handleRequest calls sendResponse . With a session present the response is not sent. It is queued inside the session under the key mcp.outgoing queue : js // src/Server/Protocol.php, 0.8.1 private const SESSION OUTGOING QUEUE = ' mcp.outgoing queue'; private function sendResponse TransportInterface $transport, Response|Error $response, ?SessionInterface $session, array $context = : void { if null === $session { // ... json encode and $transport- send $encoded, $context ; } else { $this- queueOutgoing $response, 'type' = 'response' , $session ; } } private function queueOutgoing Request|Notification|Response|Error $message, array $context, SessionInterface $session : void { // ... $queue = $session- get self::SESSION OUTGOING QUEUE, ; $queue = 'message' = $encoded, 'context' = $context ; $session- set self::SESSION OUTGOING QUEUE, $queue ; } The transport then builds the HTTP response by reading the queue back, through Protocol::consumeOutgoingMessages , which loads the session again, takes the whole queue, writes an empty queue and saves: // src/Server/Protocol.php, 0.8.1 public function consumeOutgoingMessages Uuid $sessionId : array { $session = $this- sessionManager- createWithId $sessionId ; $queue = $session- get self::SESSION OUTGOING QUEUE, ; $session- set self::SESSION OUTGOING QUEUE, ; $session- save ; return $queue; } // src/Server/Transport/StreamableHttpTransport.php, 0.8.1, createJsonResponse $outgoingMessages = $this- getOutgoingMessages $this- sessionId ; if empty $outgoingMessages { return $this- responseFactory- createResponse 202 - withHeader 'Content-Type', 'application/json' ; } $messages = array column $outgoingMessages, 'message' ; $responseBody = 1 === \count $messages ? $messages 0 : ' '.implode ',', $messages .' '; Two more details complete the picture. Session::readData reads the store once and caches the array for the life of the object, so the session a request works on is a snapshot taken when it was first touched. And Session::save in 0.8.1 is json encode $this- readData written back whole, every key, not only the ones this request changed. With one worker and one request at a time this is fine. The queue is read, appended, saved, read, emptied, saved, and the POST that carried the request gets its response. The design assumes the requests of a session are sequential. Nothing in PHP's deployment model guarantees that. Take two workers, A and B, each handling one tools/call of the same session, with a shared FileSessionStore . Each step reads or writes the whole session blob. RA . RB . RA is gone. That is the lost update. consumeOutgoingMessages . It loads the store fresh, takes . A's HTTP response carries B's answer. That is the foreign answer. 202 with no body. That is the empty response. Shift the timing a little and step 4 happens after step 5: B saves RB after A emptied the queue, then B's own consume takes it. Both correct, by luck. Shift it the other way and A's consume runs after both saves of a three-worker race: it takes RB, RC and the implode branch sends a JSON array, which a spec-compliant client rejects, because the spec requires "a single JSON-RPC" object in a JSON response. The TypeScript client reports the lost ones as MCP error -32001: Request timed out , which is what the n8n and LangChain users in the upstream issues saw. There is a fourth outcome that is a race on the file rather than on the queue. FileSessionStore::write in 0.8.1 writes to one temporary file per session,