Skip to content

[BUG] Error: spawn npx ENOENT, Error: spawn uvx ENOENT #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
code-lixm opened this issue Apr 16, 2025 · 3 comments
Closed

[BUG] Error: spawn npx ENOENT, Error: spawn uvx ENOENT #63

code-lixm opened this issue Apr 16, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@code-lixm
Copy link

Bug Description

Error: spawn npx ENOENT, Error: spawn uvx ENOENT

Reproduction Steps

Steps to reproduce the behavior:

const client = new MultiServerMCPClient({
  mcpServers: appConfig.mcpServers as any,
})

  const tools = await client.getTools()
    "fetch": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-server-fetch"
      ],
      "requires_confirmation": [
        "fetch"
      ],
      "enabled": true,
      "exclude_tools": []
    },
    "brave-search": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-brave-search"
      ],
      "env": {
        "BRAVE_API_KEY": ""
      },
      "requires_confirmation": [
        "brave_web_search"
      ]
    },

Expected Behavior

run correcttly

Actual Behavior

发生错误: MCPClientError: Failed to connect to stdio server "brave-search": Error: spawn npx ENOENT
    at MultiServerMCPClient._initializeStdioConnection (file:///Users/lixiaoming/Desktop/doing/one-shot/node_modules/.pnpm/@langchain+mcp-adapters@0.4.2_@langchain+core@0.3.44_openai@4.93.0_encoding@0.1.13_zod@3.24.2__/node_modules/@langchain/mcp-adapters/dist/client.js:373:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at MultiServerMCPClient.initializeConnections (file:///Users/lixiaoming/Desktop/doing/one-shot/node_modules/.pnpm/@langchain+mcp-adapters@0.4.2_@langchain+core@0.3.44_openai@4.93.0_encoding@0.1.13_zod@3.24.2__/node_modules/@langchain/mcp-adapters/dist/client.js:294:17)
    at MultiServerMCPClient.getTools (file:///Users/lixiaoming/Desktop/doing/one-shot/node_modules/.pnpm/@langchain+mcp-adapters@0.4.2_@langchain+core@0.3.44_openai@4.93.0_encoding@0.1.13_zod@3.24.2__/node_modules/@langchain/mcp-adapters/dist/client.js:314:9)
    at handleListTools (/Users/lixiaoming/Desktop/doing/one-shot/src/mcp/cli.ts:35:17)
    at Command.<anonymous> (/Users/lixiaoming/Desktop/doing/one-shot/src/index.ts:56:9)
    at Command.parseAsync (/Users/lixiaoming/Desktop/doing/one-shot/node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/command.js:1104:5)
    at main (/Users/lixiaoming/Desktop/doing/one-shot/src/index.ts:116:5) {
  serverName: 'brave-search'
}

Environment

  • OS: macOS
  • Node.js version: [v20.11.1]
  • Package version: [10.2.4]
  • MCP SDK version: [0.4.2]
@code-lixm code-lixm added the bug Something isn't working label Apr 16, 2025
@Maimikuru
Copy link

@code-lixm
Try specifying the full path to the command, it might resolve the issue.

cline/cline#1948

@zjcnzxsjy
Copy link

env add process.env.PATH!, i resolve it by the issue
modelcontextprotocol/typescript-sdk#196

@benjamincburns
Copy link
Collaborator

As addressed above, this is a user environment issue, not an issue with the mcp-adapters library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants