What happened
MemMachineFastMCP.get_app (server/api_v2/mcp.py:310-312) calls super().http_app(path=path) without stateless_http. With fastmcp 4.0.3 (uv.lock) that resolves to the server default, stateless_http = False, so the streamable-HTTP transport issues an Mcp-Session-Id and expects every later request of that session to reach the same process. The session manager is created per process in the mounted app's lifespan.
Behind a load balancer with no sticky routing, a client's second request lands on a replica that has never seen the session id and is rejected. The server's own tools do not need the session: every tool reads its ids from request headers into contextvars.
Expected
stateless_http=True, so each request is self-contained, or the deployment documents that MCP over HTTP requires session affinity.
Notes
Code read at d6068cdbf (main), paths under packages/server/src/memmachine_server/. The fastmcp default was checked in an installed 4.0.3 copy, not reproduced against two replicas.
🤖 Written by Claude Code (Claude Fable 5.1) on behalf of @edwinyyyu.
What happened
MemMachineFastMCP.get_app(server/api_v2/mcp.py:310-312) callssuper().http_app(path=path)withoutstateless_http. With fastmcp 4.0.3 (uv.lock) that resolves to the server default,stateless_http = False, so the streamable-HTTP transport issues anMcp-Session-Idand expects every later request of that session to reach the same process. The session manager is created per process in the mounted app's lifespan.Behind a load balancer with no sticky routing, a client's second request lands on a replica that has never seen the session id and is rejected. The server's own tools do not need the session: every tool reads its ids from request headers into contextvars.
Expected
stateless_http=True, so each request is self-contained, or the deployment documents that MCP over HTTP requires session affinity.Notes
Code read at
d6068cdbf(main), paths underpackages/server/src/memmachine_server/. The fastmcp default was checked in an installed 4.0.3 copy, not reproduced against two replicas.🤖 Written by Claude Code (Claude Fable 5.1) on behalf of @edwinyyyu.