From 6cb6399c12e495e57394d2b706287c1984f894fe Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Mon, 5 Jan 2026 10:22:18 -0800 Subject: [PATCH] mcp: allow start server command to start all servers (#285980) Closes #283959 --- src/vs/workbench/contrib/mcp/browser/mcpCommands.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts b/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts index 7e4b7cc5460..c7d798a58f2 100644 --- a/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts +++ b/src/vs/workbench/contrib/mcp/browser/mcpCommands.ts @@ -821,9 +821,13 @@ export class StartServer extends Action2 { }); } - async run(accessor: ServicesAccessor, serverId: string, opts?: IMcpServerStartOpts) { - const s = accessor.get(IMcpService).servers.get().find(s => s.definition.id === serverId); - await s?.start({ promptType: 'all-untrusted', ...opts }); + async run(accessor: ServicesAccessor, serverId: string | undefined, opts?: IMcpServerStartOpts) { + let servers = accessor.get(IMcpService).servers.get(); + if (serverId !== undefined) { + servers = servers.filter(s => s.definition.id === serverId); + } + + await Promise.all(servers.map(s => s.start({ promptType: 'all-untrusted', ...opts }))); } }