Skip to content

Session recovery / shared session storage for distributed MCP env #148

@BC-ACherednichenko

Description

@BC-ACherednichenko

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions