cherry-studio/src/main/utils
LiuVaayne ee4553130b
[1.5.0-rc] feat(MCP): Add DXT format support for MCP server installation (#7618)
* feat(MCP): Add DXT format support for MCP server installation

- Add comprehensive DXT package upload and extraction functionality
- Support for DXT manifest validation and MCP server configuration
- Hierarchical UI structure: Quick Add | JSON Import | DXT Import
- Variable substitution for DXT args (${__dirname} replacement)
- Automatic cleanup of DXT server directories on removal
- Enhanced error handling and connectivity checks
- Full internationalization support (EN/CN)
- Uses existing node-stream-zip for efficient extraction
- Proper working directory setup for DXT-based servers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* 🐛 fix(MCP): Fix DXT server installation and deletion issues

- Replace fs.renameSync with cross-filesystem compatible moveDirectory method to handle temp->mcp directory moves across different mount points
- Add recursive copy fallback when rename fails (ENOENT error fix)
- Sanitize server names with slashes to prevent subdirectory creation during installation
- Improve cleanupDxtServer to handle sanitized names and provide fallback lookup
- Add proper error logging and directory existence warnings

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(MCP): Implement comprehensive DXT MCP configuration support

- Add platform_overrides support to DXT manifest interface
- Implement complete variable substitution system (${__dirname}, ${HOME}, ${DESKTOP}, ${DOCUMENTS}, ${pathSeparator}, ${user_config.KEY})
- Add platform detection utilities (getPlatformIdentifier)
- Create resolved MCP configuration system with applyPlatformOverrides
- Export ResolvedMcpConfig interface and utility functions
- Integrate DXT configuration resolution into MCPService runtime
- Support platform-specific command, args, and environment overrides
- Add comprehensive logging for configuration resolution

Addresses DXT MANIFEST.md mcp_configuration requirements:
- Platform-specific configuration variations
- Cross-platform variable substitution
- Flexible command and environment management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add downloads directory variable substitution and simplify platform detection

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-14 22:37:56 +08:00
..
__tests__ fix(encoding): encoding detection and decoding logic (#8024) 2025-07-10 22:13:40 +08:00
aes.ts feat: add aihubmix oauth 2025-02-07 22:27:28 +08:00
file.ts [1.5.0-rc] feat(MCP): Add DXT format support for MCP server installation (#7618) 2025-07-14 22:37:56 +08:00
index.ts fix: remove undici dependency and clean up ProxyManager code (#6020) 2025-05-15 22:09:53 +08:00
locales.ts Add Japanese localization for i18n (#533) 2024-12-25 22:04:29 +08:00
mcp.ts refactor: improve sanitization and formatting in buildFunctionCallToo… (#6152) 2025-05-19 11:20:38 +08:00
process.ts feat(knowledge): support doc2x, mistral, MacOS, MinerU... OCR (#3734) 2025-07-03 16:23:02 +08:00
systemInfo.ts feat(AppUpdater): integrate User-Agent generation for autoUpdater req… (#7751) 2025-07-02 16:18:44 +08:00
windowUtil.ts fix: font-family changed in Windows with new Electron (#6079) 2025-05-17 21:27:29 +08:00
zip.ts test: more unit tests (#5130) 2025-05-26 16:50:26 +08:00
zoom.ts style: set eol to lf, code formatting (#7923) 2025-07-08 09:50:33 +08:00