@ppdocs/mcp 3.1.7 → 3.1.8
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/dist/cli.js +16 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -356,13 +356,22 @@ function createMcpConfigAt(mcpPath, apiUrl) {
|
|
|
356
356
|
}
|
|
357
357
|
// Windows 需要 cmd /c 包装才能执行 npx
|
|
358
358
|
const isWindows = process.platform === 'win32';
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
359
|
+
// 对于 Mac/Linux,IDE 可能没有用户的完整 PATH,导致找不到 npx
|
|
360
|
+
const ppdocsServer = isWindows
|
|
361
|
+
? {
|
|
362
|
+
command: 'cmd',
|
|
363
|
+
args: ['/c', 'npx', '-y', '@ppdocs/mcp@latest'],
|
|
364
|
+
env: { "PPDOCS_API_URL": apiUrl }
|
|
365
|
+
}
|
|
366
|
+
: {
|
|
367
|
+
command: 'npx',
|
|
368
|
+
args: ['-y', '@ppdocs/mcp@latest'],
|
|
369
|
+
env: {
|
|
370
|
+
"PPDOCS_API_URL": apiUrl,
|
|
371
|
+
// 强行注入常见路径,防止找不到 node/npx
|
|
372
|
+
"PATH": "$PATH:/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin"
|
|
373
|
+
}
|
|
374
|
+
};
|
|
366
375
|
mcpConfig.mcpServers = {
|
|
367
376
|
...(mcpConfig.mcpServers || {}),
|
|
368
377
|
"ppdocs-kg": ppdocsServer,
|