Redis MCP Server (@gongrzhe/

Redis MCP Server (@gongrzhe/

这是一个用于与Redis数据库交互的Redis模型上下文协议(MCP)服务器实现。该服务器通过一组标准化工具使LLM能够与Redis键值存储进行交互。

简介

Redis MCP 服务器允许 LLM(如 Claude)直接与 Redis 数据库交互,提供一组标准化工具来操作键值存储。

smithery 徽章

安装选项

1. 通过 Smithery 安装(推荐)

npx -y @smithery/cli install @gongrzhe/server-redis-mcp --client claude

2. 使用 npx(无需安装)

npx @gongrzhe/server-redis-mcp@1.0.20 redis://localhost:6379

3. 全局安装

npm install -g @gongrzhe/server-redis-mcp@1.0.20
@gongrzhe/server-redis-mcp redis://your-redis-host:port

配置 Claude Desktop

编辑 claude_desktop_config.json 文件,添加以下配置:

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": [
        "@gongrzhe/server-redis-mcp@1.0.20",
        "redis://localhost:6379"
      ]
    }
  }
}

核心功能

Redis MCP 服务器提供以下工具:

工具描述参数
set设置键值对key, value, expireSeconds(可选)
get获取键的值key
delete删除键key (字符串或数组)
list列出匹配的键pattern (默认:*)

Docker 支持

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

注意:macOS 上使用 Docker 时,如果 Redis 运行在主机上,请使用 host.docker.internal

更多资源