mcp: allow start server command to start all servers (#285980)

Closes #283959
This commit is contained in:
Connor Peet
2026-01-05 18:22:18 +00:00
committed by GitHub
parent de56ab16ef
commit 6cb6399c12
@@ -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 })));
}
}