Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 2 min read

Claude Desktop MCP Setup Guide: Fixing "spawn npx ENOENT" & Config Crashes

Anthropic's release of the Model Context Protocol (MCP) turned Claude Desktop into an autonomous developer command center. With MCP servers enabled, Claude Desktop can read and write files directly, query PostgreSQL and

Anthropic's release of the Model Context Protocol (MCP) turned Claude Desktop into an autonomous developer command center.

With MCP servers enabled, Claude Desktop can read and write files directly, query PostgreSQL and SQLite databases, inspect GitHub repos, and invoke internal APIsβ€”all without copy-pasting raw text back and forth.

However, configuring Claude Desktop manually remains error-prone. Because Claude Desktop runs as a GUI application, it does not inherit your interactive shell's $PATH, leading to cryptic errors like spawn npx ENOENT or silent crashes when a JSON comma is misplaced.

Here is the exact configuration schema, config file locations across operating systems, and fixes for the top Claude MCP errors.

Where is claude_desktop_config.json Located?

Claude Desktop stores all registered server configurations in a single JSON file named claude_desktop_config.json.

By default, this file resides in hidden system directories:

Operating System Exact File Location Quick Terminal Shortcut
macOS ~/Library/Application Support/Claude/claude_desktop_config.json open ~/Library/Application\ Support/Claude
Windows %APPDATA%\Claude\claude_desktop_config.json explorer %APPDATA%\Claude
Linux (Proton / Wine) ~/.config/Claude/claude_desktop_config.json xdg-open ~/.config/Claude

Note: If this file does not exist yet in your directory, you can create it manually as valid JSON.

Official Claude MCP Config Schema

Claude Desktop expects a top-level object containing a mcpServers dictionary. Each key in this dictionary represents a unique server name:

json
{
"mcpServers": {
"sqlite-analytics": {
"command": "uvx",
"args": [
"mcp-server-sqlite",
"--db-path",
"/Users/username/data/analytics.db"
]
},
"github-tools": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}
3 Strict Rules to Avoid Claude Crashes:
Never Leave Trailing Commas: Standard JSON parsers reject trailing commas after the last item. A trailing comma will prevent Claude Desktop from launching tools.
Double-Escape Windows Backslashes: On Windows, file paths must use double backslashes (C:\Users\name) or forward slashes (C:/Users/name).
Use Absolute Executable Paths: If npx or uvx fails with spawn ENOENT, replace "command": "npx" with the absolute path (/usr/local/bin/npx or C:\Program Files\nodejs\npx.cmd).
How to Verify Your Servers are Working
Completely close Claude Desktop (ensure all background processes are quit).
Relaunch Claude Desktop.
Look at the bottom-right corner of the chat input box. You should see a hammer (πŸ› οΈ) icon.
Click the hammer icon to see the list of active tools registered by your MCP servers.
1-Click Setup with the AIStoreHub CLI

To avoid manual JSON editing and path troubleshooting, you can install and configure verified MCP servers in Claude Desktop with 1 command:

bash

Install the open-source CLI

pip install aistorehub

Configure servers in Claude Desktop automatically

aistorehub add github --client claude
aistorehub add sqlite --client claude

The CLI automatically handles OS-specific path resolution, backs up your config before modifications, and validates JSON syntax.

Original guide published at AIStoreHub: Claude Desktop MCP Setup & Troubleshooting.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.