Skip to main content
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Run MCP Server with a specific node version (NVM)

Learn how to configure the BrowserStack MCP server to run with a specific Node.js version when using NVM (Node Version Manager) to avoid version conflicts and ensure a successful launch.

If you use NVM (Node Version Manager) to manage multiple Node.js versions, you might need a specific configuration to ensure the MCP server runs with the correct Node.js environment. This guide provides the necessary configuration to load NVM and select a specific Node version before starting the server.

Configuration for NVM

To use a specific Node.js version managed by NVM, update your configuration file with the following settings. This approach uses a bash command to first source the NVM script and then execute the MCP server command. Ensure the Node.js version you specify (e.g., 22.16.0) is version 22 or later, and is already installed using NVM.

Configuration Snippet

Copy the following JSON into your configuration file:

mcp.json
Copy icon Copy

Key Steps in the Command

The args array executes a series of commands in a specific order:

  1. source ~/.nvm/nvm.sh: This loads the NVM functions into the shell session.

  2. nvm use 22.16.0: This command switches to Node.js version 22.16.0. Remember to change this version number to match the one you have installed and wish to use.

  3. npx -y @browserstack/mcp-server@latest mcp-server: This downloads and runs the latest version of the BrowserStack MCP server.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle