Skip to content

Commit ff70856

Browse files
committed
[Doc] Note sticky session requirement for multi-instance deployments
## Motivation and Context PR #290 documented that `StreamableHTTPTransport` requires a single-process server. However, when running multiple server instances behind a load balancer, requests for the same session must be routed to the same instance since session state is stored in memory. This adds a note about using sticky sessions (session affinity) based on the `Mcp-Session-Id` header. ## How Has This Been Tested? Documentation-only change. ## Breaking Changes None.
1 parent 40b048b commit ff70856

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ transport = MCP::Server::Transports::StreamableHTTPTransport.new(server, session
514514
> so it must run in a single process. Use a single-process server (e.g., Puma with `workers 0`).
515515
> Multi-process configurations (Unicorn, or Puma with `workers > 0`) fork separate processes that
516516
> do not share memory, which breaks session management and SSE connections.
517+
>
518+
> When running multiple server instances behind a load balancer, configure your load balancer
519+
> to use sticky sessions (session affinity) so that requests with the same `Mcp-Session-Id`
520+
> header are always routed to the same instance.
521+
>
517522
> Stateless mode (`stateless: true`) does not use sessions and works with any server configuration.
518523
519524
#### Rails Controller

0 commit comments

Comments
 (0)