Skip to content
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

MCP Servers Don't Work with NVM #64

Open
combdn opened this issue Nov 26, 2024 · 5 comments
Open

MCP Servers Don't Work with NVM #64

combdn opened this issue Nov 26, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@combdn
Copy link

combdn commented Nov 26, 2024

Problem

When using NVM (Node Version Manager), the standard installation and usage instructions for MCP servers don't work. The app tries to use an incorrect Node and fails.

Workaround

  1. Avoid npx, install packages globally.
  2. Use absolute paths to both the Node executable and server script.

Example:

{  
  "mcpServers": {
    "puppeteer": {
      "command": "/Users/username/.nvm/versions/node/v22.11.0/bin/node",
      "args": [
        "/Users/username/.nvm/versions/node/v22.11.0/lib/node_modules/@modelcontextprotocol/server-puppeteer/dist/index.js"
      ]
    }
  }
}

OS: macOS 15.1.1 (24B91)

@mckaywrigley
Copy link

mckaywrigley commented Nov 26, 2024

I also ran into issues with the recommended npx setup, and I was able to successfully reproduce this workaround - fixes it completely.

MCPs now install and attach correctly within Claude Desktop.

@lborgav
Copy link

lborgav commented Nov 27, 2024

This workaround works fine

@adam91holt
Copy link

I can confirm this is working for me too.

You may have a different node.js version installed so just do the following for puppeteer as an example

npm i -g @modelcontextprotocol/server-puppeteer
cd /Users/YOUR_USERNAME/.nvm/versions/node
ls
>>> v14.17.6        v16.19.0        v18.14.0        v18.20.4

Then I ended up with this and it works sweet!

{
  "mcpServers": {
    "puppeteer": {
      "command": "/Users/YOUR_USERNAME/.nvm/versions/node/v18.20.4/bin/node",
      "args": [
        "/Users/YOUR_USERNAME/.nvm/versions/node/v18.20.4/lib/node_modules/@modelcontextprotocol/server-puppeteer/dist/index.js"
      ]
    }
  }
}

@jspahrsummers
Copy link
Member

The challenge with NVM is that it seems to mostly work by installing a very complicated shell function into your shell profile. It'd be great if we could figure out your preferred Node version via NVM, but I haven't found a good way to do that—open to ideas!

@jspahrsummers jspahrsummers added the bug Something isn't working label Nov 27, 2024
@jspahrsummers
Copy link
Member

Cross-linking: see #77 for Windows workaround steps as well

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

5 participants