Skip to content

Conversation

@mbhargav294
Copy link

Implements the feature requested in issue #273 to prefix tool names with server names, similar to the JavaScript implementation. This prevents tool name collisions when using multiple MCP servers that may have tools with identical names.

Changes:

  • Added prefix_tool_name_with_server_name parameter to MultiServerMCPClient
  • Added prefix_tool_name_with_server_name parameter to load_mcp_tools()
  • Added prefix_tool_name_with_server_name parameter to convert_mcp_tool_to_langchain_tool()
  • When enabled, tool names are formatted as "{server_name}__{tool_name}"
  • Default behavior (False) preserves backward compatibility
  • Added comprehensive tests for the new feature

Fixes #273

…isions

Implements the feature requested in issue langchain-ai#273 to prefix tool names with
server names, similar to the JavaScript implementation. This prevents tool
name collisions when using multiple MCP servers that may have tools with
identical names.

Changes:
- Added prefix_tool_name_with_server_name parameter to MultiServerMCPClient
- Added prefix_tool_name_with_server_name parameter to load_mcp_tools()
- Added prefix_tool_name_with_server_name parameter to convert_mcp_tool_to_langchain_tool()
- When enabled, tool names are formatted as "{server_name}__{tool_name}"
- Default behavior (False) preserves backward compatibility
- Added comprehensive tests for the new feature

Fixes langchain-ai#273
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow adding a prefix to tool names to deal with tool name collisions

1 participant