You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP: De-dupe servers using reported name/version #244644
We should also make sure priority order is respected per-tool and indicate (e.g. in the Select Tools picker) when a tool is not available because its name is used by a higher priority server. The tool registration API doesn't support priorities and I'm not sure it should, but MCP side we can have a little indirection such that its tool registration doesn't duplicate and calls the highest priority tool of any given name.
The deduplication and prioritization approach introduces significant limitations on how MCP can be practically utilized. Since MCP tool names are typically determined by servers, there’s little control on the client-side over potential naming collisions, especially when identical tool names with different behaviors or arguments are involved.
For instance, consider the official GitHub MCP server, which requires a Personal Access Token (PAT) to function. If a user wants an agent to interact with multiple GitHub accounts, each needing its own distinct PAT, this would necessitate running multiple MCP servers with differing environment variables. However, the current deduplication and naming approach does not support this scenario, as it would treat identically named tools from these servers as duplicates, effectively preventing simultaneous distinct usage.
Given these constraints, it would be highly beneficial to introduce some flexibility—such as incorporating a server name or namespace—to allow tools with the same name but differing behaviors or contexts to coexist clearly. For example, the GitHub MCP server could include organizational namespaces in tool names, such as github.microsoft.createIssue or github.anthropic.createIssue. Aligning on a more explicit and flexible naming mechanism within the MCP specification itself would significantly enhance usability and better accommodate real-world scenarios.
I recommend discussing these challenges further with the MCP working group to refine the specification, ensuring it better supports complex and flexible real-world scenarios.
Due to random prefixes my tool got 590_smtp-send-email name which prevented me from using Gemini since it won't accept tool name starting with a numeric value
We now will do this. With the new tool naming schemes, tools are named mcp_servername_toolname. The highest priority ('most local') MCP servers have priority, and then if there are collisions we add counters after servername e.g. mcp_servername2_toolname.
Activity
connor4312 commentedon Mar 25, 2025
We should also make sure priority order is respected per-tool and indicate (e.g. in the Select Tools picker) when a tool is not available because its name is used by a higher priority server. The tool registration API doesn't support priorities and I'm not sure it should, but MCP side we can have a little indirection such that its tool registration doesn't duplicate and calls the highest priority tool of any given name.
cc Johannes Rieken (@jrieken) given you want to keep ownership of the picker 🙂
nikhil-pandey commentedon Apr 8, 2025
The deduplication and prioritization approach introduces significant limitations on how MCP can be practically utilized. Since MCP tool names are typically determined by servers, there’s little control on the client-side over potential naming collisions, especially when identical tool names with different behaviors or arguments are involved.
For instance, consider the official GitHub MCP server, which requires a Personal Access Token (PAT) to function. If a user wants an agent to interact with multiple GitHub accounts, each needing its own distinct PAT, this would necessitate running multiple MCP servers with differing environment variables. However, the current deduplication and naming approach does not support this scenario, as it would treat identically named tools from these servers as duplicates, effectively preventing simultaneous distinct usage.
Given these constraints, it would be highly beneficial to introduce some flexibility—such as incorporating a server name or namespace—to allow tools with the same name but differing behaviors or contexts to coexist clearly. For example, the GitHub MCP server could include organizational namespaces in tool names, such as
github.microsoft.createIssueorgithub.anthropic.createIssue. Aligning on a more explicit and flexible naming mechanism within the MCP specification itself would significantly enhance usability and better accommodate real-world scenarios.I recommend discussing these challenges further with the MCP working group to refine the specification, ensuring it better supports complex and flexible real-world scenarios.
connor4312 commentedon Apr 8, 2025
Note that we do dedupe tool names seen by the model by giving them a randomish prefix, but we probably do want more control over them as you say.
skadeglad commentedon Apr 29, 2025
Due to random prefixes my tool got
590_smtp-send-emailname which prevented me from using Gemini since it won't accept tool name starting with a numeric valueconnor4312 commentedon Apr 29, 2025
That is fixed already on VS Code Insiders
connor4312 commentedon Jun 2, 2025
We now will do this. With the new tool naming schemes, tools are named
mcp_servername_toolname. The highest priority ('most local') MCP servers have priority, and then if there are collisions we add counters afterservernamee.g.mcp_servername2_toolname.