Back to Skill Directory

MCP Server

Cache & QueueProd DebuggingMIT License

Redis MCP Server

Community server · modelcontextprotocol/servers

Redis MCP Server bridges your AI coding assistant directly into your Redis instance. Instead of SSH-ing into a bastion host and running redis-cli, your agent can scan keys, read TTLs, inspect streams, and diagnose cache misses from natural language.

It is especially valuable for the boring-but-important work of debugging queues and caches in production: finding the oldest failed job in BullMQ, checking why a feature flag is stale, locating a session that was supposed to expire an hour ago.

40+
Commands
GET, SCAN, XREAD...
<1min
Setup
connection URL + npx
Redis 6+
Compatible
Valkey, Upstash, ElastiCache
ACL-aware
Mode
use a read-only user

Quick Install

claude mcp add redis -- npx -y @modelcontextprotocol/server-redis redis://default:password@host:6379

Key Features

Key Inspection

GET, TYPE, TTL, OBJECT ENCODING — everything you need to understand what a key holds and how long it will live.

SCAN Patterns

Cursor-based key scanning with glob patterns. Agent can answer "how many sessions are stuck past their TTL" without blocking the server.

Stream & Queue Debugging

XRANGE, XLEN, XPENDING for streams; LRANGE / LLEN for lists. Diagnose stuck BullMQ, Sidekiq, or RSMQ jobs without custom tooling.

Sorted Set Analytics

ZRANGE, ZREVRANGE, ZSCORE for leaderboards, rate limiters, and scheduled jobs. Agent can explain why a user is rate-limited.

Pub/Sub Monitoring

Count active subscribers on a channel, list keyspace notifications, and verify that events are flowing where you expect.

Memory & Info

INFO and MEMORY USAGE to diagnose capacity issues — find the 10 largest keys eating your ElastiCache instance.

Execution Brief

Use this page as a rollout checklist, not just reference text.

Suggest update

Tool Mapping Lens

Organize Tools by Workflow Phase

Catalog-oriented pages work best when users can map discovery, evaluation, and rollout in a clear path instead of reading an undifferentiated list.

  • Define the job-to-be-done first
  • Group tools by stage
  • Prioritize by adoption friction

Actionable Utility Module

Skill Implementation Board

Use this board for Redis MCP Server before rollout. Capture inputs, apply one decision rule, execute the checklist, and log outcome.

Input: Objective

Deliver one measurable improvement with redis mcp server claude code cache queue debugging

Input: Baseline Window

20-30 minutes

Input: Fallback Window

8-12 minutes

Decision TriggerActionExpected Output
Input: one workflow objective and release owner are definedRun preview execution with fixed acceptance criteria.Go or hold decision backed by repeatable evidence.
Input: output quality below baseline or retries increaseLimit scope, isolate root issue, and rerun controlled test.One confirmed correction path before wider rollout.
Input: checks pass for two consecutive replay windowsPromote to broader traffic with fallback path active.Stable rollout with low operational surprise.

Execution Steps

  1. Record objective, owner, and stop condition.
  2. Execute one controlled preview run.
  3. Measure quality, latency, and correction burden.
  4. Promote only when pass criteria are stable.

Output Template

tool=redis mcp server claude code cache queue debugging
objective=
preview_result=pass|fail
primary_metric=
next_step=rollout|patch|hold

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

  1. On-call alert: emails have not been sent for 20 minutes
  2. Ask the agent: "Inspect the BullMQ email queue and show me any stuck or failed jobs"
  3. Agent runs LLEN on bull:email:wait and bull:email:active
  4. Agent runs XPENDING on bull:email:failed to list recent failures
  5. Agent reads the job hash for the oldest failure: HGETALL bull:email:123
  6. 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

  1. Upstash dashboard shows you at 88% of the memory quota
  2. Ask: "Find the 10 largest keys in this Redis instance"
  3. Agent runs SCAN with MATCH * and samples MEMORY USAGE for each key
  4. Agent sorts by size and returns a table: top key is user:5821:search_history at 14 MB
  5. 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.

Missing a better tool match?

Send the exact workflow you are solving and we will prioritize a new comparison or rollout guide.