redis
A Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
A Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
A Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
ECONNREFUSED
- Cause: Redis server is not running or unreachable
- Solution:
- Verify Redis is running: redis-cli ping
should return "PONG"
- Check Redis service status: systemctl status redis
(Linux) or brew services list
(macOS)
- Ensure correct port (default 6379) is not blocked by firewall
- Verify Redis URL format: redis://hostname:port
Input:
key
(string): Redis keyvalue
(string): Value to storeexpireSeconds
(number, optional): Expiration time in secondsget
Input: key
(string): Redis key to retrieve
delete
Input: key
(string | string[]): Key or array of keys to delete
list
pattern
(string, optional): Pattern to match keys (default: *)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": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/redis",
"redis://host.docker.internal:6379"]
}
}
}
{
"mcpServers": {
"redis": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-redis",
"redis://localhost:6379"
]
}
}
}
Docker:
docker build -t mcp/redis -f src/redis/Dockerfile .
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
[
{
"description": "Set multiple hash fields to multiple values",
"inputSchema": {
"properties": {
"fields": {
"description": "Field-value pairs to set (格式示例:"field1 value1 field2 value2")",
"type": "string"
},
"key": {
"description": "Hash key",
"type": "string"
}
},
"required": [
"fields",
"key"
],
"type": "object"
},
"name": "hmset"
},
{
"description": "Get the value of a hash field",
"inputSchema": {
"properties": {
"field": {
"description": "Field to get",
"type": "string"
},
"key": {
"description": "Hash key",
"type": "string"
}
},
"required": [
"field",
"key"
],
"type": "object"
},
"name": "hget"
},
{
"description": "Get all the fields and values in a hash",
"inputSchema": {
"properties": {
"key": {
"description": "Hash key",
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
},
"name": "hgetall"
},
{
"description": "Scan Redis keys matching a pattern",
"inputSchema": {
"properties": {
"count": {
"description": "Number of keys to return per iteration (optional)",
"type": "integer"
},
"pattern": {
"description": "Pattern to match (e.g., "user:*" or "schedule:*")",
"type": "string"
}
},
"required": [
"pattern"
],
"type": "object"
},
"name": "scan"
},
{
"description": "Set string value with optional NX (only if not exists) and PX (expiry in milliseconds) options",
"inputSchema": {
"properties": {
"key": {
"description": "Key to set",
"type": "string"
},
"nx": {
"description": "Only set if key does not exist",
"type": "boolean"
},
"px": {
"description": "Set expiry in milliseconds",
"type": "integer"
},
"value": {
"description": "Value to set",
"type": "string"
}
},
"required": [
"key",
"value"
],
"type": "object"
},
"name": "set"
},
{
"description": "Get string value",
"inputSchema": {
"properties": {
"key": {
"description": "Key to get",
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
},
"name": "get"
},
{
"description": "Delete a key",
"inputSchema": {
"properties": {
"key": {
"description": "Key to delete",
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
},
"name": "del"
},
{
"description": "Add one or more members to a sorted set",
"inputSchema": {
"properties": {
"key": {
"description": "Sorted set key",
"type": "string"
},
"members": {
"description": "Score-value pairs (格式示例:"1 member1 2 member2")",
"type": "string"
}
},
"required": [
"key",
"members"
],
"type": "object"
},
"name": "zadd"
},
{
"description": "Return a range of members from a sorted set by index",
"inputSchema": {
"properties": {
"key": {
"description": "Sorted set key",
"type": "string"
},
"start": {
"description": "Start index (0-based)",
"minimum": 0,
"type": "integer"
},
"stop": {
"description": "Stop index (inclusive)",
"minimum": 0,
"type": "integer"
},
"withScores": {
"description": "Include scores in output",
"type": "boolean"
}
},
"required": [
"key",
"start",
"stop"
],
"type": "object"
},
"name": "zrange"
},
{
"description": "Return members from a sorted set with scores between min and max",
"inputSchema": {
"properties": {
"key": {
"description": "Sorted set key",
"type": "string"
},
"max": {
"description": "Maximum score",
"type": "number"
},
"min": {
"description": "Minimum score",
"type": "number"
},
"withScores": {
"description": "Include scores in output",
"type": "boolean"
}
},
"required": [
"key",
"min",
"max"
],
"type": "object"
},
"name": "zrangebyscore"
},
{
"description": "Remove one or more members from a sorted set",
"inputSchema": {
"properties": {
"key": {
"description": "Sorted set key",
"type": "string"
},
"members": {
"description": "Members to remove (格式示例:"member1 member2")",
"type": "string"
}
},
"required": [
"key",
"members"
],
"type": "object"
},
"name": "zrem"
},
{
"description": "Add one or more members to a set",
"inputSchema": {
"properties": {
"key": {
"description": "Set key",
"type": "string"
},
"members": {
"description": "Members to add (格式示例:"member1 member2")",
"type": "string"
}
},
"required": [
"key",
"members"
],
"type": "object"
},
"name": "sadd"
},
{
"description": "Get all members in a set",
"inputSchema": {
"properties": {
"key": {
"description": "Set key",
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
},
"name": "smembers"
}
]