npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chenyingxian/redis-mcp

v0.1.1

Published

A Redis Model Context Protocol server supporting standalone, Sentinel, Cluster, TLS, and Unix socket deployments.

Readme

redis-mcp

Redis MCP 服务,支持 standalone、代理入口、Sentinel、Cluster、TLS 和 Unix socket 等 Redis 架构,用于安全读取和受控操作 Redis 数据。

该包面向需要访问 Redis 的 MCP 客户端。连接信息可以通过环境变量传入,也可以通过 JSON 配置文件传入,配置文件支持多个工作区和多个 Redis 源。源码和 npm 包中不包含真实账号、主机、密码、token 或个人本机路径。

文档

安装

npm install -g @chenyingxian/redis-mcp

也可以不全局安装,直接使用:

npx @chenyingxian/redis-mcp

快速配置

Standalone Redis 或 Redis 代理入口:

REDIS_MCP_MODE=standalone
REDIS_URL=redis://localhost:6379/0
REDIS_MCP_READ_ONLY=true
REDIS_MCP_MAX_SCAN_COUNT=100
REDIS_MCP_MAX_RESULT_BYTES=1048576

MCP 客户端配置示例:

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": ["-y", "@chenyingxian/redis-mcp@latest"],
      "env": {
        "REDIS_MCP_MODE": "standalone",
        "REDIS_URL": "redis://localhost:6379/0",
        "REDIS_MCP_READ_ONLY": "true"
      }
    }
  }
}

配置文件维护工具默认只读。只有在需要 MCP 客户端新增、更新、删除或切换 Redis 源时,才设置 REDIS_MCP_ALLOW_CONFIG_MUTATION=true

Sentinel、Cluster、TLS、Unix socket 和安全控制配置见 CONFIG.zh-CN.md

多个 Redis 源可以通过 REDIS_MCP_CONFIG_FILE 指向 JSON 配置文件:

{
  "mcpServers": {
    "redis": {
      "command": "npx",
      "args": ["-y", "@chenyingxian/redis-mcp@latest"],
      "env": {
        "REDIS_MCP_CONFIG_FILE": "/path/to/redis-mcp.config.json"
      }
    }
  }
}

工具

  • redis_ping:检查 Redis 连接。
  • redis_list_sources:列出已配置的 Redis 工作区和源。
  • redis_config_read:读取脱敏后的配置文件内容。
  • redis_config_upsert_source:新增或更新一个 Redis 源配置。
  • redis_config_remove_source:删除一个 Redis 源配置。
  • redis_config_set_default:设置某个工作区的默认源。
  • redis_get:读取字符串值。
  • redis_set:写入字符串值,可设置过期时间。
  • redis_delete:删除一个或多个 key。
  • redis_exists:检查 key 是否存在。
  • redis_expire:设置 key 过期时间。
  • redis_ttl:读取 key TTL。
  • redis_type:读取 key 类型。
  • redis_scan:按 pattern 扫描 key。
  • redis_hgetall:读取 hash 全部字段。
  • redis_hset:写入 hash 字段。
  • redis_lrange:读取 list 范围。
  • redis_smembers:读取 set 成员。
  • redis_zrange:读取 sorted set 范围。
  • redis_info:读取 Redis INFO,支持原始文本或解析后的 JSON。
  • redis_command:执行允许的 Redis 命令。

参数和行为说明见 MCP_TOOLS.zh-CN.md

安全说明

  • 只需要查询时,建议设置 REDIS_MCP_READ_ONLY=true
  • Redis 支持 ACL 时,建议使用最小权限账号。
  • 不要发布真实 .env 文件、内部主机、用户名、密码、token 或私有连接串。
  • FLUSHALLFLUSHDBCONFIGSHUTDOWNMODULEDEBUG 等危险管理命令默认禁止。
  • 可以使用 REDIS_MCP_KEY_PREFIX 限制 key 操作范围。