-
Notifications
You must be signed in to change notification settings - Fork 242
Closed
Copy link
Labels
Description
Bug
The Gemini engine compiler generates a CLI invocation with --mcp-config, which the Gemini CLI does not support:
gemini --mcp-config /tmp/gh-aw/mcp-config/mcp-servers.json --output-format json --prompt "..."Gemini CLI rejects this immediately:
Unknown arguments: mcp-config, mcpConfig
Reproduction
Triggered Smoke Gemini workflow on gh-aw-firewall after merging github/gh-aw-firewall#974:
- Failed run: https://github.com/github/gh-aw-firewall/actions/runs/22202278807
- Gemini CLI version:
@google/gemini-cli@0.29.0 - gh-aw version: v0.47.0
Root Cause
The compiled lock file (line 1373) passes --mcp-config as a CLI flag:
gemini --mcp-config /tmp/gh-aw/mcp-config/mcp-servers.json --output-format json --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"Gemini CLI does not have a --mcp-config flag. Instead, it reads MCP server configuration from settings.json files:
- Global:
~/.gemini/settings.json - Project:
.gemini/settings.json
The mcpServers key in settings.json supports command, url, or httpUrl transports. See: https://geminicli.com/docs/tools/mcp-server/
Impact
- Agent never starts (0 turns, 0 tokens)
- All downstream jobs (detection, safe_outputs) are skipped
- The firewall itself works correctly — only the CLI invocation is broken
Suggested Fix
In the Gemini engine command builder (pkg/workflow/gemini_engine.go or equivalent):
- Instead of passing
--mcp-config <path>, write the MCP config to.gemini/settings.json(project-level) as a pre-step before invoking the Gemini CLI - The
settings.jsonformat usesmcpServerskey with server entries containingcommand/url/httpUrl - Remove
--mcp-configfrom the generated command
Comparison with Other Engines
| Engine | MCP Config Method |
|---|---|
| Claude | --mcp-config <path> CLI flag |
| Copilot | --mcp-config-file <path> or ~/.copilot/mcp-config.json |
| Codex | --mcp-config <path> CLI flag |
| Gemini | ~/.gemini/settings.json or .gemini/settings.json file |
Audit Data
gh aw audit 22202278807
- 1 error, 0 warnings
- Agent job: failure
- Duration: 3.8m (mostly container build time)
Reactions are currently unavailable