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

@yidun/sentinel-mcp-server

v1.0.1

Published

Sentinel MCP Server - Model Context Protocol server for querying Sentinel rules from ZooKeeper

Readme

Sentinel MCP Server

Sentinel MCP Server 是一个 Model Context Protocol (MCP) 服务器,用于从 ZooKeeper 查询 Sentinel 限流、熔断规则,供 AI 工具使用。

功能特性

  • 查询限流规则 (FlowRule)
  • 查询熔断降级规则 (DegradeRule)
  • 查询热点参数限流规则 (ParamFlowRule)
  • 查询授权规则 (AuthorityRule)
  • 列出所有已配置规则的应用

ZooKeeper 路径规则

基于易盾 Sentinel 的 ZooKeeper 存储规范:

| 规则类型 | ZK 路径 | |----------|---------| | 限流规则 | /sentinel_rule_config/{app}/flowRules | | 熔断规则 | /sentinel_rule_config/{app}/degradeRules | | 热点参数限流 | /sentinel_rule_config/{app}/paramFlowRules | | 授权规则 | /sentinel_rule_config/{app}/authorityRules |

安装

npm install @yidun/sentinel-mcp-server

配置

Claude Desktop 配置

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "sentinel": {
      "command": "node",
      "args": ["/path/to/sentinel-mcp-server/dist/index.js"]
    }
  }
}

网络要求

MCP Server 需要能够访问 ZooKeeper。如果 ZooKeeper 在内网,可以通过以下方式解决:

  1. VPN 连接 - 连接到公司 VPN
  2. SSH 隧道 - ssh -L 2181:zk-server:2181 jump-server

可用工具

get_flow_rules

获取指定应用的限流规则。

参数:

  • zkAddress (必需): ZooKeeper 地址,如 127.0.0.1:2181
  • appName (必需): 应用名称

示例:

获取 my-app 的限流规则,ZK 地址是 localhost:2181

get_degrade_rules

获取指定应用的熔断降级规则。

参数:

  • zkAddress (必需): ZooKeeper 地址
  • appName (必需): 应用名称

get_param_flow_rules

获取指定应用的热点参数限流规则。

参数:

  • zkAddress (必需): ZooKeeper 地址
  • appName (必需): 应用名称

get_authority_rules

获取指定应用的授权规则。

参数:

  • zkAddress (必需): ZooKeeper 地址
  • appName (必需): 应用名称

get_all_sentinel_rules

获取指定应用的所有 Sentinel 规则。

参数:

  • zkAddress (必需): ZooKeeper 地址
  • appName (必需): 应用名称

list_sentinel_apps

列出 ZooKeeper 中已配置 Sentinel 规则的所有应用。

参数:

  • zkAddress (必需): ZooKeeper 地址

开发

# 安装依赖
npm install

# 开发模式运行
npm run dev

# 构建
npm run build

# 运行测试
npm test

规则类型说明

FlowRule (限流规则)

| 字段 | 说明 | |------|------| | resource | 资源名称 | | grade | 阈值类型:0-线程数,1-QPS | | count | 阈值 | | strategy | 流控模式:0-直接,1-关联,2-链路 | | controlBehavior | 流控效果:0-快速失败,1-Warm Up,2-排队等待 |

DegradeRule (熔断规则)

| 字段 | 说明 | |------|------| | resource | 资源名称 | | grade | 熔断策略:0-慢调用比例,1-异常比例,2-异常数 | | count | 阈值 | | timeWindow | 熔断时长(秒) | | minRequestAmount | 最小请求数 |

License

MIT