feat(mcp): add cross-platform MCP config support with Windows cmd /c auto-fix

- Add buildCrossPlatformMcpConfig() helper for automatic Windows cmd /c wrapping
- Add checkWindowsMcpCompatibility() to detect configs needing Windows fixes
- Add autoFixWindowsMcpConfig() to automatically fix incompatible configs
- Add showWindowsMcpCompatibilityWarning() dialog for user confirmation
- Simplify recommended MCP configs (ace-tool, chrome-devtools, exa) using helper
- Auto-detect and prompt when adding MCP servers with npx/npm/node/python commands
- Add i18n translations for Windows compatibility warnings (en/zh)

Supported commands for auto-detection: npx, npm, node, python, python3, pip, pip3, pnpm, yarn, bun

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2026-01-13 19:07:11 +08:00
parent 340137d347
commit 7d8b13f34f
2 changed files with 182 additions and 28 deletions

View File

@@ -995,6 +995,12 @@ const i18n = {
'mcp.clickToEdit': 'Click to edit',
'mcp.clickToViewDetails': 'Click to view details',
// Windows MCP Compatibility
'mcp.windows.title': 'Windows Compatibility Warning',
'mcp.windows.compatibilityWarning': 'The MCP server "{name}" uses "{command}" which requires "cmd /c" wrapper on Windows to work properly with Claude Code.',
'mcp.windows.autoFix': 'Auto-fix (Recommended)',
'mcp.windows.keepOriginal': 'Keep Original',
// Hook Manager
'hook.projectHooks': 'Project Hooks',
'hook.projectFile': '.claude/settings.json',
@@ -3128,6 +3134,12 @@ const i18n = {
'mcp.clickToEdit': '点击编辑',
'mcp.clickToViewDetails': '点击查看详情',
// Windows MCP 兼容性
'mcp.windows.title': 'Windows 兼容性警告',
'mcp.windows.compatibilityWarning': 'MCP 服务器 "{name}" 使用的 "{command}" 命令需要在 Windows 上添加 "cmd /c" 包装才能与 Claude Code 正常工作。',
'mcp.windows.autoFix': '自动修复(推荐)',
'mcp.windows.keepOriginal': '保持原样',
// Hook Manager
'hook.projectHooks': '项目钩子',
'hook.projectFile': '.claude/settings.json',