Subagent launch fails with 'Tool names must be unique' when MCP server is configured
Description
When an MCP server (particularly chrome-devtools) is configured, attempting to launch any subagent (Task tool) results in the following error, preventing subagent execution:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"tools: Tool names must be unique."},"request_id":"req_..."}
Environment
- Claude Code Version: 2.0.30
- OS: macOS (Darwin 24.6.0)
- Configured MCP Servers: chrome-devtools, filesystem
Steps to Reproduce
- Configure an MCP server in
claude_desktop_config.json(e.g., chrome-devtools)
``json``
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["chrome-devtools-mcp@latest"]
}
}
}
- Launch Claude Code
- Attempt to launch any subagent
````
Task tool with subagent_type: rspec-runner, lint-fixer, code-reviewer, etc.
- Error occurs
Expected Behavior
Subagents should launch successfully even when MCP servers are configured.
Actual Behavior
Subagent launch fails with "Tool names must be unique" error.
Root Cause Analysis
The issue appears to be caused by tool name conflicts between:
- Tools provided by MCP servers (e.g.,
mcp__chrome-devtools__*) - Tool definitions during subagent initialization
These tools seem to be registered twice, causing the duplicate name error.
Workaround
Currently, the only workaround is to disable MCP servers, which allows subagents to function properly.
Related Issues
- #703 - Slash Command registration collision with MCP Server Configuration (fixed in v0.2.64)
- This appears to be a similar issue affecting subagents
Impact
All subagent types are affected by this issue:
- rspec-runner
- lint-fixer
- code-reviewer
- chrome-devtools
- temporary-script-runner
- serena-expert
- etc.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