federating-mcp-servers
Skill2 starsChanged 44 days agoMITView on GitHub
Use when a fleet service ships its own Spring AI MCP server - explains how to discover those servers from the spring-fleet config and federate them alongside the spring-fleet MCP tools so the agent has one unified tool surface across the fleet.
In this repository10 other files it gives its agents.
- debugging-runtime-logsSkill
- debugSkill
- doctorSkill
- fleet-initSkill
- impactSkill
- logsSkill
- runSkill
- spring-fleet-logging-setupSkill
- traceSkill
- tracing-across-servicesSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Always prefix the federated server name with fleet- so the namespace is readable and collisions with non-fleet MCP servers are unlikely.
- Distinctive: line 51
Verify reachable: After registration, ask Claude to list MCP tools (the IDE surfaces this) and confirm the federated tools appear with …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Federating fleet-owned MCP servers
Spring AI 1.1 ships spring-ai-starter-mcp-server-{webmvc,webflux,servlet},
so any Spring Boot service in the fleet can expose @Tool-annotated beans
(and selected actuator endpoints) as MCP tools. When that happens, the
right move is not to re-implement those tools inside spring-fleet; it is to
federate them: register each service's MCP server alongside the
spring-fleet MCP server so Claude sees one unified tool surface across the
whole fleet.
When to use
/fleet-init records services[].stack.springAiMcpServer = true for any
repo whose build declares spring-ai-starter-mcp-server. That flag is your
signal.
Procedure
- Discover the candidates. Iterate
services[]and collect every one withstack.springAiMcpServer == true. For each, you need:- the transport URL (Streamable HTTP is the recommended 2026 transport;
SSE is being sunset). The default Spring AI MCP server endpoint is
http://<host>:<port><contextPath>/mcp. Confirm from each service'sapplication.propertiesifspring.ai.mcp.server.base-pathis set. - any required auth header (often a bearer token from the team's IDP).
- the transport URL (Streamable HTTP is the recommended 2026 transport;
SSE is being sunset). The default Spring AI MCP server endpoint is
- Register them in the user's MCP client config. Claude Code reads
.mcp.json. Append one entry per federated server next to the existingspring-fleetentry, e.g.:
Always prefix the federated server name with{ "mcpServers": { "spring-fleet": { "command": "python", "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/mcp_server.py"] }, "fleet-inventory": { "transport": "streamable-http", "url": "http://localhost:8083/inventory-v1/mcp" }, "fleet-order": { "transport": "streamable-http", "url": "http://localhost:8081/order-v1/mcp" } } }fleet-so the namespace is readable and collisions with non-fleet MCP servers are unlikely. - Confirm with the user before editing
.mcp.json. Federation changes the agent's effective tool surface and the data it can read; that's a shared-state change worth a quick confirmation. Show the proposed diff. - Verify reachable. After registration, ask Claude to list MCP tools (the IDE surfaces this) and confirm the federated tools appear with their service-prefixed names.
- Re-federate when topology changes. Re-run
/fleet-init(or justscan_repos_rootvia the MCP tool) whenever a service adopts or dropsspring-ai-starter-mcp-server. Thestack.springAiMcpServerflag is the source of truth.
Notes
- The federated servers run alongside the user's services, so they only serve when those services are running. spring-fleet's own MCP server always works regardless of fleet runtime state.
- Authentication is per-service. If the team uses an OIDC-protected MCP
endpoint, the
.mcp.jsonentry needs anAuthorizationheader; store the token in the user's secret manager and reference it through environment variables, never inline. - Tool name collisions across federated servers are resolved by the MCP
client by prefixing with the server name (e.g.
fleet-inventory.search_inventory).
Outside Claude Code
${CLAUDE_PLUGIN_ROOT}is the spring-fleet plugin root. Claude Code fills it in; in Codex it is the folder two directories above this SKILL.md.- Codex does not read
.mcp.jsonfor user servers. Register each federated server in~/.codex/config.toml(or the project's.codex/config.toml) instead:
The bundled[mcp_servers.fleet-order] url = "http://localhost:8081/order-v1/mcp"spring-fleetserver is already registered by the plugin.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

