🔌

Redis MCP

Database480

Interact with Redis databases for caching, session management, and real-time data.

Claude DesktopCursor

Overview

Interact with Redis databases for caching, session management, and real-time data.

Setup

Run with npx:

npx -y @modelcontextprotocol/server-redis redis://localhost:6379

Configuration

Redis URL as argument

Documentation

Redis MCP

Overview

Redis MCP provides direct access to Redis databases, enabling AI agents to interact with Redis for caching, session management, real-time data, and more. Perfect for debugging Redis issues, managing cache strategies, and building Redis-powered features.

Features

  • Key Operations: Get, set, delete, and manage Redis keys
  • Data Structures: Work with strings, hashes, lists, sets, sorted sets, and more
  • Pub/Sub: Subscribe to Redis channels for real-time messaging
  • Transaction Support: Execute MULTI/EXEC transactions
  • Connection Management: Multiple database selection, connection info
  • Performance Tools: Slow log, memory analysis, key patterns

Installation

npx -y @modelcontextprotocol/server-redis redis://localhost:6379

Configuration

Add to your Claude Desktop config:

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-redis", "redis://localhost:6379"]
    }
  }
}

For Redis with authentication:

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-redis", "redis://:password@localhost:6379"]
    }
  }
}

For Redis Enterprise or cloud Redis:

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-redis", "rediss://default:password@redis-cloud.example.com:12345"]
    }
  }
}

Available Tools

ToolDescription
getGet value by key
setSet key-value pair
deleteDelete one or more keys
existsCheck if key exists
expireSet key expiration
keysFind all keys matching pattern
typeGet the type of key
hgetGet hash field value
hsetSet hash field value
lpushPush value to list head
rpushPush value to list tail
saddAdd member to set
zaddAdd member to sorted set
publishPublish message to channel
subscribeSubscribe to channel

Usage Examples

Basic Key Operations

Get the value of key "user:1000":profile

Set key "session:abc123" to "active" with 3600 second expiry

Hash Operations

Get field "name" from hash "user:1000"

Set field "email" to "user@example.com" in hash "user:1000"

List Operations

Push "task:1" to the head of list "queue:tasks"

Pop from the tail of list "queue:tasks"

Pattern Search

Find all keys matching pattern "cache:*"

Claude Desktop Setup

  1. Install the MCP server with your Redis connection string
  2. Add configuration to claude_desktop_config.json
  3. Restart Claude Desktop
  4. The Redis tool will appear in your available tools

Pros

  • ✅ Direct Redis CLI-like interface
  • ✅ Support for all Redis data structures
  • ✅ Works with local and cloud Redis
  • ✅ No additional authentication required (uses Redis auth)
  • ✅ Great for debugging and exploration

Cons

  • ❌ Requires Redis instance to be running
  • ❌ No GUI for visual inspection
  • ❌ Connection string must be managed carefully
  • ❌ Limited to Redis operations only

Resources