The Redis MCP Server is a natural language interface that allows AI agents to interact with Redis databases efficiently. It enables storing, retrieving, and searching data in Redis using natural language queries, making it ideal for AI-driven applications that need to manage structured and unstructured data.
The simplest way to install and use Redis MCP Server is through PyPI using the uvx command:
{
"mcpServers": {
"RedisMCPServer": {
"command": "uvx",
"args": [
"--from",
"redis-mcp-server@latest",
"redis-mcp-server",
"--url",
"\"redis://localhost:6379/0\""
]
}
}
}
To install the package directly for testing:
pip install redis-mcp-server
uv python install 3.14
uv sync
uv run redis-mcp-server --url redis://localhost:6379/0
You can run Redis MCP Server directly from GitHub:
# Run with Redis URI
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --url redis://localhost:6379/0
# Run with Redis URI and SSL
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --url "rediss://<USERNAME>:<PASSWORD>@<HOST>:<PORT>?ssl_cert_reqs=required&ssl_ca_certs=<PATH_TO_CERT>"
# Run with individual parameters
uvx --from git+https://github.com/redis/mcp-redis.git redis-mcp-server --host localhost --port 6379 --password mypassword
You can use the official Docker image:
docker run --rm -i -e REDIS_HOST=<redis_hostname> -e REDIS_PORT=<redis_port> -e REDIS_USERNAME=<redis_username> -e REDIS_PWD=<redis_password> mcp/redis
The Redis MCP Server accepts Redis connection URLs in the following format:
redis://user:secret@localhost:6379/0?foo=bar&qux=baz
For encrypted connections, use the rediss scheme:
rediss://user:secret@hostname:port?ssl_cert_reqs=required&ssl_ca_certs=path_to_the_certificate
Configure the server with these command-line arguments:
# Basic connection
uvx --from redis-mcp-server@latest redis-mcp-server --host localhost --port 6379 --password mypassword
# Using Redis URI
uvx --from redis-mcp-server@latest redis-mcp-server --url redis://user:pass@localhost:6379/0
Available options:
--url - Redis connection URI--host - Redis hostname (default: 127.0.0.1)--port - Redis port (default: 6379)--db - Redis database number (default: 0)--username - Redis username--password - Redis password--ssl - Enable SSL connection--ssl-ca-path - Path to CA certificate file--ssl-keyfile - Path to SSL key file--ssl-certfile - Path to SSL certificate file--ssl-cert-reqs - SSL certificate requirements--ssl-ca-certs - Path to CA certificates file--cluster-mode - Enable Redis cluster modeYou can also configure the server using environment variables:
| Name | Description | Default Value |
|---|---|---|
REDIS_HOST |
Redis IP or hostname | "127.0.0.1" |
REDIS_PORT |
Redis port | 6379 |
REDIS_DB |
Database | 0 |
REDIS_USERNAME |
Default database username | "default" |
REDIS_PWD |
Default database password | "" |
REDIS_SSL |
Enables or disables SSL/TLS | False |
REDIS_SSL_CA_PATH |
CA certificate for verifying server | None |
REDIS_SSL_KEYFILE |
Client's private key file | None |
REDIS_SSL_CERTFILE |
Client's certificate file | None |
REDIS_SSL_CERT_REQS |
Whether to verify the server's certificate | "required" |
REDIS_SSL_CA_CERTS |
Path to trusted CA certificates | None |
REDIS_CLUSTER_MODE |
Enable Redis Cluster mode | False |
Redis MCP Server supports EntraID (Azure Active Directory) authentication:
Service Principal Authentication:
export REDIS_ENTRAID_AUTH_FLOW=service_principal
export REDIS_ENTRAID_CLIENT_ID=your-client-id
export REDIS_ENTRAID_CLIENT_SECRET=your-client-secret
export REDIS_ENTRAID_TENANT_ID=your-tenant-id
Managed Identity Authentication:
# System-assigned managed identity
export REDIS_ENTRAID_AUTH_FLOW=managed_identity
export REDIS_ENTRAID_IDENTITY_TYPE=system_assigned
# User-assigned managed identity
export REDIS_ENTRAID_AUTH_FLOW=managed_identity
export REDIS_ENTRAID_IDENTITY_TYPE=user_assigned
export REDIS_ENTRAID_USER_ASSIGNED_CLIENT_ID=your-identity-client-id
Default Azure Credential:
export REDIS_ENTRAID_AUTH_FLOW=default_credential
export REDIS_ENTRAID_SCOPES=https://redis.azure.com/.default
Control logging verbosity with the MCP_REDIS_LOG_LEVEL environment variable:
# See normal lifecycle messages
MCP_REDIS_LOG_LEVEL=INFO uv run src/main.py
# Very verbose for debugging
MCP_REDIS_LOG_LEVEL=DEBUG uvx --from redis-mcp-server@latest redis-mcp-server --url redis://localhost:6379/0
pip install openai-agents
export OPENAI_API_KEY="<openai_token>"
python3.14 redis_assistant.py
Use Easy MCP or manually configure with:
{
"mcpServers": {
"Redis MCP Server": {
"command": "uvx",
"args": [
"--from",
"redis-mcp-server@latest",
"redis-mcp-server",
"--url",
"redis://localhost:6379/0"
]
}
}
}
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"redis-mcp-server": {
"type": "stdio",
"command": "/path/to/.local/bin/uvx",
"args": [
"--from", "redis-mcp-server@latest",
"redis-mcp-server",
"--url", "redis://localhost:6379/0"
]
}
}
}
Enable agent mode and configure mcp.json:
"servers": {
"redis": {
"type": "stdio",
"command": "uvx",
"args": [
"--from", "redis-mcp-server@latest",
"redis-mcp-server",
"--url", "redis://localhost:6379/0"
]
}
}
The Redis MCP Server provides these tools to work with Redis data:
Use the MCP Inspector for visual debugging:
npx @modelcontextprotocol/inspector uv run src/main.py
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "redis" '{"command":"uv","args":["--directory","<your_mcp_server_directory>","run","src/main.py"],"env":{"REDIS_HOST":"<your_redis_database_hostname>","REDIS_PORT":"<your_redis_database_port>","REDIS_USERNAME":"<your_redis_database_username>","REDIS_PWD":"<your_redis_database_password>"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"redis": {
"command": "uv",
"args": [
"--directory",
"<your_mcp_server_directory>",
"run",
"src/main.py"
],
"env": {
"REDIS_HOST": "<your_redis_database_hostname>",
"REDIS_PORT": "<your_redis_database_port>",
"REDIS_USERNAME": "<your_redis_database_username>",
"REDIS_PWD": "<your_redis_database_password>"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"redis": {
"command": "uv",
"args": [
"--directory",
"<your_mcp_server_directory>",
"run",
"src/main.py"
],
"env": {
"REDIS_HOST": "<your_redis_database_hostname>",
"REDIS_PORT": "<your_redis_database_port>",
"REDIS_USERNAME": "<your_redis_database_username>",
"REDIS_PWD": "<your_redis_database_password>"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect