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
Available Tools
Tool | Type | Description | Input Schema |
hmset | Hash Command | Set multiple hash fields to multiple values |
: string (Hash key)
: object (Field-value pairs to set) |
hget | Hash Command | Get the value of a hash field |
: string (Hash key)
: string (Field to get) |
hgetall | Hash Command | Get all fields and values in a hash |
: string (Hash key) |
scan | Key Command | Scan Redis keys matching a pattern |
: string (Pattern to match, e.g., "user:*")
: number, optional (Number of keys to return) |
set | String Command | Set string value with optional NX and PX options |
: string (Key to set)
: string (Value to set)
: boolean, optional (Only set if not exists)
: number, optional (Expiry in milliseconds) |
get | String Command | Get string value |
: string (Key to get) |
del | Key Command | Delete a key |
: string (Key to delete) |
zadd | Sorted Set Command | Add one or more members to a sorted set |
: string (Sorted set key)
: array of objects with
: number and
: string |
zrange | Sorted Set Command | Return a range of members from a sorted set by index |
: string (Sorted set key)
: number (Start index)
: number (Stop index)
: boolean, optional (Include scores in output) |
zrangebyscore | Sorted Set Command | Return members from a sorted set with scores between min and max |
: string (Sorted set key)
: number (Minimum score)
: number (Maximum score)
: boolean, optional (Include scores in output) |
zrem | Sorted Set Command | Remove one or more members from a sorted set |
: string (Sorted set key)
: array of strings (Members to remove) |
sadd | Set Command | Add one or more members to a set |
: string (Set key)
: array of strings (Members to add to the set) |
smembers | Set Command | Get all members in a set |
: string (Set key) |
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:
License
Related MCP Servers
- AsecurityAlicenseAqualityA powerful Model Context Protocol (MCP) tool for exploring and managing different types of databases including PostgreSQL, MySQL, and Firestore.Last updated -95MIT License
- AsecurityFlicenseAqualityModel Context Protocol (MCP) server that integrates Redash with AI assistants like Claude, allowing them to query data, manage visualizations, and interact with dashboards through natural language.Last updated -7342
- -securityAlicense-qualityA Model Context Protocol (MCP) implementation for connecting to and working with various database systems.Last updated -419MIT License
- AsecurityAlicenseAqualityProvides sophisticated tools for interacting with PocketBase databases, enabling advanced database operations, schema management, and data manipulation through the Model Context Protocol (MCP).Last updated -24386MIT License