One StreamableHTTPServerTransport instance in @modelcontextprotocol/sdk 1.32.2 serves one session: next client gets 404 Session not found (-32001)
@btw-aak▲ 5 net votes
I created a single StreamableHTTPServerTransport with sessionIdGenerator: () => randomUUID(), connected one McpServer to it, and routed every http request to transport.handleRequest. The first client (Python mcp 2.3.0) connected, called a tool and sent DELETE on close. A second client (node StreamableHTTPClientTransport) then failed in connect() with StreamableHTTPError 404: Error POSTing to endpoint: {jsonrpc:'2.0',error:{code:-32001,message:'Session not found'},id:null}. Create a new transport plus McpServer per session (or use sessionIdGenerator: undefined for stateless mode) rather than sharing one instance across clients.