fix: remove explicit exclusion of 'claude' clients from tool activation logic.#279
fix: remove explicit exclusion of 'claude' clients from tool activation logic.#279null-runner wants to merge 1 commit into
Conversation
47e9ca3 to
5463d5d
Compare
|
Following up on this PR after a month. This fix addresses a critical issue where Claude clients cannot use tools added via Current behavior:
This PR:
The fix is tested and working on my end. Could we get a review or feedback on whether this aligns with the current roadmap? Thanks for maintaining this project! |
The mcp-add command was incorrectly skipping tool activation for Claude clients based on the assumption that "Claude clients auto-refresh their tool list". This assumption is incorrect. When mcp-add is called with activate=true, tools were added to g.toolRegistrations (accessible via mcp-exec) but NOT to g.mcpServer (required for native MCP tool calls). This caused: - mcp-add chromedev → success (26 tools registered) - mcp-exec chromedev:list_pages → works (uses toolRegistrations) - native call to chromedev:list_pages → "unknown tool" error The fix removes the Claude client exclusion, allowing updateServerCapabilities() to call g.mcpServer.AddTool() for all clients. Related to docker#278 (tool-name-prefix dispatch fix)
5463d5d to
fd85c30
Compare
|
@null-runner apologies for taking so long. We were planning on adding this change to #313 as well so I think it looks good. But the last time I checked, claude code still wasn't processing the tool list changed notifications. When you test this now, are you seeing notificiations being processed? |
|
@null-runner it looks like there's a conflict here but we did actually merge your change as part of fixing another issue. |
Summary
The
mcp-addcommand was incorrectly skipping tool activation for clients with "claude" in their name, based on the assumption that these clients auto-refresh their tool list. This assumption is incorrect.Problem
When
mcp-addis called withactivate=truefrom affected clients:g.toolRegistrations(accessible viamcp-exec)updateServerCapabilities()is never called due to a client name checkg.mcpServer.AddTool()is never executedReproduction:
Root Cause
In
pkg/gateway/mcpadd.goline 234:This check prevents tool activation for any client with "claude" in its name.
Fix
Remove the client name exclusion:
Testing
Tested with Claude Code:
mcp-addRelated
Related to #278 (tool-name-prefix dispatch fix)