What Is Redis MCP Server?
Redis MCP Server is a Model Context Protocol server that wraps a Redis client and exposes common commands as MCP tools. It speaks the standard Redis wire protocol, so it works with every Redis-compatible store: Valkey, KeyDB, Upstash, ElastiCache, Memorystore, and self-hosted Redis.
The big unlock is turning Redis debugging into a conversation. Instead of remembering SCAN syntax or XPENDING flags, you ask: "Which sessions were created more than 24 hours ago?" and the agent translates the intent into the right SCAN pattern with MATCH and COUNT arguments, filters by IDLETIME, and returns an answer.
It is read-oriented by design. Every production-grade deployment pattern uses a Redis ACL user with -@dangerous +@read permissions, which blocks FLUSHALL, CONFIG SET, DEBUG, and other foot-guns at the server level. Write access lives on a separate MCP registration you enable only when you explicitly need to fix something.
Pairs naturally with Postgres MCP for full-stack debugging. A typical prompt: "Why is user 42 seeing stale data?" The agent checks the cache key in Redis, notices the TTL is still 55 seconds, reads the underlying row in Postgres, spots the mismatch, and tells you a cache invalidation is missing from a code path.
How to Calculate Better Results with redis mcp server claude code cache queue debugging
Create a dedicated Redis ACL user with read-only permissions: ACL SETUSER ai_readonly on >password ~* &* -@all +@read +@connection. Use this user for day-to-day MCP access.
Register the server: claude mcp add redis -- npx -y @modelcontextprotocol/server-redis "redis://ai_readonly:password@your-host:6379". Most hosted providers give you a pastable connection URL.
Verify with a safe prompt: "How many keys are in this Redis database and what are the most common prefixes?" Agent uses DBSIZE and SCAN with sampling to answer without blocking.
For write access, register a second server instance with a different name (e.g. redis-write) and a privileged user. Keep it disabled in your MCP config and only turn it on during incidents, so you cannot accidentally FLUSH during routine debugging.
Treat this page as a decision map. Build a shortlist fast, then run a focused second pass for security, ownership, and operational fit.
When a team keeps one shared selection rubric, tool adoption speeds up because evaluators stop debating criteria every time a new option appears.
Worked Examples
Finding stuck jobs in a BullMQ queue
- On-call alert: emails have not been sent for 20 minutes
- Ask the agent: "Inspect the BullMQ email queue and show me any stuck or failed jobs"
- Agent runs LLEN on bull:email:wait and bull:email:active
- Agent runs XPENDING on bull:email:failed to list recent failures
- Agent reads the job hash for the oldest failure: HGETALL bull:email:123
- Agent returns: "Job 123 has been active for 19 minutes. Error message: SMTP timeout to provider X. 47 jobs queued behind it."
Outcome: Root cause identified in 60 seconds with concrete job IDs and payloads you can action, instead of SSH + redis-cli + manual key spelunking.
Hunting the biggest keys eating your cache quota
- Upstash dashboard shows you at 88% of the memory quota
- Ask: "Find the 10 largest keys in this Redis instance"
- Agent runs SCAN with MATCH * and samples MEMORY USAGE for each key
- Agent sorts by size and returns a table: top key is user:5821:search_history at 14 MB
- Agent suggests a TTL of 7 days on the search_history prefix based on the key naming
Outcome: An actionable memory-optimization plan with specific key prefixes to target, produced in under two minutes from natural language.
Frequently Asked Questions
What is the Redis MCP Server?
Redis MCP Server is a Model Context Protocol server that connects AI agents to a Redis or Redis-compatible store (Valkey, KeyDB, Upstash, ElastiCache, Memorystore). It exposes core Redis commands — GET, SET, SCAN, TTL, XREAD, ZRANGE, and more — as MCP tools your agent can call from natural language.
How do I install it?
Register the community Redis MCP with your client. In Claude Code: claude mcp add redis -- npx -y @modelcontextprotocol/server-redis redis://default:password@host:6379. Most hosted Redis providers give you a full connection URL in their dashboard you can paste directly.
Is it safe to let an agent run FLUSHALL or DEL?
By default, MCP clients prompt before any destructive command and most Redis MCP implementations refuse FLUSHALL/FLUSHDB entirely unless explicitly enabled via a flag. Best practice: connect with a Redis ACL user that has -@dangerous +@read for read-only use, and keep write access on a separate, gated MCP registration you only enable when needed.
What Redis data types does it handle?
All of them. Strings (GET/SET), hashes (HGETALL), lists (LRANGE), sets (SMEMBERS), sorted sets (ZRANGE/ZSCORE), streams (XREAD/XLEN), and HyperLogLog counters. The agent picks the right command based on the key type returned by TYPE.
Can it help debug BullMQ / Sidekiq queues?
Yes — queue backends store their state in normal Redis keys, so the agent can inspect waiting/active/failed lists, read job payloads from hashes, and count stuck jobs. A typical prompt: "Show me the oldest 10 failed jobs in the email queue and summarize their error messages."
Does it work with Upstash Redis over REST?
The reference server uses the standard Redis protocol, so it works with Upstash when you use the TCP endpoint (not the REST URL). If you prefer REST, there are community Upstash-specific MCP servers on the directory that wrap the HTTP API instead.