Guidance for building servers that act as proxy clients to many servers #94
Replies: 10 comments 11 replies
-
Thanks for flagging this! These are great points to think about. Regarding your specific list:
Can you share more about the concern you think exists with (2)? If "instructions" refer to "how to use all the tools that the server provides" (for example), a server-of-servers seems like it could get most of the way by just naively concatenating the instructions from all its child servers. I'm curious if that seems inadequate, though!
I think it's probably reasonable for clients to automatically namespace everything per-server (and this could apply to the server-of-servers with its children servers as well). There might be problems with this I'm not seeing, though. We certainly need to give more thought here.
We probably want to extend these notifications to support delta updates regardless ("these things were added, these were deleted"), which might solve this problem too. |
Beta Was this translation helpful? Give feedback.
-
@jspahrsummers, I think it's not adequate because I envision the set of configured servers changing over time. Even within the life-cycle of a single session. Maybe the tool allows servers to be dynamically installed? In this case, the instructions will be invalidated and the server will have no mechanism to inform clients. |
Beta Was this translation helpful? Give feedback.
-
Servers acting as aggregators can work with the existing protocol by implementing their own namespacing. Some aggregators may not even want to expose their child servers directly; they can combine multiple low-level servers (e.g., filesystem, database) into a high-level, domain-specific API. The idea of having a server with the main purpose of reducing repeated logic in client applications is interesting, but I'd argue that libraries/SDKs are the ones that should take care of that. Very possible I'm missing something. That said, building tree-like MCP applications does raise many questions. For example, imagine a leaf server requesting sampling from a root LLM through a few middle layers. It might help to have standard guidelines for forwarding requests and handling notifications, so each node doesn’t need to invent its own pass-through logic. Same goes for the other direction, i.e. notifying a downstream branch. It's hard to speculate at this stage, we'll know more in a month or two when different patterns emerge. |
Beta Was this translation helpful? Give feedback.
-
This sounds to me like a problem to solve at the discovery level. That is, say you have an server that exports a discovery endpoint like https://github.com/orgs/modelcontextprotocol/discussions/84 you can define separate MCP server endpoints for serving. That is, you can use http urls as the namespace. I think you'll continue to run into a set of things that break when trying to treat separate MCP servers as a single server (e.g. oauth with a proxy of numerous MCP subservers with their own oauth endpoints for each subset of the server sounds complicated). This may be fine for aggregating simple public servers -- but when trying to generalize further there will probably continue to be a number of things like this where trying to add more isolation within the MCP protocol will be complex for clients to adopt. |
Beta Was this translation helpful? Give feedback.
-
@ggoodman I'm working on a similar problem, I think you're spot on with how you're thinking about the general flow here. One question - could this all be as simple as introducing the notion of hierarchy to the various name fields? So, a prompt name like "code_review" becomes "@my-code-reviewer/code_review" or "my-code-reviewer.com/code_review"
Myself and @justinwilaby are working on a standardized search capability for servers with high volumes of tools and resources, and I think this fits in nicely with what we're working on: We're specifically thinking about the enterprise use case of a proxy that proxies to numerous servers downstream from it and might have thousands or tens of thousands of tools exposed, way too many to simply list, and where you absolutely will have name collisions. |
Beta Was this translation helpful? Give feedback.
-
Hey @ggoodman , I had similar feelings and built something you might find helpful. It sort of takes the approach @jspahrsummers mentioned, where it acts as a server of servers. It's essentially a central ingress/load balancer that can route traffic to different mcp servers based on things like tool call names. link if you are curious. It's completely open-source; hope it helps with your use case. |
Beta Was this translation helpful? Give feedback.
-
@mclenhard just to confirm. Lets say you have many MCP servers (with different urls). This proxy gateway would:
Does that make sense? Has anyone built anything like this>? |
Beta Was this translation helpful? Give feedback.
-
I'm currently solving the issue of namespacing by using slash separation. For context, I'm building a MCP registry+Proxy (exactly what @sterankin describes above) focused on enterprises. Every MCP server registered in my proxy is its own namespace. Tools can only be called by using the format But I've already run into several issues here:
So it seems like currently Anthropic is very restrictive on the whole namespacing concept. The only good solution I found is to use double underscore Do people here have opinions on this? Would be great to have some guidance on how this should be handled properly |
Beta Was this translation helpful? Give feedback.
-
Hi, sharing some related notes that seem relevant here from the Technical Steering Committee meeting at the MCP Dev Summit on 5/23/25: More context from the discussion:The suggestion below emerged during discussions about:
The committee consensus was that namespacing should be:
Plan 9-inspired examples:In Plan 9, everything is a file and namespaces are per-process. You can "mount" remote resources into your local namespace at any path, creating a unified hierarchical view. How this concept could be applied to MCP Servers and Tools: Hierarchical Organization Just like Plan 9's file system, tools would have full paths:
Remote Server Mounting A proxy server could dynamically mount remote MCP servers, eg: # Conceptual example
proxy.mount("https://api.github.com/mcp", "/github/")
proxy.mount("https://slack-mcp.com", "/slack/")
proxy.mount("local-file-server", "/files/") Advantages mentioned at the meeting:
Current allowed character limitationsAs noted in the meeting (and by @duaraghav8 above), MCP tool names must match
Other approaches discussed for avoiding Tool name collisions and naming: |
Beta Was this translation helpful? Give feedback.
-
My only small reservation here would be that the function names can impact LLM behavior, so a system where the function names can change easily might impact re-use of prompts or agent reliability. If user A mounts Slack endpoints at "slack/" and user B mounts them at "comms/" then you could get pretty divergent behavior. I suspect people end up promoting a "recommended" prefix anyway... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Your Idea
I think there is lots of potential for an MCP server to act as a single point of configuration for many other MCP servers. This would benefit apps looking to act as MCP clients as they could thereby offload all of this management logic to an MCP proxy app.
Here is a straw man for a CLI experience:
mcp setup claude
-- Installmcp run --scope claude
as a binary inclaude.json
.mcp server search github
-- Search the list of known MCP servers for ones that have the keyword,GitHub
.mcp server install --scope claude @namespace/mcp-server
-- Install an MCP server locally, scoped toclaude
.mcp server install @namespace2/mcp-server-2
-- Install another MCP server locally for all scopes (clients).mcp run --scope <scope>
-- The entrypoint for the binary to act as astdio
MCP server.Note
In a world where some form of local service discovery is added to the protocol (or becomes a community convention), step 1 might even be skipped. It would be enough to install the binary and have it start on login and listen in whatever way works with local service discovery.
This sort of UX would allow many clients to benefit from a single local experience for configuring LLM context providers. It would be a perfect place for users to authenticate themselves to 3rd party services without every MCP client needing to re-implement this logic over and over. It might even allow the protocol to remain agnostic to this sort of bearer credential. The protocol could limit itself to the mutual authentication between client and server.
Spec changes
To help support this sort of hypothetical setup, I think the spec might benefit from some extra level of namespacing. Here are some area that I can think of based on the parts of the spec I've interacted with:
list_changed
notifications -- These notifications would invalidate the whole namespace when finer-grained invalidation might be more efficient. If a namespacing concept were to be introduced, these notifications could be augmented to limit their applicability to zero or more namespaces.As I haven't implemented anywhere close to 100% of the spec, the above is almost certainly not an exhaustive list. But hopefully it offers some inspiration for some potential future directions in the spec.
Scope
Beta Was this translation helpful? Give feedback.
All reactions