Update mcp gateway launch script to delete server config file#14719
Update mcp gateway launch script to delete server config file#14719
Conversation
|
@copilot keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot keep working |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🧪 Smoke Project is now testing project operations... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✅ Changeset Generator completed successfully! |
|
✅ Smoke Project completed successfully. All project operations validated. |
|
Smoke test (Codex)
|
There was a problem hiding this comment.
Pull request overview
Updates the MCP gateway startup script to delete the generated Copilot MCP config file (/home/runner/.copilot/mcp-config.json) after gateway startup completes, mirroring the existing cleanup of gateway-output.json.
Changes:
- Add post-start cleanup that removes
/home/runner/.copilot/mcp-config.jsonif present. - Emit status messages indicating whether the config file was deleted or not found.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Delete MCP server configuration file after gateway is launched | ||
| echo "Cleaning up MCP server configuration file..." | ||
| if [ -f /home/runner/.copilot/mcp-config.json ]; then | ||
| rm /home/runner/.copilot/mcp-config.json | ||
| echo "MCP server configuration file deleted" |
There was a problem hiding this comment.
Deleting /home/runner/.copilot/mcp-config.json here will likely break later agent execution: the Copilot engine sets GH_AW_MCP_CONFIG to this path when MCP servers are enabled, and the runtime expects the file to exist during the actual Copilot CLI run. If cleanup is desired for security, consider moving it to the end of the job (e.g., in stop_mcp_gateway.sh or a dedicated always() cleanup step) or gating it behind an opt-in env flag so the config remains available for the agent.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Updates the MCP gateway launch script to delete the MCP server configuration file at
/home/runner/.copilot/mcp-config.jsonafter the gateway is successfully launched and configured.Changes Made
Modified
actions/setup/sh/start_mcp_gateway.shto add cleanup logic that:/home/runner/.copilot/mcp-config.jsonafter gateway setup is completeImplementation Details
The cleanup code (lines 416-424) safely checks if the file exists before deletion and provides informative status messages. This ensures the configuration file is only present while needed during gateway setup and is immediately cleaned up after use, improving security by not leaving configuration data on disk unnecessarily.
Testing
make fmt)💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset
/home/runner/.copilot/mcp-config.jsonafter the MCP gateway starts so the temporary config is not left on disk.