redis
A Model Context Protocol server that provides access to Redis databases, enabling LLMs to interact with Redis key-value stores through standardized tools.
The Redis Model Context Protocol (MCP) server facilitates interaction between language models and Redis databases. It allows for seamless integration with Redis key-value stores, providing a standardized interface for setting, retrieving, and managing data. This server is particularly useful for applications that require real-time data access and manipulation, leveraging Redis's speed and efficiency. The server supports essential operations such as setting key-value pairs, retrieving values, deleting keys, and listing keys based on patterns. It also includes robust error handling and retry mechanisms to ensure reliable connectivity and operation.
Features
- Standardized interface for Redis operations
- Supports key-value pair management with optional expiration
- Pattern-based key listing
- Exponential backoff for connection retries
- Compatible with Docker and NPX for easy deployment
MCP Tools
- set: Set a Redis key-value pair with optional expiration.
- get: Retrieve a value by key from Redis.
- delete: Delete one or more keys from Redis.
- list: List Redis keys matching a pattern.
Usage with Different Platforms
Claude Desktop
{'Docker': {'script': '\n{\n "mcpServers": {\n "redis": {\n "command": "docker",\n "args": [\n "run", \n "-i", \n "--rm", \n "mcp/redis", \n "redis://host.docker.internal:6379"]\n }\n }\n}\n'}, 'NPX': {'script': '\n{\n "mcpServers": {\n "redis": {\n "command": "npx",\n "args": [\n "-y",\n "@modelcontextprotocol/server-redis",\n "redis://localhost:6379"\n ]\n }\n }\n}\n'}}
VS Code
{'NPX': {'script': '\n{\n "mcp": {\n "inputs": [\n {\n "type": "promptString",\n "id": "redis_url",\n "description": "Redis URL (e.g. redis://localhost:6379)"\n }\n ],\n "servers": {\n "redis": {\n "command": "npx",\n "args": ["-y", "@modelcontextprotocol/server-redis"],\n "env": {\n "REDIS_URL": "${input:redis_url}"\n }\n }\n }\n }\n}\n'}, 'Docker': {'script': '\n{\n "mcp": {\n "inputs": [\n {\n "type": "promptString",\n "id": "redis_url",\n "description": "Redis URL (e.g. redis://host.docker.internal:6379)"\n }\n ],\n "servers": {\n "redis": {\n "command": "docker",\n "args": ["run", "-i", "--rm", "mcp/redis"],\n "env": {\n "REDIS_URL": "${input:redis_url}"\n }\n }\n }\n }\n}\n'}}