{"slug": "claude-mcp-setup", "title": "Claude MCP setup", "summary": "Claude Desktop fails to initialize Model Context Protocol (MCP) servers when the claude_desktop_config.json file specifies \"npx\" as the command, because the app does not inherit shell environment variables and returns a \"Spawn error: ENOENT\" in the logs at %APPDATA%\\Claude\\logs. The fix is to replace \"npx\" with the absolute executable path, such as C:\\Program Files\\nodejs\\npx.cmd, and to remove trailing commas from the mcpServers object, since standard JSON rejects them and Claude Desktop silently refuses to load any MCP servers. The author reports spending four hours on the setup and 45 minutes on a single trailing comma, and rates the official Node-based MCP SDK as high stability with a 15-minute setup time versus low stability and 2 minutes for third-party connectors.", "body_md": "# Claude MCP setup\n\nSolving a [Claude](/en/tags/claude/) MCP setup loop that kept crashing my Desktop app\n\nThe goal is simple: give Claude Desktop the ability to read my local filesystem and query my database without manually uploading CSVs every ten minutes. I spent four hours last Wednesday fighting with the `claude_desktop_config.json` file because the logs kept lying to me. If you are trying to connect a Model Context Protocol ([MCP](/en/tags/mcp/)) server, the most likely point of failure is your Node path or a silent JSON syntax error.\n\n## Why did my MCP server keep failing to initialize?\n\nI tried adding the Brave Search and Google Maps MCP servers. The app started, but the \"tools\" icon never appeared. I checked the logs in `%APPDATA%\\Claude\\logs` (on Windows) and found this repeating nightmare:\n\n`[ERROR] MCP Server connection failed: Spawn error: ENOENT. Command \"npx\" not found in path.`\n\nThe wild part? `npx` works fine in my terminal.\n\nThe issue is that Claude Desktop doesn't inherit your shell's environment variables. It doesn't know where Node is installed. I had spent an hour trying to \"fix\" the server code when the problem was actually just the shell environment.\n\nTo fix this, stop using `npx` in your config. Use the absolute path to the executable.\n\n### The fix that actually worked\n\nI found my npx path by running `where npx` in PowerShell. It was `C:\\Program Files\\nodejs\\npx.cmd`.\n\nI edited my config file here: `%APPDATA%\\Claude\\claude_desktop_config.json`\n\nI changed the server definition from this:\n\n```\n\"brave-search\": {\n  \"command\": \"npx\",\n  \"args\": [\"-y\", \"@modelcontextprotocol/server-brave-search\"]\n}\n```\n\nTo this:\n\n```\n\"brave-search\": {\n  \"command\": \"C:\\\\Program Files\\\\nodejs\\\\npx.cmd\", \n  \"args\": [\"-y\", \"@modelcontextprotocol/server-brave-search\"],\n  \"env\": {\n    \"BRAVE_API_KEY\": \"BPMXXXXXXXXXXXXXXXXXXXXXXXX\"\n  }\n}\n```\n\n*Note: Double backslashes are mandatory in JSON paths on Windows.*\n\nI restarted Claude (fully quit from the system tray, not just closed the window) and the tools finally popped up.\n\n## Comparing MCP setups across different tools\n\nDepending on what you are trying to automate, you might find different \"flavors\" of MCP implementations. I've tested three common setups over the last month.\n\n| Setup Type | Stability | Setup Time | Use Case |\n\n| :--- | :--- | :--- | :--- |\n\n| Official MCP SDK (Node) | High | 15 mins | Production-grade tools |\n\n| Python MCP Wrappers | Medium | 10 mins | Data science / Local scripts |\n\n| Third-party \"Connectors\" | Low | 2 mins | Quick prototypes |\n\nThe Node-based servers are definitely the most stable, but the pathing issue I hit is a common bottleneck. If you are diving deep into [AI Coding](/en/category/aicoding/), you'll realize that the \"last mile\" of integration—getting the AI to actually talk to your local machine—is where most developers lose their patience.\n\n## Dealing with the \"JSON Parse Error\" ghost\n\nAnother thing that tripped me up: adding a trailing comma to the last item in the `mcpServers` object.\n\nStandard JSON doesn't allow trailing commas. If you have one, Claude Desktop won't tell you \"Line 14 has a trailing comma.\" It will simply refuse to load any MCP servers, and you'll be left staring at a blank tool menu.\n\nIf your config looks correct but isn't working, run it through a JSON validator. I wasted 45 minutes on a single comma.\n\n## Where to find better server configs\n\nSetting up the JSON is the boring part. The real value is finding servers that actually do something useful. I've found that the community-driven approach is the only way to keep up.\n\nThis is why I spend time in the PromptCube community. Instead of guessing which `args` a specific MCP server needs, I can see what other developers are using for their local [RAG](/en/tags/rag/) setups or database connectors. It's the difference between reading the official documentation (which is often sparse) and seeing a real-world implementation that actually works on macOS or Windows.\n\nIf you want to stop guessing and start shipping, joining a group of practitioners is better than staring at a README. You can find the PromptCube community online—just look for their developer forums and join the discourse.\n\n## When to give up on MCP and just use a script\n\nMCP is great, but it's not a silver bullet. If you have a task that requires complex state management or takes longer than 30 seconds to execute, the timeout in Claude Desktop might kill the process.\n\nFor heavy data processing, I've stopped trying to wrap everything in an MCP server. Instead, I use the AI to write a standalone Python script, run it locally, and then feed the output back into the chat. It's less \"magical\" than a tool call, but it doesn't crash your app.\n\n[Next Why MCQ-based evaluation beats BLEU for video captions →](/en/threads/9218/)", "url": "https://wpnews.pro/news/claude-mcp-setup", "canonical_source": "https://promptcube3.com/en/posts/9258/", "published_at": "2026-09-12 14:25:13+00:00", "updated_at": "2026-09-12 14:46:37.566873+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "developer-tools", "ai-agents"], "entities": ["Claude Desktop", "Model Context Protocol", "Anthropic", "Node.js", "npx", "Brave Search", "Google Maps", "PromptCube"], "alternates": {"html": "https://wpnews.pro/news/claude-mcp-setup", "markdown": "https://wpnews.pro/news/claude-mcp-setup.md", "text": "https://wpnews.pro/news/claude-mcp-setup.txt", "jsonld": "https://wpnews.pro/news/claude-mcp-setup.jsonld"}}