VectleSkillsfirecrawl-mcp: Unexpected token 'D', "[DEBUG] 202"... is not valid JSON

firecrawl-mcp: Unexpected token 'D', "[DEBUG] 202"... is not valid JSON

Export

Fixes the firecrawl MCP server failing in Claude Desktop with a JSON parse error caused by debug log lines on stdout. Use when the server shows connected but immediately errors with Unexpected token 'D' and a [DEBUG] prefix. Not for missing API keys or fetch tool errors.

Fix Firecrawl MCP Unexpected token 'D', "[DEBUG] 202"... is not valid JSON

TL;DR

Stop the server from writing log lines to stdout: switch its logging to stderr or turn debug logging off. The [DEBUG] lines pollute the same pipe the MCP protocol uses, so the client chokes trying to parse a log line as JSON.

The exact error in the Claude Desktop log:

[error] Unexpected token 'D', "[DEBUG] 202"... is not valid JSON

Steps

1. Confirm stdout pollution in the logs

Open the Claude Desktop MCP log for firecrawl and look for log lines interleaved with protocol messages, like:

[mcp-server-firecrawl] [info] Server started and connected successfully
[mcp-server-firecrawl] [error] Unexpected token 'D', "[DEBUG] 202"... is not valid JSON

Success check: the error mentions [DEBUG] and the quoted fragment starts with [DEBUG] 202 (a timestamp). That confirms log output, not protocol output.

2. Redirect logging to stderr or disable debug logging

In your claude_desktop_config.json, set the server's log level so debug output does not go to stdout:

{
  "mcpServers": {
    "firecrawl": {
      "command": "npx",
      "args": ["-y", "firecrawl-mcp"],
      "env": {
        "FIRECRAWL_API_KEY": "[your Firecrawl API key]",
        "LOG_LEVEL": "error"
      }
    }
  }
}

Success check: no more [DEBUG] lines in the log after a restart.

3. Restart and verify the handshake

Fully quit Claude Desktop (kill leftover processes) and reopen it. Check the log for:

[mcp-server-firecrawl] [info] Server started and connected successfully

with no [error] Unexpected token after it. Success check: firecrawl_scrape and firecrawl_search appear in the tool list.

When this applies

  • The firecrawl MCP server starts (you see the "connected successfully" line) but immediately errors with Unexpected token 'D' quoting a [DEBUG] fragment.
  • Affects Claude Desktop and any stdio client; the JSON-RPC transport requires stdout to carry only protocol messages.

When it does not apply

  • You see FIRECRAWL_API_KEY missing or 401 errors. That is an auth problem; set the key in env.
  • The scrape/search tools run but return bad data. That is an API-side issue, not the transport.

Tool compatibility

  • firecrawl-mcp npm package
  • Claude Desktop (any recent version), also Cursor and other stdio MCP clients
  • Node.js 18+

Why it happens

MCP over stdio uses stdout as the JSON-RPC message channel. Any server process that prints logs to stdout breaks the framing: the client reads a log line, calls JSON.parse on it, and dies with Unexpected token. Debug-level logging is the usual culprit because it is the noisiest and includes timestamps, which is why the error quotes [DEBUG] 202....

Edge cases

  • dotenv banner lines ([dotenv@...]) cause the sibling error Unexpected token 'd'; the same fix (keep stdout clean) applies.
  • If the env var for the log level is ignored by your package version, wrap the command in a small script that redirects stdout: run the server with its stdout filtered so only lines starting with { pass through.
  • On Windows, leftover Claude.exe processes hold the old config; use Task Manager to end them all before retesting.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=firecrawl-mcp%3A+Unexpected+token+%27D%27%2C+%22%5BDEBUG%5D+202%22...+is+not+valid+JSON&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.