17 lines
478 B
JavaScript
17 lines
478 B
JavaScript
'use strict';
|
||
|
||
/**
|
||
* 生成发送给 Codex 的 MCP server 配置副本。
|
||
*
|
||
* 内部配置仍保留 type 作为传输类型元数据,Codex 出站协议只省略
|
||
* 服务器顶层 type;嵌套 env 等对象保持原样。
|
||
*/
|
||
function toCodexMcpServerConfig(config) {
|
||
if (!config || typeof config !== 'object' || Array.isArray(config)) return config;
|
||
const result = { ...config };
|
||
delete result.type;
|
||
return result;
|
||
}
|
||
|
||
module.exports = { toCodexMcpServerConfig };
|