首页
学习
活动
专区
圈层
工具
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
首页
学习
活动
专区
圈层
工具
MCP广场
MCP广场 >详情页
REDIS-MCP-Server2025-05-210分享
github
提供对Redis数据库的访问。此服务器通过一组标准化工具,使大型语言模型(LLM)能够与Redis键值存储进行交互。
By GongRzhe
2025-05-210
github
详情内容

Redis MCP 服务器 (@gongrzhe/server-redis-mcp@1.0.0)


smithery 徽章

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

更新

62 个 Redis MCP 工具在 https://github.com/GongRzhe/REDIS-MCP-Server/tree/redis-plus

安装与使用

通过 Smithery 安装

要通过 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

    • 设置带有可选过期时间的 Redis 键值对
    • 输入:
      • key (字符串): Redis 键
      • value (字符串): 要存储的值
      • expireSeconds (数字, 可选): 过期时间(秒)
  • get

    • 从 Redis 中按键获取值
    • 输入: key (字符串): 要检索的 Redis 键
  • delete

    • 从 Redis 中删除一个或多个键
    • 输入: key (字符串 | 字符串数组): 要删除的键或键数组
  • list

    • 列出匹配模式的 Redis 键
    • 输入: pattern (字符串, 可选): 匹配键的模式(默认: *)

配置

与 Claude Desktop 一起使用

要将此服务器与 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 使用

当使用 Docker 时:

  • 对于 macOS,如果 Redis 服务器运行在主机网络上,请使用 host.docker.internal
  • 可以指定 Redis URL 作为参数,默认为 "redis://localhost:6379"
{
  "mcpServers": {
    "redis": {
      "command": "docker",
      "args": [
        "run", 
        "-i", 
        "--rm", 
        "mcp/redis", 
        "redis://host.docker.internal:6379"
      ]
    }
  }
}

开发

从源代码构建

  1. 克隆仓库
  2. 安装依赖项:
    npm install
    
  3. 构建项目:
    npm run build
    

Docker 构建

docker build -t mcp/redis .

许可证

此 MCP 服务器根据 ISC 许可证授权。有关更多详细信息,请参见项目仓库中的 LICENSE 文件。

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档