fix(mcp): prevent tool override name collisions - #8026
Draft
Sehlani042 wants to merge 1 commit into
Draft
Conversation
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
McpWorkbench.tool_overrides validates renamed tools only against other configured overrides. It does not validate the final exposed names against the tools actually returned by the MCP server.
As a result, renaming fetch to an existing server tool name such as search can expose two schemas named search and route a real search call to fetch. A stale override for an original tool that is no longer present can cause the same wrong-route class by retaining a reverse mapping that shadows a present server tool.
This patch:
No public API or persistence format changes.
Related issue number
No existing issue covers this root cause. I also checked current open PRs before publication; #7594 changes schema handling and is unrelated.
Checks
Verification
RED before the production change:
GREEN after the change:
The broader test_mcp_tools.py run reached 22 passed, 1 skipped with five external mcp-server-fetch / mcp-server-git failures. Those exact five failures reproduce on untouched main, so they are baseline environment noise rather than regressions from this patch.
AI assistance
This patch was prepared with Codex under the contributor's direction. Codex was used for issue/PR race checking, RED/GREEN implementation, current-main verification, and preparing this draft description.