You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop app local MCP can fail when PATH resolves an older Node, while CLI works #22299
When using the desktop app, a local MCP configured as npx -y @mcp_router/cli@latest connect fails with MCP error -32000: Connection closed.
The same config works from the terminal with opencode mcp list.
This looks like a desktop/runtime environment bug rather than an mcp-router bug. The desktop app appears to launch the MCP child process with a different Node/PATH resolution than the terminal.
Environment
OpenCode version: 1.4.3
macOS: 13.3 (22E252)
Terminal Node: v22.19.0
Also installed on machine: /usr/local/bin/node -> v16.16.0
In the desktop UI, mcp-router shows as failed / disconnected.
OpenCode log shows:
file:///Users/.../.npm/_npx/.../node_modules/@hono/node-server/dist/index.mjs:23
var Request = class extends GlobalRequest {
^
TypeError: Class extends value undefined is not a constructor or null
And then:
MCP error -32000: Connection closed
Why this seems like a PATH / Node version issue
The failure is consistent with @mcp_router/cli being started under an older Node runtime where global.Request is not available.
On this machine:
terminal node -v -> v22.19.0
/usr/local/bin/node -v -> v16.16.0
The same mcp-router config works fine when run from terminal via opencode mcp list, but fails in the desktop app. That strongly suggests desktop and terminal are resolving a different Node / PATH for local MCP child processes.
Workaround
I was able to make the desktop app connect by forcing the MCP command to run with a PATH that puts Node 22 first, for example:
After that, the desktop app connected successfully.
Expected
Desktop app local MCP startup should behave consistently with terminal opencode mcp list, or at least use a predictable Node runtime / PATH resolution strategy.
Possible fix direction
Make local MCP child processes use a controlled PATH / runtime instead of inheriting an ambiguous desktop environment
Or log the exact resolved executable / PATH / Node version used for local MCP startup to make this diagnosable
If your issue is distinct (e.g. it affects a version where #15195 was supposedly fixed, or the behavior is different), please add a comment clarifying how it differs.
I was having issues with both MCP and it being able to run my pnpm commands for linting fixes. #26321 (comment) fixes both issues for me on Mac as a workaround.
Activity
github-actions commentedon Apr 13, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct (e.g. it affects a version where #15195 was supposedly fixed, or the behavior is different), please add a comment clarifying how it differs.
mcfarljw commentedon May 8, 2026
I was having issues with both MCP and it being able to run my
pnpmcommands for linting fixes. #26321 (comment) fixes both issues for me on Mac as a workaround.github-actions commentedon Jul 9, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.