Skip to content

MCP: De-dupe servers using reported name/version #244644

Closed

Description

When servers come from various sources, we should de-dupe in prioritized order.

As server ids come from users and are not reliable, maybe we can use server-reported name/version as unique identifier.

Activity

  1. added
    feature-request
    on Mar 25, 2025
  2. connor4312 commented on Mar 25, 2025

    @connor4312
    Member

    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 🙂

  3. nikhil-pandey commented on Apr 8, 2025

    @nikhil-pandey

    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.

  4. connor4312 commented on Apr 8, 2025

    @connor4312
    Member

    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.

  5. skadeglad commented on Apr 29, 2025

    @skadeglad

    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

  6. connor4312 commented on Apr 29, 2025

    @connor4312
    Member

    That is fixed already on VS Code Insiders

  7. connor4312 commented on Jun 2, 2025

    @connor4312
    Member

    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.

  8. added
    verification-needed
    on Jun 3, 2025
  9. locked and limited conversation to collaborators on Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

chat-mcpfeature-requestverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions