home / mcp / nacos mcp server

Nacos MCP Server

Queries and manages Nacos configurations across versions 1.x/2.x/3.x for automated AI workflows.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jeweis-jewei-mcp-nacos": {
      "command": "uvx",
      "args": [
        "jewei-mcp-nacos"
      ],
      "env": {
        "NACOS_HOST": "localhost",
        "NACOS_PORT": "8848",
        "NACOS_VERSION": "3",
        "NACOS_API_PORT": "8848",
        "NACOS_PASSWORD": "your-password",
        "NACOS_USERNAME": "nacos",
        "NACOS_NAMESPACE": "dev",
        "NACOS_READ_ONLY": "false",
        "NACOS_CONSOLE_PORT": "8080"
      }
    }
  }
}

You can connect your AI assistant to a Nacos server and manage configurations directly. This MCP server allows querying and publishing Nacos configurations across versions 1.x/2.x/3.x, enabling automated workflows and safer configuration management.

How to use

You interact with the Nacos MCP Server through your MCP client by connecting to the local or remote MCP endpoint configured for Nacos. Use natural language prompts to query, view, and publish configurations in Nacos.

Common tasks you can perform after setup include: querying a specific dataId in a given namespace, viewing the content of a configuration, and publishing or updating configuration data. For example you can ask your AI assistant to: find the configuration with dataId "application.yaml"; view the contents of a file such as user-service.yml in the dev namespace; or publish a fragment like server: port: 6379 to dataId redis.yaml.

How to install

Prerequisites: you need the MCP runtime tool installed and available on your system. The configuration examples assume the MCP launcher is invoked as the command uvx with a local MCP server named jewei-mcp-nacos.

1) Ensure the MCP launcher is installed on your system. 2) Create or edit your MCP config to include the Nacos server entry shown in the example snippets below. 3) Start the MCP client or environment that reads the MCP configuration so the Nacos MCP Server can be connected by your AI assistant.

Below is a representative configuration you place in your client’s MCP config file, under the mcpServers section with the key nacos.

{
  "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",
        "NACOS_VERSION": "3",
        "NACOS_READ_ONLY": "false"
      }
    }
  }
}

Additional configuration details

Environment variables control how the MCP server connects to Nacos and what capabilities are enabled. You can override these values per environment by exporting different values in your shell or by placing them in your MCP config as shown in the examples.

Configuration and environment variables

The following environment variables are supported for the Nacos MCP Server configuration. If you do not provide a value, sensible defaults apply where noted.

- NACOS_HOST: Nacos service address. Default: localhost - NACOS_PORT: API port for v1/v2 (required for v1/v2). Default: 8848 - NACOS_API_PORT: API port for v3 (required for v3). Default: 8848 - NACOS_CONSOLE_PORT: Console port for v3 (required for v3). Default: 8080 - NACOS_USERNAME: Username (optional) - NACOS_PASSWORD: Password (optional) - NACOS_NAMESPACE: Default namespace ID. For version 1, this is the namespace ID field. Default: public - NACOS_VERSION: Nacos version, 1/2/3. Default: 3 - NACOS_READ_ONLY: Enable read-only mode to disable publishing. Default: false

Troubleshooting and notes

If you need read-only access to configurations in production, set NACOS_READ_ONLY=true to prevent publish operations while still allowing queries.

When configuring multiple clients, ensure the host, ports, and namespace values match the Nacos installation you target. Double-check the password if you enable authentication.

Tools and usage patterns

The Nacos MCP Server exposes tools to retrieve and publish configurations. Use these operations through your MCP client to fetch current configurations or push updates to Nacos.

Available tools

nacos_get_config

Fetch a configuration content by dataId and namespace.

nacos_publish_config

Publish or update a configuration to Nacos; disabled in read-only mode.