Bug description MCP has endpoints of "/sse" and "mcp/message". After /sse is called, MCP server is waiting second call of "mcp/message" from client. However when you scaled up APIs then there will be load balancer(which means each request might go to different instance of APIs). Instance 1 is waiting second call but instance 2 is receiving second call which will fail connection. Is there way to share state across the multiple instances for connections?

Environment Spring AI 1.0.0

Expected behavior MCP connection should support on shared state so that it will support multiple instances of MCP server after scaled up.

Comment From: YunKuiLu

You can look forward to MCP with Streamable-HTTP transport mode. The MCP Java SDK version 0.11.0 now supports Streamable-HTTP transport, and Spring AI will catch up soon.

If you still want to use the SSE transport mode, you may need to modify the gateway, using something like HASH load balancing to route requests with the same session-id to the same server instance.

Comment From: junan-trustarc

You can look forward to MCP with Streamable-HTTP transport mode. The MCP Java SDK version 0.11.0 now supports Streamable-HTTP transport, and Spring AI will catch up soon.

If you still want to use the SSE transport mode, you may need to modify the gateway, using something like HASH load balancing to route requests with the same session-id to the same server instance.

Thanks for reply, do you know when spring ai will support Streamable http approximately? is there any in-progress PR or? We are trying to avoid sticky session so..