这是一个用于与 Redis 数据库交互的 Redis 模型上下文协议 (MCP) 服务器实现。该服务器通过一组标准化工具使 LLMs 能够与 Redis 键值存储进行交互。
62 个 Redis MCP 工具在 https://github.com/GongRzhe/REDIS-MCP-Server/tree/redis-plus
要通过 Smithery 自动为 Claude Desktop 安装 Redis MCP 服务器:
npx -y @smithery/cli install @gongrzhe/server-redis-mcp --client claude
# 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

或者全局安装:
# 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

set
key
(字符串): Redis 键value
(字符串): 要存储的值expireSeconds
(数字, 可选): 过期时间(秒)get
key
(字符串): 要检索的 Redis 键delete
key
(字符串 | 字符串数组): 要删除的键或键数组list
pattern
(字符串, 可选): 匹配键的模式(默认: *)要将此服务器与 Claude Desktop 应用程序一起使用,请将以下配置添加到您的 claude_desktop_config.json
文件中的 "mcpServers" 部分:
{
"mcpServers": {
"redis": {
"command": "npx",
"args": [
"@gongrzhe/server-redis-mcp@1.0.0",
"redis://localhost:6379"
]
}
}
}

或者,如果您已经安装了包,可以直接使用 node 命令:
{
"mcpServers": {
"redis": {
"command": "node",
"args": [
"path/to/build/index.js",
"redis://10.1.210.223:6379"
]
}
}
}

当使用 Docker 时:
host.docker.internal
{
"mcpServers": {
"redis": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"mcp/redis",
"redis://host.docker.internal:6379"
]
}
}
}

npm install
npm run build
docker build -t mcp/redis .
此 MCP 服务器根据 ISC 许可证授权。有关更多详细信息,请参见项目仓库中的 LICENSE 文件。