Skip to main content
Glama
Nacos MCP Server

Nacos MCP Server

Official
by nacos-group

mcp-server-nacos:Nacos MCP 服务器

概述

Nacos是一个易于使用的平台,专为动态服务发现、配置和服务管理而设计。它可以帮助您轻松构建云原生应用程序和微服务平台。

此 MCP(模型上下文协议)服务器用于 Nacos 交互和自动化。该服务器提供工具,用于通过大型语言模型搜索和读取 Nacos 集群中的namespace 、 service和configuration相关信息。

请注意, mcp-server-nacos目前处于早期开发阶段。随着我们不断开发和改进服务器,其功能和可用工具可能会有所变更和扩展。另请注意, mcp-server-nacos当前版本仅提供读取、搜索和列表操作,不支持任何写入操作。计划在未来版本中支持写入操作。

还需要注意的是, mcp-server-nacos所需的版本:

1. Nacos version required upper `3.0.0`, because of depended on the [Nacos Admin API](https://nacos.io/en/swagger/admin/) in 3.x.
2. python version required 3.x, recommend upper `3.13`.

工具

  1. list_namespaces

    • 检索当前 Nacos 集群中的命名空间列表。

    • 输入:

      • 没有任何

    • 返回:当前 Nacos 集群中的命名空间列表。

  2. list_services

    • 此工具用于获取指定命名空间下的服务列表。返回结果格式取决于withInstances参数: withInstances=true :返回包含实例的服务详情( ServiceDetailInfo对象)。withInstances withInstances=false :返回不包含实例的服务元数据( ServiceView对象)。**注意:** 当withInstances=true时,该 API 可能会占用过多的内存和网络资源。如果只想获取包含少量服务或单个服务的实例列表,建议将withInstances=false与List Service Instances一起使用。

    • 输入:

      • pageNo (数字):当前页码,默认为1。

      • pageSize (数字):每页服务的大小,默认为 100。

      • namespaceId (字符串,可选):服务的 namespaceId,如果缺失,则默认为public 。

      • groupNameParam (字符串,可选):服务的 groupName 模式,如果缺失,则默认为 null,表示所有组。

      • serviceNameParam (字符串,可选):服务的 serviceName 模式,如果缺失,则默认为 null,表示所有服务。

      • ignoreEmptyService (bool,可选):是否忽略结果中的空服务,默认为 true。

      • withInstances (bool, 可选): 结果中是否包含各个服务下的实例,推荐使用,默认为 false。

    • 返回:指定命名空间下的服务列表。

  3. get_service

    • 该工具检索指定服务的详细信息,包括元数据和集群,但不包括实例列表。

    • 输入:

      • namespaceId (字符串,可选):服务的 namespaceId,如果缺失,则默认为public 。

      • groupName (字符串,可选):服务的 groupName 模式,如果缺失,则默认为DEFAULT_GROUP 。

      • serviceName (字符串):服务的 serviceName 模式,必需。

    • 返回:指定服务的详细信息。

  4. list_service_instances

    • 此工具检索指定服务的实例列表。

    • 输入:

      • namespaceId (字符串,可选):服务的 namespaceId,如果缺失,则默认为public 。

      • groupName (字符串,可选):服务的 groupName 模式,如果缺失,则默认为DEFAULT_GROUP 。

      • serviceName (字符串):服务的 serviceName 模式,必需。

      • clusterName (字符串,可选):服务中实例的集群名称,可选,默认为 null,表示匹配所有集群。

    • 返回:指定服务的实例列表。

  5. list_service_subscribers

    • 此工具检索指定服务的订阅者列表。

    • 输入:

      • pageNo (数字):当前页码,默认为1。

      • pageSize (数字):每页服务订阅者的大小,默认为100。

      • namespaceId (字符串,可选):服务的 namespaceId,如果缺失,则默认为public 。

      • groupName (字符串,可选):服务的 groupName 模式,如果缺失,则默认为DEFAULT_GROUP 。

      • serviceName (字符串):服务的 serviceName 模式,必需。

      • aggregation (bool,可选):是否从整个集群进行聚合。

    • 返回:指定服务的订阅者列表。

  6. list_configs

    • 此工具检索指定命名空间下的配置列表。

    • 输入:

      • pageNo (数字):当前页码,默认为1。

      • pageSize (数字):每页配置的大小,默认为100。

      • namespaceId (字符串,可选):配置的 namespaceId,如果缺失,则默认为public 。

      • groupName (字符串,可选):配置的groupName模式,默认为null,表示所有组。

      • dataId (string, 可选): 配置的dataId模式,默认null表示所有dataId。

      • type (字符串,可选):配置的类型,默认为 null 表示所有类型。

      • configTags (字符串,可选):配置的标签,默认为 null 表示所有标签。

      • appName (字符串,可选):配置的appName,默认为null,表示所有appName。

      • search (字符串,可选):列表配置的搜索方式,默认为blur ,可选值accurate 。

    • 返回:指定命名空间下的配置列表。

  7. get_config

    • 检索指定配置的详细信息。

    • 输入:

      • namespaceId (字符串,可选):配置的 namespaceId,如果缺失,则默认为public 。

      • groupName (字符串):配置的组名称,必需。

      • dataId (字符串):配置的dataId,必需。

    • 返回:指定配置的详细信息。

  8. list_config_history

    • 此工具检索配置的完整发布历史记录。

    • 输入:

      • pageNo (数字):当前页码,默认为1。

      • pageSize (数字):每页配置历史记录的大小,默认为100。

      • namespaceId (字符串,可选):配置的 namespaceId,如果缺失,则默认为public 。

      • groupName (字符串):配置的组名称,必需。

      • dataId (字符串):配置的dataId,必需。

    • 返回:指定命名空间下的配置列表。

  9. get_config_history

    • 检索配置的特定历史变更记录。

    • 输入:

      • namespaceId (字符串,可选):配置的 namespaceId,如果缺失,则默认为public 。

      • groupName (字符串):配置的组名称,必需。

      • dataId (字符串):配置的dataId,必需。

      • nid (数字):配置历史记录的实际 id,从列表配置历史记录工具中获取, id字段。

    • 返回:配置的历史变更记录。

  10. list_config_listeners

  • 检索订阅特定配置的监听器列表。

  • 输入:

    • namespaceId (字符串,可选):配置的 namespaceId,如果缺失,则默认为public 。

    • groupName (字符串):配置的组名称,必需。

    • dataId (字符串):配置的dataId,必需。

    • aggregation (bool,可选):是否从整个集群进行聚合。

  • 返回:订阅特定配置的监听器列表。

  1. list_listened_configs

  • 检索特定客户端 IP 地址订阅的配置列表。

  • 输入:

    • namespaceId (字符串,可选):配置的 namespaceId,如果缺失,则默认为public 。

    • ip (字符串):配置监听器的客户端ip,必需。

    • aggregation (bool,可选):是否从整个集群进行聚合。

  • 返回:列出特定客户端IP地址订阅的配置。

Related MCP server: jewei-mcp-nacos

安装

使用 uv(推荐)

使用uv时无需特殊安装。我们将使用uvx直接运行mcp-server-nacos 。

使用 PIP

或者,您可以通过 pip 安装mcp-server-nacos :

pip install mcp-server-nacos

安装后,您可以使用以下命令将其作为脚本运行:

python -m mcp_server_nacos

配置

与 Claude Desktop 一起使用

将其添加到您的claude_desktop_config.json中:

"mcpServers": {
  "git": {
    "command": "uvx",
    "args": [
        "nacos-mcp-server",
        "--host",
        "your_nacos_host",
        "--port",
        "your_nacos_main_port, such as 8848",
        "--access_token",
        "your_nacos_access_token, get from `login` api: /nacos/v3/auth/user/login with `username` and `password`"
      ],
  }
}

您可能需要在command字段中输入uvx可执行文件的完整路径。您可以在 MacOS/Linux 上运行which uvx ,或在 Windows 上where uvx来获取此路径。

"mcpServers": {
  "git": {
    "command": "python",
        "args": [
        "-m",
        "nacos-mcp-server",
        "--host",
        "your_nacos_host",
        "--port",
        "your_nacos_main_port, such as 8848",
        "--access_token",
        "your_nacos_access_token, get from `login` api: /nacos/v3/auth/user/login with `username` and `password`"
      ],
  }
}

发展

如果您正在进行本地开发,只需按照以下步骤操作:

  1. 将此 repo 克隆到您的本地环境中。

  2. 修改src/mcp_server_nacos中的代码来实现您想要的功能。

  3. 使用 Claude 桌面应用进行测试。将以下内容添加到 claude_desktop_config.json 中:

{
"mcpServers": {
  "mcp-server-nacos": {
    "command": "uv",
    "args": [ 
      "--directory",
      "/<path to mcp-server-nacos>/src/mcp_server_nacos",
      "run",
      "mcp-server-nacos"
    ]
  }
}

执照

mcp-server-nacos 采用 Apache 2.0 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 Apache 2.0 许可证的条款和条件。更多详细信息,请参阅项目仓库中的LICENSE文件。

Available Tools

11 tools
get_configC

This interface retrieves the details of the specified configuration.

Inputs: groupName (required), dataId (required), namespaceId.

get_config_historyB

This interface retrieves a specific historical change record of a configuration.

Inputs: groupName (required), dataId (required), namespaceId, nid.

get_serviceA

This interface retrieves detailed information of a specified service, including metadata and clusters, not including instance list.

Inputs: serviceName (required), namespaceId, groupName.

list_config_historyC

This interface retrieves the complete publish history of a configuration.

Inputs: pageNo (required), pageSize (required), groupName (required), dataId (required), +1 more.

list_config_listenersB

This interface retrieves the list of listeners subscribed to a specific configuration.

Inputs: groupName (required), dataId (required), namespaceId, aggregation.

list_configsC

This interface retrieves the list of configurations under a specified namespace.

Inputs: pageNo (required), pageSize (required), namespaceId, groupName, +5 more.

list_listened_configsC

This interface lists the configurations subscribed to by a specific client IP address.

Inputs: ip (required), namespaceId, aggregation.

list_namespacesB

Retrieves the list of namespaces in the current Nacos cluster.

Inputs: no named parameters.

list_service_instancesC

This interface retrieves the list of instances for a specified service.

Inputs: serviceName (required), namespaceId, groupName, clusterName.

list_servicesA

This interface retrieves the list of services under a specified namespace. The response format depends on the withInstances parameter:withInstances=true: Returns service details with instances (ServiceDetailInfo objects). withInstances=false: Returns service metadata without instances (ServiceView objects). **NOTE: ** When withInstances=true, The API may cost too much memory and networks, If Only want get instance list with little or one service, Suggest use withInstances=false with List Service Instances.

Inputs: pageNo (required), pageSize (required), namespaceId, groupNameParam, +3 more.

list_service_subscribersC

This interface retrieves the list of subscribers for a specified service.

Inputs: pageNo (required), pageSize (required), serviceName (required), namespaceId, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 11 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose targeting specific resources and actions in the Nacos domain (configurations, services, namespaces, listeners/subscribers). No tools appear to overlap or cause confusion, as each name precisely indicates its function, such as get_config vs. list_configs or get_service vs. list_services.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case throughout, using clear verbs like 'get', 'list', and specific nouns like 'config', 'service', 'namespace'. There are no deviations or mixed conventions, making the naming highly predictable and readable.

    Tool Count5/5

    With 11 tools, this server is well-scoped for managing configurations and services in Nacos, covering key operations like retrieval, listing, and history tracking. Each tool earns its place without feeling excessive or insufficient for the domain's needs.

    Completeness4/5

    The tool set provides strong coverage for read operations on configurations, services, namespaces, and related metadata, but lacks explicit create, update, or delete tools for these resources. This minor gap means agents can query effectively but may need workarounds for full lifecycle management.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A server that enables LLMs to interact with Lark/Feishu services, currently supporting employee information queries via Lark's Contact API.
      3
      -
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that enables AI assistants to query and manage Nacos configurations. It supports Nacos 3.x for retrieving or publishing configuration files and includes an optional read-only mode for secure environments.
      2
      3
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that exposes all AgileConfig RESTful APIs as tools, enabling AI assistants to manage configuration, applications, users, nodes, and more via natural language.
      36
      8 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to query and manage Nacos configurations, supporting Nacos 1.x/2.x/3.x with multiple transport protocols.
      7
      51 PyPI
      1
      MIT