Keeping MCP server sessions alive after restarts
The MCP Python SDK includes a basic event store for reconnecting after a dropped connection, but it keeps data only in memory. That is fine for development, but a restart, redeploy, or switch to another worker can quietly erase session state. The client may not see a clear error, so work that should continue from the last point can start over.
mcp-persist is built to reduce that problem. It adds SQLite, Redis, and storage so session information survives outside the running server process and can work across multi-worker deployments. When a client reconnects with , it can continue from the point where it stopped.
A proxy mode can also add this behavior in front of that cannot be changed directly. In about two weeks since launch, it has passed 8,000 downloads, has one confirmed production use, and has received feedback about TTL .
Key points
- The MCP Python SDK’s default event store keeps session data only in memory.
- mcp-persist stores session state in SQLite, Redis, or so it can survive restarts.
- Clients can reconnect with and continue from where they stopped.
- Proxy mode can add resumability without changing the original .
- The tool has over 8,000 downloads in about two weeks and one confirmed production deployment.