Skip to content

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

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

feat: mount MCP servers as local CLIs after gateway starts#24503
Copilot wants to merge 15 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 ·



✨ PR Review Safe Output Test - Run 23987300602

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

- 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.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 4, 2026

@copilot merge main and recompile

Done in 3a7b43c. 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)
  • 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 (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:

@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
@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 v4.52.5
curl 8.5.0
gh 2.89.0
node v20.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 · ● 164.5K ·

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Smoke Test Run 23987300602 — Core: ✅✅✅✅✅❌✅✅✅✅✅✅ | PR Review: ✅✅✅⚠️✅✅⚠️ | PARTIAL

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

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 · ● 218.8K

let data = "";
res.on("data", chunk => {
data += chunk;
});
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 function uses a timeout via req.setTimeout but calls req.destroy() which may not cleanly abort ongoing requests. Consider using req.abort() or wrapping in an AbortController for more predictable cleanup.

const path = require("path");

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
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 comment explaining that RUNNER_TEMP is intentionally used over /tmp/gh-aw/ here — the reason (AWF sandbox mount) is important for maintainability and is otherwise non-obvious.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Smoke Test Results — Run §23987300615

Test Status
mcpscripts-gh
Web Fetch
File Writing + Bash
Discussion Interaction
Build gh-aw
Discussion Creation
Workflow Dispatch
PR Review
GitHub/Serena/Playwright CLI ❌ (MCP gateway not at port 80)

Overall: ⚠️ PARTIAL PASS — Core tests pass; MCP gateway CLI tests fail (gateway not running in this context).

PR Author: @copilot-swe-agent | Assignees: @pelikhan, @Copilot

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

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. Two confirmed bugs found during smoke test validation:

  1. Generated bash scripts have syntax error (actions/setup/js/mount_mcp_as_cli.cjs:335): The nested \\" escaping produces \"" in the output bash, which terminates the double-quoted string prematurely. Confirmed: running the generated CLI scripts fails with bash: line 177: unexpected EOF while looking for matching '"'.

  2. Server name mismatch (pkg/workflow/mcp_cli_mount.go:54): "agentic-workflows" vs "agenticworkflows" (no hyphen) — filtering in the gateway config won't work correctly.

Otherwise the feature concept is solid — baking the API key into the script, locking the bin dir with chmod 555, and the MCP session handshake logic are all well done.

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

if echo "\$response" | jq -e ".result.content" >/dev/null 2>&1; then
echo "\$response" | jq -r ".result.content[] |
if .type == \\"text\\" then .text
elif .type == \\"image\\" then \\"[image data - \(.mimeType // \\"unknown\\")]\\""
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.

Bug: Generated bash script has an unclosed quote causing syntax error.

The \\" escaping at end of this line generates \"" in the bash script. In bash double-quoted context, \" is an escaped quote and the trailing " terminates the string prematurely — leaving else (. | tostring)\nend" outside the string, causing bash -n to fail with "unexpected EOF while looking for matching "'".

This is confirmed by testing the generated scripts in this smoke test run.

Fix: Use single quotes for the jq expression, or restructure to avoid nested double-quote escaping:

echo "\$response" | jq -r '.result.content[] | if .type == "text" then .text elif .type == "image" then "[image data - \\(.mimeType // \\"unknown\\")]" else (. | tostring) end'

}
// 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":
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 tool name "agentic-workflows" here doesn't match the MCP server ID used in the gateway config (agenticworkflows without the hyphen). This means GH_AW_MCP_CLI_SERVERS will contain "agentic-workflows" but the gateway config filtering looks for "agenticworkflows", so the server won't be removed from agent MCP config and the generated CLI name won't match the actual server. Consider using constants.AgenticWorkflowsMCPServerID.String() to stay in sync.

@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. 🎤

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 4, 2026

@copilot Confirmed Bug: Generated bash wrapper scripts (from mount_mcp_as_cli.cjs:335) have a syntax error — nested double-quote escaping in the jq -r expression causes bash: unexpected EOF while looking for matching '"'. Also flagged "agentic-workflows" vs "agenticworkflows" name mismatch in mcp_cli_mount.go:54.

…smatch

- Fix bash 'unexpected EOF' in generated CLI wrapper: switch the multi-line
  jq -r expression from double-quoted to single-quoted bash string so that
  double quotes inside the jq filter don't prematurely close the outer string
  (mount_mcp_as_cli.cjs:335)
- Fix agentic-workflows server ID mismatch: getMCPCLIServerNames now emits
  'agenticworkflows' (gateway/manifest ID) instead of 'agentic-workflows'
  (frontmatter key), so GH_AW_MCP_CLI_SERVERS correctly matches manifest
  entries and the convert_gateway_config_*.sh filter works (mcp_cli_mount.go:54)

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/faa03f79-19e9-4c74-b505-9a9b11fdd786

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

Copilot AI commented Apr 4, 2026

@copilot Confirmed Bug: Generated bash wrapper scripts (from mount_mcp_as_cli.cjs:335) have a syntax error — nested double-quote escaping in the jq -r expression causes `bash: unexpected E...

Fixed in 7526d82:

  1. Bash syntax error (mount_mcp_as_cli.cjs:335): Switched the multi-line jq -r expression from a double-quoted to a single-quoted bash string. In the previous double-quoted form, the \" at the end of the elif line was followed by a bare " that prematurely closed the outer bash string, leaving else ... end" dangling. Single-quoted bash strings need no escaping for " characters.

  2. Name mismatch (mcp_cli_mount.go:54): getMCPCLIServerNames now emits "agenticworkflows" (the gateway/manifest server ID) instead of "agentic-workflows" (the frontmatter key). This ensures GH_AW_MCP_CLI_SERVERS correctly matches the manifest entry names and the convert_gateway_config_*.sh filter (select(.key | IN($cliServers[]) | not)) actually excludes the server from the agent's final config.

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 cidrPko/A8NKLbGP-C (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 n_pins.go n_pins_integratiinspect n_pins_logging_tghcr.io/github/serena-mcp-server:latest n_pi�� on&#39; --ignore-path ../../../.prettierignore n_reference_test.go es/.bin/sh n_resolver_test.git n_sha_checker.go-C n_sha_checker_in/home/REDACTED/work/gh-aw/gh-aw/.github/workflows n_sha_checker_terev-parse (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 ath ../../../.pr**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha h ../../../.pret.prettierignore (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 w/js/**/*.json&#39; --ignore-path (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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants