# Redis

> Inspect keys, run commands, and debug Redis from an AI agent.

[Canonical HTML page](https://top-mcps.com/mcp/redis) · [server.json](https://top-mcps.com/mcp/redis.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

```json
{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": [
        "--from",
        "\"git+https://github.com/redis/mcp-redis\"",
        "redis-mcp"
      ],
      "env": {
        "REDIS_URL": "${REDIS_URL}"
      }
    }
  }
}
```

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
# export REDIS_URL=redis://default:pass@localhost:6379/0
claude mcp add redis -- uvx --from "git+https://github.com/redis/mcp-redis" redis-mcp
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

```json
{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": [
        "--from",
        "\"git+https://github.com/redis/mcp-redis\"",
        "redis-mcp"
      ],
      "env": {
        "REDIS_URL": "${REDIS_URL}"
      }
    }
  }
}
```

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

```jsonc
{
  "servers": {
    "redis": {
      "command": "uvx",
      "args": [
        "--from",
        "\"git+https://github.com/redis/mcp-redis\"",
        "redis-mcp"
      ],
      "env": {
        "REDIS_URL": "${REDIS_URL}"
      }
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

```json
{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": [
        "--from",
        "\"git+https://github.com/redis/mcp-redis\"",
        "redis-mcp"
      ],
      "env": {
        "REDIS_URL": "${REDIS_URL}"
      }
    }
  }
}
```

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

```json
{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": [
        "--from",
        "\"git+https://github.com/redis/mcp-redis\"",
        "redis-mcp"
      ],
      "env": {
        "REDIS_URL": "${REDIS_URL}"
      }
    }
  }
}
```

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "uvx",
          "args": [
            "--from",
            "\"git+https://github.com/redis/mcp-redis\"",
            "redis-mcp"
          ],
          "env": {
            "REDIS_URL": "${REDIS_URL}"
          }
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.redis]
command = "uvx"
args = [
  "--from",
  "\"git+https://github.com/redis/mcp-redis\"",
  "redis-mcp",
]
env = { REDIS_URL = "${REDIS_URL}" }
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "redis": {
      "command": {
        "path": "uvx",
        "args": [
          "--from",
          "\"git+https://github.com/redis/mcp-redis\"",
          "redis-mcp"
        ]
      },
      "env": {
        "REDIS_URL": "${REDIS_URL}"
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Apps directory`

Redis doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** Redis
- **Transport:** stdio
- **Auth model:** API key
- **Required secrets:** REDIS_URL
- **Supported clients:** Claude, Cursor, VS Code, Windsurf, Any MCP-compatible client, Redis 6+, Redis Stack, Valkey
- **License:** MIT
- **Language:** Python
- **Latest version:** latest
- **Last verified:** 2026-05-27
- **GitHub stars:** 513 (fetched 2026-06-02T11:55:52.271Z)
- **Score:** 87/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/redis/mcp-redis

## Tools & permissions

| Tool | Description | Args | Side effects |
|------|-------------|------|--------------|
| `scan_keys` | Iterate keys matching a pattern using SCAN. | `pattern: string` | read |
| `get_string` | GET a string value. | `key: string` | read |
| `hgetall` | Return all fields and values of a hash. | `key: string` | read |
| `lrange` | Return a range of list elements. | `key: string, start: number, stop: number` | read |
| `ttl` | Return the TTL of a key. | `key: string` | read |

## Security & scope

- **Access scope:** read-only
- **Sandbox:** Connects to a Redis instance via REDIS_URL. Read-only mode disables write commands at the tool layer. Use a Redis user with read-only ACL as defence in depth.
- **Gotchas:**
  - KEYS is replaced by SCAN intentionally — do not enable a custom passthrough tool that re-introduces KEYS.
  - TLS is required for managed providers (Upstash, Redis Cloud). Use rediss:// in the URL.
  - Pub/Sub subscriptions are not exposed — agents holding open subscriptions is a footgun.

## Quick answer

**What it does.** Connects to a Redis server and exposes key inspection, value retrieval for all core data types, TTL inspection, and a curated set of read-only debug commands.

**Best for:**
- Cache inspection
- Session debugging
- Queue depth checks
- TTL audits
- Pattern-based key listing

**Not for:**
- Production-wide KEYS scans
- Write operations from an LLM
- Pub/Sub stream consumption

## Description

The official Redis MCP exposes a Redis instance to an AI model — inspect keys by pattern, read string/hash/list/set/zset values, and run safe debug commands. Designed for the "what is in this cache" and "why is this key TTLd" workflows where dropping into redis-cli is the usual answer.

## Why it matters

Redis sits in the middle of nearly every production stack as cache, session store, or queue. A read-only MCP turns "let me ssh in and run redis-cli" into a conversational debug.

## Key features

- Redis + Redis Stack + Valkey support
- Read-only mode default
- Per-data-type read tools
- TTL and memory inspection
- Pattern-based SCAN (not KEYS)

## FAQ

### Does it use KEYS or SCAN?

SCAN with a cursor. KEYS is intentionally avoided because it blocks the Redis event loop on large keyspaces — fine in development, dangerous in production.

### Does it support Redis Stack modules (JSON, Search)?

Yes for read access. The MCP detects available modules at connect time and exposes JSON.GET / FT.SEARCH tools when present.

### How do I scope to one database number?

Add /<db> to the REDIS_URL (e.g. redis://host:6379/3). The MCP runs every command against that single database.

### Can the agent write?

Not in read-only mode (the default). Enable writes only on dev/staging clusters; LLM-issued SET/DEL against a shared cache is rarely what you want.

## Changelog

- **2026-05-27** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-03-12** — Initial directory listing.
