修复 Codex MCP type 配置并更新发布包

This commit is contained in:
shiyue
2026-10-08 14:55:58 +08:00
parent caf8947cd9
commit 747771a048
17 changed files with 181 additions and 4 deletions

16
lib/codex-mcp-config.js Normal file
View File

@@ -0,0 +1,16 @@
'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 };