plugins/mcp: allow disabling/enabling similar to extensions#300273
Merged
connor4312 merged 2 commits intomainfrom Mar 9, 2026
Merged
plugins/mcp: allow disabling/enabling similar to extensions#300273connor4312 merged 2 commits intomainfrom
connor4312 merged 2 commits intomainfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
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
EnablementModelpersisted 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
enabledflag inIPluginMarketplaceService.installedPlugins, but discovery no longer uses it. This likely re-enables plugins that users previously disabled (and makessetInstalledPluginEnabledeffectively dead code) unless there is a migration elsewhere. Consider seeding the newEnablementModelfromentry.enabled(when no explicit enablement override exists yet) or continue gating discovery based onentry.enableduntil 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.
roblourens
approved these changes
Mar 9, 2026
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.
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