You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Drop Node.js requirement from 22 to 18 and remove cheerio dependency (#572)
* fix: Drop Node.js requirement from 22 to 18 and remove cheerio dependency
Sentry telemetry showed ~20K crash events from users on older Node.js
versions (File is not defined, ReadableStream is not defined) and ~115K
events from corrupted npx caches. This change improves compatibility
by lowering the minimum Node.js version to 18 (matching @modelcontextprotocol/sdk).
- Remove cheerio dependency (required Node >=20.18.1) and the unused
get-html-skeleton tool, its cache, constants, and tests
- Lower engines.node to >=18 in package.json, manifest.json, docs
- Add Node.js version guard in stdio.ts with a clear error message
- Add Node.js version policy documentation in DEVELOPMENT.md
- Expand README troubleshooting section (npx cache, old Node, log paths)
- CI now tests against Node.js 18, 20, 22, and 24 via matrix strategy
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: Simplify MCP URL assignment and improve README clarity
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: DEVELOPMENT.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,19 @@ Key entry points:
34
34
-`src/main.ts` - Actor entry point (standby server / debugging)
35
35
-`src/input.ts` - Input processing and validation
36
36
37
+
## Node.js version policy
38
+
39
+
The minimum supported Node.js version is **18** (`engines.node >= 18` in `package.json`).
40
+
41
+
**Why Node.js 18 (not higher):**
42
+
The MCP server is installed by end-users via `npx` and must work on the widest reasonable range of Node.js versions. Our key dependency, `@modelcontextprotocol/sdk`, requires Node.js >= 18, and our own source code uses no APIs beyond what Node.js 18 provides. Sentry telemetry showed ~20K crash events from users on older Node versions (`File is not defined`, `ReadableStream is not defined`), confirming that many users run older runtimes.
43
+
44
+
**Rules for maintaining compatibility:**
45
+
- Do not use Node.js APIs introduced after v18 (e.g., `import.meta.resolve`, `Array.fromAsync`, `Set.union()`).
46
+
- Do not add dependencies that require Node.js > 18 at runtime. Check `engines` field of new dependencies before adding them.
47
+
- CI runs unit tests against Node.js 18, 20, 22, and 24 to catch compatibility regressions.
48
+
- The `.nvmrc` file pins the latest Node.js version for development tooling (lint, type-check, build) — this is intentionally higher than the minimum supported version.
49
+
37
50
## How to contribute
38
51
39
52
Refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) file.
Copy file name to clipboardExpand all lines: README.md
+45-5Lines changed: 45 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,19 +235,19 @@ All tools include metadata annotations to help MCP clients and LLMs understand t
235
235
236
236
-**`title`**: Short display name for the tool (e.g., "Search Actors", "Call Actor", "apify/rag-web-browser")
237
237
-**`readOnlyHint`**: `true` for tools that only read data without modifying state (e.g., `get-dataset`, `fetch-actor-details`)
238
-
-**`openWorldHint`**: `true` for tools that access external resources outside the Apify platform (e.g., `call-actor` executes external Actors, `get-html-skeleton` scrapes external websites). Tools that interact only with the Apify platform (like `search-actors` or `fetch-apify-docs`) do not have this hint.
238
+
-**`openWorldHint`**: `true` for tools that access external resources outside the Apify platform (e.g., `call-actor` executes external Actors). Tools that interact only with the Apify platform (like `search-actors` or `fetch-apify-docs`) do not have this hint.
239
239
240
240
### Tools configuration
241
241
242
-
The `tools` configuration parameter is used to specify loaded tools - either categories or specific tools directly, and Apify Actors. For example, `tools=storage,runs` loads two categories; `tools=add-actor` loads just one tool.
242
+
The `tools` configuration parameter is used to specify loaded tools – either categories or specific tools directly, and Apify Actors. For example, `tools=storage,runs` loads two categories; `tools=add-actor` loads just one tool.
243
243
244
244
When no query parameters are provided, the MCP server loads the following `tools` by default:
245
245
246
246
-`actors`
247
247
-`docs`
248
248
-`apify/rag-web-browser`
249
249
250
-
If the tools parameter is specified, only the listed tools or categories will be enabled - no default tools will be included.
250
+
If the tools parameter is specified, only the listed tools or categories will be enabled – no default tools will be included.
251
251
252
252
> **Easy configuration:**
253
253
>
@@ -390,7 +390,7 @@ For detailed development setup, project structure, and local testing instruction
390
390
391
391
## Prerequisites
392
392
393
-
-[Node.js](https://nodejs.org/en) (v22 or higher)
393
+
-[Node.js](https://nodejs.org/en) (v18 or higher)
394
394
395
395
Create an environment file, `.env`, with the following content:
396
396
```text
@@ -446,10 +446,50 @@ The Apify MCP Server is also available on [Docker Hub](https://hub.docker.com/mc
446
446
447
447
# 🐛 Troubleshooting (local MCP server)
448
448
449
-
- Make sure you have `node` installed by running `node -v`.
449
+
- Make sure you have `node`(v18 or higher) installed by running `node -v`.
450
450
- Make sure the `APIFY_TOKEN` environment variable is set.
451
451
- Always use the latest version of the MCP server by using `@apify/actors-mcp-server@latest`.
452
452
453
+
### Common issues
454
+
455
+
#### "Unable to connect to extension server" or tools not loading
456
+
457
+
This is most commonly caused by a **corrupted npx cache**. Fix it by clearing the cache and retrying:
458
+
459
+
```bash
460
+
# Clear the npx cache
461
+
rm -rf ~/.npm/_npx
462
+
463
+
# Retry
464
+
npx -y @apify/actors-mcp-server@latest
465
+
```
466
+
467
+
#### Errors like "File is not defined" or "ReadableStream is not defined"
468
+
469
+
You are running an **outdated version of Node.js**. The Apify MCP server requires Node.js 18 or higher:
470
+
471
+
```bash
472
+
node -v # Check your version
473
+
```
474
+
475
+
If your version is below 18, update Node.js from [nodejs.org](https://nodejs.org).
476
+
477
+
#### "Cannot find module" errors
478
+
479
+
This usually indicates a corrupted `npx` cache (see above). Clear it with `rm -rf ~/.npm/_npx` and retry.
480
+
481
+
#### Server works in Claude Desktop chat but not in cowork mode
482
+
483
+
This is a known issue we are investigating. As a workaround, try using the hosted server at [mcp.apify.com](https://mcp.apify.com) instead of the local stdio server.
484
+
485
+
### Checking logs
486
+
487
+
If you encounter issues, check the Claude Desktop logs for error details:
488
+
489
+
-**macOS**: `~/Library/Logs/Claude/`
490
+
-**Windows**: `%APPDATA%\Claude\logs\`
491
+
-**Linux**: `~/.config/Claude/logs/`
492
+
453
493
### Debugging the NPM package
454
494
455
495
To debug the server, use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) tool:
0 commit comments