Skip to main content

MCP Server for Nacos configuration management

Project description

jewei-mcp-nacos

Nacos MCP Server - 让 AI 助手能够查询和管理 Nacos 配置。

支持 Nacos 3.x 版本。

快速开始

Claude Code

在项目 .mcp.json 或全局 ~/.claude.json 中添加:

{
  "mcpServers": {
    "nacos": {
      "type": "stdio",
      "command": "uvx",
      "args": ["jewei-mcp-nacos"],
      "env": {
        "NACOS_HOST": "localhost",
        "NACOS_API_PORT": "8848",
        "NACOS_CONSOLE_PORT": "8080",
        "NACOS_USERNAME": "nacos",
        "NACOS_PASSWORD": "your-password",
        "NACOS_NAMESPACE": "dev"
      }
    }
  }
}

Cursor

~/.cursor/mcp.json 中添加:

{
  "mcpServers": {
    "nacos": {
      "command": "uvx",
      "args": ["jewei-mcp-nacos"],
      "env": {
        "NACOS_HOST": "localhost",
        "NACOS_API_PORT": "8848",
        "NACOS_CONSOLE_PORT": "8080",
        "NACOS_USERNAME": "nacos",
        "NACOS_PASSWORD": "your-password"
      }
    }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json 中添加:

{
  "mcpServers": {
    "nacos": {
      "command": "uvx",
      "args": ["jewei-mcp-nacos"],
      "env": {
        "NACOS_HOST": "localhost",
        "NACOS_API_PORT": "8848",
        "NACOS_CONSOLE_PORT": "8080"
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "nacos": {
      "command": "uvx",
      "args": ["jewei-mcp-nacos"],
      "env": {
        "NACOS_HOST": "localhost",
        "NACOS_API_PORT": "8848",
        "NACOS_CONSOLE_PORT": "8080",
        "NACOS_USERNAME": "nacos",
        "NACOS_PASSWORD": "your-password"
      }
    }
  }
}

环境变量

变量 说明 默认值
NACOS_HOST Nacos 服务地址 localhost
NACOS_API_PORT API 端口(用于登录) 8848
NACOS_CONSOLE_PORT Console 端口(用于配置操作) 8080
NACOS_USERNAME 用户名(可选) -
NACOS_PASSWORD 密码(可选) -
NACOS_NAMESPACE 默认命名空间 ID public
NACOS_READ_ONLY 只读模式,禁用发布功能 false

可用工具

工具 说明
nacos_get_config 获取配置内容
nacos_publish_config 发布/更新配置(只读模式下不可用)

提示示例

配置好后,你可以这样和 AI 对话:

查询配置:

帮我获取 Nacos 中 dataId 为 "application.yaml" 的配置
查看 nacos 里 user-service.yml 的配置内容,namespace 是 dev
获取 gateway 的配置,分组是 PROD_GROUP

发布配置:

把下面这段配置发布到 Nacos,dataId 是 "redis.yaml":
server:
  port: 6379
更新 user-service 的配置,把数据库端口改成 3307

只读模式

设置 NACOS_READ_ONLY=true 可以禁用发布功能,只允许查询配置。适合生产环境使用。

{
  "env": {
    "NACOS_READ_ONLY": "true"
  }
}

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jewei_mcp_nacos-0.1.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jewei_mcp_nacos-0.1.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file jewei_mcp_nacos-0.1.2.tar.gz.

File metadata

  • Download URL: jewei_mcp_nacos-0.1.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jewei_mcp_nacos-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f732ca7acce230a6e4c5b39f558c5526c995db7a3f5a4a1ac29a0638d71c60f9
MD5 81b348a21c97212a42567953ba88b95f
BLAKE2b-256 748a9095df495388b3f14475309050d8c5f760af490c8e974bf4fc0bb2c119ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for jewei_mcp_nacos-0.1.2.tar.gz:

Publisher: publish.yml on jeweis/jewei-mcp-nacos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jewei_mcp_nacos-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jewei_mcp_nacos-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2d50a112f6010e5dbc4b4e4d90d29c0d1fe762c078444bc02212e8cb56f996
MD5 b1fcca3ede3166bdfdcf59a3878a9a57
BLAKE2b-256 efb5bfe6eb89234a988e3fcd229fba6126cd73912bf83c3ea0a215cd20240524

See more details on using hashes here.

Provenance

The following attestation bundles were made for jewei_mcp_nacos-0.1.2-py3-none-any.whl:

Publisher: publish.yml on jeweis/jewei-mcp-nacos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page