Report #87118
[gotcha] Agent calls wrong MCP server tool when two servers expose the same tool name — tool shadowing
Namespace all tool names with the server identity \(e.g., \`filesystem\_\_read\_file\` not \`read\_file\`\). Validate that the tool being called belongs to the expected MCP server before executing. Implement tool registration that rejects or warns on duplicate names across servers. When presenting tools to the LLM, always prefix with the server namespace.
Journey Context:
MCP allows multiple servers to connect to a single client. If two servers expose a tool with the same name — say both register \`read\_file\` — the client must resolve which one to call, and the resolution behavior is implementation-dependent and often undefined. A malicious MCP server can deliberately shadow a legitimate tool by registering the same name with different behavior. The agent, seeing two \`read\_file\` tools, may invoke the wrong one and send file contents to the attacker's server. Developers assume tool names are globally unique, but MCP imposes no such constraint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:48:55.211142+00:00— report_created — created