Skip to content

mcp: Activate lazy providers in Agent Customizations - #334411

Open
kondv wants to merge 1 commit into
microsoft:mainfrom
kondv:dev/kondv/mcp-extension-provider-agent-window
Open

mcp: Activate lazy providers in Agent Customizations#334411
kondv wants to merge 1 commit into
microsoft:mainfrom
kondv:dev/kondv/mcp-extension-provider-agent-window

Conversation

@kondv

@kondv kondv commented Sep 4, 2026

Copy link
Copy Markdown

Fixes #327317

Problem

Extension-contributed MCP providers are registered as uncached lazy collections with no initial server definitions. Opening Agent Customizations > MCP Servers refreshed the already-materialized server list but did not activate those collections, so the provider extension remained inactive and its servers were absent.

Running another discovery command such as MCP: List Servers activated the same provider and made the server appear, which explains why reinstalling or interacting with the regular VS Code MCP surface temporarily repaired the Agent Customizations list.

Change

Activate MCP collections when the MCP management section becomes visible and when MCP access is restored while that section is already visible.

Activation remains scoped to explicit user intent: this does not eagerly activate MCP providers during workbench startup. It is gated by MCP access, repeated visibility notifications remain idempotent, and provider activation failures are surfaced through the notification service.

Validation

  • npm run gulp compile-client
  • scripts/test.bat --run src\vs\workbench\contrib\chat\test\browser\aiCustomization\mcpListWidget.test.js — 43 passing
  • Targeted ESLint and git diff --check
  • Added coverage for:
    • activation on the first visible transition;
    • no activation while MCP access is disabled;
    • activation when access is restored while visible;
    • user-visible activation errors.
  • Live Code OSS A/B with an isolated profile and a lazy extension-contributed MCP provider:
    • Unpatched: opening Agent Customizations left the provider inactive and the server absent; running MCP: List Servers activated it and made the server appear.
    • Patched: opening the MCP section activated the provider immediately and showed the server before any discovery command was run.

Copilot AI balanced review requested due to automatic review settings September 4, 2026 04:16
@kondv

kondv commented Sep 4, 2026

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

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.

🟢 Approval recommended

The focused implementation matches the reported scenario and is adequately covered by tests.

Pull request overview

Activates lazy extension-contributed MCP providers when users view the MCP customization section, while respecting MCP access controls.

Changes:

  • Activates collections on visibility and restored access.
  • Reports activation failures and adds focused tests.
File summaries
File Description
mcpListWidget.ts Adds gated provider activation and error reporting.
mcpListWidget.test.ts Tests activation, access gating, idempotency, and errors.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Agent Window MCP server List does not match what is in VS Code

3 participants