Connect LLMs to Redis Data
A Redis MCP server exposing four key-value tools: set, get, delete, and pattern-based list, with optional TTL.
Why it matters
Enable Large Language Models (LLMs) to interact with Redis key-value stores. This asset provides standardized tools for database operations, allowing LLMs to read, write, and manage data within Redis.
Outcomes
What it gets done
Set key-value pairs in Redis with optional expiration.
Retrieve values from Redis by key.
Delete keys from Redis.
List and search Redis keys using patterns.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-redis | bash Capabilities
Tools your agent gets
Sets a key-value pair in Redis with optional expiration time in seconds
Retrieves a value by key from Redis
Deletes one or multiple keys from Redis
Lists Redis keys matching a pattern (default: *)
Overview
Redis MCP Server
This MCP server exposes four Redis key-value tools - set, get, delete, and pattern-based list - with optional TTL on writes and batch key deletion. Use it when an LLM needs direct Redis key-value access. Not for advanced data structures like lists, sets, hashes, streams, or pub/sub.
What it does
A Redis MCP server exposing four tools for key-value operations: set stores a key-value pair with an optional expireSeconds expiration, get retrieves a value by key, delete removes one or more keys accepting either a single key or an array of keys, and list enumerates Redis keys matching a glob pattern, defaulting to *. It lets an LLM read, write, expire, and enumerate Redis keys directly through standardized MCP tools. The project's README notes that a separate redis-plus branch expands this to 62 Redis MCP tools, though this v1.0.0 package ships only the four listed above.
When to use - and when NOT to
Use it when an LLM needs direct key-value access to a Redis instance - setting, reading, deleting, or listing keys by pattern. It is not intended for advanced Redis data structures such as lists, sets, hashes, streams, or pub/sub - those would require the expanded redis-plus branch rather than this v1.0.0 package.
Capabilities
Input types are minimal and explicit: set takes key (string), value (string), and an optional expireSeconds (number); get takes only key (string); delete takes key as either a single string or a string array, so a single call can remove one key or many; list takes an optional pattern (string) defaulting to *. No tool accepts a numeric index, offset, or field name - Redis's richer per-type commands are entirely out of scope for this package.
How to install
npx @gongrzhe/server-redis-mcp@1.0.0 redis://localhost:6379
Or install via Smithery with npx -y @smithery/cli install @gongrzhe/server-redis-mcp --client claude, install it globally with npm, or build from source by cloning the repository, running npm install, and then npm run build. A Claude Desktop config looks like:
{
"mcpServers": {
"redis": {
"command": "npx",
"args": ["@gongrzhe/server-redis-mcp@1.0.0", "redis://localhost:6379"]
}
}
}
Docker is also supported - build with docker build -t mcp/redis ., then run the image with the Redis connection URL as an argument; on macOS, use host.docker.internal in place of localhost if Redis is running on the host network. The server can equally be launched with node directly against a built index.js path instead of through npx, which is useful when a specific local build needs to be pinned in the client configuration rather than resolved dynamically.
Who it's for
Developers who want an LLM to read and write Redis key-value data directly - caching lookups, session data, or simple key-value storage - without building a custom Redis client integration themselves. It's also a reasonable starting point for teams who want to run their own alternative to the official Redis Docker image (mcp/redis), since it can also be installed globally via npm and invoked as @gongrzhe/server-redis-mcp with the target Redis URL as its only argument. Licensed under the ISC License.
Source README
Redis MCP Server (@gongrzhe/server-redis-mcp@1.0.0)
A Redis Model Context Protocol (MCP) server implementation for interacting with Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Update
62 Redis MCP tools in https://github.com/GongRzhe/REDIS-MCP-Server/tree/redis-plus
Installation & Usage
Installing via Smithery
To install Redis MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @gongrzhe/server-redis-mcp --client claude
Installing Manually
# Using npx with specific version (recommended)
npx @gongrzhe/server-redis-mcp@1.0.0 redis://your-redis-host:port
# Example:
npx @gongrzhe/server-redis-mcp@1.0.0 redis://localhost:6379
Or install globally:
# Install specific version globally
npm install -g @gongrzhe/server-redis-mcp@1.0.0
# Run after global installation
@gongrzhe/server-redis-mcp redis://your-redis-host:port
Components
Tools
set
- Set a Redis key-value pair with optional expiration
- Input:
key(string): Redis keyvalue(string): Value to storeexpireSeconds(number, optional): Expiration time in seconds
get
- Get value by key from Redis
- Input:
key(string): Redis key to retrieve
delete
- Delete one or more keys from Redis
- Input:
key(string | string[]): Key or array of keys to delete
list
- List Redis keys matching a pattern
- Input:
pattern(string, optional): Pattern to match keys (default: *)
Configuration
Usage with Claude Desktop
To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:
{
"mcpServers": {
"redis": {
"command": "npx",
"args": [
"@gongrzhe/server-redis-mcp@1.0.0",
"redis://localhost:6379"
]
}
}
}
Alternatively, you can use the node command directly if you have the package installed:
{
"mcpServers": {
"redis": {
"command": "node",
"args": [
"path/to/build/index.js",
"redis://10.1.210.223:6379"
]
}
}
}
Docker Usage
When using Docker:
- For macOS, use
host.docker.internalif the Redis server is running on the host network - Redis URL can be specified as an argument, defaults to "redis://localhost:6379"
{
"mcpServers": {
"redis": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/redis",
"redis://host.docker.internal:6379"
]
}
}
}
Development
Building from Source
- Clone the repository
- Install dependencies:
npm install - Build the project:
npm run build
Docker Build
docker build -t mcp/redis .
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.