Skip to content

Conversation

@connor4312
Copy link
Member

  • Now that MCP autostart is on by default, we can remove the special
    eager activation we did for extensions.
  • Also support a when clause for MCP extension collections, so they
    can be activated lazily and specifically.

Closes #266221

- Now that MCP autostart is on by default, we can remove the special
  eager activation we did for extensions.
- Also support a `when` clause for MCP extension collections, so they
  can be activated lazily and specifically.

Closes #266221
Copilot AI review requested due to automatic review settings September 24, 2025 05:07
@connor4312 connor4312 enabled auto-merge (squash) September 24, 2025 05:07
@connor4312 connor4312 self-assigned this Sep 24, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes automatic eager activation of MCP extensions and introduces support for conditional activation via when clauses. With MCP autostart now enabled by default, the special eager activation behavior is no longer needed, allowing extensions to be activated lazily based on specific conditions.

Key changes:

  • Removed auto-discovery and eager activation logic from McpLanguageModelToolContribution
  • Added support for when clause in MCP extension collections for conditional activation
  • Enhanced McpService.autostart() to activate collections before processing servers

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/vs/workbench/contrib/mcp/common/mcpService.ts Added early return for disabled autostart and collection activation call
src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.ts Removed auto-discovery logic and LazyCollectionState import
src/vs/workbench/contrib/mcp/common/mcpConfiguration.ts Added when property to MCP collection contribution schema
src/vs/workbench/contrib/mcp/common/discovery/extensionMcpDiscovery.ts Implemented conditional collection registration with context key evaluation
src/vs/workbench/api/browser/mainThreadMcp.ts Added conditional registration logic for extension-provided collections
src/vs/platform/extensions/common/extensions.ts Added optional when property to IMcpCollectionContribution interface

@vs-code-engineering vs-code-engineering bot added this to the September 2025 milestone Sep 24, 2025
@connor4312 connor4312 merged commit 3765e5a into main Sep 24, 2025
28 checks passed
@connor4312 connor4312 deleted the connor4312/266221 branch September 24, 2025 05:23
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Server results in extension always activating in all workspaces (even empty ones)

3 participants