Skip to content

mcp: discover Copilot Home mcp configuration - #333891

Merged
Vritant Bhardwaj (vritant24) merged 7 commits into
mainfrom
agents/support-changes-investigation-a5ebe3e0
Sep 2, 2026
Merged

mcp: discover Copilot Home mcp configuration#333891
Vritant Bhardwaj (vritant24) merged 7 commits into
mainfrom
agents/support-changes-investigation-a5ebe3e0

Conversation

@vritant24

@vritant24 Vritant Bhardwaj (vritant24) commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Makes MCP servers from the Copilot CLI user configuration available to the Local harness.
  • Adds GitHub Copilot CLI as an opt-in MCP discovery source, disabled by default.
  • Honors COPILOT_HOME for local and remote discovery, falling back to ~/.copilot.
  • Reuses the existing .mcp.json parsing, 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 mcpServers format used by workspace .mcp.json files and registers the result with the existing MCP collection pipeline.

Native discovery carries COPILOT_HOME from the process that owns the filesystem, including remote environments. Discovery reads mcp-config.json from that directory when set and falls back to ~/.copilot/mcp-config.json when unset.

Behavior and constraints

  • chat.mcp.discovery.enabled.copilot remains false by default.
  • Existing MCP access policy, allow/deny filtering, enablement, collision handling, and nonce-based trust remain authoritative.
  • The implementation does not introduce a VS Code-specific Copilot home setting or scan both configured and default homes.
  • Copilot-specific fields outside the shared launch schema retain the same support boundary as workspace .mcp.json discovery.
  • Agent Host delivery behavior is unchanged.

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 AI balanced review requested due to automatic review settings September 1, 2026 23:01
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>
@vritant24 Vritant Bhardwaj (vritant24) changed the title mcp: discover Copilot CLI user configuration mcp: discover Copilot Home mcp configuration Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 High severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
High severity src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostMcpServerSupport.ts — This unconditionally treats every Copilot-config collection as visible to the Copilot runtime, but…
Low severity 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, honoring COPILOT_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.

Comment thread src/vs/workbench/contrib/mcp/common/mcpConfiguration.ts Outdated
@vritant24
Vritant Bhardwaj (vritant24) merged commit a9638dc into main Sep 2, 2026
40 checks passed
@vritant24
Vritant Bhardwaj (vritant24) deleted the agents/support-changes-investigation-a5ebe3e0 branch September 2, 2026 15:25
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ~/.copilot/mcp-config.json in the Local Harness

3 participants