spring-nacos-mcp
Provides tools for managing and inspecting Nacos configurations and service discovery across Spring Cloud environments, enabling AI agents to list, get, search, and diff configs, as well as list services and instances.
spring-nacos-mcp
A project-aware, read-only Nacos MCP server for Spring Cloud repositories.
Point it at your Spring Cloud repo. It reads your own application-* / bootstrap-*
files, discovers every environment (dev / test / pre / prod / ...), and gives your AI
assistant read-only Nacos tools across all of them — no host, port, namespace or
token to configure.
You: "Is sso.server.productCode consistent between dev and test?"
Claude: → nacos_search_config(env=dev, keyword=sso.server.productCode)
→ nacos_diff_config(env_a=dev, env_b=test, data_id=sso.properties)
"Yes — the value is identical in both environments (`PC-1001`).
One related key differs though: sso.server.url points to
dev-sso.corp.com in dev and test-sso.corp.com in test."Why not the official nacos-mcp-server?
The official nacos-group/nacos-mcp-server
connects to one cluster that you configure by hand (--host, --port, --access_token).
That's the right tool for operating a Nacos cluster.
This project answers a different question: "what does my project's config look like across environments?"
official nacos-mcp-server | spring-nacos-mcp | |
Setup | manual host/port/token per cluster | zero-config: parsed from your repo |
Environments | one per server instance | all profiles, |
Cross-env diff | not possible (single cluster) | built-in |
Spring awareness | none | shared-configs, file-extension, app config |
Write operations | planned | never (read-only by design) |
Related MCP server: jewei-mcp-nacos
Quickstart
The easy way: let your AI agent install it
Paste this into Cursor / Claude Code / Codex / Trae:
Install the MCP server from https://github.com/kestiny18/spring-nacos-mcp into this project and verify it works.
The repo ships an llms-install.md with exact steps per client, so the agent can do the whole thing — download, config, verification — by itself.
Manual, option A: copy one file (no PyPI, no dependencies)
The whole server is a single, zero-dependency, standard-library-only Python file. Drop it into your repo:
curl -sfL -o tools/nacos_mcp.py https://raw.githubusercontent.com/kestiny18/spring-nacos-mcp/main/src/spring_nacos_mcp/server.py// .cursor/mcp.json or .mcp.json (Claude Code), at the repo root
{
"mcpServers": {
"spring-nacos-mcp": { "command": "python", "args": ["tools/nacos_mcp.py"] }
}
}Works on intranet machines too — copy the file over however you like.
Manual, option B: uv / pip straight from git
{
"mcpServers": {
"spring-nacos-mcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/kestiny18/spring-nacos-mcp", "spring-nacos-mcp"]
}
}
}Or pip install git+https://github.com/kestiny18/spring-nacos-mcp and use the
spring-nacos-mcp command.
The server auto-detects the repo root from its working directory (your editor's
workspace). For clients that don't launch servers in the workspace (e.g. Claude
Desktop), pin it: "args": [..., "--repo", "/path/to/repo"].
Verify your setup
python tools/nacos_mcp.py --check # or: spring-nacos-mcp --checkPrints every discovered environment, where it came from, and whether the Nacos
server is reachable. Exit codes: 0 all reachable · 1 nothing discovered ·
2 discovered but some unreachable (usually VPN/network, not setup).
Tools
Tool | What it does |
| List discovered environments with address/namespace/groups |
| Read one config's raw content by dataId |
| App config + the shared/extension configs your project declares |
| List dataIds in a namespace (optional fuzzy filter) |
| Full-text search across all config contents |
| Key-level diff of one config between two environments |
| List services in the discovery registry |
| List online instances (IP/port/health) of a service |
How discovery works
Find the repo root (
.git,pom.xml,build.gradle,mvnw,gradlew, ...).Scan every
*/src/main/resources/forapplication[-<profile>].{yml,yaml,properties}andbootstrap[-<profile>].{yml,yaml,properties}. Multi-document YAML withspring.config.activate.on-profile(or legacyspring.profiles) is supported.For each profile, merge sources in priority order:
bootstrap-<profile>→application-<profile>→ basebootstrap→ baseapplication.Extract
spring.cloud.nacos.*: server-addr, namespace, username/password, config group (also fromspring.config.import: nacos:...?group=X), discovery group,file-extension,shared-configs/extension-configs/ legacyshared-dataids. Relaxed binding (server-addr/serverAddr/server_addr) is handled.${...}placeholders are resolved from environment variables (${nacos.addr}also triesNACOS_ADDR);${name:default}uses the default. Environments with unresolved placeholders are skipped with a clear log line.
Overrides
Environment variables (highest precedence), <ENV> is the upper-cased profile name:
NACOS_DEV_SERVER_ADDR / NACOS_DEV_NAMESPACE / NACOS_DEV_USERNAME /
NACOS_DEV_PASSWORD / NACOS_DEV_GROUP / NACOS_DEV_CONTEXT_PATH
NACOS_USERNAME / NACOS_PASSWORD # global fallback credentialsOr a .spring-nacos-mcp.yml at the repo root — patch discovered environments or
define ones that aren't in the repo at all:
envs:
staging:
server-addr: nacos-staging.corp.com:8848
namespace: ns-staging
username: readonly
password: ${STAGING_NACOS_PASSWORD} # resolved from env varSecurity notes
Read-only by construction: the only endpoints ever called are config/service GET queries and the login endpoint. There is no code path that writes to Nacos.
Config content reaches the LLM. If your configs contain secrets, enable masking:
SPRING_NACOS_MCP_MASK=1masks values whose keys containpassword/secret/token/credential/..., or provide your own list:SPRING_NACOS_MCP_MASK=password,apikey. Masking is off by default.Prefer a read-only Nacos account (via
NACOS_USERNAME/NACOS_PASSWORD) over credentials committed in config files.
Compatibility
Python ≥ 3.9, zero runtime dependencies.
Nacos 1.x / 2.x via the v1 OpenAPI; auth via
/v1/auth/loginwith automatic fallback to/v3/auth/user/login(Nacos 3.x).https://server addresses and comma-separated cluster address lists are supported.Nacos 3.x keeps v1 OpenAPI compatibility in current releases; if your deployment disables it, please open an issue — a v3 API backend is on the roadmap.
Limitations
The built-in YAML parser covers the subset used by Spring config files (nested maps, lists, multi-document). Anchors and flow collections are ignored.
Placeholders that come from Maven profile filtering (
@...@) are not resolved; use the override file for those repos.
License
Available Tools
8 toolsnacos_diff_configA
Compare one config (dataId) between two environments and return a structured key-level diff: keys only in A, only in B, and changed values. The best tool for questions like 'is X consistent between dev and test?'.
Inputs: env_a (required), env_b (required), data_id (required), group.
nacos_get_app_configA
Read the effective configuration of one application: its own config (.) plus the shared/extension configs declared in the project (spring.cloud.nacos.config.shared-configs). Prefer this over nacos_get_config when asked about an app's settings.
Inputs: env (required), app (required), group.
nacos_get_configA
Read the raw content of one Nacos config by its exact dataId (e.g. 'order-service.properties'). Use nacos_search_config first when you don't know which dataId contains a key.
Inputs: env (required), data_id (required), group.
nacos_list_configsA
List config dataIds in an environment's namespace (no content by default). Optionally fuzzy-filter by dataId substring.
Inputs: env (required), group, data_id, page_no, +2 more.
nacos_list_envsA
List the environments (Spring profiles) auto-discovered from this repository's application/bootstrap files, with each environment's Nacos server address, namespace and groups. Call this first if you are unsure which environments exist.
Inputs: no named parameters.
nacos_list_instancesA
List the online instances (IP, port, health) of one service. Use for 'is service X up / why is it offline' questions.
Inputs: env (required), service_name (required), group.
nacos_list_servicesC
List service names registered in the Nacos naming/discovery registry of one environment.
Inputs: env (required), group, page_no, page_size.
nacos_search_configA
Full-text search across all config contents in one environment. Returns matching dataIds with the matching lines. Use this to find which config file defines a property key.
Inputs: env (required), keyword (required), group.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct resource and action: diff config, get config (raw or app-level), list configs, list environments, list instances, list services, search config. No two tools have overlapping purposes, making selection unambiguous.
All tool names follow the consistent pattern 'nacos_verb_noun' in snake_case (e.g., nacos_diff_config, nacos_list_services). Verbs and nouns are clear and uniform, with no mixing of conventions.
With 8 tools covering both configuration and service discovery, the count is well-scoped for the domain. Each tool serves a distinct purpose without bloat or insufficiency.
The toolset provides comprehensive read and comparison capabilities for Nacos configs and services, including diff, search, and app-level config resolution. It lacks write operations (create/update/delete), but given the diagnostic focus, this is a minor gap.
Related MCP Connectors
Read-only MCP server for repository context: context packs, graph impact analysis, and validation.
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Repository knowledge graph MCP server for codebase understanding and debugging.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for managing your repositories on Forgejo/Gitea server.70Mozilla Public 2.0
- AlicenseBqualityDmaintenanceAn 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.23MIT
- AlicenseNot gradedqualityDmaintenanceSecure multi-source MCP server for reading local, GitHub, GitLab, Bitbucket, and network source code with read-only-by-default access, enabling AI assistants to inspect repositories safely.2MIT
- AlicenseAqualityDmaintenanceA unified MCP server for scaffolding project structures across multiple frameworks including Spring Boot, React, Vue, Next.js, FastAPI, Django, Flask, Express, and more.212 npm1MIT