*/
export function codexMcpServersFromPlugins(plugins: readonly ICodexClientPlugin[]): Record<string, ICodexMcpServerConfigJson> {
for (const plugin of plugins) {
for (const def of plugin.parsed?.mcpServers ?? emptyMcpDefs) {
if (!Object.prototype.hasOwnProperty.call(out, def.name)) {
out[def.name] = toCodexMcpServerJson(def.configuration);
}
}
}
return out;
}
const emptyMcpDefs: readonly IMcpServerDefinition[] = [];