The Redis MCP Server provides a Model Context Protocol interface for interacting with a Redis database, enabling operations across multiple data types:
Hash operations: Set multiple fields (
hmset), get a specific field (hget), or retrieve all fields and values (hgetall)Key operations: Scan keys matching a pattern (
scan) and delete keys (del)String operations: Set values with optional NX/PX conditions (
set) and retrieve values (get)Sorted set operations: Add members with scores (
zadd), get ranges by index (zrange) or score (zrangebyscore), and remove members (zrem)Set operations: Add members (
sadd) and retrieve all members (smembers)
Provides access to Redis database operations through a Model Context Protocol (MCP) server. Includes tools for various Redis commands such as HMSET, HGET, HGETALL, SCAN, SET, GET, DEL, ZADD, ZRANGE, ZRANGEBYSCORE, ZREM, SADD, and SMEMBERS.
Redis MCP Server
A Model Context Protocol (MCP) server that provides access to Redis database operations.
Project Structure
Related MCP server: Redash MCP Server
Available Tools
Tool | Type | Description | Input Schema |
hmset | Hash Command | Set multiple hash fields to multiple values |
|
hget | Hash Command | Get the value of a hash field |
|
hgetall | Hash Command | Get all fields and values in a hash |
|
scan | Key Command | Scan Redis keys matching a pattern |
|
set | String Command | Set string value with optional NX and PX options |
|
get | String Command | Get string value |
|
del | Key Command | Delete a key |
|
zadd | Sorted Set Command | Add one or more members to a sorted set |
|
zrange | Sorted Set Command | Return a range of members from a sorted set by index |
|
zrangebyscore | Sorted Set Command | Return members from a sorted set with scores between min and max |
|
zrem | Sorted Set Command | Remove one or more members from a sorted set |
|
sadd | Set Command | Add one or more members to a set |
|
smembers | Set Command | Get all members in a set |
|
Usage
Configure in your MCP client (e.g., Claude Desktop, Cline):
Command Line Arguments
--redis-host: Redis server host (default: localhost)--redis-port: Redis server port (default: 6379)
Installing via Smithery
To install Redis Server for Claude Desktop automatically via Smithery:
Development
To add a new Redis tool:
Create a new tool class in
src/tools/extendingRedisToolDefine the tool's interface in
src/interfaces/types.tsRegister the tool in
src/tools/tool_registry.ts
Example tool implementation:
Running evals
The evals package loads an mcp client that then runs the index.ts file, so there is no need to rebuild between tests. You can load environment variables by prefixing the npx command. Full documentation can be found here.