Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Updates the MCP gateway launch script to delete the MCP server configuration file at /home/runner/.copilot/mcp-config.json after the gateway is successfully launched and configured.

Changes Made

Modified actions/setup/sh/start_mcp_gateway.sh to add cleanup logic that:

  • Deletes /home/runner/.copilot/mcp-config.json after gateway setup is complete
  • Runs after the gateway is started, converter scripts execute, and MCP server checks pass
  • Works for all engine types (copilot, claude, codex, and fallback)
  • Follows the same cleanup pattern as the existing gateway output file deletion

Implementation 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

  • ✅ Script syntax validated
  • ✅ Code formatting passed (make fmt)
  • ✅ Unit tests passed
  • ✅ Changes follow existing codebase patterns

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Changeset

  • Type: patch
  • Description: Remove /home/runner/.copilot/mcp-config.json after the MCP gateway starts so the temporary config is not left on disk.

Generated by Changeset Generator

@pelikhan
Copy link
Contributor

@copilot keep working

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

@copilot keep working

Copy link
Contributor Author

Copilot AI commented Feb 10, 2026

@copilot keep working

Completed! The MCP gateway launch script now deletes /home/runner/.copilot/mcp-config.json after the gateway is launched and configured (commit ca7f48e).

Copilot AI changed the title [WIP] Update mcp gateway launch script to delete server config file Update mcp gateway launch script to delete server config file Feb 10, 2026
@pelikhan pelikhan added the smoke label Feb 10, 2026
@pelikhan pelikhan marked this pull request as ready for review February 10, 2026 02:30
Copilot AI review requested due to automatic review settings February 10, 2026 02:30
@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

🧪 Smoke Project is now testing project operations...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

Changeset Generator completed successfully!

@github-actions
Copy link
Contributor

Smoke Project completed successfully. All project operations validated.

@github-actions
Copy link
Contributor

Smoke test (Codex)
PRs: #14700 Add git credentials cleanup and regeneration for agent execution; #14702 Apply strict matching to slash commands (startsWith + exact equality)
GitHub MCP: ✅
Serena MCP: ✅
Playwright: ✅
File write+cat: ✅
Build: ✅
Overall: PASS

AI generated by Smoke Codex

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +416 to +420
# 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"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@pelikhan pelikhan closed this Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants