fix: wire MCP gateway into Gemini CLI settings (localhost) - #2405
Conversation
The MCP gateway writes github and safeoutputs server config to .gemini/settings.json, but uses host.docker.internal URLs which don't resolve on the host runner (only inside Docker containers). Gemini runs directly on the host (unlike Claude which runs inside AWF), so the URLs need to use localhost instead. This patch: - Replaces host.docker.internal with localhost in settings.json - Sets trust=true on MCP servers for --yolo mode compatibility - Logs the final settings for debugging Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Smoke Test Results
Overall Status: PASS
|
There was a problem hiding this comment.
Pull request overview
This PR patches the generated Smoke Gemini workflow lock file to make Gemini CLI (running on the host runner) able to reach MCP tools exposed by the MCP gateway that currently emits host.docker.internal URLs.
Changes:
- Post-processes
.gemini/settings.jsonto replacehost.docker.internalwithlocalhost. - Forces
trust: trueon all configured MCP servers for--yoloruns. - Adds debug logging of the final Gemini settings.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/smoke-gemini.lock.yml | Rewrites MCP server URLs for host execution, sets MCP trust flags, and logs resulting Gemini settings for debugging. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
| echo "Final Gemini settings:" | ||
| cat "$SETTINGS" |
| if [ -f "$SETTINGS" ] && jq -e '.mcpServers' "$SETTINGS" > /dev/null 2>&1; then | ||
| jq '.mcpServers |= with_entries(.value.trust = true)' "$SETTINGS" > "${SETTINGS}.tmp" && mv "${SETTINGS}.tmp" "$SETTINGS" | ||
| echo "Set trust=true on all MCP servers" |
|
Smoke test results: Status: PASS
|
🏗️ Build Test Suite Results
Overall: 0/8 ecosystems passed — ❌ FAIL Error DetailsAll repository clones failed. The Action required: Ensure the workflow passes
|
🤖 Smoke Test Results
PR: "fix: wire MCP gateway into Gemini CLI settings (localhost)" by @lpcox (reviewers: Overall: FAIL — Pre-computed smoke data was not substituted into the agent prompt; tests 2 and 3 could not be verified.
|
|
fix: move smoke-gemini tests into agent container Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK (Offline) — Results
Running in BYOK offline mode ( Overall: PARTIAL — tests 2 & 3 indeterminate due to unexpanded workflow template variables. Author: @lpcox. Reviewer:
|
Smoke Test Results
Overall: FAIL —
|
Problem
The smoke-gemini workflow fails at "Validate safe outputs were invoked" because Gemini CLI can't reach MCP tools (github, safeoutputs).
Root cause: The MCP gateway correctly writes MCP server config to
.gemini/settings.jsonwith URLs likehttp://host.docker.internal:8080/mcp/github. However,host.docker.internalonly resolves inside Docker containers. Unlike Claude (which runs inside AWF), Gemini runs directly on the host runner wherehost.docker.internaldoesn't resolve.The gateway log shows it wrote the config:
But Gemini reported:
MCP issues detected. Run /mcp list for status.Fix
Modifies the "Write Gemini Config" step in the lock file to:
host.docker.internalwithlocalhostin MCP server URLstrust: trueon MCP servers for yolo mode compatibilityNote
This is a manual lock file patch to test the diagnosis. The proper fix belongs in gh-aw's Gemini engine compiler. If this works, we should file a gh-aw issue.
Failed run
https://github.com/github/gh-aw-firewall/actions/runs/25259025540