Skip to content

Commit 47e9ca3

Browse files
null-runnerclaude
andcommitted
fix: enable tool activation for Claude clients in mcp-add
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) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 94b4ea8 commit 47e9ca3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/gateway/mcpadd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ func (g *Gateway) createMcpAddTool(clientConfig *clientConfig) *ToolRegistration
229229
}
230230
clientNameLower := strings.ToLower(clientName)
231231

232-
// Only activate tools if activate is true AND client name doesn't contain "claude"
233-
// (Claude clients auto-refresh their tool list, so they don't need explicit activation)
234-
shouldActivate := params.Activate && !strings.Contains(clientNameLower, "claude")
232+
// Activate tools if requested - all clients need explicit activation
233+
// (Removed incorrect assumption that Claude auto-refreshes tool list)
234+
shouldActivate := params.Activate // Claude clients also need explicit activation
235235

236236
if shouldActivate {
237237
// Now update g.mcpServer with the new capabilities

0 commit comments

Comments
 (0)