From 719d5934bbe0301a7fbf085f1b70fb1c0edd756d Mon Sep 17 00:00:00 2001 From: Zezae Oh Date: Sun, 21 Jun 2026 09:53:07 +0900 Subject: [PATCH] fix(mcp): expose delegate tool via MCP bridge (#1247) The BridgeToolNames allowlist omitted "delegate", so claude-cli / Claude-Code-backed agents never received the tool even when their orchestration mode resolved to "delegate" with active agent_links. The native agent loop injects delegate per orchestration mode, but bridge sessions only see this curated allowlist, making inter-agent delegation impossible from bridge-backed agents. delegate is safe to expose unconditionally: it self-gates via CanDelegate/agent_links and resolves its source agent from the X-Agent-ID header context, exactly like team_tasks (already bridged). --- internal/mcp/bridge_server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/mcp/bridge_server.go b/internal/mcp/bridge_server.go index bb3646c4..9d45d538 100644 --- a/internal/mcp/bridge_server.go +++ b/internal/mcp/bridge_server.go @@ -17,6 +17,8 @@ import ( // BridgeToolNames is the subset of GoClaw tools exposed via the MCP bridge. // Excluded: spawn (agent loop), create_forum_topic (channels). +// delegate is included: it self-gates via CanDelegate/agent_links and resolves +// its source agent from the X-Agent-ID header context, same as team_tasks. var BridgeToolNames = map[string]bool{ // Filesystem "read_file": true, @@ -48,6 +50,8 @@ var BridgeToolNames = map[string]bool{ "sessions_send": true, // Team tools (context from X-Agent-ID/X-Channel/X-Chat-ID headers) "team_tasks": true, + // Inter-agent delegation (self-gates via CanDelegate / agent_links) + "delegate": true, } // NewBridgeServer creates a StreamableHTTPServer that exposes GoClaw tools as MCP tools.