Skip to main content
Community resource — not affiliated with Anthropic. Learn more


Redis MCP

Databases · Community

Interact with Redis — read/write keys, manage sets, sorted sets, hashes, lists, and pub/sub channels. Inspect caches, debug queues, and analyze data structures.

4.5 rating 3,800+ connects Free · Open source Protocol v1.0
Redis Cache Pub/Sub Community Queues

Connect command

REDIS_URL=redis://localhost:6379 claude mcp add redis -- npx -y redis-mcp-server
View on GitHub →

Requires REDIS_URL env var

3.8kConnects
4.5Rating

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.

terminal
export REDIS_URL="redis://localhost:6379"
claude mcp add redis -- npx -y redis-mcp-server

For Redis Cloud or Upstash:

terminal — cloud Redis
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 key
  • set — set a key with optional expiry (TTL)
  • del — delete one or more keys
  • keys — search keys matching a glob pattern
  • hget — get a field from a hash
  • hset — set a field in a hash
  • lpush — push a value onto the left of a list
  • lrange — get a range of elements from a list
  • zadd — add a member to a sorted set with a score
  • zrange — get members from a sorted set by rank
  • publish — publish a message to a channel
  • subscribe — subscribe and receive messages from a channel
  • info — get Redis server statistics

Example usage

Ask Claude to inspect your cache contents, identify stale keys, or investigate queue depth:

example prompt
# 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)?
tool call sequence
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.