Is your feature request related to a problem? Please describe.
Currently MCP SDK is using in-memory storage for sessions
|
http.Error(w, "session not found", http.StatusNotFound) |
which become potentially a tricky place for session recovery scenarios in particular in distributed prod-like environment with multiple instances of MCP servers up and running.
As the result in the scenario when a client has proper session id but for some reason has lost or patially lost the connection in the downstream of an entrypoint (client -> entripoint -> [no connection] downstream), the request may be routed through load balancer to various instances of MCP which may not have session context in memory.
Additionally within the deployment in scalable multi instance enveronment session context due to being in mem only often also can be lost without a way to greacefully recover.
Describe the solution you'd like
Potentially introduce shared session storage (e.g redis) for being able to share the session state for graceful recovery within connection loss / re-deployments.
EDIT(@findleyr): The current concrete proposal is in #148 (comment).
Is your feature request related to a problem? Please describe.
Currently MCP SDK is using in-memory storage for sessions
go-sdk/mcp/streamable.go
Line 102 in dd49b70
As the result in the scenario when a client has proper session id but for some reason has lost or patially lost the connection in the downstream of an entrypoint (client -> entripoint -> [no connection] downstream), the request may be routed through load balancer to various instances of MCP which may not have session context in memory.
Additionally within the deployment in scalable multi instance enveronment session context due to being in mem only often also can be lost without a way to greacefully recover.
Describe the solution you'd like
Potentially introduce shared session storage (e.g redis) for being able to share the session state for graceful recovery within connection loss / re-deployments.
EDIT(@findleyr): The current concrete proposal is in #148 (comment).