Frontmatter
| id | 7941 |
| title | Investigate Multi-Server Tool Namespacing for MCP Client |
| state | Closed |
| labels | enhancementairefactoring |
| assignees | tobiu |
| createdAt | Nov 30, 2025, 12:29 AM |
| updatedAt | Nov 30, 2025, 12:45 AM |
| githubUrl | https://github.com/neomjs/neo/issues/7941 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | 7931 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Nov 30, 2025, 12:45 AM |
Investigate Multi-Server Tool Namespacing for MCP Client

Input from Gemini 2.5:
✦ I have conducted the Multi-Server Experiment.
Findings
- Collision Confirmed: All three servers (
github-workflow,knowledge-base,memory-core) expose ahealthchecktool.- Partial Collision:
knowledge-baseandmemory-coreboth exposestart_databaseandstop_databasetools.- Current Behavior: The
Neo.ai.mcp.client.Clientcreates dynamic proxies onthis.tools. If we were to merge these into a single object (e.g., in an Agent class), these collisions would be problematic.Proposed Solution: Server Namespacing
As suggested in the ticket, we should namespace tools by server.
Implementation Plan:
- Modify
Neo.ai.mcp.client.Clientto not flatten tools ontothis.toolsdirectly, OR...- Actually, the
Clientrepresents a single connection. The namespacing should happen at the Agent level (or a newClientManagerclass).- Since
Neo.ai.Agentis not yet implemented, I propose refactoringClientto support an optionalnamespaceconfig. If provided, tools are mounted atclient.tools[namespace]. If not, they remain atclient.tools(backward compatibility).Correction: Wait,
Neo.ai.mcp.client.Clientconnects to one server. Soclient.toolsis effectively namespaced by the client instance itself.In
test-multi-server.mjs:const ghClient = ...; const kbClient = ...;ghClient.tools.healthcheck(); // GitHub health kbClient.tools.healthcheck(); // KB health
The collision only happens if we try to merge them.
Refined Proposal: We don't need to change
Client.mjsto namespace tools internally. Instead, the futureNeo.ai.Agentshould likely hold a map of clients:class Agent { clients = { github: new Client({ serverName: 'github-workflow' }), memory: new Client({ serverName: 'memory-core' }) }async work() { await this.clients.github.tools.listIssues(); await this.clients.memory.tools.addMemory(); }}
This seems cleaner than
this.tools.githubWorkflow.healthcheck.However, for the "Agent OS" vision, we often want a unified toolbox. If we do want a unified toolbox, we can implement a
ToolAggregatorthat handles collisions by prefixing.Decision: I will verify if
config.mjsneeds updates. It currently supports the map. I will conclude the investigation with the recommendation: Keep Client simple. Handle aggregation in Agent/Manager.For this ticket, I will clean up the test script and close it, as the "investigation" is complete and the "namespacing" is best handled by the consumer (Agent) rather than forcing it into the low-level Client.
Wait, the ticket says: "Implement Namespacing (Proposal): ... refactor Client or create Agent ... aggregates tools".
I will write a simple
Neo.ai.AgentMVP class now to demonstrate this aggregation pattern, as it is the natural next step and fulfills the "Implement" part of the ticket via the "higher-level class" option.

Input from Gemini 2.5:
✦ I have completed the investigation and implementation for multi-server tool namespacing.
Deliverables Completed
- Multi-Server Experiment & Analysis: Confirmed tool name collisions and determined that namespacing is necessary.
- Implemented Namespacing: Created the
Neo.ai.Agentbase class (ai/Agent.mjs) which:
- Manages multiple
Neo.ai.mcp.client.Clientinstances.- Aggregates tools into a structured
this.tools.<serverName>.<toolName>namespace, converting server names to camelCase for ergonomic access.- Updated Demo Agent: Refactored
ai/agents/mcp-demo-agent.mjsto instantiate and useNeo.ai.Agent, demonstrating connections to multiple servers and usage of the namespaced tools.- Clean-up: Deleted the temporary
ai/mcp/client/test-multi-server.mjsscript.This establishes a clear and scalable architecture for agents to interact with multiple MCP servers. (Note: The observed
memory-coreoutput schema validation error is a bug in thememory-coreserver itself, unrelated to this client namespacing work).
This task involves integrating multiple MCP servers into the MCP Client and exploring the behavior of tool listing, specifically regarding name collisions (e.g.,
healthcheck).The goal is to determine how the
Neo.ai.mcp.client.Clientshould expose tools from multiple servers. The proposed strategy is to namespace tools by server (e.g.,this.tools.githubWorkflow.healthcheck) to avoid conflicts and provide a structured API.Deliverables
ai/mcp/client/test-multi-server.mjsthat connects to all three servers (github-workflow,knowledge-base,memory-core) using separateClientinstances or a modifiedClientthat can handle multiple connections (depending on findings).listTools()when multiple servers are involved. Check if tool names collide or if the SDK provides server metadata.Neo.ai.mcp.client.Clientor create a higher-levelNeo.ai.Agentclass that aggregates tools intothis.tools.<serverName>.<toolName>.ai/mcp/client/config.mjssupports the multi-server setup.