Skip to main content

基于 nacos-sdk-python 的 Nacos MCP Server,支持多环境配置读取与 Spring Cloud 项目配置发现

Project description

nacos-mcp-py

基于 nacos-sdk-python 的 Nacos MCP Server,支持多环境配置读取与 Spring Cloud 项目配置发现。

功能

  • nacos_get_config — 按 dataId + group 读取配置内容
  • nacos_list_configs — 按 group 列出配置列表
  • nacos_discover_configs — 扫描 Spring Cloud 项目配置文件,自动发现并读取 Nacos 配置
  • nacos_list_environments — 查看已配置的环境列表

安装

pip install nacos-mcp-py
# 或
uv tool install nacos-mcp-py

配置

通过环境变量 NACOS_SERVERS 配置多环境 Nacos 连接:

export NACOS_SERVERS='{
  "test": {
    "host": "mse-xxx.mse.aliyuncs.com",
    "port": 8848,
    "namespace": "ns-id",
    "accessKey": "your-ak",
    "secretKey": "your-sk"
  }
}'

使用

作为 MCP Server 运行:

nacos-mcp-py

在 Claude Code 的 ~/.claude.json 中配置:

{
  "mcpServers": {
    "nacos-mcp-py": {
      "command": "nacos-mcp-py",
      "env": {
        "NACOS_SERVERS": "{\"test\": {\"host\": \"...\", \"port\": 8848, \"namespace\": \"...\", \"accessKey\": \"...\", \"secretKey\": \"...\"}}"
      }
    }
  }
}

然后在对话中:

  • "读取 Nacos 配置 dataId=system.properties group=financeServer"
  • "列出 financeServer 分组的所有配置"
  • "扫描这个项目目录 /path/to/project 自动发现 Nacos 配置"

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

nacos_mcp_py-0.2.0.tar.gz (153.1 kB view details)

Uploaded Source

Built Distribution

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

nacos_mcp_py-0.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file nacos_mcp_py-0.2.0.tar.gz.

File metadata

  • Download URL: nacos_mcp_py-0.2.0.tar.gz
  • Upload date:
  • Size: 153.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for nacos_mcp_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 18cecfe2d028372d3336f28a76b5076a2d5807d32ed642b814c7164e1c0159f4
MD5 8450f5b1596a8132e54660a6fac8f5b6
BLAKE2b-256 42e7223d6edac5af306984670ed20169a5eca06d51ad7322b7213f6806d85b02

See more details on using hashes here.

File details

Details for the file nacos_mcp_py-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nacos_mcp_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e793b7b74b213eb1edb22574d28f0fcd10585f967187e06d205a8299686fdbf
MD5 003a9f42d2df2ee72389863a3b5bf572
BLAKE2b-256 04407880fb7ed76a90de2598c7f6ebd3b4ddea7d83177933b50ac49ef767a410

See more details on using hashes here.

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