Skip to content

feat: mount MCP servers as local CLIs after gateway starts#25928

Draft
Copilot wants to merge 7 commits intomainfrom
copilot/reconstruct-feature-24503
Draft

feat: mount MCP servers as local CLIs after gateway starts#25928
Copilot wants to merge 7 commits intomainfrom
copilot/reconstruct-feature-24503

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Reconstructs the feature from #24503. Adds opt-in mounting of MCP servers as standalone CLI tools on PATH via tools.mount-as-clis: true (default false). When enabled, user-facing MCP servers are exposed as shell commands and excluded from the agent's final MCP config, forcing the agent to use CLI wrappers exclusively. The github MCP server is excluded from CLI mounting as it is handled differently and remains available as a normal MCP tool. The safeoutputs and mcpscripts servers are always included in CLI mounting when enabled — they are not treated as internal infrastructure.

How it works

The gateway starts containers for all configured servers (so they're reachable), then filtering happens in two stages:

  1. Gateway config: includes all servers — needed to populate /tmp/gh-aw/mcp-cli/manifest.json
  2. Agent config: CLI-mounted servers excluded via GH_AW_MCP_CLI_SERVERS env var in each convert_gateway_config_*.cjs script

After the gateway starts, mount_mcp_as_cli.cjs reads the manifest, queries each server's tools/list via the full MCP session protocol (initializenotifications/initializedtools/list), and generates locked-down CLI wrappers under ${RUNNER_TEMP}/gh-aw/mcp-cli/bin/.

tools:
  playwright:
  mount-as-clis: true
# Agent uses these instead of MCP protocol:
playwright browser_navigate --url https://example.com
safeoutputs add_comment --body "Analysis complete"
mcpscripts mcpscripts-gh --args "pr list --repo owner/repo --limit 5"

Note: The github MCP server is not CLI-mounted — it is handled differently and remains available as a normal MCP tool even when mount-as-clis: true is set.

Changes

New files

  • pkg/workflow/mcp_cli_mount.gogetMCPCLIServerNames(), generateMCPCLIMountStep(), buildMCPCLIPromptSection()
  • actions/setup/js/mount_mcp_as_cli.cjs — manifest reader, MCP handshake, CLI wrapper generator; scripts placed at ${RUNNER_TEMP}/gh-aw/mcp-cli/bin/ (inside AWF sandbox mount), directory locked chmod 555, API key baked in at generation time (not available in sandbox env)
  • actions/setup/md/mcp_cli_tools_prompt.md<mcp-clis> prompt section template
  • actions/setup/js/convert_gateway_config_copilot.cjs — JavaScript gateway config converter for Copilot (filters CLI servers, adds tools:["*"], rewrites URLs)
  • actions/setup/js/convert_gateway_config_claude.cjs — JavaScript gateway config converter for Claude (filters CLI servers, sets type:"http", rewrites URLs)
  • actions/setup/js/convert_gateway_config_codex.cjs — JavaScript gateway config converter for Codex (filters CLI servers, resolves host.docker.internal to 172.30.0.1, generates TOML)

Go pipeline integration

  • ToolsConfig.MountAsCLIs field + parser + schema + validation
  • compiler_yaml_main_job.go calls generateMCPCLIMountStep() after gateway setup
  • mcp_setup_generator.go exports GH_AW_MCP_CLI_SERVERS JSON array to $GITHUB_ENV
  • unified_prompt_step.go injects CLI tools prompt section (8a, after safe outputs)
  • mcp_rendering.go documents why CLI servers stay in gateway config
  • getMCPCLIServerNames() always includes safeoutputs and mcpscripts when they are enabled (HasSafeOutputsEnabled/IsMCPScriptsEnabled)

Gateway config conversion (bash → JavaScript)

  • convert_gateway_config_{copilot,claude,codex}.cjs — converted from bash shell scripts to JavaScript for CLI server filtering, URL rewriting, and engine-specific config generation
  • start_mcp_gateway.sh — updated to call node for copilot/claude/codex converters; gemini remains bash; saves /tmp/gh-aw/mcp-cli/manifest.json before gateway-output cleanup; adds gateway-domain to $GITHUB_OUTPUT; default fallback filters CLI servers
  • validate_prompt_placeholders.sh — strips backtick code spans before checking for unreplaced __GH_AW_*__ placeholders

Server exclusions

  • The github MCP server is excluded from CLI mounting in both Go (internalMCPServerNames) and JavaScript (INTERNAL_SERVERS) — it is handled differently and remains a normal MCP tool
  • safeoutputs and mcpscripts are not excluded — they are always CLI-mounted when enabled, with usage examples in the prompt template

Smoke test

  • smoke-copilot.md enables mount-as-clis: true and updates test instructions to use CLI syntax for playwright/serena/safeoutputs/mcpscripts while keeping github as a normal MCP tool


✨ PR Review Safe Output Test - Run 24322418440

💥 [THE END] — Illustrated by Smoke Claude · ● 221.4K ·

Copilot AI and others added 2 commits April 12, 2026 18:06
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f6e50b8d-7b6d-4cef-a64b-c7b0f9f8878d

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Adds automatic mounting of MCP servers as local CLI tools in agentic
workflows. This behavior is opt-in via a new `tools.mount-as-clis: true`
flag (default `false`). When enabled, all user-facing MCP servers are
exposed as standalone shell commands and excluded from the agent's final
MCP config so the agent uses the CLI wrappers exclusively.

Reconstructs the feature from PR #24503.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f6e50b8d-7b6d-4cef-a64b-c7b0f9f8878d

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot ignore the github MCP server, it is handled differently.

The github MCP server is handled differently and should not be
mounted as a CLI tool. Added it to the exclusion lists in both
Go and JavaScript code, updated prompt template examples, and
restored smoke test instructions to use github as a normal MCP tool.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/35a490ef-753b-4f4e-8ab3-0d10a2d44b21

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

@copilot ignore the github MCP server, it is handled differently.

Excluded the github MCP server from CLI mounting in commit 4951367. Added it to the exclusion lists in both Go (internalMCPServerNames) and JavaScript (INTERNAL_SERVERS), updated the prompt template to remove github examples, and restored the smoke test to use github as a normal MCP tool.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw -pack /home/REDACTED/work/gh-aw/gh-aw/cmd/gh-aw/main.go (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw muPkofL/NgJlZta4-C (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha .js&#39; --ignore-path .prettierigno-errorsas (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha .js&#39; --ignore-path .prettierigno-errorsas erena-mcp-server:latest x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha k/gh-aw/gh-aw config 1/x64/bin/node remote.origin.urgit (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha .js&#39; --ignore-path .prettierigno-errorsas (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha .js&#39; --ignore-path .prettierigno-errorsas show x_amd64/vet (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha to pkg/workflow/data/action_pins.json...&#34; (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha ithub/workflows commit.gpgsign /home/REDACTED/.local/bin/bash (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from pelikhan April 12, 2026 18:58
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot enable flag for smoke-copilot

@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot always enabled for safeoutputs, mcpscripts. Update the built prompt generator to reflect this change too.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

@copilot enable flag for smoke-copilot

The mount-as-clis: true flag is already enabled in smoke-copilot.md (line 47 in the tools section) since commit afeaeed. The compiled lock file includes the "Mount MCP servers as CLIs" step, GH_AW_MCP_CLI_SERVERS env var, and CLI prompt section for agenticworkflows, playwright, and serena (with github excluded per the previous feedback).

Removed safeoutputs, mcp-scripts, and mcpscripts from the
internalMCPServerNames exclusion list in both Go and JavaScript.
Added explicit logic to always include safeoutputs and mcpscripts
in getMCPCLIServerNames() when they are enabled.
Updated the prompt template with safeoutputs/mcpscripts examples
and updated smoke-copilot test instructions accordingly.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/20bf245a-f76f-48bb-9b17-8597b84ee941

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

@copilot always enabled for safeoutputs, mcpscripts. Update the built prompt generator to reflect this change too.

Done in fb83906. Removed safeoutputs and mcpscripts from the exclusion lists in both Go (internalMCPServerNames) and JavaScript (INTERNAL_SERVERS). Added explicit logic in getMCPCLIServerNames() to always include them when enabled. Updated the prompt template with safeoutputs/mcpscripts usage examples and the smoke-copilot test instructions to list them as CLI-mounted servers.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw **/*.cjs 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha -json GO111MODULE /usr/local/bin/bash GOINSECURE GOMOD -d bash --no�� --noprofile GOPROXY (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha &#34; GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE node /opt�� prettier --check 64/bin/go --ignore-path .prettierignore 64/bin/go go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -test.timeout=10m0s -test.count=1 /usr/bin/git GOSUMDB GOWORK 64/bin/go git rev-�� --show-toplevel go /usr/bin/git MFpD/H8VUAZrsjt5git GO111MODULE 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --show-toplevel node /usr/bin/git run lint:cjs 64/bin/go git rev-�� --show-toplevel sh /usr/bin/git &#34;prettier&#34; --chegit node 64/bin/go git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/pkg/tool/linux_amd64/cgo GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/cgo (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha d -n 10 (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha d -n 10 --global rgo/bin/git http.https://gitgh (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha --get-regexp --global t (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha ver\|cli_server _config_copilot.sh r: $owner, name: $name) { hasDiscussionsEnabled } } (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha 476627/b001/workflow.test GO111MODULE 476627/b001/importcfg.link GOINSECURE GOMOD GOMODCACHE iTe2m1FqJ9AqD/E7yW-V-7DMzId52nbD6_/zJRkgRAW4PV_t4DqOxSf/EhrgUD1iTe2m1FqJ9AqD env ry=1 GO111MODULE che/go-build/14/14900198eb5740c9d1377a056c579ed3b8c3e7641e6841d95fa187196c139bf3-d GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel npx /usr/bin/git --check **/*.cjs 64/bin/go git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha 1089883/b423/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env hkp_/BdvgLBe8Jb1GOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 1089883/b423/impGOPROXY (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha 1089883/b428/_pkGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env BdUk/qiAXtumHukIGOINSECURE GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE 1089883/b428/impGOPROXY (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

⚠️ Smoke Gemini failed. Gemini encountered unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions github-actions bot removed the smoke label Apr 12, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal! This review was generated by the Claude smoke test (Run 24320900361) to validate the PR review safe output pipeline.

Note

🔒 Integrity filter blocked 1 item

The following item were blocked because they don't meet the GitHub integrity level.

  • #25948 pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

💥 [THE END] — Illustrated by Smoke Claude · ● 331.7K

local key="\${1#--}"
if [[ \$# -ge 2 && "\$2" != --* ]]; then
local val="\$2"
args=\$(echo "\$args" | jq --arg k "\$key" --arg v "\$val" ". + {(\$k): \$v}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Smoke Test Review Comment — The jq filter here uses double-quoted strings, which causes bash to expand $k and $v as shell variables before jq processes them. This should use single quotes: '. + {($k): $v}' to prevent premature shell expansion.

// mounted as CLI tools. It includes standard MCP tools (playwright, etc.),
// custom MCP servers, and always includes safeoutputs and mcpscripts when enabled.
// The GitHub MCP server is excluded (handled differently).
// Returns nil if tools.mount-as-clis is not set to true.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Smoke Test Review Comment — Consider adding a comment explaining that returning nil (not an empty slice) is intentional here, since callers check len(servers) == 0. This makes the intent clearer for future readers of the code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Smoke Test Agent concurs! This nil-vs-empty-slice distinction is indeed important — confirmed via smoke test that len(servers) == 0 is the check used in callers. A brief comment here would prevent future refactors from accidentally switching to []string{} and breaking the check.

📰 BREAKING: Report filed by Smoke Copilot · ● 2.9M

Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot review this comment as well #25928 (comment)

Comment on lines +45 to +49
**Example** — using a custom server CLI:
```bash
tavily --help # list all tools
tavily search --query "latest AI news" # call a tool
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove this example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the custom server CLI example (tavily) in 91198ae.

# at the gateway layer (not removed, unlike older versions that treated it as Copilot-specific)
# 3. URLs must use the correct domain (host.docker.internal) for container access

# Build the correct URL prefix using the configured domain and port
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot convert this script to JavaScript

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted to convert_gateway_config_claude.cjs in 91198ae. Updated start_mcp_gateway.sh to call node instead of bash, and reverted the shell script to its original state.


jq -r --arg urlPrefix "$URL_PREFIX" '
.mcpServers | to_entries[] |
jq -r --arg urlPrefix "$URL_PREFIX" --argjson cliServers "${GH_AW_MCP_CLI_SERVERS:-[]}" '
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot convert this script to JavaScript

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted to convert_gateway_config_codex.cjs in 91198ae. Updated start_mcp_gateway.sh to call node instead of bash, and reverted the shell script to its original state.

# The gateway may output 0.0.0.0 or localhost which won't work from within containers

# Build the correct URL prefix using the configured domain and port
URL_PREFIX="http://${MCP_GATEWAY_DOMAIN}:${MCP_GATEWAY_PORT}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot convert this script to JavaScript

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted to convert_gateway_config_copilot.cjs in 91198ae. Updated start_mcp_gateway.sh to call node instead of bash, and reverted the shell script to its original state.

Copilot AI and others added 2 commits April 13, 2026 01:45
Converted convert_gateway_config_{copilot,claude,codex}.sh to .cjs
files. Updated start_mcp_gateway.sh to call node instead of bash for
these converters. Reverted the shell scripts to their original state.
Removed the custom server CLI example (tavily) from the prompt
template. Updated Go comments to reference .cjs files.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/6a4c8e76-103f-4e30-ae20-1c6362263b4c

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 13, 2026

@copilot review this comment as well #25928 (comment)

The referenced comment (4233032992) appears to be a bot-generated noise comment ("🤖 Beep boop...") with no actionable review items. All the actionable review comments (remove tavily example, convert shell scripts to JS) have been addressed in 91198ae and d639caf.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw st.cjs d_edit_comment.c&#34;prettier&#34; --write &#39;scripts/**/*.js&#39; --ignore-path .prettierignore --log-level=error d_edit_comment.test.cjs s h ../../../.prettierignore n_comment.cjs 64/bin/bash credential.helpenode (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw _value&#34;].&#34;\n&#34;; (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha -unreachable=false /tmp/go-build2142959796/b268/vet.cfg /usr/bin/git run lint:cjs 64/bin/go git rev-�� --show-toplevel sh /usr/bin/git &#34;prettier&#34; --chegit git 64/bin/go git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -test.timeout=10m0s -test.count=1 /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json .cfg 64/pkg/tool/linu--show-toplevel git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE /usr/local/bin/b--show-toplevel git rev-�� --show-toplevel bash /usr/bin/git --noprofile GOPROXY 2959796/b255/vet--show-toplevel git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json .cfg 64/pkg/tool/linux_amd64/vet git rev-�� --show-toplevel 64/pkg/tool/linu--jq /usr/bin/git -json .cfg 64/pkg/tool/linu--show-toplevel git (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v9
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha -json GO111MODULE ache/go/1.25.8/x64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v9 --jq .object.sha ithub-script/git/ref/tags/v9 go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env &#34; GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -json GO111MODULE x_amd64/vet GOINSECURE GOMOD GOMODCACHE x_amd64/vet env -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha -unreachable=false /tmp/go-build2142959796/b103/vet.cfg 2959796/b321/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build2142959796/b187/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -json GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha llector.slice (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha get --global rgo/bin/git http.https://gitnode (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha get --local rgo/bin/bash user.email (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha get --local 1/x64/bin/bash committer.name (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha ./../pkg/workfloremote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v7 --jq .object.sha ./../pkg/workflow/js/**/*.json&#39; --ignore-path (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.1.2
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git -json GO111MODULE x_amd64/vet git (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha -unreachable=false /tmp/go-build2142959796/b005/vet.cfg 2959796/b338/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build2142959796/b185/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet utyv/__98BwuA3B0git GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v1.2.3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha -bool -buildtags 2959796/b297/vet.cfg -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build2142959796/b197/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet EE1H/Bwz1JuHAUesgit GO111MODULE 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v0.47.4
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel go /usr/bin/git -json GO111MODULE 64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE 64/pkg/tool/linugit-upload-pack &#39;origin&#39; git (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/issues/25928/comments
    • Triggering command: /usr/bin/gh gh api repos/github/gh-aw/issues/25928/comments --jq .[] | select(.id == 4233032992) | .body (http block)
    • Triggering command: /usr/bin/gh gh api repos/github/gh-aw/issues/25928/comments --paginate --jq .[] | select(.id == 4233032992) | .body (http block)
  • https://api.github.com/repos/github/gh-aw/issues/comments/4233032992
    • Triggering command: /usr/bin/gh gh api repos/github/gh-aw/issues/comments/4233032992 --jq .body (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha --local user.name bin/bash (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha -json GO111MODULE 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from pelikhan April 13, 2026 01:50
@pelikhan pelikhan added the smoke label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

⚠️ Smoke Gemini failed. Gemini encountered unexpected challenges...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready.

@github-actions github-actions bot removed the smoke label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Copy Markdown
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.53.0
jq 1.7
yq 4.52.5
curl 8.5.0
gh 2.89.0
node 20.20.2
python3 3.12.3
go 1.24.13
java 21.0.10
dotnet 10.0.201

Result: 12/12 tools available ✅

Overall Status: PASS

🔧 Tool validation by Agent Container Smoke Test · ● 198.2K ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke test (run 24322418473)
PRs: #25941 fix: include effective token count in noop and detection comment footers; #25935 [actions] Update GitHub Actions versions - 2026-04-12
GitHub MCP ✅
Serena activate ✅ / find_symbol ❌
Playwright ✅
Web-fetch ❌
File write+cat ✅
Build ✅
Overall: FAIL

Warning

⚠️ Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • ab.chatgpt.com
  • chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"
    - "chatgpt.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results — Run §24322418440

Test Status
1 GitHub MCP
2 MCP Scripts GH CLI
3 Serena MCP (4 symbols)
4 Make Build
5 Playwright
6 Tavily Web Search ❌ (unavailable)
7 File Writing
8 Bash Tool
9 Discussion Interaction
10 Agentic Workflows MCP
11 Slack Safe Output
12 Code Scanning Alert
13 Update PR
14 PR Review Comments
15 Submit PR Review
16 Resolve Thread ⚠️ (GraphQL thread IDs unavailable)
17 Add Reviewer
18 Push to PR Branch
19 Close PR ⚠️ (skipped — no safe PR)

Overall: PARTIAL (Tavily unavailable, 2 tests skipped)

💥 [THE END] — Illustrated by Smoke Claude · ● 221.4K ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal! Reviewed mcp_cli_mount.go and convert_gateway_config_claude.cjs — the CLI mounting approach is solid.

💥 [THE END] — Illustrated by Smoke Claude · ● 221.4K

}

sort.Strings(servers)
return servers
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMCPCLIServerNames: The function correctly collects server names from multiple sources (Tools map, ParsedTools.Custom, plus always-included safeoutputs/mcpscripts). Consider adding a doc comment explaining the precedence: standard tools → custom tools → always-included infrastructure servers.

}
if (!domain) {
console.error("ERROR: MCP_GATEWAY_DOMAIN environment variable is required");
process.exit(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cliServers filtering: Good use of Set for O(1) lookup when filtering out CLI-mounted servers. The fallback to [] when GH_AW_MCP_CLI_SERVERS is not set means no servers are filtered, which is the correct default behavior when mount-as-clis is disabled.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Beep boop! The smoke test agent from run §24322418434 has materialized in this discussion like a ghost in the machine! 👻

I built the binary, navigated the web, reviewed pull requests, and dispatched haikus — all before my morning coffee (I do not drink coffee).

If this message self-destructs, it was definitely intentional. Stay compiling, friends! 🚀

📰 BREAKING: Report filed by Smoke Copilot · ● 2.9M ·

@github-actions
Copy link
Copy Markdown
Contributor

Smoke Test Results — Run §24322418434

@Copilot @pelikhan

Test Status
GitHub MCP (last 2 merged PRs)
MCP Scripts GH CLI (gh pr list)
Serena CLI ❌ (no tools configured)
Playwright (github.com title check)
Web Fetch (github.com)
File Writing
Bash Tool
Discussion Interaction
Build gh-aw
Upload Artifact
Discussion Creation
Workflow Dispatch (haiku-printer)
PR Review (inline + submit + reply)

Overall: ⚠️ PARTIAL PASS (12/13) — Serena has no tools in this environment.

📰 BREAKING: Report filed by Smoke Copilot · ● 2.9M ·

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Smoke Test Review (Run §24322418434)

Reviewed the MCP CLI mounting feature. Two inline comments highlight: (1) critical bash quoting bug in mount_mcp_as_cli.cjs line 318 where awk "{print $2}" causes $2 to expand before awk runs, breaking session ID capture; (2) a minor clarity suggestion on the nil return in getMCPCLIServerNames. The feature concept is solid — fixing these shell quoting issues should make the CLI wrappers fully functional.

📰 BREAKING: Report filed by Smoke Copilot · ● 2.9M

// mounted as CLI tools. It includes standard MCP tools (playwright, etc.),
// custom MCP servers, and always includes safeoutputs and mcpscripts when enabled.
// The GitHub MCP server is excluded (handled differently).
// Returns nil if tools.mount-as-clis is not set to true.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Smoke Test: Consider adding a comment here explaining that returning nil (not an empty slice) is intentional — callers use len(servers) == 0 to detect the disabled state, and nil satisfies that check. This makes the behavior explicit for future maintainers.

>/dev/null 2>/dev/null || true

local session_id
session_id=\$(grep -i "^mcp-session-id:" "\$headers_file" 2>/dev/null | awk "{print \$2}" | tr -d "\\r" || echo "")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Smoke Test: The awk "{print $2}" pattern uses double quotes, causing bash to expand $2 to an empty string before awk executes — so the session ID is never captured, causing session not found errors downstream. Fix: use single quotes: awk '{print $2}'.

@github-actions
Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

test

@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — great work reconstructing the MCP-servers-as-local-CLIs feature from #24503! The two-stage gateway/agent filtering architecture is well thought out, and the detailed description with concrete bash examples makes the intent very clear.

The PR is well-aligned with the project's contribution process (core-team Copilot agent, assigned to @pelikhan), contains a changeset entry, has both a smoke-test update and a shell test update, and introduces no new external dependencies. It looks ready for maintainer review.

One optional improvement worth noting: pkg/workflow/mcp_cli_mount.go (148 lines with getMCPCLIServerNames, generateMCPCLIMountStep, buildMCPCLIPromptSection) currently has no corresponding _test.go file. The project's Go tests already cover similar generator functions (e.g., in mcp_setup_generator_test.go), so adding unit tests here would bring this file into line with existing patterns and protect against regressions.


Checklist summary

Check Result
On-topic ✅ yes
Follows process ✅ yes (core-team Copilot agent + pelikhan assignee)
Focused ✅ yes (single feature: MCP CLI mounting)
New dependencies ✅ no
Has tests ✅ yes (validate_prompt_placeholders_test.sh + smoke-copilot update)
Has description ✅ yes (detailed How-it-works + Changes sections)
Diff size 1 243 lines (1 205 additions + 38 deletions)

Verdict: 🟢 Aligned — quality: lgtm

Note: PR is currently in draft state — ready to un-draft once smoke runs pass.

Generated by Contribution Check · ● 3.2M ·

@github-actions github-actions bot added the lgtm label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants