Skip to content

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

Open
Copilot wants to merge 12 commits intomainfrom
copilot/add-automatic-mounting-mcp-servers
Open

feat: mount MCP servers as local CLIs after gateway starts#24503
Copilot wants to merge 12 commits intomainfrom
copilot/add-automatic-mounting-mcp-servers

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

Summary

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 — including built-in ones like github and playwright as well as custom servers — are exposed as standalone shell commands and excluded from the agent's final MCP config so the agent uses the CLI wrappers exclusively. When false, no CLI mounting step is emitted and no prompt section is injected.

How It Works

After the MCP gateway starts, a new "Mount MCP servers as CLIs" workflow step runs mount_mcp_as_cli.cjs via actions/github-script. This script:

  1. Reads a manifest of configured MCP servers (saved by start_mcp_gateway.sh before cleanup)
  2. For each server, follows the full MCP session protocol (initializenotifications/initializedtools/list) to discover available tools
  3. Generates a standalone CLI wrapper script at ${RUNNER_TEMP}/gh-aw/mcp-cli/bin/<server-name>
  4. Locks the bin directory (chmod 555) so the agent cannot modify or add scripts
  5. Adds the directory to PATH via core.addPath() for subsequent steps

The agent is also informed about these tools via an injected prompt section (wrapped in <mcp-clis> XML tags) listing the available CLI commands.

Architecture: Gateway vs. Agent Config

The MCP gateway must start Docker containers for all configured servers — including CLI-mounted ones — so they have reachable endpoints for the CLI manifest. The filtering is therefore applied in two stages:

  1. Gateway config (piped to start_mcp_gateway.sh): includes all servers so the gateway starts their containers and populates /tmp/gh-aw/mcp-cli/manifest.json.
  2. Agent's final MCP config (written by convert_gateway_config_*.sh): CLI-mounted servers are excluded via the GH_AW_MCP_CLI_SERVERS environment variable (a JSON array exported in the gateway step), so the agent cannot reach them directly and must use the CLI wrappers.

AWF Sandbox Path

CLI wrapper scripts and tools JSON are generated under ${RUNNER_TEMP}/gh-aw/mcp-cli/ (not /tmp/gh-aw/) so they are accessible inside the AWF sandbox, which mounts ${RUNNER_TEMP}/gh-aw read-only. The manifest file written by start_mcp_gateway.sh remains at /tmp/gh-aw/mcp-cli/manifest.json since it is only read during the setup step, which runs on the host before AWF starts.

Changes

New: actions/setup/js/mount_mcp_as_cli.cjs

  • Reads /tmp/gh-aw/mcp-cli/manifest.json
  • Queries each server's tool list via the proper 3-step MCP session protocol:
    1. initialize — establishes session, captures Mcp-Session-Id
    2. notifications/initialized — required handshake notification (server responds 204 No Content)
    3. tools/list / tools/call — executed within the established session
  • Generated CLI wrapper scripts support:
    • <server> --help — list all available tools
    • <server> <tool> --help — show tool description and parameters
    • <server> <tool> [--param value ...] — call a tool (follows the same 3-step MCP session protocol per invocation)
  • Internal servers (safeoutputs, mcp-scripts) and cache-memory (file share, not an MCP server) are excluded
  • Scripts are placed at ${RUNNER_TEMP}/gh-aw/mcp-cli/bin/ in a chmod 555 directory the agent cannot write to
  • Tools JSON cache is placed at ${RUNNER_TEMP}/gh-aw/mcp-cli/tools/ so scripts can access it inside AWF
  • Full core.info() / core.warning() logging throughout

New: actions/setup/md/mcp_cli_tools_prompt.md

  • Template file for the <mcp-clis> prompt section, following the same pattern as other prompt templates (safe_outputs_prompt.md, github_mcp_tools_prompt.md, etc.)
  • Uses __GH_AW_MCP_CLI_SERVERS_LIST__ placeholder substituted at runtime by the substitute_placeholders step
  • Loaded via cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" in compiled lock files

Modified: actions/setup/sh/start_mcp_gateway.sh

  • Saves /tmp/gh-aw/mcp-cli/manifest.json with server names and local URLs before gateway-output.json is deleted
  • Default fallback agent config generation filters out CLI-mounted servers using GH_AW_MCP_CLI_SERVERS

Modified: actions/setup/sh/convert_gateway_config_*.sh (Copilot, Claude, Codex, Gemini)

  • Each conversion script now reads GH_AW_MCP_CLI_SERVERS (JSON array) and excludes those servers from the agent's final MCP config using --argjson cliServers "${GH_AW_MCP_CLI_SERVERS:-[]}" in the jq call

New: pkg/workflow/mcp_cli_mount.go

  • getMCPCLIServerNames() — returns sorted list of user-facing MCP servers to mount (built-in and custom); returns nil when tools.mount-as-clis is not true
  • generateMCPCLIMountStep() — generates the "Mount MCP servers as CLIs" actions/github-script step in compiled workflows; no-op when flag is false
  • buildMCPCLIPromptSection() — returns IsFile: true referencing mcp_cli_tools_prompt.md with the server list passed as GH_AW_MCP_CLI_SERVERS_LIST env var; no-op when flag is false

Modified: pkg/workflow/tools_types.go and pkg/workflow/tools_parser.go

  • Added MountAsCLIs bool field to ToolsConfig (parsed from tools.mount-as-clis, default false)

Modified: pkg/parser/schemas/main_workflow_schema.json

  • Added mount-as-clis boolean property to the tools schema

Modified: pkg/workflow/mcp_rendering.go

  • Removed composeCLIMountFilter — CLI-mounted servers are no longer excluded from the gateway config (they must be started by the gateway). Filtering is now delegated to the conversion scripts.

Modified: pkg/workflow/mcp_setup_generator.go

  • Exports GH_AW_MCP_CLI_SERVERS (JSON array built with json.Marshal) in the gateway step script, after GH_AW_ENGINE, so conversion scripts can exclude those servers from the agent config

Modified: pkg/workflow/compiler_yaml_main_job.go

  • Calls generateMCPCLIMountStep() after generateMCPSetup() completes

Modified: pkg/workflow/unified_prompt_step.go

  • Injects MCP CLI tools prompt section (wrapped in <mcp-clis> XML tags) after safe outputs (section 8a)

Modified: actions/setup/sh/validate_prompt_placeholders.sh

  • Strips inline backtick code spans before checking for unreplaced __GH_AW_*__ placeholders, so documented placeholder names in PR descriptions or code examples are not flagged as errors

Modified: .github/workflows/smoke-copilot.md

  • Enabled mount-as-clis: true to exercise the feature in smoke testing
  • Updated test prompts for tests 1, 3, 4, and 12 to use CLI syntax (e.g. github pull_request_read --method list ..., serena activate_project --path ..., playwright browser_navigate --url ...)

Updated

  • All 179 .lock.yml files recompiled

Example

For a workflow configured with mount-as-clis: true, playwright, github, and a custom tavily MCP server, the agent will have:

# Shell commands available on PATH (under ${RUNNER_TEMP}/gh-aw/mcp-cli/bin/):
playwright --help
playwright browser_navigate --url https://example.com
github issue_read --method get --owner octocat --repo Hello-World --issue_number 1
tavily search --query "latest AI news"

Those servers are excluded from the agent's MCP config, so the agent interacts with them exclusively through the CLI wrappers. The gateway still starts all Docker containers so the CLI wrappers can communicate with them.

The prompt injected to the agent (loaded from mcp_cli_tools_prompt.md):

<mcp-clis>
## MCP Tools Available as CLI Commands

The following MCP servers have been mounted as local CLI commands:

- `github` — run `github --help` to see available tools
- `playwright` — run `playwright --help` to see available tools
- `tavily` — run `tavily --help` to see available tools
...
</mcp-clis>


✨ PR Review Safe Output Test - Run 23985224528

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

- Add `start_mcp_gateway.sh`: save CLI manifest (server names + local
  URLs) to /tmp/gh-aw/mcp-cli/manifest.json before cleanup
- Add `mount_mcp_as_cli.sh`: new shell script that reads the manifest,
  queries each server's tools/list via JSON-RPC, and generates a
  standalone CLI wrapper script in /tmp/gh-aw/mcp-cli/bin/ (chmod 555)
