The Redis MCP Server is a Model Content Protocol (MCP) server developed by Redis Labs. It provides a natural language interface for AI agent applications, enabling them to efficiently manage and search data within Redis. This project seamlessly integrates with MCP clients, supporting AI-driven workflows to interact with structured and unstructured data in Redis.
Project Repository: https://github.com/redis/mcp-redis
Supports all major Redis data structures:
# Clone the repository
git clone https://github.com/redis/mcp-redis.git
cd mcp-redis
# Install dependencies using uv
uv venv
source .venv/bin/activate
uv sync
Variable Name | Description | Default Value |
---|---|---|
REDIS_HOST |
Redis IP or hostname | "127.0.0.1" |
REDIS_PORT |
Redis port | 6379 |
REDIS_USERNAME |
Database username | "default" |
REDIS_PWD |
Database password | "" |
REDIS_SSL |
Enable/disable SSL/TLS | False |
REDIS_CA_PATH |
CA certificate path | None |
REDIS_SSL_KEYFILE |
Client private key file | None |
REDIS_SSL_CERTFILE |
Client certificate file | None |
REDIS_CERT_REQS |
Whether to verify server certificate | "required" |
REDIS_CA_CERTS |
Path to trusted CA certificate file | None |
REDIS_CLUSTER_MODE |
Enable Redis cluster mode | False |
MCP_TRANSPORT |
Transport protocol (stdio/sse) | stdio |
# Using stdio transport
uv run src/main.py
# Set SSE transport
export MCP_TRANSPORT="sse"
uv run src/main.py
# Test the server
curl -i http://127.0.0.1:8000/sse
# Build the image
docker build -t mcp-redis .
# Run the container
docker run --rm --name redis-mcp-server -i \
-e REDIS_HOST=<redis_hostname> \
-e REDIS_PORT=<redis_port> \
-e REDIS_USERNAME=<redis_username> \
-e REDIS_PWD=<redis_password> \
mcp-redis
Edit the claude_desktop_config.json
file:
{
"mcpServers": {
"redis": {
"command": "<full path to uv command>",
"args": [
"--directory",
"<MCP server directory>",
"run",
"src/main.py"
],
"env": {
"REDIS_HOST": "<Redis hostname>",
"REDIS_PORT": "<Redis port>",
"REDIS_PWD": "<Redis password>",
"REDIS_SSL": true,
"REDIS_CA_PATH": "<CA certificate path>"
}
}
}
}
Enable proxy mode and configure mcp.json
:
{
"servers": {
"redis": {
"type": "stdio",
"command": "<full path to uv command>",
"args": [
"--directory",
"<MCP server directory>",
"run",
"src/main.py"
],
"env": {
"REDIS_HOST": "<Redis hostname>",
"REDIS_PORT": "<Redis port>",
"REDIS_USERNAME": "<Redis username>",
"REDIS_PWD": "<Redis password>"
}
}
}
}
# Install the SDK
pip install openai-agents
# Configure the API key
export OPENAI_API_KEY="<openai_token>"
# Run the application
python3.13 redis_assistant.py
# Use Smithery to automatically configure Claude Desktop
npx -y @smithery/cli install @redis/mcp-redis --client claude
# Visual debugging
npx @modelcontextprotocol/inspector uv run src/main.py
# Monitor Claude logs
tail -f ~/Library/Logs/Claude/mcp-server-redis.log
You can troubleshoot agent workflows through the OpenAI dashboard.
feature-branch
).The Redis MCP Server is a powerful tool that bridges the gap between AI agents and Redis databases, enabling AI applications to manage and query data more intelligently through a natural language interface. Whether building intelligent assistants, chatbots, or performing real-time data analysis, this project provides a reliable and efficient solution.
Its modular design, rich support for Redis data structures, and multiple deployment methods make it suitable for a wide range of scenarios, from small projects to enterprise-level applications. Through integration with major platforms such as Claude, VS Code, and OpenAI, developers can easily incorporate the power of Redis into their AI-driven applications.