Skip to content

Duplicate tool names across MCP servers cause errors #464

Closed

Description

@nikhil-pandey

Describe the bug

When using multiple MCP servers with identically named tools (but potentially different behaviors or arguments) in OpenAI's Agents SDK, the SDK raises a Duplicate tool names found across MCP servers error, preventing simultaneous usage.

This is particularly problematic when integrating with third-party MCP servers—name collisions might be unavoidable. For instance, both GitHub and Linear MCP servers might expose a tool called create_issue, making it impossible to use both without tool name differentiation which the consumer has no control over.

Debug information

  • Agents SDK version: v0.0.8
  • Python version: Python 3.13.2

Repro steps

Run the following minimal Python script:

import json
from agents import Agent, Runner
from agents.mcp.server import MCPServerStdio
import asyncio

async def main():
    async with MCPServerStdio(params={"command": "terminal-stdio", "args": []}) as server:
        async with MCPServerStdio(params={"command": "some-other-stdio", "args": []}) as server2:
            tools = await server.list_tools()
            print("Tools: ", json.dumps(tools, indent=4, default=lambda o: o.__dict__))

            agent = Agent(
                name="Assistant",
                instructions="Use the tools to achieve the task",
                mcp_servers=[server, server2],
                model="gpt-4o-mini"
            )

            result = await Runner.run(agent, "Hi there, how are you?")
            print("Result: ", result.final_output)

if __name__ == "__main__":
    asyncio.run(main())

Expected behavior

The SDK should either namespace or differentiate identically named tools from different MCP servers, allowing simultaneous and clear invocation of each distinct tool.

Crosslinks

Similar behavior observed in other MCP clients such as the VSCode where identically named tools across servers are de-duplicated or hidden from the UI, limiting usability in multi-server setups. Cursor on the other hand uses mcp_<server>_<tool_name> to avoid collisions and doesn't run into this.

Activity

  1. added
    bug
    on Apr 9, 2025
  2. rm-openai commented on Apr 11, 2025

    @rm-openai
    Collaborator

    It probably would not be correct to edit the tool name - among other reasons, tools often have a 64 max character limit, and their names are carefully chosen.

    Perhaps we should add an optional append_prefix arg that lets the user specify a custom prefix or indicate that we should prefix the server name.

    PR welcome!

  3. self-assigned this
    on Apr 14, 2025
  4. stevemadere commented on May 17, 2025

    @stevemadere

    Would a workaround for this problem be a general purpose tool prefixer decorator class?

    class MCPToolUniqifier(MCPServer):
      def __init(self, actual_server: MCPServer, tool_name_prefix: string):
         self.actual_server = actual_server
         self.tool_name_prefix = tool_name_prefix
    
     for f in every_other_method:
          apply_the_prefix_as_needed_and_proxy
    
    
    
    
  5. yulong-CSAI commented on Jun 20, 2025

    @yulong-CSAI

    It's not elegant to nest multiple MCP servers. Are there any non - nested implementation methods?

  6. deleted a comment from on Jul 26, 2025
  7. hayescode commented on Dec 12, 2025

    @hayescode

    @seratch We could perhaps leverage the name in the MCP Servers, but since the MCP tools themselves show as FunctionTool the only "name" is the tool's name and the server_name here (deepwiki) doesn't seem to be retrieveable anywhere?

    mcp_server = MCPServerStreamableHttp(
        name="deepwiki",
        params=MCPServerStreamableHttpParams(
            url="https://mcp.deepwiki.com/mcp",
            timeout=10,
        ),
        cache_tools_list=True,
    )
  8. added 3 commits that reference this issue on Apr 19, 2026
    1b6fef1
    7c372d4
    86683e0
  9. added a commit that references this issue on May 22, 2026
    f3a5040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfeature:mcp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions