Installing Node.js for Claude Desktop MCP Usage
Introduction
Node.js is a JavaScript runtime environment that’s required to run Model Context Protocol (MCP) servers with Claude Desktop. MCP allows Claude Desktop to connect to external tools and data sources, greatly extending its capabilities. This guide will walk you through installing Node.js on both Mac and Windows systems.
What You’ll Need
- A Mac or Windows computer
- Administrator privileges on your system
- Internet connection for downloading Node.js
Installation Instructions
For Mac Users
Method 1: Using the Official Installer (Recommended)
-
Visit the Node.js website
- Go to nodejs.org
- Click on the LTS (Long Term Support) version download button
- This will download a
.pkg
file for macOS
-
Run the installer
- Locate the downloaded
.pkg
file in your Downloads folder - Double-click the installer to launch it
- Follow the installation wizard:
- Click “Continue” through the introduction screens
- Accept the license agreement
- Choose the installation location (default is recommended)
- Click “Install” and enter your admin password when prompted
- Locate the downloaded
-
Verify the installation
- Open Terminal (Press
Cmd + Space
, type “Terminal”, and press Enter) - Type the following commands to verify Node.js and npm are installed:
node --version npm --version
- You should see version numbers for both commands
- Open Terminal (Press
Method 2: Using Homebrew (For Advanced Users)
If you have Homebrew installed:
- Open Terminal
- Install Node.js using Homebrew
brew install node
- Verify the installation
node --version npm --version
For Windows Users
Method 1: Using the Official Installer (Recommended)
-
Visit the Node.js website
- Go to nodejs.org
- Click on the LTS (Long Term Support) version download button
- This will download a
.msi
file for Windows
-
Run the installer
- Locate the downloaded
.msi
file in your Downloads folder - Double-click the installer to launch it
- Follow the installation wizard:
- Click “Next” through the welcome screen
- Accept the license agreement
- Choose the installation path (default is recommended:
C:\Program Files\nodejs\
) - Important: Make sure “Add to PATH” is checked (this is usually enabled by default)
- Click “Install” and allow the installer to make changes when prompted
- Locate the downloaded
-
Restart your computer (recommended to ensure PATH changes take effect)
-
Verify the installation
- Open Command Prompt or PowerShell:
- Press
Win + R
, typecmd
, and press Enter (for Command Prompt) - Or press
Win + X
and select “Windows PowerShell” (for PowerShell)
- Press
- Type the following commands:
node --version npm --version
- You should see version numbers for both commands
- Open Command Prompt or PowerShell:
Method 2: Using Chocolatey (For Advanced Users)
If you have Chocolatey package manager installed:
- Open PowerShell as Administrator
- Install Node.js using Chocolatey
choco install nodejs
- Verify the installation
node --version npm --version
Recommended Node.js Version
For Claude Desktop MCP usage, it’s recommended to use:
- Node.js 18.x LTS or newer
- The LTS (Long Term Support) version is more stable and recommended for most users
Verifying Your Installation
After installation, verify that everything is working correctly:
Check Node.js and npm versions
node --version
npm --version
Test Node.js functionality
Create a simple test file to ensure Node.js is working:
-
Create a new file called
test.js
with the following content:console.log("Node.js is working correctly!"); console.log("Node.js version:", process.version);
-
Run the file:
node test.js
-
You should see the output confirming Node.js is working.
Troubleshooting Common Issues
Mac Troubleshooting
Issue: Command not found after installation
- Solution: Restart Terminal or run
source ~/.bash_profile
orsource ~/.zshrc
- Alternative: Check if Node.js is in your PATH by running
echo $PATH
Issue: Permission errors when installing packages globally
- Solution: Use
sudo
prefix or configure npm to use a different directory for global packages
Windows Troubleshooting
Issue: ‘node’ is not recognized as an internal or external command
- Solution:
- Restart Command Prompt or PowerShell
- Restart your computer
- Check if Node.js is in your PATH:
- Open System Properties → Advanced → Environment Variables
- Look for
C:\Program Files\nodejs\
in the PATH variable
Issue: Permission errors
- Solution: Run Command Prompt or PowerShell as Administrator
General Troubleshooting
Issue: Installation fails or Node.js doesn’t work
- Solution:
- Uninstall Node.js completely
- Download the latest LTS version from the official website
- Run the installer as Administrator (Windows) or with sudo (Mac if needed)
Next Steps
Once Node.js is successfully installed, you can:
- Configure Claude Desktop MCP: Follow Claude Desktop’s documentation to set up MCP servers
- Install MCP packages: Use npm to install specific MCP server packages as needed
- Create custom MCP servers: Develop your own MCP servers using Node.js
Additional Resources
- Official Node.js Documentation
- npm Documentation
- Claude Desktop MCP Documentation (for specific MCP setup instructions)
Summary
You now have Node.js installed and ready for use with Claude Desktop’s MCP functionality. The installation provides you with both Node.js (the runtime) and npm (the package manager), which are essential for running and managing MCP servers. If you encounter any issues, refer to the troubleshooting section above or consult the official Node.js documentation.