Skip to content

plugins/mcp: allow disabling/enabling similar to extensions#300273

Merged
connor4312 merged 2 commits intomainfrom
connor4312/mcp-enablement-2
Mar 9, 2026
Merged

plugins/mcp: allow disabling/enabling similar to extensions#300273
connor4312 merged 2 commits intomainfrom
connor4312/mcp-enablement-2

Conversation

@connor4312
Copy link
Copy Markdown
Member

Introduces an EnablementModel which is used to allow users to enable and disable both plugins and MCP at both a workspace and global level. Accessible on the mcp/plugins editors, inline within the marketplace view, and in the chat customizations view.

Closes #243620
Closes #300271

Introduces an EnablementModel which is used to allow users to enable and disable both plugins and MCP at both a workspace and global level. Accessible on the mcp/plugins editors, inline within the marketplace view, and in the chat customizations view.
Copilot AI review requested due to automatic review settings March 9, 2026 21:45
@connor4312 connor4312 enabled auto-merge (squash) March 9, 2026 21:45
@connor4312 connor4312 self-assigned this Mar 9, 2026
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 9, 2026
Copy link
Copy Markdown
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

Adds a shared enablement model (profile + workspace scoped) so users can enable/disable agent plugins and MCP servers consistently across the workbench (editors, marketplace surfaces, and AI Customizations UI), and ensures disabled contributions don’t participate in discovery/tool registration.

Changes:

  • Introduces a reusable EnablementModel persisted in profile/workspace storage and integrates it into agent plugins and MCP services.
  • Updates MCP and plugin discovery/tool registration paths to skip disabled items and surfaces enable/disable actions in relevant UIs.
  • Refactors AI Customizations list UIs with a shared group-header renderer and adds disabled styling/status messaging.

Reviewed changes

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

Show a summary per file
File Description
src/vs/workbench/contrib/mcp/test/common/testMcpService.ts Adds a test enablement model stub to satisfy new IMcpService.enablementModel.
src/vs/workbench/contrib/mcp/test/common/mcpResourceFilesystem.test.ts Updates McpService construction for new storage/enablement dependency.
src/vs/workbench/contrib/mcp/test/common/mcpGatewayToolBrokerChannel.test.ts Extends MCP server test doubles with enablement observable.
src/vs/workbench/contrib/mcp/common/mcpTypes.ts Extends MCP types to expose server enablement and service enablement model.
src/vs/workbench/contrib/mcp/common/mcpService.ts Wires EnablementModel into MCP service and avoids autostart/tooling for disabled servers.
src/vs/workbench/contrib/mcp/common/mcpServer.ts Adds enablement observable on McpServer derived from the enablement model.
src/vs/workbench/contrib/mcp/common/mcpLanguageModelToolContribution.ts Skips registering tools from disabled MCP servers.
src/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery.ts Skips MCP discovery contributions from disabled plugins.
src/vs/workbench/contrib/mcp/browser/mcpWorkbenchService.ts Reacts to server enablement changes and surfaces disabled status messages.
src/vs/workbench/contrib/mcp/browser/mcpServerEditor.ts Adds enable/disable dropdown actions to MCP server editor UI.
src/vs/workbench/contrib/mcp/browser/mcpServerActions.ts Implements MCP enable/disable (global/workspace) actions and adds them to context menus.
src/vs/workbench/contrib/mcp/browser/mcpCommands.ts Updates MCP quick pick to label disabled servers and open details instead of options when disabled.
src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts Updates plugin service stubs to the new enablement model shape.
src/vs/workbench/contrib/chat/test/common/promptSyntax/computeAutomaticInstructions.test.ts Updates plugin service stubs to the new enablement model shape.
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts Filters plugin hooks/prompt contributions based on enablement state.
src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts Introduces plugin enablement model and rewires plugin discovery to use it.
src/vs/workbench/contrib/chat/common/plugins/agentPluginService.ts Updates plugin interfaces to expose enablement state/model instead of boolean enabled.
src/vs/workbench/contrib/chat/common/enablement.ts New shared profile/workspace enablement persistence model and helpers.
src/vs/workbench/contrib/chat/browser/enablementStatusWidget.ts New reusable widget to display “disabled” status messages in editors.
src/vs/workbench/contrib/chat/browser/enablementActions.ts New helper to build standard enable/disable action sets and context menu groups.
src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.ts Updates plugin list UI to reflect enablement states and reuse shared group header renderer.
src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css Adds disabled styling for list items/status badges.
src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts Updates MCP list UI to reflect disabled servers and reuse shared group header renderer.
src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.ts New shared group header renderer used by MCP/plugin list widgets.
src/vs/workbench/contrib/chat/browser/agentPluginsView.ts Updates agent plugins view to use new enablement-based actions and disabled styling.
src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.ts Integrates enable/disable dropdowns and status widget into plugin editor.
src/vs/workbench/contrib/chat/browser/agentPluginActions.ts New shared plugin actions (install/uninstall/open + enablement dropdown/context menu).
src/vs/sessions/contrib/sessions/test/browser/aiCustomizationShortcutsWidget.fixture.ts Updates fixture for plugin service API changes.
src/vs/sessions/contrib/sessions/browser/customizationsToolbar.contribution.ts Updates counts/observers to new plugin service API.
src/vs/sessions/contrib/sessions/browser/customizationCounts.ts Updates plugin counts to new plugin service API.
src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationOverviewView.ts Updates plugin counts to new plugin service API.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts:859

  • Marketplace-installed plugins still have an enabled flag in IPluginMarketplaceService.installedPlugins, but discovery no longer uses it. This likely re-enables plugins that users previously disabled (and makes setInstalledPluginEnabled effectively dead code) unless there is a migration elsewhere. Consider seeding the new EnablementModel from entry.enabled (when no explicit enablement override exists yet) or continue gating discovery based on entry.enabled until the storage-based enablement fully replaces it.
		const installed = this._pluginMarketplaceService.installedPlugins.get();
		const sources: IPluginSource[] = [];

		for (const entry of installed) {
			let stat;
			try {
				stat = await this._fileService.resolve(entry.pluginUri);
			} catch {
				this._logService.debug(`[MarketplaceAgentPluginDiscovery] Could not resolve installed plugin: ${entry.pluginUri.toString()}`);
				continue;
			}

			if (!stat.isDirectory) {
				this._logService.debug(`[MarketplaceAgentPluginDiscovery] Installed plugin path is not a directory: ${entry.pluginUri.toString()}`);
				continue;
			}

			sources.push({
				uri: stat.resource,
				fromMarketplace: entry.plugin,
				remove: () => {

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/vs/workbench/contrib/mcp/test/common/mcpResourceFilesystem.test.ts Outdated
Comment thread src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts Outdated
@connor4312 connor4312 merged commit c3788b7 into main Mar 9, 2026
18 of 19 checks passed
@connor4312 connor4312 deleted the connor4312/mcp-enablement-2 branch March 9, 2026 23:36
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.

Allow enabling/disabling agent plugins per workspace and globally Allow marking servers/tools MCP for enabled/auto-allow in mcp.json

3 participants