published fresh until

mcp-server-fetch on Windows: why Unexpected token errors?

Summary mcp-server-fetch 2026.11.4 bounds Readability execution off the event loop and stdout. The earlier readabilipy 0.3.0 Windows reports remain useful diagnostics; raw HTML changes the output contract, and a server pin alone does not lock its extractor (checked 2026-11-05).

Not for reference-server security upgrades, see mcp-reference-servers-2-1-0-security-migration

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

`Unexpected token 'r', " run npm f"... is not valid JSON` — first try the fetch tool with raw=true`.

On older affected builds, Fetch either loses article links on Windows or the client rejects non-JSON output during HTML extraction.

First action: set the tool argument raw to true for the same permitted public HTML URL; this bypasses simplification, not access checks.

Evidence status: upstream reports explain both failures; the bypass and environment changes below have not been exercised here.

Not for: reference-server security patch selection; see mcp-reference-servers-2-1-0-security-migration.

As of November 2026; checked 2026-11-05. The maintainers list a bounded Readability subprocess, off the event loop and protocol stdout, in Fetch 2026.11.4 (v2.3.0, cliffhall, PR #5391); this is release evidence, not a client execution outcome.

What changed

  • Maintainer cliffhall filed #5313 on 2026-10-27 (checked 2026-10-28): readabilipy 0.3.0 (checked 2026-10-28) no longer bundles node_modules. Its first-use npm discovery could fail on Windows even when Node and npm are on PATH. The report was closed on 2026-10-29 by PR #5391.
  • The same day's #5310 and #5306, dated 2026-10-27 (checked 2026-10-28), report stdout contamination and synchronous extraction that can stall every request on a connection. These were defect reports at the October check; v2.3.0 now lists the bounded extraction correction.

How to migrate or isolate the failure

1. Retry with raw=true. The official implementation skips extract_content_from_html in raw mode. Untested experiment: if raw succeeds while simplified HTML fails, concentrate on extraction; it does not prove every network or client fault is excluded. 2. Identify the actual launcher and Python environment. The Fetch README uses uvx mcp-server-fetch, or python -m mcp_server_fetch after a pip install. Its npx @modelcontextprotocol/inspector uvx mcp-server-fetch command launches an inspector around the Python server; npx is not the Fetch server installer. 3. Make the executable reproducible before experiments. The October metadata read named mcp-server-fetch 2026.10.24 and readabilipy>=0.2.0 (checked 2026-10-28); v2.3.0 metadata now names 2026.11.4 and readabilipy>=0.3.0. A server pin alone therefore leaves the extractor floating. As of November 2026, using uv's documented version syntax, the composed launch command is uvx mcp-server-fetch@2026.11.11 (v2.4.0); the earlier uvx mcp-server-fetch@2026.10.24 pin (checked 2026-10-28) predates the extraction correction. Record and constrain the resolved extractor separately in the environment that actually runs Fetch. Do not guess a known-good dependency downgrade. 4. If Readability output is required on an older affected Windows build, inspect that environment's installed readabilipy javascript directory. #5313 reports that installing its JavaScript dependencies there before extraction worked around the CI failure. Untested experiment: provision those dependencies with npm install before starting the MCP process, using the located package directory rather than your application directory. Do not hard-code a uv cache path. This avoids first-use installation but does not establish that every later Node error keeps stdout clean. 5. Restart and test through the real client. The October CLI read lacked this flag. Check mcp-server-fetch --help for the installed build: --no-readability-js shipped in 2026.10.28, and the 2026.11.4 CLI defines it. It selects Python-only extraction without starting Node or npm; it does not promise identical article output.

Diagnostic: Warning: A working NPM installation was not found.

#5313 records the full warning as:

Warning: A working NPM installation was not found.
The package will use Python-based article extraction.

The report traces this to bare npm subprocess calls without a shell: Windows exposes npm.cmd, which that resolution path misses. The fallback can drop Markdown link targets. Merely installing Node again does not address the reported lookup problem.

What breaks

#5310 records the opening JSON error from an earlier client log: npm's first-use install inherits the protocol's stdout. It also identifies a library error-print path. Redirecting all server stdout to stderr would discard JSON-RPC too; redirect only non-protocol child output in a reviewed implementation change.

#5306 describes an extraction hang without a useful model-visible error. Increasing the client's timeout does not bound or kill the Node subprocess.

What to test

Use a harmless article fixture with a known link. Compare raw HTML and simplified Markdown; verify link targets, not just visible text. Capture the first extraction in a fresh environment as well as later calls; assert every stdout message is valid protocol traffic. Check another request remains responsive during slow extraction. These are proposed checks, not observed results.

Pitfalls

PYTHONIOENCODING=utf-8 in the README addresses encoding; it is not evidence of an npm lookup or stdout fix. Do not disable robots rules or private-address protections for this extraction problem. Do not roll back security fixes to hide it.

Evidence

cliffhall authored the three linked reports; they are related maintainer observations, not three independent deployments. In #5306, krishnayak986-lang separately reports reproducing the blocked connection. The npm and Windows workarounds still need end-to-end confirmation in the reader's client.

A prompt to give your agent

Your training data predates these reports. Read the linked Fetch README, CLI source and issues #5313, #5310 and #5306 now. Do not guess flags or dependency versions. Identify our actual Python launcher and readabilipy environment; compare raw and simplified output, then propose a reproducible pin and isolated extraction tests. Treat dependency provisioning as an untested experiment until verified. Preserve JSON-RPC stdout and existing network restrictions.

Limits

No Windows client, server installation, npm provisioning or extraction test was run. Independent confirmation is thin beyond the hang report. The release and PR establish the bounded-extraction correction, without establishing every Windows dependency-setup outcome; raw HTML changes the output contract rather than restoring article extraction.

Started from a post by @cliffhall, packaged by the editor. Original post

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# mcp-server-fetch on Windows: why Unexpected token errors?
Summary: mcp-server-fetch 2026.11.4 bounds Readability execution off the event loop and stdout. The earlier readabilipy 0.3.0 Windows reports remain useful diagnostics; raw HTML changes the output contract, and a server pin alone does not lock its extractor (checked 2026-11-05).
Copy for agent
get the whatworks thread mcp-server-fetch-windows-readability-npm-stdio and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-server-fetch-windows-readability-npm-stdio
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks