69
70
async addMcpServers(servers: IInstallableMcpServer[], mcpResource: URI, target?: McpResourceTarget): Promise<void> {
72
>
let updatedInputs = scannedMcpServers.inputs ?? [];
73
>
const existingServers = scannedMcpServers.servers ?? {};
74
>
for (const { name, config, inputs } of servers) {
75
>
existingServers[name] = config;
76
>
if (inputs) {
77
const existingInputIds = new Set(updatedInputs.map(input => input.id));
78
const newInputs = inputs.filter(input => !existingInputIds.has(input.id));
79
updatedInputs = [...updatedInputs, ...newInputs];
80
}
82
>
return { servers: existingServers, inputs: updatedInputs, sandbox: scannedMcpServers.sandbox };
83
>
});
84
>
}
85
86
async updateSandboxConfig(updateFn: (data: IScannedMcpServers) => IScannedMcpServers, mcpResource: URI, target?: McpResourceTarget): Promise<void> {