@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.
Files changed (2) hide show
  1. package/dist/cli.js +16 -7
  2. 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
- const ppdocsServer = {
360
- command: isWindows ? 'cmd' : 'npx',
361
- args: isWindows ? ['/c', 'npx', '-y', '@ppdocs/mcp@latest'] : ['-y', '@ppdocs/mcp@latest'],
362
- env: {
363
- "PPDOCS_API_URL": apiUrl
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ppdocs/mcp",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "description": "ppdocs MCP Server - Knowledge Graph for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",