Skip to content

After using the official node installation, the mac configuration mcp cannot be used #7870

Closed

Description

@idoall

Before submitting your bug report

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
Image

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)

Activity

  1. added
    area:mcp
    ide:vscode
    kind:bug
    os:mac
    on Sep 20, 2025
  2. bdougie commented on Oct 22, 2025

    @bdougie
    Contributor

    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:

    1. Essential variables (HOME, USER, PATH, etc.)
    2. MCP-specific variables (MCP_, NODE_, NPM_, CONTINUE_)
    3. 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:

    1. Please read our Contributing Guide
    2. The main file to modify is
    3. Add environment filtering logic to the method
    4. 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!

  3. bdougie commented on Oct 22, 2025

    @bdougie
    Contributor

    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.

  4. sestinj commented on Oct 29, 2025

    @sestinj
    Contributor

    🎉 This issue has been resolved in version 1.31.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  5. sestinj commented on Oct 29, 2025

    @sestinj
    Contributor

    🎉 This issue has been resolved in version 1.4.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  6. sestinj commented on Oct 29, 2025

    @sestinj
    Contributor

    🎉 This issue has been resolved in version 1.28.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  7. idoall commented on Nov 6, 2025

    @idoall
    Author

    @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'.
    
  8. sestinj commented on Nov 20, 2025

    @sestinj
    Contributor

    🎉 This issue has been resolved in version 1.6.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:mcpide:vscodekind:bugos:macreleased

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions