Skip to content

Instantly share code, notes, and snippets.

@brunos3d
Last active June 1, 2026 13:56
Show Gist options
  • Select an option

  • Save brunos3d/88e8a07f87f3ca9c9876ef8bde7d2768 to your computer and use it in GitHub Desktop.

Select an option

Save brunos3d/88e8a07f87f3ca9c9876ef8bde7d2768 to your computer and use it in GitHub Desktop.
How to alias your npx npm node globally for MCPs to work
# your .bashrc or .zshrc shit...
npx() { command $HOME/.nvm/versions/node/$(node --version)/bin/npx "$@"; }
npm() { command $HOME/.nvm/versions/node/$(node --version)/bin/npm "$@"; }
node() { command $HOME/.nvm/versions/node/$(node --version)/bin/node "$@"; }
# save and run "source ~/.bashrc" or "source ~/.zshrc"
@brunos3d
Copy link
Copy Markdown
Author

brunos3d commented Jun 1, 2026

Then you no longer need to use pinned versions of your nvm installation bin path

{
  "servers": {
    "chrome-devtools": {
      "command": "~/.nvm/versions/node/v22.13.1/bin/npx",
      "args": ["-y", "chrome-devtools-mcp@latest"]
    }
  }
}

Or dynamic version (it also works, but it's awful)

{
  "servers": {
    "chrome-devtools": {
      "command": "~/.nvm/versions/node/$(node --version)/bin/npx",
      "args": ["-y", "chrome-devtools-mcp@latest"]
    }
  }
}

Just use it normally

{
  "servers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "chrome-devtools-mcp@latest"]
    }
  }
}

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