From 6307b2e05830e59099f10a3ab650a9ef56e9b9e9 Mon Sep 17 00:00:00 2001 From: Harald Kirschner Date: Thu, 3 Jul 2025 04:23:25 -0700 Subject: [PATCH] Fix MCP configure menu (#253794) --- .../contrib/chat/browser/actions/chatActions.ts | 11 ----------- src/vs/workbench/contrib/mcp/browser/mcpCommands.ts | 9 ++++++++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts index b532a026787..864bdf1f9c5 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts @@ -47,7 +47,6 @@ import { IHostService } from '../../../../services/host/browser/host.js'; import { IWorkbenchLayoutService, Parts } from '../../../../services/layout/browser/layoutService.js'; import { IViewsService } from '../../../../services/views/common/viewsService.js'; import { EXTENSIONS_CATEGORY, IExtensionsWorkbenchService } from '../../../extensions/common/extensions.js'; -import { McpCommandIds } from '../../../mcp/common/mcpCommandIds.js'; import { IChatAgentService } from '../../common/chatAgents.js'; import { ChatContextKeys } from '../../common/chatContextKeys.js'; import { IChatEditingSession, ModifiedFileEntryState } from '../../common/chatEditingService.js'; @@ -879,16 +878,6 @@ Update \`.github/copilot-instructions.md\` for the user, then ask for feedback o icon: Codicon.settings, order: 6 }); - - MenuRegistry.appendMenuItem(CHAT_CONFIG_MENU_ID, { - command: { - id: McpCommandIds.ShowInstalled, - title: localize2('mcp.servers', "MCP Servers") - }, - when: ContextKeyExpr.and(ChatContextKeys.enabled, ContextKeyExpr.equals('view', ChatViewId)), - order: 14, - group: '0_level' - }); } export function stringifyItem(item: IChatRequestViewModel | IChatResponseViewModel, includeName = true): string { diff --git a/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts b/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts index a6ad8e425ea..8d54d9fa28b 100644 --- a/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts +++ b/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts @@ -33,7 +33,7 @@ import { IAccountQuery, IAuthenticationQueryService } from '../../../services/au import { IAuthenticationService } from '../../../services/authentication/common/authentication.js'; import { IEditorService } from '../../../services/editor/common/editorService.js'; import { IViewsService } from '../../../services/views/common/viewsService.js'; -import { IChatWidgetService } from '../../chat/browser/chat.js'; +import { ChatViewId, IChatWidgetService } from '../../chat/browser/chat.js'; import { ChatContextKeys } from '../../chat/common/chatContextKeys.js'; import { ChatModeKind } from '../../chat/common/constants.js'; import { ILanguageModelsService } from '../../chat/common/languageModels.js'; @@ -54,6 +54,7 @@ import { IFileService } from '../../../../platform/files/common/files.js'; import { VSBuffer } from '../../../../base/common/buffer.js'; import { IProductService } from '../../../../platform/product/common/productService.js'; import { IOpenerService } from '../../../../platform/opener/common/opener.js'; +import { CHAT_CONFIG_MENU_ID } from '../../chat/browser/actions/chatActions.js'; // acroynms do not get localized const category: ILocalizedString = { @@ -729,6 +730,12 @@ export class ShowInstalledMcpServersCommand extends Action2 { category, precondition: HasInstalledMcpServersContext, f1: true, + menu: { + id: CHAT_CONFIG_MENU_ID, + when: ContextKeyExpr.and(ChatContextKeys.enabled, ContextKeyExpr.equals('view', ChatViewId)), + order: 14, + group: '0_level' + } }); }