# Redis MCP Server

> Redis MCP Server is an open-source MCP server for databases. Read-only Redis and Valkey explorer with safe key scans and a big-key advisor. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux, Windows
- **Website:** https://yaw.sh/mcp-servers/redis-mcp/
- **Repository:** https://github.com/yawlabs/redis-mcp
- **MCP Registry name:** io.github.YawLabs/redis-mcp
- **Categories:** databases
- **Listing updated:** 2026-11-14

## About

Safety on a live instance is the main design point. Key enumeration always uses cursor-based SCAN with a bounded count and iteration cap, never the O(N) KEYS command that can block Redis's single-threaded loop, so the README says it is fine to point at a production instance with millions of keys. Tools run a curated read-only command allowlist, and writes such as SET, DEL, EXPIRE and HSET only work if ALLOW_WRITES=1 is set. EVAL, FUNCTION, SCRIPT, MULTI, MONITOR, SHUTDOWN and cluster commands are never exposed, even with writes on.

redis_health rolls INFO, DBSIZE and recent SLOWLOG into one report covering memory pressure, eviction policy, hit rate, ops per second, persistence, replication role and per-database key counts. redis_advisor acts as a lint pass, flagging big keys, missing TTLs, eviction pressure including the risky noeviction with no-TTL combination, and fork-latency risk, each with a severity and a fix. redis_key_info reports type, TTL, encoding, memory footprint and idle time without reading the value, and redis_get windows collection reads so a huge list cannot flood the model's context.

It works with Redis 6 and later and with Valkey, and a field the server does not report shows as null. Set REDIS_URL, and note that a password-only URL needs the form redis://:password@host:6379. It ships as one bundled file with no runtime dependencies, is MIT licensed and is built by Yaw Labs.

## Features

- **SCAN-based key explorer:** Pages through keys with a resumable cursor, glob match and type filter, capped at REDIS_MAX_KEYS.
- **One-call health report:** Summarises memory, eviction, hit rate, persistence, replication and slow commands.
- **DBA advisor:** Finds big keys, missing TTLs, eviction risks and fork-latency risk with suggested fixes.
- **Key inspection:** Reads type, TTL, encoding, memory and idle time without fetching the value.
- **Windowed reads:** Type-aware reads cap collection output to protect model context.
- **Opt-in writes:** Mutating commands need ALLOW_WRITES=1, and arbitrary execution stays blocked.

## Good for

- Find out what is stored in an unfamiliar Redis instance
- Check a production cache for big keys and missing expiry
- Review recent slowlog entries after a latency spike
- Run a quick health check before a deploy

## Install

### Claude Code (Terminal)

```sh
claude mcp add redis-mcp -- npx -y @yawlabs/redis-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "redis-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/redis-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "redis-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/redis-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "redis-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/redis-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "redis-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/redis-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "redis-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/redis-mcp"
      ]
    }
  }
}
```

## Tools

- `redis_scan`: Enumerate keys with cursor-based SCAN, with optional glob match and type filter.
- `redis_key_info`: Inspect one key's type, TTL, encoding, memory and idle time without reading its value.
- `redis_health`: Summarise INFO, DBSIZE and recent SLOWLOG into one health report.
- `redis_advisor`: Report big keys, missing TTLs, eviction pressure and fork-latency risk with fixes.
- `redis_slowlog`: Return recent slow-log entries with command, microseconds, timestamp and client.
- `redis_get`: Read a value by type with windowed collection reads.
- `redis_command`: Run allowed commands; mutating ones need ALLOW_WRITES=1.

## FAQ

### Is it safe on production?

The README says so: it is read-only by default and enumerates keys with SCAN, never KEYS.

### How do I enable writes?

Set ALLOW_WRITES=1; scoping that to dev and test instances is advised, and arbitrary-execution commands stay blocked.

### Does it work with Valkey?

Yes, it works with Redis 6 and later and Valkey; some health fields depend on what INFO exposes.

### What does it not cover?

EVAL, scripts, pub/sub, MONITOR, cluster management and replication control; the README points to redis-cli for those.

### Is Redis MCP Server free?

Yes. Redis MCP Server is open source, so you can use and self-host it for free.

### How do I add Redis MCP Server to Claude Code?

Run this command in your terminal: claude mcp add redis-mcp -- npx -y @yawlabs/redis-mcp

### What are the best alternatives to Redis MCP Server?

The closest alternatives to Redis MCP Server are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

## Alternatives

- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [PlatypusDB](https://ai-powered.com/mcp/platypusdb): PlatypusDB is an open-source MCP server for databases.
- [Lorebase](https://ai-powered.com/mcp/lorebase): Lorebase is an open-source MCP server for knowledge and memory.
- [Sovaria](https://ai-powered.com/mcp/sovaria): Sovaria is a freemium MCP server for databases.
- [model2data studio](https://ai-powered.com/mcp/model2data-studio): model2data studio is a freemium MCP server for databases.
- [semlayer](https://ai-powered.com/mcp/semlayer): semlayer is a free MCP server for databases.
- [bricksentry](https://ai-powered.com/mcp/bricksentry): bricksentry is an open-source MCP server for databases.
- [MCP Toolbox for Databases](https://ai-powered.com/mcp/mcp-toolbox-for-databases-2): MCP Toolbox for Databases is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/redis-mcp-server-2
