MCP Directory

MCP config not working? The JSON mistakes that break it silently

Close-up of HTML code lines highlighting web development concepts and techniques.
Photo: Pixabay / Pexels

Symptom: You pasted a config, nothing errors, but no server loads — the client behaves as if the file is empty.

Short answer

MCP clients don't show JSON errors — a malformed config just silently does nothing. The four killers: a trailing comma after the last entry, smart-quotes from a doc/website, wrong nesting (servers not inside one "mcpServers" object), and unescaped backslashes in Windows paths. Validate the file and these disappear.

Why it happens, ranked by how often it's the real cause

1. Trailing comma after the last entry

Valid in JavaScript, invalid in JSON — and it voids the whole file.

Fix: Remove the comma after the final server/brace.

2. Smart quotes (“ ”) instead of straight quotes (")

Copying from a blog or word processor swaps in curly quotes that JSON rejects.

Fix: Retype the quotes, or copy from a code-formatted source (every config on this site is straight-quoted).

3. Wrong nesting

Each server must live inside a single top-level "mcpServers" object, not at the root.

Fix: Shape: { "mcpServers": { "name": { "command": ..., "args": [...] } } }.

4. Unescaped Windows backslashes

"C:\path\to\x" breaks JSON; backslashes must be doubled.

Fix: Use "C:\\path\\to\\x" or forward slashes "C:/path/to/x".

Fix it step by step

  1. 1Paste the entire file into a JSON validator or VS Code (it underlines the exact error).
  2. 2Confirm one top-level "mcpServers" object containing every server.
  3. 3Remove any trailing commas; replace smart quotes with straight quotes.
  4. 4Double every backslash in Windows paths (or use forward slashes).
  5. 5Save, fully restart the client, and re-check.

Still stuck?

If the JSON validates but still nothing loads, the problem moved downstream — it's no longer the config syntax but the command or env. Jump to the 'not connecting' guide and read the log.

FAQ

Why does my MCP config fail with no error message?

MCP clients parse the config silently — a syntax error just makes them load nothing instead of showing a message. Validate the JSON; a single trailing comma or smart-quote is usually the culprit.

What is the correct mcpServers JSON structure?

{ "mcpServers": { "server-name": { "command": "npx", "args": ["-y", "package"], "env": { "KEY": "value" } } } } — one top-level mcpServers object, no trailing comma after the last entry.