Connecting to Claude Desktop
Configure claude_desktop_config.json to run your MCP server as a subprocess — including why you need the full node path and what NODE_NO_WARNINGS=1 does.
Claude Desktop reads a JSON config file to know which MCP servers to launch. The location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Here's a minimal config for a local Node.js server:
{
"mcpServers": {
"my-mcp-server": {
"command": "/usr/local/bin/node",
"args": ["/Users/you/my-mcp-server/dist/index.js"],
"env": {
"NODE_NO_WARNINGS": "1"
}
}
}
}Why the Full Path to Node
This caught me off guard the first time: Claude Desktop spawns MCP server processes in an environment where your shell's PATH may not be available. If you write "command": "node", it may fail to find Node at all.
Get the full path with:
which node # macOS/Linux
where node # WindowsThen use that absolute path in the config. This is the most common setup issue — always use the full path.
What NODE_NO_WARNINGS=1 Does
MCP servers communicate over stdio — standard input and output. Claude Desktop reads the server's stdout as JSON-RPC responses.
Node.js sometimes emits deprecation warnings to stderr, which flows through the stdio channel to the LLM. Without suppression, those warnings can confuse the model or pollute the protocol stream.
NODE_NO_WARNINGS=1 silences them cleanly. It only suppresses warnings — crashes and real errors still surface.
Restart Required
Claude Desktop spawns MCP server processes at startup. If you change your server code, update the config, or add a new server:
- Quit Claude Desktop completely (not just close the window — quit the app)
- Restart it
- The new server process launches with the updated configuration
There's no hot-reload. The most common confusion for new users is editing their server, testing it, and wondering why nothing changed — because Claude Desktop is still running the old process. I've been caught by this more than once.
Verifying the Connection
After restarting, Claude Desktop shows a hammer icon in the chat interface when tools are available. Clicking it shows which tools are loaded from which servers.
If your tools don't appear:
- Check the config file path (easy to get wrong on Windows vs macOS)
- Verify the node path is absolute and correct
- Look at Claude Desktop's logs — on macOS,
Console.appshows MCP server stderr output - Try running the command manually in your terminal to confirm it starts without errors
Adding API Keys
If your tool needs API keys (weather APIs, GitHub tokens, etc.), pass them as environment variables in the config:
{
"mcpServers": {
"weather-server": {
"command": "/usr/local/bin/node",
"args": ["/path/to/weather/dist/index.js"],
"env": {
"NODE_NO_WARNINGS": "1",
"WEATHER_API_KEY": "your-key-here"
}
}
}
}The MCP server process reads them with process.env.WEATHER_API_KEY. This keeps credentials out of your code and out of version control.
Further Reading
Practice what you just read.
Enjoyed this? Get more like it.
Deep dives on system design, React, web development, and personal finance — straight to your inbox. Free, always.