You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature or problem you'd like to solve
Make it possible to extend / override MCP configuration for a single session without destructive edits to user config
Proposed solution
My proposed solution would be something like Claude Code's or Amp's --mcp-config (which takes an MCP config file directly) or Codex CLI's --config (which can override any configuration parameter).
The user would invoke Copilot CLI with their transient config:
copilot --mcp-config my_temporary_config.json
This could be useful:
When integrating Copilot CLI with an external tool that can export its functionality over HTTP on a dynamic port (this is my specific use case).
To easily switch between different MCP configurations during development, without having to make permanent edits to project- or user-wide config.
For automated testing, in which instances MCP servers may be started dynamically (in parallel) on a number of ports.
Example prompts or workflows
My target use case:
My tool (which has its own, user-facing interface) wants to invoke the services of Copilot CLI as an agentic backend.
My tool starts an MCP server to expose its functionality on a dynamically-allocated HTTP port.
My tool invokes Copilot CLI, which takes on its usual configuration for the user / project but also applies the settings passed by --mcp-config so that it can find my tool's MCP server instance and provide user assistance.
Copilot CLI accomplishes agentic work with my tool.
Copilot CLI exits and my tool shuts down its MCP server instance.
Good suggestion, thanks. In general we want to expand the flexibility of the config system considerably, including the ability to have per-project config and config files passed in from the command line. As per your suggestion we should include the MCP configuration files in that.
(this assumes my_temporary_config.json is located in your CWD).
This aguments, the configuration you have in the tool via /mcp (which lives in ~/.copilot/`).
Note you can use this to change the configuration of a server you have configured. If the same server name appears in the system configuration and in a JSON blob provided via --additional-mcp-config, we use the configuration from the one that came from --additional-mcp-config.
Hope this helps, @mark-undoio and you build cool stuff with it!
I'll update our implementation to use this (we'd been setting alternate XDG directories to make Copilot find our updated config in another place - this will be much cleaner and more robust).
Activity
SteveSandersonMS commentedon Sep 26, 2025
Good suggestion, thanks. In general we want to expand the flexibility of the config system considerably, including the ability to have per-project config and config files passed in from the command line. As per your suggestion we should include the MCP configuration files in that.
ellismg commentedon Nov 4, 2025
We did something like this, with a few small tweaks from what you describe in the issue:
--additional-mcp-configas the flag instead of just--mcp-config. This flag may be specificed multiple times.@as a prefix to point it at a file.So in your example it would be:
(this assumes
my_temporary_config.jsonis located in your CWD).This aguments, the configuration you have in the tool via
/mcp (which lives in~/.copilot/`).Note you can use this to change the configuration of a server you have configured. If the same server name appears in the system configuration and in a JSON blob provided via
--additional-mcp-config, we use the configuration from the one that came from--additional-mcp-config.Hope this helps, @mark-undoio and you build cool stuff with it!
mark-undoio commentedon Nov 6, 2025
Thank you @ellismg - this will be very useful.
I'll update our implementation to use this (we'd been setting alternate XDG directories to make Copilot find our updated config in another place - this will be much cleaner and more robust).
Explain: Improve configuration using --additional-mcp-config.