Skip to main content

Overview

The Redis MCP server gives AI assistants direct read/write access to a Redis database, covering the full range of Redis data structures — strings, hashes, lists, sets, sorted sets, streams, pub/sub, and (with the right modules) JSON and vector search. It’s ideal for inspecting and debugging live data, managing caches and queues, and building or testing Redis-backed features.

How to Add Redis

1

Get Your Redis Connection URL

Gather your Redis connection details - username, password, host, port. This is available from your Redis hosting provider’s dashboard (e.g. Redis Cloud, AWS ElastiCache, Upstash, or your self-hosted instance).
2

Trigger a Tool Call

Start with "How many keys are in the database?" or "Show me Redis server info" - you will be requested to provide your Redis connection details.
3

Add connection details

Add the Redis connection details in the provided dialog. Note: if your instance uses SSL (i.e the URL starts with rediss://), make sure to check the “ssl” box.

What You Can Do

Key-Value Operations

Get, set, delete, rename, scan, and expire keys with full TTL control

Hashes

Store and retrieve structured objects as field-value pairs

Lists & Queues

Push, pop, and range operations for ordered collections

Sets & Sorted Sets

Unique members, intersections, and scored leaderboards

Streams & Pub/Sub

Durable event streams and fire-and-forget messaging

Vector Search

Store vectors, create indexes, and run similarity searches (requires RediSearch)

JSON Documents

Native JSON storage with path-based get/set/delete (requires RedisJSON)

Server Info & Docs

Database stats, client list, key inspection, and built-in Redis documentation search

Use Cases

Strings & Keys

  • Set with expiry: "Set a key 'user:123:name' to 'Alice' with a 10-minute expiry"
  • Get value: "Get the value of 'user:123:name'"
  • Delete: "Delete the key 'user:123:name'"
  • Rename: "Rename the key 'temp:job' to 'jobs:completed:42'"
  • Scan: "Scan for all keys matching 'session:*'"

Hashes

  • Store object: "Store a user object with fields name, email and role in a hash at 'user:42'"
  • Get all fields: "Get all fields from the hash 'user:42'"
  • Check field: "Check if the field 'email' exists in 'user:42'"
  • Delete field: "Delete the 'role' field from the hash 'user:42'"

Lists

  • Push items: "Push 'task-1' and 'task-2' onto the list 'queue:jobs'"
  • Get all: "Get all items in the list 'queue:jobs'"
  • Pop: "Pop the first item off 'queue:jobs'"

Sets

  • Add members: "Add 'admin' and 'editor' to the set 'user:42:roles'"
  • List members: "Show all members of 'user:42:roles'"
  • Remove member: "Remove 'editor' from 'user:42:roles'"

Sorted Sets

  • Leaderboard: "Add players 'alice' (score 150) and 'bob' (score 200) to the leaderboard 'game:scores'"
  • View scores: "Show the leaderboard 'game:scores' with scores"
  • Remove member: "Remove 'alice' from 'game:scores'"

Streams

  • Add event: "Add an event to stream 'events:orders' with fields type='purchase' and amount='99.99'"
  • Read entries: "Read the last 10 entries from 'events:orders'"
  • Delete entry: "Delete entry '1775116133215-0' from 'events:orders'"

Pub/Sub

  • Publish: "Publish a message 'deployment complete' to the channel 'ops:notifications'"
  • Store vector: "Store a vector [0.1, 0.5, 0.9] in the hash 'doc:1'"
  • Create index: "Create a vector index on keys with prefix 'doc:' using cosine similarity and 1536 dimensions"
  • Similarity search: "Find the 5 most similar documents to this vector: [0.1, 0.5, 0.9, ...]"
  • Hybrid search: "Search for documents similar to this vector, but only where category is 'news'"

Server Info

  • Key count: "How many keys are in the database?"
  • Server stats: "Show me Redis server info — version, memory usage, connected clients"
  • Client list: "List all connected clients"
  • Key inspection: "What type is the key 'game:scores', and when does it expire?"
  • Documentation: "Search the Redis docs — when should I use a sorted set vs a list?"

Available Tools

Core Key Operations

String key operations — set values with optional TTL, retrieve, delete, and rename keys
Cursor-based key scanning with pattern matching — always use these instead of KEYS *
Key metadata — set expiration, check TTL, inspect type, and check existence

Hashes

Hash field operations — set one field at a time, get single/all fields, delete fields, check existence

Lists

List operations — push to head/tail, pop from head/tail, range queries, and length

Sets & Sorted Sets

Set operations — add members, list all, remove, and check membership
Sorted set operations — add with scores, range queries, remove, and rank lookups

Streams & Pub/Sub

Stream operations — add entries, read ranges, count, and delete entries
publish — Send a message to a pub/sub channel (fire-and-forget — not persisted)

JSON (requires RedisJSON module)

Native JSON document operations with JSONPath-based get, set, and delete

Vector Search (requires RediSearch module)

Index management — list indexes, inspect schema, and count indexed documents
Store and retrieve float32 vectors in hash fields

Server & Documentation

Server introspection — key count, server stats (version, memory, clients), and connected client list
search_redis_documents — Search the Redis documentation knowledge base for data type trade-offs, command behavior, and patterns

Always set TTLs — Use the expiration parameter on write operations, or call expire afterwards. Without TTLs, keys accumulate indefinitely.Use namespaced keys — Follow a prefix:type:id convention (e.g. user:profile:42) for clarity and to enable pattern-based scanning.Use scan_keys, never KEYS * — SCAN is cursor-based and non-blocking. KEYS blocks the server and should never be used in production.Hashes are one field per callhset sets a single field at a time; there is no multi-field set in this server.Pub/sub is fire-and-forget — Messages are not persisted. If no subscriber is listening, the message is lost. Use streams for durability.Streams vs lists for queuing — Streams retain messages after reading and support ordered replay; lists do not. Prefer streams for event and queue use cases.Vector float32 precision — Vectors are stored as binary float32, so values may have minor precision loss on retrieval.Module-dependent tools — Some tools require optional Redis modules:
  • json_set / json_get / json_del require RedisJSON
  • Vector search tools (create_vector_index_hash, vector_search_hash, hybrid_search, etc.) require RediSearch

Guardrails

This server is covered by the 14 universal guardrails. Server-specific guardrails are coming soon.
Configure guardrails via the Civic UI or ask the Configurator Agent: “Add guardrails to my Redis server.”