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
{{ message }}
Repository navigation
Add a stable environment variable for local MCP servers to detect Copilot CLI as their host #2107
Describe the feature or problem you'd like to solve
MCP servers launched by Copilot CLI currently have no reliable, intentional way to detect they're running under the CLI - COPILOT_CLI_BINARY_VERSION only works in SEA mode and COPILOT_RUN_APP is an internal loader implementation detail. Adding a deliberate env var like COPILOT_CLI=true in setupProcess.ts would provide a stable, documented signal that works across both SEA and source modes, enabling MCP servers to adapt behavior or log appropriate details based on their host without requiring special arguments in the server configuration. This also layers cleanly with existing env vars like MSFT_AGENCY to let consumers infer the full orchestration stack.
Proposed solution
Defining the name of the env var is probably one of the hardest parts. Assuming for the moment that we pick something like COPILOT_CLI, then one option for implementation would be to set process.env.COPILOT_CLI = "true" in setupProcess.ts, which runs early in the CLI entry point across all modes (interactive, server, ACP) and in both SEA and source builds. Since this env var isn't in the filter list, it naturally propagates to MCP server child processes via the existing environment inheritance.
Example prompts or workflows
N/A
Additional context
The MCP initialize handshake already sends clientInfo.name: "github-copilot-developer", but that value is shared with CCA and other hosts, so it only tells you "some Copilot client" — not specifically the CLI.
The DO NOT CHANGE THE CLIENT NAME comments in the codebase confirm MCP servers already rely on client identification — this request aligns with that existing pattern but fills the CLI-specific gap.
Telemetry is a specific use-case here, but there are likely others.
Additionally, current environment variables that could be used to detect CCA as their host are not propagated to the MCP server due to existing environment inheritance. For the same reasons, an env var for detecting CCA that is propagated to MCP servers would be helpful as well.
Thanks for the report. We've shipped fixes in this area since this was filed (most recently in Copilot CLI v1.0.28), and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.
Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.
Activity
lonitra commentedon Apr 7, 2026
Additionally, current environment variables that could be used to detect CCA as their host are not propagated to the MCP server due to existing environment inheritance. For the same reasons, an env var for detecting CCA that is propagated to MCP servers would be helpful as well.
fix: ARIS#360 Layer 1 — copilot CLI contract fixes from live testing
patniko commentedon Oct 26, 2026
Thanks for the report. We've shipped fixes in this area since this was filed (most recently in Copilot CLI v1.0.28), and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.
Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.