Overview
Interact with Redis databases for caching, session management, and real-time data.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-redis redis://localhost:6379Configuration
Redis URL as argumentDocumentation
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
| Tool | Description |
|---|---|
get | Get value by key |
set | Set key-value pair |
delete | Delete one or more keys |
exists | Check if key exists |
expire | Set key expiration |
keys | Find all keys matching pattern |
type | Get the type of key |
hget | Get hash field value |
hset | Set hash field value |
lpush | Push value to list head |
rpush | Push value to list tail |
sadd | Add member to set |
zadd | Add member to sorted set |
publish | Publish message to channel |
subscribe | Subscribe 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
- Install the MCP server with your Redis connection string
- Add configuration to
claude_desktop_config.json - Restart Claude Desktop
- 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
