RedisSessionStore for serializable session metadata and RedisStreamManager for routing active stream messages across instances.
This guide focuses on choosing and wiring Redis. Use the Sessions API reference for constructor options, defaults, method behavior, Redis command details, and stream-manager contracts.
Choose the Redis pieces you need
Use the session store alone when you only need session metadata persistence or ordinary request recovery across instances. Add the stream manager when active server-to-client delivery must cross instance boundaries.RedisSessionStore does not store active stream controllers. Use RedisStreamManager for distributed server-to-client delivery.
Install Redis support
Install a Redis client library and provide an already-connected client to mcp-use.Persist session metadata
UseRedisSessionStore when reconnecting clients should keep session metadata after a restart or deploy.
Add distributed stream routing
UseRedisStreamManager when an active client stream may live on one server while another server needs to send a notification or route the response to a server-to-client request. Pub/Sub needs a dedicated Redis connection, so create a duplicate client.
Verify distributed behavior
Before using Redis in production, verify these cases in an environment that resembles your deployment:- Restarting one server does not force clients to re-initialize.
- A notification or resource update published by one instance reaches a client stream connected to another instance.
- Sampling, elicitation, or other server-to-client request responses route back to the instance waiting for them.
- Redis connection shutdown is handled when the server exits.
Next steps
Redis session store API reference
Look up Redis session store options and methods.
Redis stream manager API reference
Look up distributed stream routing options and methods.
ServerConfig API reference
Look up
sessionStore and streamManager fields.Session management example
Compare your setup with a runnable Redis-backed example.