355
356
private initialize(): Promise<void> {
358
>
this.initializePromise = (async () => {
359
>
try {
360
>
this.local = await this.populateLocalServers();
361
>
} finally {
362
>
this.startWatching();
363
>
}
364
>
})();
365
>
}
366
>
return this.initializePromise;
367
>
}
368
369
private async populateLocalServers(): Promise<Map<string, ILocalMcpServer>> {
370
>
this.logService.trace('AbstractMcpResourceManagementService#populateLocalServers', this.mcpResource.toString());
mcpManagementService.ts
371
>
const local = new Map<string, ILocalMcpServer>();
372
>
try {
373
>
const scannedMcpServers = await this.mcpResourceScannerService.scanMcpServers(this.mcpResource, this.target);
374
>
if (scannedMcpServers.servers) {
375
await Promise.allSettled(Object.entries(scannedMcpServers.servers).map(async ([name, scannedServer]) => {
376
const server = await this.scanLocalServer(name, scannedServer, scannedMcpServers.sandbox);