Skip to content

fix(mcp): reject duplicate SDK tool names - #1473

Open
Linxiushen wants to merge 1 commit into
anthropics:mainfrom
Linxiushen:fix/reject-duplicate-sdk-mcp-tool-names
Open

Linxiushen wants to merge 1 commit into
anthropics:mainfrom
Linxiushen:fix/reject-duplicate-sdk-mcp-tool-names

Conversation

@Linxiushen

Copy link
Copy Markdown

When two SDK tools share a name, tools/list currently exposes both descriptions and annotations while the schema and handler maps silently use the last tool. This can pair one tool's advertised metadata with another tool's implementation.

Reject duplicate names in create_sdk_mcp_server with a ValueError naming the conflict. Names remain case-sensitive and scoped to each server. Add construction regressions plus real in-memory MCP tests for distinct case-sensitive names and reuse across servers.

Validation: the new duplicate cases fail on the unchanged runtime; Windows MCP integration 146 passed; full Linux suite 1647 passed / 6 skipped; Ruff check/format and mypy pass. Both async backends run, with MCP 2.3.0; no live Claude request was required.

This branch has not been deployed

No deployments
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.

1 participant