Redis MCP Server: Connect AI Agents to Redis
What it is: Redis's own MCP server (redis/mcp-redis), a Python package run with uv/uvx that exposes Redis's core commands — strings, hashes, lists, sets, sorted sets, and if your instance has it, vector/search operations — as MCP tools. It connects to any Redis-compatible endpoint: local, Redis Cloud, or Enterprise.
Quick answer: Run uvx redis-mcp-server with connection details supplied as environment variables (host, port, username, password), register it in your client's MCP config, and the agent can read and write keys directly. Treat write access the same way you'd treat a production database credential — scope it and use a dedicated user if your Redis deployment supports ACLs.
Why it matters for data work
Redis shows up in data workflows as a cache, a session store, a queue, and increasingly a vector index for RAG. An agent that can inspect keys directly saves you from manually running redis-cli to debug a stale cache entry or check what a queue actually contains — it can just look, and with write access it can clear a bad key or seed test data without you leaving the chat.
Install & configure
The server reads connection details from environment variables rather than command-line flags, so credentials don't end up in your shell history or config file in plaintext argv:
# Claude Code
claude mcp add redis -e REDIS_HOST=localhost -e REDIS_PORT=6379 \
-e REDIS_USERNAME=default -e REDIS_PWD=<password> -- uvx redis-mcp-server
// Claude Desktop / Cursor config
{
"mcpServers": {
"redis": {
"command": "uvx",
"args": ["redis-mcp-server"],
"env": {
"REDIS_HOST": "localhost",
"REDIS_PORT": "6379",
"REDIS_USERNAME": "default",
"REDIS_PWD": "<password>"
}
}
}
}
For Redis Cloud or Enterprise with TLS, the README also documents REDIS_SSL and a CA-cert path — check the repo for the current full variable list before you deploy, since the server has picked up new options as Redis's search and vector features matured.
Do you scope it to one database or the whole instance?
A single Redis instance can hold 16 logical databases (0–15) plus, on Enterprise/Cloud, multiple separate instances entirely. The MCP server connects to whatever REDIS_HOST/REDIS_PORT (and database index, where supported) you give it — there's no built-in key-prefix sandboxing. If you share one Redis instance across services, point the agent at a dedicated logical database or a separate instance rather than the one backing production sessions, so a bad FLUSHDB from an agent can't touch anything you care about.
How do I keep it safe?
Redis has no concept of read-only connections at the protocol level the way Postgres does, so safety here comes from access control, not a transaction wrapper. If your Redis version supports ACLs, create a user restricted to the commands and key patterns the agent actually needs (+get +hget +scan -flushall -flushdb style rules) instead of connecting as the default admin user. Never point an agent at a Redis instance backing production sessions, rate limiters, or a job queue without that kind of restriction — a single misinterpreted DEL * pattern can take a service down.
Troubleshooting
Most setup failures trace back to connectivity or auth, not the MCP layer itself:
- Connection refused: confirm Redis is actually listening on the host/port you configured, and that TLS is enabled/disabled to match the server (Redis Cloud generally requires
REDIS_SSL=true). - NOAUTH / WRONGPASS errors: the username/password env vars don't match an ACL user on the server — double-check
REDIS_USERNAMEdefaults todefaultif you haven't created ACL users. - uvx: command not found: install
uvfirst (pip install uvor the standalone installer). - Tools appear but every write silently fails: check the ACL rules on the connecting user before assuming a bug — it may simply lack permission.
Author & links
Author: Redis, Inc. (official)
Repo: github.com/redis/mcp-redis
License: MIT
Related skills
For a document/search-oriented store instead of key-value, see the Elasticsearch MCP server or MongoDB MCP server. If you need a graph model, look at the Neo4j MCP server.
← Back to MCP Servers