← All recipes

MCP Recipe

Inspect Redis keys before mutating

Influzer starter recipe: connect Redis MCP to a non-production instance, survey key patterns and TTLs first, then ask for a safe read — before any SET/DEL/FLUSH.

Data & Analytics
By Influzer Published 2026-11-22 Updated 2026-11-22 0 worked for me

MCP servers used

Compatible clients (author-reported, not verified by Influzer): Cursor, Claude Code, Claude Desktop

Prerequisites

  • Redis reachable from your machine (prefer local/staging)
  • uvx available for redis-mcp-server
  • Connection URL only in MCP config — never in the chat
  • Prefer a read-limited Redis ACL user

Required permissions

Redis MCP can read and write keys depending on the ACL. Point it at staging. Never run FLUSHALL/FLUSHDB. Secrets and session tokens in Redis are sensitive — do not dump values into public channels.

Setup

1. Add Redis MCP with a placeholder URL

Install the official Redis MCP (redis-mcp-server via uvx). Put the real Redis URL only in local MCP config or env. Use a staging instance and a restricted ACL when possible.

2. Example stdio config (placeholder URL) · json
{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": [
        "--from",
        "redis-mcp-server@latest",
        "redis-mcp-server",
        "--url",
        "redis://127.0.0.1:6379/0"
      ]
    }
  }
}
3. Survey keys, then read-only checks · markdown
Using Redis MCP against my staging instance, summarize the main key patterns (e.g. session:*, cache:*) and typical TTLs.
Then propose a read-only plan to inspect one cache key and one session key metadata (type + TTL) without printing secrets.
Do not run SET/DEL/FLUSHALL/FLUSHDB or overwrite keys unless I explicitly approve afterward.

Expected result

A keyspace overview (patterns + sample TTLs) and a proposed read-only inspection plan — no destructive commands.

Sample output

Patterns: session:, cache:product:, lock:checkout:*
session:* ~12k keys, TTL ~1800s
Next: GET one cache:product:* sample; do not DEL or FLUSH.

Troubleshooting

  • uvx missing: install uv, or follow https://github.com/redis/mcp-redis install docs
  • Connection refused: check host/port/TLS (rediss://) and ACL user
  • Stdio only — not usable from ChatGPT’s remote-only MCP path

Source repository

https://github.com/redis/mcp-redis

Report an issue