Get a value from Redis by key
Set a value in Redis with optional expiry
Delete a key from Redis
Increment a numeric value in Redis
Push values to a Redis list
Get range of Redis list values
Set Redis hash fields
Get Redis hash fields
Add values to a Redis set
Get members of a Redis set
Publish a message to a Redis channel
The Redis Client MCP provides a comprehensive interface to interact with Redis servers, AWS MemoryDB, and other Redis-compatible services. It enables AI assistants to perform key-value operations, manage lists, hashes, sets, and utilize pub/sub functionality directly through Redis. This MCP is ideal for applications requiring fast in-memory data storage, caching solutions, or any use case where key-value based storage is appropriate. It handles connection management automatically and provides a rich set of tools for manipulating data in Redis.
To use the Redis Client MCP, you'll need to set up the server and configure it to connect to your Redis instance.
git clone https://github.com/prajwalnayak7/mcp-server-redis.git
cd mcp-server-redis
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv sync
.env
file based on the provided .env.example
:REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD= # If required
REDIS_SSL=false # Set to true for SSL connections
python src/server.py
Add the following configuration to your AI assistant's settings:
"mcpServers": {
"redis-client": {
"command": "python",
"args": [
"PATH_TO_REPO/mcp-server-redis/src/server.py"
]
}
}
Replace PATH_TO_REPO
with the actual path to where you cloned the repository.
The MCP can also be run using Docker:
docker build -t redis-mcp-server .
docker run -p 8000:8000 -e REDIS_HOST=your-redis-host -e REDIS_PORT=6379 redis-mcp-server
Once the MCP is running and connected to your AI assistant, you can interact with Redis through natural language. The MCP provides resources for checking connection status and tools for manipulating data.
Checking connection status:
User: What's the current Redis connection status?
AI: Let me check the Redis connection status for you.
[Reading resource redis://status]
The Redis server is currently connected and running on localhost:6379, database 0.
Storing data:
User: Can you store my name "Alice" in Redis?
AI: I'll help you store your name in Redis.
[Calling set_value with key="name" value="Alice"]
Successfully set key 'name'
Retrieving data:
User: What's the value of the "name" key?
AI: Let me retrieve that for you.
[Calling get_value with key="name"]
The value for key "name" is "Alice".
The MCP provides several resources for interacting with Redis:
redis://status
- Shows the current connection statusredis://info
- Provides detailed Redis server informationredis://keys/{pattern}
- Lists keys matching a specified patternThese resources can be accessed directly by the AI assistant to gather information about the Redis server and its data.