Description
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.