Configuration · troubleshooting record
MCP configuration file fails with a JSON parse error
JSON parse errorThe client cannot read its MCP configuration because the JSON contains a syntax error, comment, trailing comma, duplicate key, or prose around the object. The fix depends on the exact parser message and the file the client actually loads.
Symptoms
- Client reports invalid JSON, unexpected token, or configuration could not be parsed.
- The MCP server list is empty even though a configuration file exists.
- The editor shows valid-looking JSON but the runtime rejects it.
Confirmed causes
These causes have a documented basis. They may not be the cause of your specific failure.
Trailing comma or comment in a .json file
JSON does not permit comments or trailing commas; strict client parsers reject them.
Markdown code fences or explanatory text pasted into the file
A configuration file must contain a single JSON value, not documentation prose or a fenced block.
The client is reading a different file path or scope than the one edited
Claude Code, Cursor, and VS Code use different file paths and scopes, so editing the wrong file leaves the loaded config unchanged.
Possible causes
- An unescaped Windows backslash in a command or path.
- A UTF-8 BOM or smart quote introduced by an editor.
- Duplicate server names that the parser reports as a syntax-adjacent error.
- A configuration merge that combined two objects incorrectly.
What still needs verification
- Which exact path the client reports or documents for the selected scope.
- Whether the parser supports JSON with comments (most MCP clients use strict JSON).
- Whether a project-level file is overriding a global file.
Affected environments
Fixes
Validate the exact file the client loads
- Open the path for the active scope and make sure it is the file the client reports using.
- Run the content through a strict JSON parser or the Code X MCP Config Doctor.
- Remove comments, trailing commas, code fences, and text outside the root object.
Check escaping and encoding
- Use forward slashes or escaped double backslashes in Windows paths.
- Save the file as UTF-8 without a BOM.
- Replace smart quotes with straight double quotes.
Verify the fix
- The Config Doctor parses the file with zero syntax errors.
- The client starts without a configuration parse message.
- The server appears in the client's MCP server list.
Paste the configuration into the Config Doctor. It runs in your browser, never uploads the file, and can show structural issues and safe fixes.
Why we believe this
- code.claude.com/docs/en/mcpOfficial documentation · checked Oct 23, 2026 · documented
Claude Code documents .mcp.json and its JSON structure for project-scoped servers.
- cursor.com/docs/mcpOfficial documentation · checked Oct 23, 2026 · documented
Cursor documents .cursor/mcp.json and ~/.cursor/mcp.json configuration files.