What it does
Redis MCP connects Claude directly to a Redis instance. Redis is not just a key-value store — it is a full data structures engine, and this MCP server exposes all of its primary data types: strings, hashes, lists, sets, sorted sets, and pub/sub channels.
Common developer use cases include inspecting what is in a cache layer without using redis-cli, debugging a job queue to see what tasks are pending or stuck, analysing rate-limit counters, checking session data, and getting server statistics like memory usage and connection count.
- Get and set string key-value pairs
- Delete keys individually or by pattern
- Search all keys matching a glob pattern
- Read and write hash fields
- Push to and read from lists
- Add members to and read from sorted sets
- Publish messages to channels
- Subscribe to channels and receive messages
- Get server info: memory, uptime, connected clients
How to connect
Set REDIS_URL to your Redis connection string. For local Redis the default is redis://localhost:6379. For Redis with a password: redis://:password@host:6379.
export REDIS_URL="redis://localhost:6379" claude mcp add redis -- npx -y redis-mcp-server
For Redis Cloud or Upstash:
export REDIS_URL="rediss://:password@host.upstash.io:6380" claude mcp add redis -- npx -y redis-mcp-server
Available tools
get— get the value of a keyset— set a key with optional expiry (TTL)del— delete one or more keyskeys— search keys matching a glob patternhget— get a field from a hashhset— set a field in a hashlpush— push a value onto the left of a listlrange— get a range of elements from a listzadd— add a member to a sorted set with a scorezrange— get members from a sorted set by rankpublish— publish a message to a channelsubscribe— subscribe and receive messages from a channelinfo— get Redis server statistics
Example usage
Ask Claude to inspect your cache contents, identify stale keys, or investigate queue depth:
# User prompt
Look at all keys matching "session:*" in Redis.
How many are there? What is the average TTL?
Are any keys missing a TTL (never expiring)?
keys("session:*") → returns 1,847 keys get("session:abc123") + TTL check × sample → avg TTL: 3,240 seconds (54 min) → 12 keys have TTL = -1 (no expiry) → Claude lists the 12 persistent session keys
Pattern matching: The keys command uses KEYS under the hood, which can block Redis on large keyspaces. For production Redis instances with millions of keys, consider using the SCAN-based approach. Ask Claude to use keys incrementally with specific prefixes to avoid long blocking calls.