Dev.to AI 🤖 Ai 👁 2 📖 3 min read

Your MCP server won't connect — and the client won't tell you why

Your MCP server won't connect — and the client won't tell you why You add an MCP server to Claude Desktop or Cursor, restart, and get... nothing. No error. No server. Just silence. This is the most common first experi

Your MCP server won't connect — and the client won't tell you why

You add an MCP server to Claude Desktop or Cursor, restart, and get... nothing. No error. No server. Just silence.

This is the most common first experience with MCP, and it's the worst kind of failure: a silent one. Install guides put the average first-time MCP install at up to 3 hours of guessing (that's their claim, not a measurement — but anyone who has done it knows the feeling). The same four silent killers show up everywhere:

  1. Wrong config file — every client reads a different one. Claude Desktop, Cursor, VS Code and Codex all keep their server lists in different places, under different keys.
  2. Quietly broken JSON — one trailing comma and the whole server list fails to load, with no error dialog anywhere.
  3. The GUI PATH gap — your terminal finds npx fine; the desktop app was launched without your shell PATH, so it sees nothing.
  4. The server dies at startup — a missing import or env var, and the client shows you the same silence as causes 1–3.

Never fail silently: run the real handshake

I got tired of guessing, so I built a small tool that stops guessing and measures instead: mcpdoctor.

For every server entry in every client config it finds, it checks stage by stage — parse, schema, resolve, run — and prints which step failed, why, and the exact fix:

  • parse — JSON/TOML syntax with the exact line and column, including trailing commas, comments, UTF-8 BOMs and duplicate keys.
  • schema — the client's top-level key, entry shape, a missing command, a whole command line stuffed into command, bad args/env shapes.
  • resolve — the command resolved twice: against your shell PATH and against the minimal PATH a GUI app inherits, so the GUI PATH gap is caught, not guessed.
  • run — the server is actually spawned and spoken to in raw JSON-RPC over stdio: initialize → notifications/initialized → tools/list, with stderr captured separately.

Failures are classified into 17 cause codes (TRAILING_COMMA, GUI_PATH, STDOUT_POLLUTION, PROCESS_EXITED_EARLY, and more), each with a plain-language explanation and the exact fix.

It works with Claude Desktop, Claude Code, Cursor, VS Code and Codex. Zero dependencies, read-only — it never modifies your configs, and env values are never printed (key names only).

Measured, not claimed

I fed it 20 deliberately broken configs — bad JSON, invisible commands, crashing servers, stdout polluters. It named the exact cause in 20 out of 20 cases, with a median diagnosis time of 0.08 seconds. The test suite is 51 real tests, including adversarial cases found by a bug-hunt pass (BOM and invalid-UTF-8 configs, duplicate server names, secret leakage through crash stderr, a 30 MB stderr line, Codex TOML, double-forking servers). Real config files and real server processes throughout — no mocked subprocess for the live-run cases.

Install

pip install mcpdoctor-py
mcpdoctor

That's it. If a server is healthy you get a confirmation plus a "tool tax" line (tool count and an approximate token estimate). If it's broken you get the cause and the fix.

If you've ever lost an evening to a silent MCP install, I'd like to know which of the four got you.

Kamal Mosadegh — freelance developer building trading bots, TradingView indicators and Python tools. More of my work: https://kamalmosadegh.github.io — connect with me on LinkedIn: https://www.linkedin.com/in/kamalmosadegh/

📰 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.