Documentation Index
Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt
Use this file to discover all available pages before exploring further.
Redis storage consists of two components:
RedisSessionStore - Stores serializable session metadata (capabilities, client info, etc.)
RedisStreamManager - Manages distributed notifications via Redis Pub/Sub
Together, they enable horizontal scaling with full MCP feature support.
Architecture
Installation
Install the Redis client library:
yarn add redis
# or
yarn add ioredis
Basic Setup
For single-server deployments with persistent sessions:
import { MCPServer, RedisSessionStore } from 'mcp-use/server';
import { createClient } from 'redis';
const redis = createClient({
url: process.env.REDIS_URL,
password: process.env.REDIS_PASSWORD,
});
await redis.connect();
const sessionStore = new RedisSessionStore({
client: redis,
prefix: 'mcp:session:', // Optional: custom key prefix
defaultTTL: 3600, // Optional: 1 hour default TTL (in seconds)
});
const server = new MCPServer({
name: 'my-server',
version: '1.0.0',
sessionStore
});
server.start({ port: 3000 });
Full Example
See the Redis session management example for a complete, runnable server with session recovery and notifications across restarts.