From 14d5176f5fdebbd638c901845cf591d6856f5ce2 Mon Sep 17 00:00:00 2001 From: Josh Spicer <23246594+joshspicer@users.noreply.github.com> Date: Thu, 19 Mar 2026 19:18:27 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20MCP=20servers=20from=20Copilot=20extensio?= =?UTF-8?q?n=20showing=20under=20Extensions=20inste=E2=80=A6=20(#303359)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix MCP servers from Copilot extension showing under Extensions instead of Built-in Servers from github.copilot and github.copilot-chat are now treated as built-in. Only servers from other extensions show under the Extensions group. --- .../browser/aiCustomization/mcpListWidget.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts b/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts index 2dddce3c0f8..84243027596 100644 --- a/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts +++ b/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.ts @@ -17,6 +17,8 @@ import { Button } from '../../../../../base/browser/ui/button/button.js'; import { defaultButtonStyles, defaultInputBoxStyles } from '../../../../../platform/theme/browser/defaultStyles.js'; import { ICommandService } from '../../../../../platform/commands/common/commands.js'; import { IMcpWorkbenchService, IWorkbenchMcpServer, McpConnectionState, McpServerInstallState, IMcpService, IMcpServer } from '../../../../contrib/mcp/common/mcpTypes.js'; +import { IMcpRegistry } from '../../../mcp/common/mcpRegistryTypes.js'; +import { ExtensionIdentifier } from '../../../../../platform/extensions/common/extensions.js'; import { isContributionDisabled } from '../../common/enablement.js'; import { McpCommandIds } from '../../../../contrib/mcp/common/mcpCommandIds.js'; import { autorun } from '../../../../../base/common/observable.js'; @@ -39,8 +41,6 @@ import { IAICustomizationWorkspaceService } from '../../common/aiCustomizationWo import { ICustomizationHarnessService, CustomizationHarness } from '../../common/customizationHarnessService.js'; import { CustomizationGroupHeaderRenderer, ICustomizationGroupHeaderEntry, CUSTOMIZATION_GROUP_HEADER_HEIGHT, CUSTOMIZATION_GROUP_HEADER_HEIGHT_WITH_SEPARATOR } from './customizationGroupHeaderRenderer.js'; import { AgentPluginItemKind, IAgentPluginItem } from '../agentPluginEditor/agentPluginItems.js'; -import { IMcpRegistry } from '../../../mcp/common/mcpRegistryTypes.js'; -import { ExtensionIdentifier } from '../../../../../platform/extensions/common/extensions.js'; const $ = DOM.$; @@ -48,6 +48,12 @@ const MCP_ITEM_HEIGHT = 36; const PLUGIN_COLLECTION_PREFIX = 'plugin.'; +const COPILOT_EXTENSION_IDS = ['github.copilot', 'github.copilot-chat']; + +function isCopilotExtension(id: ExtensionIdentifier): boolean { + return COPILOT_EXTENSION_IDS.some(copilotId => ExtensionIdentifier.equals(id, copilotId)); +} + function getPluginUriFromCollectionId(collectionId: string | undefined): string | undefined { return collectionId?.startsWith(PLUGIN_COLLECTION_PREFIX) ? collectionId.slice(PLUGIN_COLLECTION_PREFIX.length) : undefined; } @@ -737,15 +743,18 @@ export class McpListWidget extends Disposable { isFirst = false; } - // Add plugin-provided, extension-provided, and built-in servers + // Add plugin-provided, extension-provided, and built-in servers. + // Servers from the Copilot extension (github.copilot / github.copilot-chat) + // are treated as built-in; servers from other extensions go under "Extensions". const collectionSources = new Map(this.mcpRegistry.collections.get().map(c => [c.id, c.source])); const pluginServers: IMcpServer[] = []; const extensionServers: IMcpServer[] = []; const otherBuiltinServers: IMcpServer[] = []; for (const server of builtinServers) { + const source = collectionSources.get(server.collection.id); if (server.collection.id.startsWith(PLUGIN_COLLECTION_PREFIX)) { pluginServers.push(server); - } else if (collectionSources.get(server.collection.id) instanceof ExtensionIdentifier) { + } else if (source instanceof ExtensionIdentifier && !isCopilotExtension(source)) { extensionServers.push(server); } else { otherBuiltinServers.push(server);