DatabaseFreeactiveReviewed by MCPIndex

Redis MCP Server

Official Redis MCP server for inspecting keys, hashes, streams, and TTLs — deploy behind a restricted ACL user or regret it.

Looking for more MCP servers? Browse the full MCP tools directory or explore more tools in Database.

Quick overview

Redis is not a cache — it is a data structure server that happens to be fast, and the Redis MCP server exposes that full command surface to a probabilistic reasoning engine. Read that sentence twice before deploying. The architectural reality: an agent with GET, HGETALL, SCAN, and TTL is a phenomenally useful operator for session inspection, queue depth analysis, and cache-invalidation debugging — but the same connection string with FLUSHALL privileges is one ambiguous prompt away from deleting your entire session layer, and the model will not lose sleep over it. The correct deployment posture borrows from Redis own criminally underused ACL system: a restricted user with keyspace-pattern scoping (~mcp:*) and command-category whitelisting (+@read -@dangerous) converts the server from a liability into a read-mostly observability tool with surgical write access. Deployed this way, redis-mcp-server becomes the fastest path for an agent to answer why is this user logged out — inspect the session hash, check the TTL, verify the eviction policy — in a single reasoning pass instead of a twenty-minute redis-cli archaeology session.

What this MCP server is best for

  • Querying and inspecting data directly from your AI assistant with Redis MCP Server.
  • Debugging records, reviewing schemas, or validating application data quickly.
  • Supporting developer workflows that need fast database access without context switching.

When to choose it

Choose Redis MCP Server when your workflow depends on inspecting or querying structured data directly from an MCP-compatible AI assistant.

Good fit

rediscachekey-valuesessionspubsubstreams

Redis MCP Server Configuration

Use the following configuration as a starting point for Claude Desktop or any compatible MCP client, then replace placeholder credentials with your own values.

claude_desktop_config.json
{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": ["redis-mcp-server"],
      "env": {
        "REDIS_HOST": "localhost",
        "REDIS_PORT": "6379",
        "REDIS_PWD": "restricted-acl-password",
        "REDIS_SSL": "false"
      }
    }
  }
}

How to set up Redis MCP Server

These setup steps cover the typical installation flow for this MCP server.

  1. 1

    Create a restricted ACL user BEFORE anything else: ACL SETUSER mcp_agent on >STRONGPASS ~mcp:* ~sess:* +@read +@hash +@string +ttl +scan -@dangerous — this whitelists keyspace patterns and strips FLUSHALL, FLUSHDB, CONFIG, DEBUG, and KEYS in a single atomic move.

  2. 2

    Pro-Tip: The fatal flaw 90% of developers commit is connecting the MCP server with the default user (full privileges) just for testing and then shipping it. An agent asked to clean up stale cache entries has no semantic distinction between DEL stale:key and FLUSHALL — only the ACL layer does. If you implement nothing else from this guide, implement step 1.

  3. 3

    Install via uvx redis-mcp-server and pass REDIS_HOST, REDIS_PORT, REDIS_PWD, and REDIS_SSL as environment variables — for managed Redis (ElastiCache, Upstash, Redis Cloud), REDIS_SSL=true is mandatory, not optional.

  4. 4

    Pin the logical database index explicitly (SELECT 0 vs SELECT 1) in your connection or prompts — multi-db deployments are a silent-nil minefield where every read returns nothing and nothing explains why.

  5. 5

    Verify the read-only posture: ask the agent to check the TTL of sess:12345, then deliberately attempt a write and confirm the ACL rejection surfaces as a tool error rather than a silent no-op.

Frequently asked questions

Common questions for Redis MCP Server.

The agent ran a simple key lookup and the entire application latency spiked — but no error was logged anywhere. Why?

The silent failure that takes down production Redis: the agent (or a server fallback path) issued KEYS * to find a key — an O(N) blocking command that freezes the Redis single-threaded event loop. Every other client queues behind it, and the resulting latency spike masquerades as a network problem because Redis never raises an error for legal commands. The engineering fix: strip KEYS from the ACL (-keys), force SCAN with COUNT hints for any keyspace exploration, and confirm with SLOWLOG GET — the offending KEYS call will be sitting there with a microsecond timestamp and your agent fingerprints all over it.

Why does the agent get nil for keys that definitely exist?

Almost always a wrong logical database index (SELECT 1 vs SELECT 0) or a keyspace prefix mismatch — Redis returns nil, never an error, so the agent concludes the key expired. Pin the DB index in the connection and verify with SCAN MATCH against the expected prefix.

Can it work with Redis Streams and Pub/Sub?

Streams yes — XRANGE and XADD work within ACL limits and are excellent for queue inspection. Pub/Sub is a poor fit: it is connection-stateful, and stdio MCP servers are request-scoped, so subscriptions do not survive across tool calls. Use keyspace notifications persisted to a stream instead.

Does it support Redis Cluster mode?

Point the server at a single replica for read workloads. Cross-slot writes will fail with MOVED redirects that the server may not follow — for cluster write workflows, route through a proxy that handles slot mapping.

Redis MCP Server vs Competitors

FeatureRedis MCP ServerCompetitor
Data-structure awareness Agent inspects TYPE first, then chooses HGETALL vs GET vs XRANGE Scripts hard-code one structure and break on drift
Safety rails in practice ACL-scoped user with dangerous commands stripped Cron scripts almost always run as the default full-privilege user
Ad-hoc incident queries Natural language incident questions answered in one pass A new bash script per question
Multi-step inspection atomicity Single reasoning pass, MULTI when mutation is needed Race-prone sequential redis-cli invocations
Determinism and replayability Probabilistic agent reasoning, varies per run Deterministic, version-controlled, replayable scripts

Related Guides