After using the official node installation, the mac configuration mcp cannot be used
Closed this issue ยท 6 comments
Before submitting your bug report
- I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- I believe this is a bug. I'll try to join the Continue Discord for questions
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS:macOS
- Continue version:1.3.11
- IDE version:VSCode 1.104.0
- Node:v22.19.0
- config:
name: Memory MCP server
version: 0.0.1
schema: v1
mcpServers:
- name: Memory MCP server
command: npx
args:
- -y
- "@modelcontextprotocol/server-memory"Description
Node was installed using the official nvm method: https://nodejs.org/zh-cn/download
After configuring the MCP file, it can be started from the shell, and the service can also be used from a remote URL.
Only the npx method fails to start, and the error message appears:
Failed to connect to "Memory MCP server"
Error: spawn ENAMETOOLONG
I run npx normally in the local command line:
>npx -v
10.9.3
To reproduce
No response
Log output
Opening the VSCode console, I see the following error:
console.ts:137 [Extension Host] Failed to fetch MCP prompt content for write_custom_semgrep_rule from server Semgrep MCP: McpError: MCP error 0: Missing required arguments: {'code', 'language'}
at Client2._onresponse (/Users/666/.vscode/extensions/continue.continue-1.3.11/out/extension.js:259662:26)
at _transport.onmessage (/Users/666/.vscode/extensions/continue.continue-1.3.11/out/extension.js:259542:18)
at StreamableHTTPClientTransport.send (/Users/666/.vscode/extensions/continue.continue-1.3.11/out/extension.js:267370:79)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)Issue Analysis: ENAMETOOLONG Error on macOS
I've investigated this issue and found the root cause. When Continue spawns MCP servers, it copies the entire process environment () to the child process. On macOS systems with large environments, this can exceed system limits and cause the error.
Root Cause
The issue is in in the method, which copies all environment variables when spawning MCP server processes.
Proposed Solution
Filter environment variables to only include:
- Essential variables (HOME, USER, PATH, etc.)
- MCP-specific variables (MCP_, NODE_, NPM_, CONTINUE_)
- Clean up PATH by removing duplicates
This would significantly reduce the environment size passed to child processes.
For Contributors
If you'd like to work on this issue:
- Please read our Contributing Guide
- The main file to modify is
- Add environment filtering logic to the method
- Include tests to verify the fix works with various MCP servers
This affects multiple users on macOS (#6699 has the same issue), so a fix would be very helpful!
Update: Workaround Available
A user in #6699 found a workaround - use the full path to the command instead of relying on PATH resolution:
mcpServers:
- name: Memory MCP server
command: /usr/local/bin/npx # Use full path
args:
- -y
- "@modelcontextprotocol/server-memory"To find the full path to npx on your system, run: which npx
This avoids the PATH environment variable issues that contribute to the ENAMETOOLONG error.
๐ This issue has been resolved in version 1.31.0 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
๐ This issue has been resolved in version 1.4.0 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
๐ This issue has been resolved in version 1.28.0 ๐
The release is available on:
Your semantic-release bot ๐ฆ๐
@sestinj
A new error has occurred:
name: MUI MCP Server
version: 1.0.0
schema: v1
mcpServers:
- name: MUI MCP
type: stdio
command: /Users/xxx/.nvm/versions/node/v22.19.0/bin/npx
args:
- -y
- "@mui/mcp@latest"
Failed to connect to "MUI MCP"
Error: MCP error -32000: Connection closed
name: Fetch MCP Server
version: 1.0.0
schema: v1
mcpServers:
- name: Fetch MCP
type: stdio
command: /opt/homebrew/bin/uvx
args:
- -y
- "mcp-server-fetch"
Failed to connect to "Fetch MCP"
Error: MCP error -32000: Connection closed
Process output:
STDERR:
error: unexpected argument '-y' found
Usage: uvx [OPTIONS] [COMMAND]
For more information, try '--help'.