diff --git a/package.json b/package.json index 1e44c75..64045f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccg-workflow", - "version": "1.7.23", + "version": "1.7.24", "description": "Claude-Codex-Gemini 多模型协作系统 - 智能路由多模型开发工作流", "type": "module", "packageManager": "pnpm@10.17.1", diff --git a/src/utils/mcp.ts b/src/utils/mcp.ts index 3dca02b..84e57ac 100644 --- a/src/utils/mcp.ts +++ b/src/utils/mcp.ts @@ -87,6 +87,11 @@ export async function writeClaudeCodeConfig(config: ClaudeCodeConfig): Promise= 3 && args[1] === args[2]) { + args.splice(2, 1) // 移除重复的命令 + repaired = true + } + + return repaired +} + /** * Fix Windows MCP configuration by applying platform wrappers * This function processes all MCP servers in the config and applies Windows-specific fixes @@ -161,7 +207,11 @@ export function fixWindowsMcpConfig(config: ClaudeCodeConfig): ClaudeCodeConfig // Fix each MCP server configuration for (const [serverName, serverConfig] of Object.entries(fixed.mcpServers || {})) { if (serverConfig && typeof serverConfig === 'object' && 'command' in serverConfig) { - applyPlatformCommand(serverConfig as McpServerConfig) + const mcpConfig = serverConfig as McpServerConfig + // 先尝试修复损坏的配置 + repairCorruptedMcpArgs(mcpConfig) + // 再应用平台命令包装(幂等,已处理过的会跳过) + applyPlatformCommand(mcpConfig) } }