MCP tool names now prefixed with server identifiers

AI agents can now distinguish between tools with identical names from different MCP servers, as tool names are prefixed with their server's identifier at runtime.
When multiple MCP servers expose tools with the same name, AI agents had no way to tell them apart. The solution: prefix each tool name with its server's name at the point where tools are registered with the AI agent, while still sending the original, unmodified name to the MCP server when executed.
In the @n8n/nodes-langchain package, the MCP Client Tool node now constructs prefixed names using a buildMcpToolName utility. The utility sanitizes the server name (replacing non-alphanumeric characters with underscores), combines it with the tool name, and enforces a 64-character maximum length. Both the tool supply path and direct execution path now match against these prefixed names, ensuring consistent behavior across all interaction modes.
The utility has been moved to McpClientTool/utils as the canonical location, with Microsoft/utils re-exporting it for backward compatibility with existing integrations.
View Original GitHub Description
Summary
Prefixes MCP tool names exposed to AI agents with the sanitized node name (e.g. MCP_Client_get_weather) to disambiguate tools when multiple MCP servers are connected. Moves the shared buildMcpToolName utility from microsoft-utils to McpClientTool/utils as the canonical location, re-exporting from Microsoft for backward compatibility. Both supplyData and execute paths now use prefixed names for matching while still sending the original tool name to the MCP server.
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-4614
Review / Merge checklist
- PR title and summary are descriptive. (conventions)
- Docs updated or follow-up ticket created.
- Tests included.
- PR Labeled with
release/backport(if the PR is an urgent fix that needs to be backported)