Skip to content

Commit d63c9dd

Browse files
authored
1 parent 2a4faa2 commit d63c9dd

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

src/vs/workbench/contrib/mcp/browser/mcp.contribution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { McpSamplingService } from '../common/mcpSamplingService.js';
3030
import { McpService } from '../common/mcpService.js';
3131
import { IMcpElicitationService, IMcpSamplingService, IMcpService, IMcpWorkbenchService } from '../common/mcpTypes.js';
3232
import { McpAddContextContribution } from './mcpAddContextContribution.js';
33-
import { AddConfigurationAction, EditStoredInput, ListMcpServerCommand, McpBrowseCommand, McpBrowseResourcesCommand, McpConfigureSamplingModels, MCPServerActionRendering, McpServerOptionsCommand, McpStartPromptingServerCommand, OpenRemoteUserMcpResourceCommand, OpenUserMcpResourceCommand, OpenWorkspaceFolderMcpResourceCommand, OpenWorkspaceMcpResourceCommand, RemoveStoredInput, ResetMcpCachedTools, ResetMcpTrustCommand, RestartServer, ShowConfiguration, ShowInstalledMcpServersCommand, ShowOutput, StartServer, StopServer } from './mcpCommands.js';
33+
import { AddConfigurationAction, BrowseMcpServersPageCommand, EditStoredInput, ListMcpServerCommand, McpBrowseCommand, McpBrowseResourcesCommand, McpConfigureSamplingModels, MCPServerActionRendering, McpServerOptionsCommand, McpStartPromptingServerCommand, OpenRemoteUserMcpResourceCommand, OpenUserMcpResourceCommand, OpenWorkspaceFolderMcpResourceCommand, OpenWorkspaceMcpResourceCommand, RemoveStoredInput, ResetMcpCachedTools, ResetMcpTrustCommand, RestartServer, ShowConfiguration, ShowInstalledMcpServersCommand, ShowOutput, StartServer, StopServer } from './mcpCommands.js';
3434
import { McpDiscovery } from './mcpDiscovery.js';
3535
import { McpElicitationService } from './mcpElicitationService.js';
3636
import { McpLanguageFeatures } from './mcpLanguageFeatures.js';
@@ -71,6 +71,7 @@ registerAction2(ShowOutput);
7171
registerAction2(RestartServer);
7272
registerAction2(ShowConfiguration);
7373
registerAction2(McpBrowseCommand);
74+
registerAction2(BrowseMcpServersPageCommand);
7475
registerAction2(OpenUserMcpResourceCommand);
7576
registerAction2(OpenRemoteUserMcpResourceCommand);
7677
registerAction2(OpenWorkspaceMcpResourceCommand);

src/vs/workbench/contrib/mcp/browser/mcpCommands.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from '../../../browser/actions/works
5252
import { MCP_CONFIGURATION_KEY, WORKSPACE_STANDALONE_CONFIGURATIONS } from '../../../services/configuration/common/configuration.js';
5353
import { IFileService } from '../../../../platform/files/common/files.js';
5454
import { VSBuffer } from '../../../../base/common/buffer.js';
55+
import { IProductService } from '../../../../platform/product/common/productService.js';
56+
import { IOpenerService } from '../../../../platform/opener/common/opener.js';
5557

5658
// acroynms do not get localized
5759
const category: ILocalizedString = {
@@ -698,6 +700,27 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
698700
},
699701
});
700702

703+
export class BrowseMcpServersPageCommand extends Action2 {
704+
constructor() {
705+
super({
706+
id: McpCommandIds.BrowsePage,
707+
title: localize2('mcp.command.open', "Browse MCP Servers"),
708+
icon: Codicon.globe,
709+
menu: [{
710+
id: MenuId.ViewTitle,
711+
when: ContextKeyExpr.equals('view', InstalledMcpServersViewId),
712+
group: 'navigation',
713+
}],
714+
});
715+
}
716+
717+
async run(accessor: ServicesAccessor) {
718+
const productService = accessor.get(IProductService);
719+
const openerService = accessor.get(IOpenerService);
720+
return openerService.open(productService.quality === 'insider' ? 'https://code.visualstudio.com/insider/mcp' : 'https://code.visualstudio.com/mcp');
721+
}
722+
}
723+
701724
export class ShowInstalledMcpServersCommand extends Action2 {
702725
constructor() {
703726
super({

src/vs/workbench/contrib/mcp/common/mcpCommandIds.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
export const enum McpCommandIds {
1010
AddConfiguration = 'workbench.mcp.addConfiguration',
1111
Browse = 'workbench.mcp.browseServers',
12+
BrowsePage = 'workbench.mcp.browseServersPage',
1213
ShowInstalled = 'workbench.mcp.showInstalledServers',
1314
OpenUserMcp = 'workbench.mcp.openUserMcpJson',
1415
OpenRemoteUserMcp = 'workbench.mcp.openRemoteUserMcpJson',

0 commit comments

Comments
 (0)