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
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:
importjsonfromagentsimportAgent, Runnerfromagents.mcp.serverimportMCPServerStdioimportasyncioasyncdefmain():
asyncwithMCPServerStdio(params={"command": "terminal-stdio", "args": []}) asserver:
asyncwithMCPServerStdio(params={"command": "some-other-stdio", "args": []}) asserver2:
tools=awaitserver.list_tools()
print("Tools: ", json.dumps(tools, indent=4, default=lambdao: o.__dict__))
agent=Agent(
name="Assistant",
instructions="Use the tools to achieve the task",
mcp_servers=[server, server2],
model="gpt-4o-mini"
)
result=awaitRunner.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.
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.
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
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
Repro steps
Run the following minimal Python script:
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.The text was updated successfully, but these errors were encountered: