Skip to content

Commit 5463d5d

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 #278 (tool-name-prefix dispatch fix) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 16a778f commit 5463d5d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/gateway/mcpadd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ func addServerHandler(g *Gateway, clientConfig *clientConfig) mcp.ToolHandler {
209209
}
210210
clientNameLower := strings.ToLower(clientName)
211211

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

216216
if shouldActivate {
217217
// Now update g.mcpServer with the new capabilities

0 commit comments

Comments
 (0)