- Add `mcp_cli_mount.go`: Go helpers getMCPCLIServerNames() and
  generateMCPCLIMountStep() + buildMCPCLIPromptSection()
- Add "Mount MCP servers as CLIs" workflow step in compiler_yaml_main_job.go
- Inject MCP CLI tools prompt section in unified_prompt_step.go
- Update golden test fixtures

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f83b0114-9c57-4701-ac7d-bfa80f07a971

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
<safe-output-tools>
Tools: add_comment(max:10), create_issue(max:5), create_discussion(max:2), missing_tool, missing_data, noop
</safe-output-tools>
## MCP Tools Available as CLI Commands
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 wrap in xml tags "mcp-clis"

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.

Done in f3d7205. The MCP CLI tools prompt section is now wrapped in <mcp-clis> XML tags (matching the <safe-output-tools> pattern).

@@ -0,0 +1,309 @@
#!/usr/bin/env bash
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 a hell script to actions/github-script (and delete after conversion)
  • add logging

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.

Done in f3d7205. Converted to actions/setup/js/mount_mcp_as_cli.cjs with core.info() logging throughout (and core.warning() for non-fatal errors). The shell script has been deleted. The workflow step now uses actions/github-script.

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.

Great work converting to github-script! The added core.info() logging makes it much easier to debug MCP mounting issues in the Actions log. 🎉

📰 BREAKING: Report filed by Smoke Copilot · ● 860.4K

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 4, 2026

@lpcox @Mossaka where is a good location to drop these shell scripts

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 4, 2026

@copilot

  • add a field

    tools.mount-as-clis: true/false

that enables this behavior. Default is false.

  • Enable in smoke copilot
  • when a MCP server is mounted as a cli, remove from mcp-config returned by the gateway.

…ml tags

- Delete mount_mcp_as_cli.sh shell script
- Add mount_mcp_as_cli.cjs using actions/github-script with core.info() logging
- Update generateMCPCLIMountStep to use actions/github-script
- Wrap MCP CLI prompt section in <mcp-clis> XML tags
- Update golden fixtures and recompile lock files

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/1bf60ced-fb56-48d7-a2ce-b870a185cc27

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

