Skip to main content

How to Set Up the Redis MCP Server (2026)

Updated July 13, 2026Web MCP Guide

The Redis MCP server connects Claude, Cursor, or VS Code straight to a Redis instance using a standard connection string. Once configured, your AI assistant can inspect keys, read data structures, run commands, and query vector search indexes — no separate Redis client code needed.

Prerequisites

Step 1 — Gather Your Redis Connection Details

You need either a single connection string or the individual host, port, and auth pieces. For Redis Cloud, both are visible on your database's details page. For a local instance, the default is localhost:6379 with no password unless you set one.

redis://default:YOUR_PASSWORD@your-host.redis.cloud:12345

If your password contains special characters like @ or :, URL-encode them or use the split environment variables instead of a single connection string.

⚠️ Use a scoped, read-only user for production

The MCP server can run whatever commands your credentials allow, including writes and deletes. Against a production database, create a Redis ACL user restricted to read-only commands and only the key patterns the assistant actually needs, rather than connecting with full admin credentials.

Step 2 — Install the Redis MCP Server

Redis maintains an open-source MCP server (redis/mcp-redis) that can be run without a separate install step using uvx:

uvx --from redis-mcp-server redis-mcp-server

Check the official GitHub repository for the exact package name and installation flags — MCP server packaging changes periodically, and some clients prefer a pip-installed version over uvx.

Step 3 — Configure Your MCP Client

Add the server to your client config, passing connection details as environment variables. Replace the placeholders with your actual Redis credentials.

Claude Desktop

Config: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": ["--from", "redis-mcp-server", "redis-mcp-server"],
      "env": {
        "REDIS_HOST": "your-host.redis.cloud",
        "REDIS_PORT": "12345",
        "REDIS_USERNAME": "default",
        "REDIS_PASSWORD": "YOUR_PASSWORD",
        "REDIS_SSL": "true"
      }
    }
  }
}

Cursor IDE

Config: ~/.cursor/mcp.json

{
  "mcpServers": {
    "redis": {
      "command": "uvx",
      "args": ["--from", "redis-mcp-server", "redis-mcp-server"],
      "env": {
        "REDIS_URL": "redis://default:YOUR_PASSWORD@your-host.redis.cloud:12345"
      }
    }
  }
}

Restart your MCP client after saving. Redis should appear in your available tools list.

Step 4 — Test the Connection

Try a query in your client's chat:

"List the first 20 keys in Redis matching the pattern session:*"

A real list of matching keys confirms the connection is working. If you get a connection error, verify the host, port, and credentials with redis-cli -h HOST -p PORT -a PASSWORD ping before troubleshooting the MCP config further.

What You Can Do With the Redis MCP Server

If your stack also uses Redis alongside cloud file storage, the filesystem MCP server guide covers giving your assistant safe, scoped access to local files as well.

Troubleshooting

ProblemLikely CauseFix
Connection refusedWrong host/port, or firewall blocking accessVerify with redis-cli first; check security group/firewall rules
Authentication failedWrong password, or unencoded special characters in REDIS_URLURL-encode the password or switch to split env vars
TLS/SSL handshake errorREDIS_SSL not set for a TLS-required instanceSet REDIS_SSL to true for Redis Cloud and most managed instances
Vector search tools return nothingRediSearch module not enabled on this instanceUse Redis Stack or a Redis Cloud plan with search enabled

Frequently Asked Questions

Is there an official Redis MCP server?

Yes. Redis maintains an open-source MCP server (redis/mcp-redis) that connects an AI client directly to a Redis instance. It exposes tools for running commands, listing and inspecting keys, reading hashes, sets, lists, and sorted sets, checking TTLs, and querying vector indexes when the RediSearch module is enabled.

What connection details does the Redis MCP server need?

Either a full connection string (REDIS_URL, e.g. redis://user:password@host:6379) or the individual pieces split into environment variables: REDIS_HOST, REDIS_PORT, REDIS_USERNAME, REDIS_PASSWORD, and REDIS_SSL if your instance requires TLS. Redis Cloud, a local Docker container, or a self-hosted instance all work the same way as long as the server can reach the host and port.

Can the Redis MCP server write and delete data, not just read it?

It can run write commands if the credentials you provide allow it — the MCP server itself doesn't restrict command types beyond what the connecting Redis user is permitted to do. For safety, most setups should connect with a read-only or scoped ACL user rather than the default full-access account, especially against a production instance.

Does the Redis MCP server support vector search?

Yes, if your Redis instance has the RediSearch module enabled (standard on Redis Cloud and Redis Stack). The server can query vector indexes and return similarity search results, which is useful for inspecting or debugging a retrieval-augmented generation (RAG) pipeline that stores embeddings in Redis.

Why is my Redis MCP server failing to connect?

Most failures are connection issues, not MCP issues: wrong host or port, a firewall or security group blocking the connection, a password that includes special characters that need URL-encoding in REDIS_URL, or a self-signed TLS certificate rejected because REDIS_SSL wasn't set. Test the same credentials with redis-cli first to confirm the database itself is reachable before debugging the MCP layer.