mta-mcp 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/mta.cjs CHANGED
@@ -7,6 +7,7 @@
7
7
 
8
8
  const { existsSync } = require('fs');
9
9
  const { join } = require('path');
10
+ const { pathToFileURL } = require('url');
10
11
 
11
12
  // 检测 Node.js 版本
12
13
  const nodeVersion = process.versions.node;
@@ -30,8 +31,9 @@ if (!existsSync(esmPath)) {
30
31
  process.exit(1);
31
32
  }
32
33
 
33
- // 加载 ES Module
34
- import(esmPath).catch(err => {
34
+ // 加载 ES Module - 在 Windows 上必须转换为 file:// URL
35
+ const esmUrl = pathToFileURL(esmPath).href;
36
+ import(esmUrl).catch(err => {
35
37
  console.error('[MCP Error] 启动失败:', err.message);
36
38
  process.exit(1);
37
39
  });