Copilot AI commented Apr 4, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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 GO111MODULE 64/bin/go git rev-�� --show-toplevel go /usr/bin/git rt GO111MODULE 64/bin/go git (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 ache/go/1.25.8/xrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel ache/go/1.25.8/xrev-parse /usr/bin/git git (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 git ache/node/24.14.1/x64/bin/node git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git ache/node/24.14.1/x64/bin/node 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 -unreachable=false /tmp/go-build1076245136/b036/vet.cfg 6245136/b348/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b214/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)
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha 64/pkg/tool/linuxterm-color git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git node js/f�� 64/pkg/tool/linu--show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git (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 -json .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_amd64/vet env -json GO111MODULE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel go /usr/bin/git git rev-�� --show-toplevel git ache/node/24.14.1/x64/bin/node --show-toplevel go /usr/bin/git 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 GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha -bool -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git rev-�� --show-toplevel -tests /usr/bin/git &#34;prettier&#34; --chegit sh 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 x_amd64/vet /usr/bin/git -json GO111MODULE x_amd64/vet git rev-�� --show-toplevel x_amd64/vet /usr/bin/infocmp -json GO111MODULE 64/pkg/tool/linu--show-toplevel infocmp (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha se 6245136/b176/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b029/vet.cfg /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b047/vet.cfg 6245136/b296/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel x_amd64/vet /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/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE 6245136/b138/vet.cfg GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b014/vet.cfg 6245136/b289/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b027/vet.cfg 6245136/b253/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -json GO111MODULE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b043/vet.cfg 6245136/b276/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (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/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b033/vet.cfg 6245136/b308/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/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 git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel x_amd64/vet n-dir/node node js/f�� x_amd64/vet git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel x_amd64/vet /usr/bin/git node (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/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b031/vet.cfg 6245136/b313/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/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 git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel x_amd64/vet 1/x64/bin/npm node js/f�� x_amd64/vet 1/x64/bin/npm /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel x_amd64/vet /usr/bin/git node (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/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/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel git 1/x64/bin/node --show-toplevel -tests 0/x64/bin/go git rev-�� --show-toplevel git 1/x64/bin/node --show-toplevel go /usr/bin/git git (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 --show-toplevel CVPY8ufrsqBYOdMbxp/ElTUoC6JKE41W2G5XEZh/Lzo9F25NDZwT7YZekNBQ /usr/bin/git --show-toplevel git g_.a git rev-�� --show-toplevel git /usr/bin/git --show-toplevel git ache/go/1.25.8/x64/pkg/tool/linu--show-toplevel git (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility --show-toplevel node /usr/bin/git n-dir/bash git /opt/hostedtoolc/home/REDACTED/work/gh-aw/gh-aw/.github/workflows git rev-�� --show-toplevel node r: $owner, name: $name) { hasDiscussionsEnabled } } 64/pkg/tool/linudocker git /home/REDACTED/.cainspect infocmp (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 -json GO111MODULE 6245136/b125/vet.cfg GOINSECURE GOMOD GOMODCACHE /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet -uns�� -unreachable=false /tmp/go-build1076245136/b018/vet.cfg 6245136/b299/vet.cfg GOSUMDB GOWORK 64/bin/go /opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.1.2 --jq .object.sha --show-toplevel git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel x_amd64/vet /usr/bin/git node js/f�� x_amd64/vet git /opt/hostedtoolcache/node/24.14.1/x64/bin/node --show-toplevel x_amd64/vet /usr/bin/git node (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 .cfg 64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 64/pkg/tool/linux_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/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git 1/x64/bin/node --show-toplevel -tests /usr/bin/git git arne�� --show-toplevel git 1/x64/bin/node --show-toplevel go /usr/bin/git git (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 .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/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel git 1/x64/bin/node --show-toplevel -tests /usr/bin/git git arne�� --show-toplevel git 1/x64/bin/node --show-toplevel go /usr/bin/git git (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 -tests /usr/bin/git --check **/*.cjs 64/bin/go git rev-�� --show-toplevel /usr/lib/sysstat-buildtags /usr/bin/git 1 sh 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v0.47.4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse (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 k/gh-aw/gh-aw/pkGOSUMDB k/gh-aw/gh-aw/pkGOWORK 64/bin/go **/*.json --ignore-path ../../../.pretti-bool /opt/hostedtoolc-buildtags -o /tmp/go-build354-errorsas -trimpath 64/bin/go -p main -lang=go1.25 go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE ache/go/1.25.8/x64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 6245136/b046/vetjs/fuzz_sanitize_output_harness.cjs .cfg git (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 --show-toplevel git $name) { hasDiscussionsEnabled } } --show-toplevel git ache/uv/0.11.3/x-v infocmp -1 xterm-color git /usr/bin/git --show-toplevel git /opt/hostedtoolcgraphql git (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 --check **/*.cjs 64/bin/go **/*.json --ignore-path ../../../.pretti-unreachable=false /opt/hostedtoolc/tmp/go-build1076245136/b074/vet.cfg -o /tmp/go-build3545609933/b395/_pkGOINSECURE -trimpath 64/bin/go -p main -lang=go1.25 go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git -json GO111MODULE ache/go/1.25.8/x64/pkg/tool/linu--show-toplevel git rev-�� --show-toplevel ache/go/1.25.8/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 6245136/b050/vetjs/fuzz_sanitize_output_harness.cjs .cfg git (http block)

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

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 4, 2026

@copilot add a field

tools.mount-as-clis: true/false

that enables this behavior. Default is false. When false, do not emit custom prompt or mount any MCPs.

@pelikhan pelikhan added the smoke label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 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 4, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

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

@github-actions github-actions bot removed the smoke label Apr 4, 2026
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 4, 2026

@copilot the cli wrappers must implement a proper mcp client protocol and maintain a session

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Smoke Test #23981224949 | @pelikhan @Copilot

Test Result
GitHub MCP
MCP Scripts GH CLI
Serena MCP
Playwright
Web Fetch
File Writing
Bash Tool
Discussion Interaction
Build gh-aw
Discussion Creation
Workflow Dispatch
PR Review

Overall: ⚠️ PARTIAL PASS (10/12)

📰 BREAKING: Report filed by Smoke Copilot · ● 860.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.

This PR adds MCP server CLI mounting to all workflow lock files — a useful improvement for discoverability. The pattern of continue-on-error: true is appropriate for non-critical tooling. Two minor suggestions: add explicit success logging in the script, and consider documenting the mount_mcp_as_cli.cjs function signature for future maintainers.

📰 BREAKING: Report filed by Smoke Copilot · ● 860.4K

"apiKey": "${MCP_GATEWAY_API_KEY}",
"payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
}
}
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.

