modelcontextprotocol/server-redis
Free官方参考实现,与 Redis 键值存储进行交互。
FreeFree tier
About modelcontextprotocol/server-redis
A Model Context Protocol server that enables LLMs to interact with Redis key-value stores through a set of standardized tools. It provides basic CRUD operations: set (with optional expiration), get, delete (single or multiple keys), and list (pattern-based key listing). The server includes connection retry logic with exponential backoff, supports Docker deployment and npx execution, and is designed for use with Claude Desktop and VS Code MCP integrations.
Key Features
Set Redis key-value pairs with optional expiration time
Get value by key from Redis
Delete one or more keys from Redis
List Redis keys matching a pattern (default: *)
Connection retry with exponential backoff (max 5 retries, initial 1s delay, max 30s)
Runs as Docker container or via npx
Pros & Cons
Pros
- Simple, focused tool set for essential Redis operations
- Supports optional key expiration for time-sensitive data
- Robust reconnection logic prevents infinite loops
- Lightweight deployment options: Docker or npx
- Free and open source under the Model Context Protocol project
Cons
- Repository archived as of May 2025 (no longer actively maintained)
- Limited to basic key-value operations; no support for Redis data structures (e.g., lists, sets, hashes, streams)
- Requires a running Redis server (separate setup needed)
- Windows users need WSL or Memurai; no native Windows Redis support
Best For
Enable LLMs to read and write cached data in RedisManage session state and temporary data for AI agent workflowsStore and retrieve application configuration or user preferences via natural languageRapidly prototype Redis-backed applications using conversational interfaces
FAQ
What should I do if I get an ECONNREFUSED error?
Ensure the Redis server is running and reachable. For Linux, use `systemctl status redis`; for macOS, `brew services list`; for Windows, check Memurai in Services (services.msc). Also verify the correct port (default 6379) is not blocked by a firewall. If `redis://localhost:6379` fails, try `redis://127.0.0.1:6379`.
How do I configure this server with Claude Desktop?
Add the server configuration to the "mcpServers" section of your `claude_desktop_config.json`. Use either Docker (with host.docker.internal for macOS) or npx. A sample Docker config: `{"command": "docker", "args": ["run", "-i", "--rm", "mcp/redis", "redis://host.docker.internal:6379"]}`. An npx config: `{"command": "npx", "args": ["-y", "@modelcontextprotocol/server-redis", "redis://localhost:6379"]}`.
Can I use this server with VS Code?
Yes. For a one-click install, use the provided install buttons. For manual setup, add a JSON block to your User Settings (JSON) file (accessible via Ctrl+Shift+P and selecting "Preferences: Open User Settings (JSON)") or to a `.vscode/mcp.json` file in your workspace. The `mcp` key is not needed in `.vscode/mcp.json`.