这是一个用于与Redis数据库交互的Redis模型上下文协议(MCP)服务器实现。此服务器使大型语言模型能够通过一组标准化工具与Redis键值存储进行交互。
62个Redis MCP工具在 https://github.com/GongRzhe/REDIS-MCP-Server/tree/redis-plus
要通过Smithery自动安装Redis MCP Server到Claude Desktop:
npx -y @smithery/cli install @gongrzhe/server-redis-mcp --client claude
# 使用npx指定版本(推荐)
npx @gongrzhe/server-redis-mcp@1.0.0 redis://your-redis-host:port
# 示例:
npx @gongrzhe/server-redis-mcp@1.0.0 redis://localhost:6379
或者全局安装:
# 全局安装特定版本
npm install -g @gongrzhe/server-redis-mcp@1.0.0
# 全局安装后运行
@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文件。 </中文翻译>