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

@hzkj/nacos-mcp-server

v1.0.0

Published

MCP Server for Nacos 2.x configuration and service discovery

Readme

nacos-mcp-server

基于 Model Context Protocol 的 Nacos 2.x 配置中心和服务发现 MCP 服务器,通过 stdio 与 AI 助手通信,提供只读查询和可选写入能力。

配置

通过环境变量进行配置:

| 环境变量 | 必填 | 默认值 | 说明 | |---------|------|--------|------| | NACOS_SERVER_URL | 是 | - | Nacos 服务器地址,例如 http://127.0.0.1:8848 | | NACOS_USERNAME | 否 | - | Nacos 用户名(需与 NACOS_PASSWORD 同时使用) | | NACOS_PASSWORD | 否 | - | Nacos 密码 | | NACOS_NAMESPACE_ID | 否 | - | 默认命名空间 ID | | NACOS_GROUP | 否 | DEFAULT_GROUP | 默认分组 | | NACOS_ENABLE_WRITE_TOOLS | 否 | false | 是否启用写工具,设为 true 开启 |

使用方式

Claude Code

claude_desktop_config.json 或项目 .mcp.json 中配置:

{
  "mcpServers": {
    "nacos": {
      "command": "npx",
      "args": ["nacos-mcp-server"],
      "env": {
        "NACOS_SERVER_URL": "http://devnacos.hanfatong.com:8848",
        "NACOS_USERNAME": "",
        "NACOS_PASSWORD": "",
        "NACOS_NAMESPACE_ID": ""
      }
    }
  }
}

OpenCode

opencode.json 中配置:

{
  "mcpServers": {
    "nacos": {
      "command": "npx",
      "args": ["nacos-mcp-server"],
      "env": {
        "NACOS_SERVER_URL": "http://devnacos.hanfatong.com:8848",
        "NACOS_USERNAME": "",
        "NACOS_PASSWORD": "",
        "NACOS_NAMESPACE_ID": ""
      }
    }
  }
}

工具列表

只读工具(默认启用)

| 工具 | 说明 | |------|------| | nacos_get_config | 获取指定配置内容 | | nacos_list_config_history | 列出配置变更历史 | | nacos_get_config_history_detail | 获取配置历史版本详情 | | nacos_list_services | 列出服务列表 | | nacos_get_service | 获取服务详情 | | nacos_list_instances | 获取服务实例列表 |

写工具(需 NACOS_ENABLE_WRITE_TOOLS=true

| 工具 | 说明 | |------|------| | nacos_publish_config | 发布或更新配置 | | nacos_delete_config | 删除配置 |

开发

# 安装依赖
npm install

# 构建
npm run build

# 运行测试
npm test

# 本地调试
npm run dev

# MCP Inspector 调试
npx @modelcontextprotocol/inspector node dist/index.js

兼容性

  • Nacos 2.x(优先兼容 2.4.3)
  • 不引入 Nacos 专用 SDK,直接封装 /nacos/v1/ HTTP OpenAPI

License

MIT