From 4ce6f26ef7a68b49140abc02cf221c86370b6c57 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 7 Nov 2025 10:40:07 +0100 Subject: [PATCH] fix #275478 (#276022) --- src/vs/workbench/contrib/mcp/browser/mcpCommands.ts | 6 +++--- src/vs/workbench/contrib/mcp/browser/mcpServersView.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts b/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts index 5fa3f85a76b..ccaca626ebd 100644 --- a/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts +++ b/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts @@ -657,7 +657,7 @@ export class ResetMcpTrustCommand extends Action2 { title: localize2('mcp.resetTrust', "Reset Trust"), category, f1: true, - precondition: McpContextKeys.toolsCount.greater(0), + precondition: ContextKeyExpr.and(McpContextKeys.toolsCount.greater(0), ChatContextKeys.Setup.hidden.negate()), }); } @@ -885,7 +885,7 @@ export class ShowInstalledMcpServersCommand extends Action2 { id: McpCommandIds.ShowInstalled, title: localize2('mcp.command.show.installed', "Show Installed Servers"), category, - precondition: HasInstalledMcpServersContext, + precondition: ContextKeyExpr.and(HasInstalledMcpServersContext, ChatContextKeys.Setup.hidden.negate()), f1: true, }); } @@ -1019,7 +1019,7 @@ export class McpBrowseResourcesCommand extends Action2 { id: McpCommandIds.BrowseResources, title: localize2('mcp.browseResources', "Browse Resources..."), category, - precondition: McpContextKeys.serverCount.greater(0), + precondition: ContextKeyExpr.and(McpContextKeys.serverCount.greater(0), ChatContextKeys.Setup.hidden.negate()), f1: true, }); } diff --git a/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts b/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts index 7eb368978f8..882583b65a5 100644 --- a/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts +++ b/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts @@ -529,7 +529,7 @@ export class McpServersViewsContribution extends Disposable implements IWorkbenc id: InstalledMcpServersViewId, name: localize2('mcp-installed', "MCP Servers - Installed"), ctorDescriptor: new SyncDescriptor(McpServersListView, [{}]), - when: ContextKeyExpr.and(DefaultViewsContext, HasInstalledMcpServersContext), + when: ContextKeyExpr.and(DefaultViewsContext, HasInstalledMcpServersContext, ChatContextKeys.Setup.hidden.negate()), weight: 40, order: 4, canToggleVisibility: true @@ -547,7 +547,7 @@ export class McpServersViewsContribution extends Disposable implements IWorkbenc id: 'workbench.views.mcp.marketplace', name: localize2('mcp', "MCP Servers"), ctorDescriptor: new SyncDescriptor(McpServersListView, [{}]), - when: ContextKeyExpr.and(SearchMcpServersContext, McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available), ContextKeyExpr.or(ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`), ProductQualityContext.notEqualsTo('stable'), ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`))), + when: ContextKeyExpr.and(SearchMcpServersContext, ChatContextKeys.Setup.hidden.negate(), McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available), ContextKeyExpr.or(ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`), ProductQualityContext.notEqualsTo('stable'), ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`))), }, { id: 'workbench.views.mcp.default.welcomeView', @@ -562,7 +562,7 @@ export class McpServersViewsContribution extends Disposable implements IWorkbenc id: 'workbench.views.mcp.welcomeView', name: localize2('mcp', "MCP Servers"), ctorDescriptor: new SyncDescriptor(McpServersListView, [{ showWelcome: true }]), - when: ContextKeyExpr.and(SearchMcpServersContext, McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available), ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`).negate(), ProductQualityContext.isEqualTo('stable'), ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`).negate()), + when: ContextKeyExpr.and(SearchMcpServersContext, ChatContextKeys.Setup.hidden.negate(), McpServersGalleryStatusContext.isEqualTo(McpGalleryManifestStatus.Available), ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceUrlConfig}`).negate(), ProductQualityContext.isEqualTo('stable'), ContextKeyDefinedExpr.create(`config.${mcpGalleryServiceEnablementConfig}`).negate()), } ], VIEW_CONTAINER); }