Consider adding a debug output after await main() (e.g., core.info('MCP CLI mounts completed')) to make it easier to diagnose issues in the Actions log when continue-on-error silently eats failures.

"apiKey": "${MCP_GATEWAY_API_KEY}",
"payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
}
}
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.

The continue-on-error: true flag is appropriate here since mounting MCP CLIs is non-critical — failing silently is better than blocking the workflow. Good defensive pattern. 👍

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

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

@github-actions

This comment has been minimized.

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 4, 2026

@copilot merge main and recompile

…-mounting-mcp-servers

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

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

Copilot AI commented Apr 4, 2026

@copilot merge main and recompile

Done in d22ea30. Merged main and recompiled all 181 workflows successfully.

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)
  • 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/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility it} (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:

@pelikhan pelikhan removed the smoke label Apr 4, 2026
@pelikhan pelikhan marked this pull request as ready for review April 4, 2026 18:44
Copilot AI review requested due to automatic review settings April 4, 2026 18:44
@pelikhan pelikhan added the smoke label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

📰 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 4, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

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

github-actions bot commented Apr 4, 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 4, 2026

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 10.0.201
dotnet 10.0.201

Result: 12/12 tools available ✅

Overall Status: PASS

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in workflow feature to mount MCP servers as local CLI commands after the MCP gateway starts, and injects a prompt section listing those CLIs so the agent uses wrappers instead of speaking MCP directly.

Changes:

  • Introduces a new tools.mount-as-clis flag, plus workflow generation to run a post-gateway “mount as CLI” step.
  • Adds a Node script to read an MCP manifest, discover server tools, and generate read-only CLI wrapper scripts on PATH.
  • Updates gateway config conversion scripts and prompt placeholder validation to support the new prompt section and filtering behavior.
Show a summary per file
File Description
pkg/workflow/unified_prompt_step.go Injects the new <mcp-clis> prompt section into the unified prompt.
pkg/workflow/tools_types.go Adds MountAsCLIs to typed tools config.
pkg/workflow/tools_parser.go Parses mount-as-clis from tools: and excludes it from custom tool detection.
pkg/workflow/prompt_constants.go Adds constant for the new prompt template filename.
pkg/workflow/mcp_setup_generator.go Exports GH_AW_MCP_CLI_SERVERS for downstream config filtering.
pkg/workflow/mcp_rendering.go Documents that CLI-mounted servers remain in gateway config; filtering occurs later.
pkg/workflow/mcp_cli_mount.go New logic to compute CLI-mounted server list, generate mount step, and build prompt section.
pkg/workflow/compiler_yaml_main_job.go Adds a generated “Mount MCP servers as CLIs” step after MCP setup.
pkg/parser/schemas/main_workflow_schema.json Adds schema for tools.mount-as-clis.
actions/setup/sh/validate_prompt_placeholders.sh Ignores backtick-quoted placeholder names during placeholder validation.
actions/setup/sh/validate_prompt_placeholders_test.sh Adds regression test for backtick-quoted placeholder names.
actions/setup/sh/start_mcp_gateway.sh Saves a CLI manifest and filters CLI-mounted servers out of fallback agent config.
actions/setup/sh/convert_gateway_config_gemini.sh Filters CLI-mounted servers out of Gemini agent MCP config.
actions/setup/sh/convert_gateway_config_copilot.sh Filters CLI-mounted servers out of Copilot agent MCP config.
actions/setup/sh/convert_gateway_config_codex.sh Filters CLI-mounted servers out of Codex agent MCP config output.
actions/setup/sh/convert_gateway_config_claude.sh Filters CLI-mounted servers out of Claude agent MCP config.
actions/setup/md/mcp_cli_tools_prompt.md New prompt template describing how to use mounted MCP CLIs.
actions/setup/js/mount_mcp_as_cli.cjs New script that reads manifest, performs MCP handshake, and generates CLI wrappers.
.github/workflows/smoke-copilot.md Enables mount-as-clis: true and updates smoke prompts to use CLI syntax.
.github/workflows/smoke-copilot.lock.yml Recompiled lockfile reflecting the new mount step and prompt injection.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

pkg/workflow/mcp_cli_mount.go:54

  • getMCPCLIServerNames currently returns "agentic-workflows" for the built-in tool, but the actual MCP server ID used in gateway configs (and thus in the CLI manifest / wrapper name) is "agenticworkflows" (no hyphen). This mismatch is visible in the compiled lock file where GH_AW_MCP_CLI_SERVERS contains "agentic-workflows" while the gateway config key is "agenticworkflows", so filtering won’t remove it from the agent config and the prompt will advertise a non-existent CLI name. Please map tool keys to the correct MCP server IDs (e.g., use constants.AgenticWorkflowsMCPServerID.String()).
		// Only include tools that have MCP servers (skip bash, web-fetch, web-search, edit, cache-memory, etc.)
		switch toolName {
		case "github", "playwright", "qmd", "agentic-workflows":
			servers = append(servers, toolName)
		default:

actions/setup/js/mount_mcp_as_cli.cjs:419

  • Server names from the manifest are used directly in path.join() and interpolated into the generated bash script (e.g., TOOLS_DIR/${name}.json, CLI_BIN_DIR/name, and SERVER_NAME="${serverName}"). Because MCP server IDs ultimately come from user-controlled config keys and aren’t validated/sanitized, a malicious name containing path separators or quotes could write files outside the intended directory or break the generated script. Please validate/sanitize name to a safe identifier (e.g., restrict to [A-Za-z0-9._-]+ and skip/warn otherwise) before using it in paths or templates.
  for (const server of servers) {
    const { name, url } = server;
    core.info(`Mounting MCP server '${name}' (url: ${url})...`);

    const toolsFile = path.join(TOOLS_DIR, `${name}.json`);

    // Query tools from the server
    const tools = await fetchMCPTools(url, apiKey, core);
    core.info(`  Found ${tools.length} tool(s)`);

    // Cache the tool list
    try {
      fs.writeFileSync(toolsFile, JSON.stringify(tools, null, 2), { mode: 0o644 });
    } catch (err) {
      core.warning(`  Failed to write tools cache for ${name}: ${err instanceof Error ? err.message : String(err)}`);
    }

    // Write the CLI wrapper script
    const scriptPath = path.join(CLI_BIN_DIR, name);
    try {
      fs.writeFileSync(scriptPath, generateCLIWrapperScript(name, url, toolsFile), { mode: 0o755 });
  • Files reviewed: 20/20 changed files
  • Comments generated: 5

Comment on lines +88 to +89
// a read-only directory added to PATH, and those servers are removed from the
// MCP gateway config (so the agent uses the CLI instead of the MCP protocol).
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The MountAsCLIs doc comment says CLI-mounted servers are removed from the “MCP gateway config”, but this PR’s implementation keeps them in the gateway config and instead filters them out of the agent’s final MCP config (via GH_AW_MCP_CLI_SERVERS + convert_gateway_config_*.sh). Please update this comment to reflect the actual behavior to avoid misleading future changes.

Suggested change
// a read-only directory added to PATH, and those servers are removed from the
// MCP gateway config (so the agent uses the CLI instead of the MCP protocol).
// a read-only directory added to PATH. The servers remain in the MCP gateway
// config, but are filtered out of the agent's final MCP config so the agent
// uses the CLI instead of the MCP protocol.

Copilot uses AI. Check for mistakes.
},
"mount-as-clis": {
"type": "boolean",
"description": "When true, each user-facing MCP server is mounted as a standalone CLI tool on PATH. The agent can then call MCP servers via shell commands (e.g. 'github issue_read --method get ...'). Servers that are CLI-mounted are removed from the MCP gateway config. Default: false.",
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

Schema description for tools.mount-as-clis claims CLI-mounted servers are removed from the “MCP gateway config”, but the code now explicitly keeps them in the gateway config (so containers start) and only removes them from the agent’s final config in convert_gateway_config_*.sh. Please update the schema description so it matches the runtime behavior.

Suggested change
"description": "When true, each user-facing MCP server is mounted as a standalone CLI tool on PATH. The agent can then call MCP servers via shell commands (e.g. 'github issue_read --method get ...'). Servers that are CLI-mounted are removed from the MCP gateway config. Default: false.",
"description": "When true, each user-facing MCP server is mounted as a standalone CLI tool on PATH. The agent can then call MCP servers via shell commands (e.g. 'github issue_read --method get ...'). CLI-mounted servers remain in the MCP gateway config so their containers can start, and are removed only from the agent's final config during convert_gateway_config_*.sh processing. Default: false.",

Copilot uses AI. Check for mistakes.
// actions/github-script which:
// - Reads the CLI manifest saved by start_mcp_gateway.sh
// - Queries each server for its tools/list via JSON-RPC
// - Writes a standalone CLI wrapper script for each server to /tmp/gh-aw/mcp-cli/bin/
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The file header comment says CLI wrapper scripts are written to /tmp/gh-aw/mcp-cli/bin/, but mount_mcp_as_cli.cjs generates them under ${RUNNER_TEMP}/gh-aw/mcp-cli/bin so they’re accessible inside the AWF sandbox. Please update this comment to match the actual output path.

This issue also appears on line 50 of the same file.

Suggested change
// - Writes a standalone CLI wrapper script for each server to /tmp/gh-aw/mcp-cli/bin/
// - Writes a standalone CLI wrapper script for each server to ${RUNNER_TEMP}/gh-aw/mcp-cli/bin/

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +25
// should not be exposed as user-facing CLI tools.
var internalMCPServerNames = map[string]bool{
"safeoutputs": true,
"mcp-scripts": true,
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

internalMCPServerNames includes "mcp-scripts", but the actual MCP server ID used in rendered gateway configs is "mcpscripts" (see pkg/constants/job_constants.go) and the manifest will therefore contain "mcpscripts". As-is, enabling mount-as-clis can accidentally expose the internal mcpscripts server as a CLI. Consider excluding both "mcp-scripts" (config key) and "mcpscripts" (server ID) consistently.

Suggested change
// should not be exposed as user-facing CLI tools.
var internalMCPServerNames = map[string]bool{
"safeoutputs": true,
"mcp-scripts": true,
// should not be exposed as user-facing CLI tools.
// Include both config-key and rendered server-ID variants where they differ.
var internalMCPServerNames = map[string]bool{
"safeoutputs": true,
"mcp-scripts": true,
"mcpscripts": true,

Copilot uses AI. Check for mistakes.
const TOOLS_DIR = `${RUNNER_TEMP}/gh-aw/mcp-cli/tools`;

/** MCP servers that are internal infrastructure and should not be user-facing CLIs */
const INTERNAL_SERVERS = new Set(["safeoutputs", "mcp-scripts"]);
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

INTERNAL_SERVERS excludes "mcp-scripts", but the gateway/server ID is "mcpscripts" (no hyphen). The CLI manifest will therefore contain "mcpscripts" and this step will mount it as a user-facing CLI unless it’s added to the internal exclusion list (or otherwise filtered).

This issue also appears on line 399 of the same file.

Suggested change
const INTERNAL_SERVERS = new Set(["safeoutputs", "mcp-scripts"]);
const INTERNAL_SERVERS = new Set(["safeoutputs", "mcp-scripts", "mcpscripts"]);

Copilot uses AI. Check for mistakes.
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 4, 2026

@copilot read comments

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Smoke Test §23985224521 — PR #24503 (@copilot-swe-agent, assignees: @pelikhan, @Copilot)

Test Result
GitHub CLI ⚠️ (syntax error in generated scripts)
MCP Scripts GH CLI
Serena CLI ❌ (same syntax error)
Playwright CLI ❌ (same syntax error)
Web Fetch
File Writing
Bash Tool
Discussion Interaction
Build gh-aw
Discussion Creation
Workflow Dispatch
PR Review

Overall: ⚠️ PARTIAL PASS — Generated MCP CLI bash scripts have a syntax error (unclosed quote in multi-line jq expression).

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

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 for PR #24503 — MCP CLI mounting feature. The new mount_mcp_as_cli.cjs and mcp_cli_mount.go add a nice ergonomic improvement for agents. Two issues found: (1) generated bash scripts have a syntax error from an unclosed quote in the multi-line jq expression (bash -n validation fails); (2) the RUNNER_TEMP fallback path is hardcoded. The build passes, file writing and web-fetch work correctly. The core concept is solid but the script generation needs a fix before the CLIs are usable.

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

const MANIFEST_FILE = "/tmp/gh-aw/mcp-cli/manifest.json";
// Use RUNNER_TEMP so the bin and tools directories are inside the AWF sandbox mount
// (AWF mounts ${RUNNER_TEMP}/gh-aw read-only; /tmp/gh-aw is not accessible inside AWF)
const RUNNER_TEMP = process.env.RUNNER_TEMP || "/home/runner/work/_temp";
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.

The RUNNER_TEMP fallback to /home/runner/work/_temp is reasonable, but consider using a more portable fallback like process.env.RUNNER_TEMP || path.join(require('os').tmpdir(), 'gh-aw') to avoid hardcoding a runner-specific path.

"GH_AW_MCP_CLI_SERVERS_LIST": serversList,
},
}
}
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.

The multi-line jq expression that generates CLI output formatting (lines 153-158 of the generated bash scripts) contains an unclosed string literal, causing a bash syntax error (unexpected EOF while looking for matching '"'). The generated scripts fail with bash -n validation. The jq expression spanning multiple lines needs to be handled carefully to avoid shell quoting issues — consider using a heredoc or single-quoted jq string.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Smoke Test Results — Run §23985224528

Core tests #1–12: ✅✅✅✅✅✅✅✅✅✅✅✅
PR review tests #13–19: ✅✅✅✅⚠️✅✅⚠️

Status: PARTIAL — all executed tests passed; #16 (resolve thread, no node IDs available) and #19 (close PR, skipped) were skipped.

💥 [THE END] — Illustrated by Smoke Claude · ● 249.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!

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

...headers,
},
};

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.

The httpPostJSON helper is clean and well-structured. Consider adding a note in the JSDoc about the 15s default timeout behavior, since callers for initialize and tools/list have different latency expectations.

# Show all available tools for a server
<server-name> --help

# Show help for a specific tool
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.

Good use of structured CLI usage examples. Would be helpful to add an example showing how to handle multi-word values with spaces (e.g., --param "value with spaces") since agents may need this for natural-language inputs.

…ripts exclusion

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/4e66887c-a46e-489f-83bd-7d092d487482

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

Copilot AI commented Apr 4, 2026

@copilot read comments

Addressed all 5 review comments in 2946954:

  1. Fixed MountAsCLIs doc comment in tools_types.go — now correctly says servers stay in the gateway config and are filtered from the agent's final config.
  2. Updated mount-as-clis schema description to match the actual runtime behavior (gateway config unchanged, agent config filtered by convert_gateway_config_*.sh).
  3. Fixed file header comment in mcp_cli_mount.go — output path is now ${RUNNER_TEMP}/gh-aw/mcp-cli/bin/ (not /tmp/gh-aw/).
  4. Added "mcpscripts": true to internalMCPServerNames in mcp_cli_mount.go to exclude the rendered server ID.
  5. Added "mcpscripts" to INTERNAL_SERVERS Set in mount_mcp_as_cli.cjs for the same reason.

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)
  • 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)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha th .prettierigno-errorsas (http block)
  • https://api.github.com/repos/github/gh-aw
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw --jq .visibility (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 ../pkg/workflow/-errorsas (http block)

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

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.

3 participants