One issue I hit with Claude Desktop app was getting MCP integrations working locally with npx
. I tried the examples from the documentation:
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}
No matter which MCP server I tried I was getting the same error again and again.

It seems that Claude Desktop searches for npx
in /usr/local/bin/
or the default location for node
on MacOS. Since nvm
works by exporting the NVM directory in your shell, this mechanism doesn’t work out of the box.
Working MCP servers with NVM
An easy way to get this working through nvm is by using an absolute path.
Prerequisites:
- Node
v20.19.0
but newer nodes will probably work as well. I’m mostly using version 20 on my current projects. - Set nvm default alias to the node version you’d like to use (
nvm alias default 20
)
Steps:
1. Install the MCP server you want to use in the node you’ll be using.
Example:
$ npm i -g @modelcontextprotocol/server-puppeteer
2. Once this is done we need to find the absolute path to the node version we want to use.
$ which node
The result will be the path to the node installation. For me this is /Users/angel/.nvm/versions/node/v20.19.0/bin/node
3. Copy the version and open your claude_desktop_config.json
4. Instead of using npx
for the command, type absolute path to node
, for args use the server name and pass the same args as specified in the original docs.
"puppeteer": {
"command": "/Users/angel/.nvm/versions/node/v20.19.0/bin/node",
"args": ["/Users/angel/.nvm/versions/node/v20.19.0/lib/node_modules/@modelcontextprotocol/server-puppeteer/dist/index.js"]
}
Important Nodes:
- Use absolute path for the command instead of
npx
- Use absolute path to the installed server
/Users/angel/.nvm/versions/node/v20.19.0/lib/node_modules/@modelcontextprotocol/
… - Don’t forget to add
/dist/index.js
after the server - Change the username and/or full path to match your system
Save the JSOn and restart Claude Desktop. I’ve tried this with several MCP servers and all of them worked.
MCP Filesystem Server
You can get the Filesystem server working the same way by using an absolute path to your nvm node installation. However, this approach isn’t flexible enough.
I prefer to link it using the docker setup, since it allows me to specify a read only flag. Claude 3.7 Sonnet is really capable, however I don’t always feel comfortable with the AI write access to critical files.
With the docker setup, you can specify readonly (ro
) write access on a folder by folder basis.
Example:
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount",
"type=bind,src=/Users/angel/Documents/amazing-project,dst=/projects/amazing-project,ro",
"--mount",
"type=bind,src=/Users/angel/Documents/second-project,dst=/projects/second-project",
"mcp/filesystem",
"/projects"
]
},
With the setup above Claude will be able to read files from both amazing-project
and second-project
, but it can write only to second-project
.
Leave a Reply