mcp: discover Copilot Home mcp configuration - #333891
Merged
Vritant Bhardwaj (vritant24) merged 7 commits intoSep 2, 2026
Merged
mcp: discover Copilot Home mcp configuration#333891Vritant Bhardwaj (vritant24) merged 7 commits into
Vritant Bhardwaj (vritant24) merged 7 commits into
Conversation
Discover MCP servers from ~/.copilot/mcp-config.json when the corresponding external discovery source is enabled. Avoid forwarding those servers back to Copilot Agent Host, which discovers them natively. Refs #333613 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the configured Copilot home when locating mcp-config.json in both local and remote native discovery, while retaining ~/.copilot as the default location. Refs #333613 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Vritant Bhardwaj (vritant24)
September 1, 2026 23:01
View session
Use CopilotHome to align the source identifier with the COPILOT_HOME environment variable that defines this configuration location. Refs #333613 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Remote Agent Hosts can incorrectly omit locally discovered Copilot MCP configurations that they cannot rediscover.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.ts — This unconditionally treats every Copilot-config collection as visible to the Copilot runtime, but… |
|
src/vs/workbench/contrib/mcp/common/mcpConfiguration.ts — This setting text becomes inaccurate when COPILOT_HOME is set, because discovery then replaces… |
What changed in this PR
Adds opt-in discovery of GitHub Copilot CLI user MCP configuration for local and remote environments.
Changes:
- Discovers
mcp-config.json, honoringCOPILOT_HOME. - Reuses existing parsing, trust, and MCP collection behavior.
- Avoids forwarding configurations expected to be runtime-discovered by Copilot CLI.
| File | Description |
|---|---|
src/vs/platform/mcp/common/nativeMcpDiscoveryHelper.ts |
Adds Copilot home metadata. |
src/vs/platform/mcp/node/nativeMcpDiscoveryHelperService.ts |
Reads COPILOT_HOME. |
src/vs/platform/mcp/test/node/nativeMcpDiscoveryHelperService.test.ts |
Tests environment roots. |
src/vs/workbench/contrib/mcp/common/mcpConfiguration.ts |
Registers the opt-in source. |
src/vs/workbench/contrib/mcp/common/mcpTypes.ts |
Updates provenance documentation. |
src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAdapters.ts |
Adds the Copilot adapter. |
src/vs/workbench/contrib/mcp/common/discovery/nativeMcpDiscoveryAbstract.ts |
Activates discovery and revives its URI. |
src/vs/workbench/contrib/mcp/test/common/nativeMcpDiscoveryAdapters.test.ts |
Tests paths, defaults, and parsing. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.ts |
Classifies Copilot delivery. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostMcpServerSupport.test.ts |
Tests runtime and forwarded delivery. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Vritant Bhardwaj (vritant24)
marked this pull request as ready for review
September 2, 2026 04:53
Martin Aeschlimann (aeschli)
approved these changes
Sep 2, 2026
Vritant Bhardwaj (vritant24)
deleted the
agents/support-changes-investigation-a5ebe3e0
branch
September 2, 2026 15:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
COPILOT_HOMEfor local and remote discovery, falling back to~/.copilot..mcp.jsonparsing, trust, enablement, access, and collision behavior.Fixes #333613
Technical context for AI-assisted review
Intent and previous behavior
Copilot CLI reads user-scoped MCP servers from
~/.copilot/mcp-config.json, but the Local harness only discovered MCP configurations from other supported applications. Moving between the Local and Copilot harnesses therefore required duplicating user configuration.Implementation
The native filesystem discovery pipeline now exposes GitHub Copilot CLI as an opt-in external source. Its adapter reads the same
mcpServersformat used by workspace.mcp.jsonfiles and registers the result with the existing MCP collection pipeline.Native discovery carries
COPILOT_HOMEfrom the process that owns the filesystem, including remote environments. Discovery readsmcp-config.jsonfrom that directory when set and falls back to~/.copilot/mcp-config.jsonwhen unset.Behavior and constraints
chat.mcp.discovery.enabled.copilotremainsfalseby default..mcp.jsondiscovery.