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.

March 9, 20263 min read3 / 7

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:

JSON
{ "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:

Bash
which node # macOS/Linux where node # Windows

Then 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:

  1. Quit Claude Desktop completely (not just close the window — quit the app)
  2. Restart it
  3. 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:

  1. Check the config file path (easy to get wrong on Windows vs macOS)
  2. Verify the node path is absolute and correct
  3. Look at Claude Desktop's logs — on macOS, Console.app shows MCP server stderr output
  4. 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:

JSON
{ "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.

Validate Your Claude Desktop Config
1 exercise

Enjoyed this? Get more like it.

Deep dives on system design, React, web development, and personal finance — straight to your inbox. Free, always.