Pass MCP environment variables to gateway server#8677
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS. |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️ |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤 |
|
Smoke Test Results ✅ File Writing: Created Status: FAIL (safeinputs-gh tool not accessible)
|
Smoke Test Results: Copilot Engine (Run 20666695018)Last 2 Merged PRs:
Test Results:
Overall Status: PASS (5/6 tests passed; MCP gateway not expected in all environments) cc: @pelikhan
|
|
Firewall smoke test results:
|
Smoke Test Results - Copilot Engine (No Firewall)✅ Test file creation: Successfully created Note: GitHub API access via tools requires authentication which is not available in this workflow context. This is expected behavior for workflows without explicit GitHub token permissions.
|
|
PRs:
|
Smoke Test Results (Run 20666695046)✅ Cache Memory Test: Successfully wrote and verified file at ❌ Playwright MCP Test: Cannot test - requires full GitHub Actions environment with compiled workflow ❌ Safe Input GH Tool Test: Tool Overall Status: ❌ FAIL (2/3 tests failed due to environment constraints)
|
Smoke Test Results - Claude EngineLast 2 Merged PRs:
Test Results:
Status: PASS (5/6 tests passed)
|
The MCP gateway server (awmg) was failing to spawn MCP clients because secrets and environment variables configured in the "Setup MCPs" step were not available when the gateway process started.
Changes
Centralized environment variable collection (
pkg/workflow/mcp_servers.go)collectMCPEnvironmentVariables()helper that gathers all MCP-related env vars (GitHub tokens, safe-inputs/outputs config, Playwright secrets)generateMCPSetup()to use centralized helper, eliminating ~80 lines of duplicate logicGateway step generation (
pkg/workflow/gateway.go)generateMCPGatewaySteps()andgenerateMCPGatewayStartStep()to acceptmcpEnvVars map[string]stringparameterenv:block with alphabetically sorted variables matching "Setup MCPs" stepTest coverage (
pkg/workflow/gateway_test.go)Result
The "Start MCP Gateway" step now includes the same environment variables as "Setup MCPs":
Gateway can now access all necessary secrets when spawning MCP clients.
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/user/usr/bin/gh gh api user --jq .login wright" --help REDACTED nfig/composer/vendor/bin/bash g_.a 17gxpsi6sEqQqZZz-50 rg/toolchain@v0.0.1-go1.25.0.linux-amd64/pkg/too/home/REDACTED/work/gh-aw/gh-aw/.github/workflows infocmp -1(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.