mcp-server-cloudflare icon indicating copy to clipboard operation
mcp-server-cloudflare copied to clipboard

ReferenceError: TransformStream is not defined - MacOS, Claude Desktop

Open zudsniper opened this issue 9 months ago • 3 comments

Client Information

  • LLM Client: Claude Desktop
  • Client Config:
    "cloudflare-docs": {
      "command": "/Users/jason/.nvm/versions/node/v22.14.0/bin/npx",
      "args": ["mcp-remote@latest", "https://docs.mcp.cloudflare.com/sse"]
    },
    "cloudflare-bindings": {
      "command": "/Users/jason/.nvm/versions/node/v22.14.0/bin/npx",
      "args": ["mcp-remote@latest", "https://bindings.mcp.cloudflare.com/sse"]
    }
  • Using MCP Remote?: Yes
  • MCP Server: see above
  • Prompt: N/A

On MacOS with latest Claude Desktop I cannot start these mcp servers due to a node version issue (seemingly). I assume this is due to the nodejs version that is used to build the electron claude desktop app, but having tried many things to tell claude desktop to use a different version (fully specifying npx, using pnpx, etc.) I have not had any success. Here's the mcp server logs.

2025-05-09T17:05:48.270Z [cloudflare-bindings] [info] Initializing server...
2025-05-09T17:05:48.319Z [cloudflare-bindings] [info] Server started and connected successfully
2025-05-09T17:05:48.323Z [cloudflare-bindings] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
npm WARN exec The following package was not found and will be installed: [email protected]
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.17.1', npm: '8.15.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.17.1', npm: '8.15.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.17.1', npm: '8.15.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.17.1', npm: '8.15.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.17.1', npm: '8.15.0' }
npm WARN EBADENGINE }
file:///Users/jason/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-XFJBHM5U.js:6264
var EventSourceParserStream = class extends TransformStream {
                              ^

ReferenceError: TransformStream is not defined
    at file:///Users/jason/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-XFJBHM5U.js:6264:31
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)
2025-05-09T17:05:53.014Z [cloudflare-bindings] [info] Server transport closed
2025-05-09T17:05:53.014Z [cloudflare-bindings] [info] Client transport closed
2025-05-09T17:05:53.014Z [cloudflare-bindings] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', file=sys.stderr)` in python) and it will appear in this log.
2025-05-09T17:05:53.014Z [cloudflare-bindings] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-05-09T17:05:53.015Z [cloudflare-bindings] [info] Client transport closed
2025-05-09T17:11:18.210Z [cloudflare-bindings] [info] Initializing server...
2025-05-09T17:11:18.235Z [cloudflare-bindings] [info] Server started and connected successfully
2025-05-09T17:11:18.236Z [cloudflare-bindings] [info] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
file:///Users/jason/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-XFJBHM5U.js:6264
var EventSourceParserStream = class extends TransformStream {
                              ^

ReferenceError: TransformStream is not defined
    at file:///Users/jason/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-XFJBHM5U.js:6264:31
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)
2025-05-09T17:11:19.634Z [cloudflare-bindings] [info] Server transport closed
2025-05-09T17:11:19.634Z [cloudflare-bindings] [info] Client transport closed
2025-05-09T17:11:19.634Z [cloudflare-bindings] [info] Server transport closed unexpectedly, this is likely due to the process exiting early. If you are developing this MCP server you can add output to stderr (i.e. `console.error('...')` in JavaScript, `print('...', file=sys.stderr)` in python) and it will appear in this log.
2025-05-09T17:11:19.634Z [cloudflare-bindings] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-05-09T17:11:19.635Z [cloudflare-bindings] [info] Client transport closed

To Reproduce Steps to reproduce the behavior:

  1. Configure claude desktop as shown above
  2. Start claude desktop

Expected behavior Servers load correctly (no errors)

zudsniper avatar May 09 '25 17:05 zudsniper

Same here

pixply avatar Jun 13 '25 10:06 pixply

@zudsniper I found a solution.

The problem is NVM. Rename the ~/.nvm folder to something like .nvm-disabled, to disable NVM. Then install Node with the normal installer from the node js site. It should work then.

If you want to use NVM again you need to rename the folder back to .nvm. It will break the mcp server again though.

(I also tested the direct path to the node version in the nvm directory etc. but no luck either. So no NVM and mcp I guess.)

pixply avatar Jun 13 '25 11:06 pixply

@zudsniper I found a solution.

The problem is NVM. Rename the ~/.nvm folder to something like .nvm-disabled, to disable NVM. Then install Node with the normal installer from the node js site. It should work then.

If you want to use NVM again you need to rename the folder back to .nvm. It will break the mcp server again though.

(I also tested the direct path to the node version in the nvm directory etc. but no luck either. So no NVM and mcp I guess.)

This was my suspicion. But why? It doesn't make much sense.

zudsniper avatar Jun 15 '25 06:06 zudsniper