-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
StdioClientTransport()
Throw Error: spawn node ENOENT。But when I change StdioClientTransport code in node_modules, it works.
To Reproduce
- I use amap-maps-mcp-server to create a map。https://www.npmjs.com/package/@amap/amap-maps-mcp-server
new StdioClientTransport({
command: 'npx',
"args": [
"-y",
"@amap/amap-maps-mcp-server"
],
env: { AMAP_MAPS_API_KEY: '<my key>' }
})
When I run this code, it throw Error: spawn node ENOENT
2. I change code above to this code.
new StdioClientTransport({
command: 'node',
"args": [
"./node_modules/@amap/amap-maps-mcp-server/build/index.js"
],
env: { AMAP_MAPS_API_KEY: '<my key>' },
})
I run this code, it doesn't work.
3. I change StdioClientTransport
code in node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js in start
method。I change shell:false
to shell:true
。
I run this code again, it works.
4. I keep StdioClientTransport
class start
method shell:true
,and change command to npx
。I run this code again, it doesn't works, throw error: env: node: No such file or directory
new StdioClientTransport({
command: 'npx',
"args": [
"-y",
"@amap/amap-maps-mcp-server"
],
env: { AMAP_MAPS_API_KEY: '<my key>' }
})
Additional context
I use macOS Intel CPU.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working