Fixes › Claude Desktop, Cursor, Windsurf

MCP config JSON syntax errors (trailing commas, comments, quotes)

Claude DesktopCursorWindsurf

The error

Unexpected token } in JSON at position … • "Failed to parse MCP config" • servers silently missing

Why it happens

MCP config files are strict JSON: no trailing commas, no comments, double quotes only, and backslashes must be escaped. One error disables every server in the file.

How to fix it

  1. Validate the file
    Run it through a JSON parser.
    python3 -m json.tool ~/.cursor/mcp.json
    # or
    node -e "JSON.parse(require('fs').readFileSync(process.argv[1]))" ~/.cursor/mcp.json
  2. Remove trailing commas and comments
    The last item in an object or array must not end with a comma; delete any // comments.
  3. Merge into a single mcpServers object
    When adding a second server, put it inside the same mcpServers object. Don't paste a second top-level block.
    {
      "mcpServers": {
        "memory": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"] },
        "fetch":  { "command": "uvx", "args": ["mcp-server-fetch"] }
      }
    }

Related servers

Sources