diff --git a/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts b/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts index 57549d4ac02..93d8a757f94 100644 --- a/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts +++ b/src/vs/workbench/contrib/mcp/browser/mcpServersView.ts @@ -20,7 +20,7 @@ import { IHoverService } from '../../../../platform/hover/browser/hover.js'; import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js'; import { WorkbenchPagedList } from '../../../../platform/list/browser/listService.js'; -import { INotificationService } from '../../../../platform/notification/common/notification.js'; +import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js'; import { IOpenerService } from '../../../../platform/opener/common/opener.js'; import { IThemeService } from '../../../../platform/theme/common/themeService.js'; import { getLocationBasedViewColors } from '../../../browser/parts/views/viewPane.js'; @@ -34,7 +34,7 @@ import { IActionViewItemOptions } from '../../../../base/browser/ui/actionbar/ac import { IAllowedMcpServersService, mcpGalleryServiceEnablementConfig, mcpGalleryServiceUrlConfig } from '../../../../platform/mcp/common/mcpManagement.js'; import { URI } from '../../../../base/common/uri.js'; import { ThemeIcon } from '../../../../base/common/themables.js'; - +import { alert } from '../../../../base/browser/ui/aria/aria.js'; import { Registry } from '../../../../platform/registry/common/platform.js'; import { IWorkbenchContribution } from '../../../common/contributions.js'; import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; @@ -52,6 +52,7 @@ import { mcpServerIcon } from './mcpServerIcons.js'; import { IPagedRenderer } from '../../../../base/browser/ui/list/listPaging.js'; import { IMcpGalleryManifestService, McpGalleryManifestStatus } from '../../../../platform/mcp/common/mcpGalleryManifest.js'; import { ProductQualityContext } from '../../../../platform/contextkey/common/contextkeys.js'; +import { SeverityIcon } from '../../../../base/browser/ui/severityIcon/severityIcon.js'; export interface McpServerListViewOptions { showWelcome?: boolean; @@ -64,11 +65,22 @@ interface IQueryResult { onDidChangeModel?: Event>; } +type Message = { + readonly text: string; + readonly severity: Severity; +}; + export class McpServersListView extends AbstractExtensionsListView { private list: WorkbenchPagedList | null = null; private listContainer: HTMLElement | null = null; private welcomeContainer: HTMLElement | null = null; + private bodyTemplate: { + messageContainer: HTMLElement; + messageSeverityIcon: HTMLElement; + messageBox: HTMLElement; + mcpServersList: HTMLElement; + } | undefined; private readonly contextMenuActionRunner = this._register(new ActionRunner()); private input: IQueryResult | undefined; @@ -99,7 +111,19 @@ export class McpServersListView extends AbstractExtensionsListView 0); + + if (this.isBodyVisible()) { + if (message) { + this.bodyTemplate.messageSeverityIcon.className = SeverityIcon.className(message.severity); + this.bodyTemplate.messageBox.textContent = message.text; + } else if (count === 0) { + this.bodyTemplate.messageSeverityIcon.className = ''; + this.bodyTemplate.messageBox.textContent = localize('no extensions found', "No MCP Servers found."); + } + if (this.bodyTemplate.messageBox.textContent) { + alert(this.bodyTemplate.messageBox.textContent); + } + } + } + } + private async query(query: string): Promise { const disposables = new DisposableStore(); if (query) {