From f8b0a994a058e5c814ea53bdfc793193f604adda Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 15:33:24 +0000 Subject: [PATCH 1/3] Initial plan From a377b5152d4d7e93619f9216d5df395e2e198308 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 16:25:50 +0000 Subject: [PATCH 2/3] fix: enable CLI fallback for GitHub MCP server by removing from INTERNAL_SERVERS Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../patch-strip-copilot-tools-from-claude-config.md | 2 +- actions/setup/js/mount_mcp_as_cli.cjs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.changeset/patch-strip-copilot-tools-from-claude-config.md b/.changeset/patch-strip-copilot-tools-from-claude-config.md index 297efa57302..0e6e2889e90 100644 --- a/.changeset/patch-strip-copilot-tools-from-claude-config.md +++ b/.changeset/patch-strip-copilot-tools-from-claude-config.md @@ -2,4 +2,4 @@ "gh-aw": patch --- -Strip Copilot-only `tools` from the Claude MCP gateway config so Claude sessions can register GitHub MCP servers correctly. +Enable CLI fallback for the GitHub MCP server by removing it from the `INTERNAL_SERVERS` exclusion list in `mount_mcp_as_cli.cjs`. When the native MCP HTTP `initialize` handshake fails (e.g. protocol-version mismatch between the agent and gateway), the CLI bridge now mounts `github` tools via a shell wrapper — the same recovery path `safeoutputs` already uses — so agents retain access to GitHub MCP tools in every session. diff --git a/actions/setup/js/mount_mcp_as_cli.cjs b/actions/setup/js/mount_mcp_as_cli.cjs index 54d931fd12f..d6918129e7a 100644 --- a/actions/setup/js/mount_mcp_as_cli.cjs +++ b/actions/setup/js/mount_mcp_as_cli.cjs @@ -36,10 +36,11 @@ const TOOLS_DIR = `${RUNNER_TEMP}/gh-aw/mcp-cli/tools`; const AWF_GATEWAY_IP = "172.30.0.1"; const SAFEOUTPUTS_SERVER_NAME = "safeoutputs"; -/** MCP servers that are handled differently and should not be user-facing CLIs. - * Note: safeoutputs and mcpscripts are NOT excluded — they are always CLI-mounted - * when mount-as-clis is enabled. */ -const INTERNAL_SERVERS = new Set(["github"]); +/** MCP servers that are internal infrastructure and should never be user-facing CLIs. + * Note: safeoutputs, mcpscripts, and github are NOT excluded — they are CLI-mounted + * so agents retain access to their tools even when the native MCP HTTP initialization + * fails (e.g. a protocol-version mismatch between the engine and the gateway). */ +const INTERNAL_SERVERS = new Set(); /** Default timeout (ms) for HTTP calls to the local MCP gateway */ const DEFAULT_HTTP_TIMEOUT_MS = 15000; @@ -403,7 +404,7 @@ async function main() { return; } - core.info(`Found ${servers.length} user-facing server(s) in manifest (after filtering internal: ${[...INTERNAL_SERVERS].join(", ")})`); + core.info(`Found ${servers.length} server(s) in manifest to mount as CLI tools`); fs.mkdirSync(CLI_BIN_DIR, { recursive: true }); fs.mkdirSync(TOOLS_DIR, { recursive: true }); From 08389ea45b96b1f1223242c52e4f2ec113ce66b5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Jul 2026 16:35:18 +0000 Subject: [PATCH 3/3] refactor: remove INTERNAL_SERVERS concept entirely from mount_mcp_as_cli.cjs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/mount_mcp_as_cli.cjs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/actions/setup/js/mount_mcp_as_cli.cjs b/actions/setup/js/mount_mcp_as_cli.cjs index d6918129e7a..f022e903970 100644 --- a/actions/setup/js/mount_mcp_as_cli.cjs +++ b/actions/setup/js/mount_mcp_as_cli.cjs @@ -36,12 +36,6 @@ const TOOLS_DIR = `${RUNNER_TEMP}/gh-aw/mcp-cli/tools`; const AWF_GATEWAY_IP = "172.30.0.1"; const SAFEOUTPUTS_SERVER_NAME = "safeoutputs"; -/** MCP servers that are internal infrastructure and should never be user-facing CLIs. - * Note: safeoutputs, mcpscripts, and github are NOT excluded — they are CLI-mounted - * so agents retain access to their tools even when the native MCP HTTP initialization - * fails (e.g. a protocol-version mismatch between the engine and the gateway). */ -const INTERNAL_SERVERS = new Set(); - /** Default timeout (ms) for HTTP calls to the local MCP gateway */ const DEFAULT_HTTP_TIMEOUT_MS = 15000; @@ -397,10 +391,10 @@ async function main() { return; } - const servers = (manifest.servers || []).filter(s => !INTERNAL_SERVERS.has(s.name)); + const servers = manifest.servers || []; if (servers.length === 0) { - core.info("No user-facing MCP servers in manifest, skipping CLI mounting"); + core.info("No MCP servers in manifest, skipping CLI mounting"); return; }