Claude Desktop connection - Supergate error?

Hi all,

As a beginner with MCP servers I found myself not be able to set it up.

I cant seem to connect Claude Desktop with the MCP server in N8n (native cloud version).

The issue lays in fetch for supergateway. Anyone experienced this before?
Not sure what goes wrong. Has anyone suggestions maybe?

The error log looks like this

/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:112:27)
at Client.connect (file:///…/.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:88:31)
at Client.connect (file://…npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js:56:21)
at StdioServerTransport.stdioServer.transport.onmessage (file:///…npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:83:41)
2025-05-06T10:53:41.374Z [n8n] [info] Message from server: {“jsonrpc”:“2.0”,“id”:0,“error”:{“code”:-32000,“message”:“fetch is not defined”}}
2025-05-06T10:53:41.374Z [n8n] [info] Client transport closed
[supergateway] Caught SIGTERM. Exiting…
2025-05-06T10:53:41.375Z [n8n] [info] Server transport closed
2025-05-06T10:53:41.375Z [n8n] [info] Client transport closed
2025-05-06T10:53:41.375Z [n8n] [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-06T10:53:41.375Z [n8n] [error] Server disconnected. For troubleshooting guidance, please visit our debugging documentation {“context”:“connection”}
2025-05-06T10:53:41.381Z [n8n] [info] Server transport closed
2025-05-06T10:53:41.381Z [n8n] [info] Client transport closed

1 Like

It looks like supergateway is working correctly, but the MCP server you’re running underneath is missing “fetch” library. Which MCP server is it - what is the full command?

2 Likes

n8n attach workflow

If you add your workflow, we can see the setting ure using, that can be helpful.

And there is community node, and built in node which one are you using?

3 Likes

Hi, thank you for your reply.

That would be the N8n mcp server (native).
Or do I still miss something?

cool, so u can try use the client inside n8n firstly see if it can communicate all okay,

You may have to setup using community node, hopefully the video helps

Ill get if it a try. Thank you very much!

Hey, it seems that supergateway has some issues (see also here)

I’ve now switched to mcp-remote and that resolved my issues. The MCP config in Claude Desktop now looks like this:

    "n8n": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "<URL>",
      ]
    }

If you are using any bearer tokens, you can add it using --header and the header, similarly to supergateway. Hope this helps!

Thank you. Let me give it a try, as I still do not have it working. I also saw that ChatGPT launched MCP options. Otherwise, I will attempt to use it with ChatGPT.

Just released Supergateway v3.1.0 that fixes the protocol version mismatch issues so all of these issues should be fixed.

Post the logs if you still encounter anything.

Thanks.
Yeah, still get the error.
I wont be surprised if I have a setting wrong somewhere, but see here the logs as well.

[supergateway] Request error: ReferenceError: fetch is not defined
    at fetch (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:39:17)
    at EventTarget.connect_fn (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:204:135)
    at new EventSource (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:125:435)
    at file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:53:33
    at new Promise (<anonymous>)
    at SSEClientTransport._startOrAuth (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:51:16)
    at SSEClientTransport.start (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:112:27)
    at Client.connect (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:88:31)
    at Client.connect (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js:56:21)
    at StdioServerTransport.stdioServer.transport.onmessage (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:83:41)
2025-06-02T11:56:48.377Z [n8n] [info] Message from server: {"jsonrpc":"2.0","id":0,"error":{"code":-32000,"message":"fetch is not defined"}}
2025-06-02T11:56:48.484Z [n8n] [info] Client transport closed
[supergateway] Caught SIGTERM. Exiting...
2025-06-02T11:56:48.484Z [n8n] [info] Server transport closed
2025-06-02T11:56:48.484Z [n8n] [info] Client transport closed
2025-06-02T11:56:48.484Z [n8n] [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-06-02T11:56:48.484Z [n8n] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-06-02T11:56:48.492Z [n8n] [info] Server transport closed
2025-06-02T11:56:48.492Z [n8n] [info] Client transport closed
2025-06-02T11:58:20.958Z [n8n] [info] Initializing server...
2025-06-02T11:58:21.007Z [n8n] [info] Server started and connected successfully
2025-06-02T11:58:21.010Z [n8n] [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}
[supergateway] Starting...
[supergateway] Supergateway is supported by Supermachine (hosted MCPs) - https://supermachine.ai
[supergateway]   - outputTransport: stdio
[supergateway]   - sse: https://....app.n8n.cloud/mcp/google-contacts/sse
[supergateway]   - Headers: (none)
[supergateway] Connecting to SSE...
[supergateway] Stdio server listening
[supergateway] Stdio → SSE: {
  jsonrpc: '2.0',
  id: 0,
  method: 'initialize',
  params: {
    protocolVersion: '2024-11-05',
    capabilities: {},
    clientInfo: { name: 'claude-ai', version: '0.1.0' }
  }
}
[supergateway] Request error: ReferenceError: fetch is not defined
    at fetch (file://.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:39:17)
    at EventTarget.connect_fn (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:204:135)
    at new EventSource (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:125:435)
    at file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:53:33
    at new Promise (<anonymous>)
    at SSEClientTransport._startOrAuth (file:///..._npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:51:16)
    at SSEClientTransport.start (file:///.../_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:112:27)
    at Client.connect (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:88:31)
    at Client.connect (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js:56:21)
    at StdioServerTransport.stdioServer.transport.onmessage (file:///.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:83:41)
2025-06-02T11:58:21.675Z [n8n] [info] Message from server: {"jsonrpc":"2.0","id":0,"error":{"code":-32000,"message":"fetch is not defined"}}
2025-06-02T11:58:21.676Z [n8n] [info] Client transport closed
[supergateway] Caught SIGTERM. Exiting...
2025-06-02T11:58:21.676Z [n8n] [info] Server transport closed
2025-06-02T11:58:21.676Z [n8n] [info] Client transport closed
2025-06-02T11:58:21.676Z [n8n] [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-06-02T11:58:21.677Z [n8n] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-06-02T11:58:21.683Z [n8n] [info] Server transport closed
2025-06-02T11:58:21.683Z [n8n] [info] Client transport closed

Martin, your last error log shows that your error is related to Node version. It looks like you are using Node v18 or <v20 which is an unsupported old Node version - therefore the “fetch is not defined” error. You can check node version with node -v

To fix this, you need to upgrade at least to Node v20 (v22 is the best/latest) to use Supergateway.

Not sure what your setup is, but here’s some info on how to do the upgrade for various setups: Node.js — Download Node.js®

If you get stuck, send us more info about your node version / node setup.

It is strange, because I do have version: v22.15.0

2025-06-05T13:58:19.962Z [info] [n8n] Initializing server... 2025-06-05T13:58:20.009Z [info] [n8n] Server started and connected successfully 2025-06-05T13:58:20.200Z [info] [n8n] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0} 2025-06-05T13:58:21.809Z [info] [n8n] Message from server: {"jsonrpc":"2.0","id":0,"error":{"code":-32000,"message":"fetch is not defined"}} 2025-06-05T13:58:21.810Z [info] [n8n] Client transport closed 2025-06-05T13:58:21.811Z [info] [n8n] Server transport closed 2025-06-05T13:58:21.811Z [info] [n8n] Client transport closed 2025-06-05T13:58:21.811Z [info] [n8n] 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-06-05T13:58:21.811Z [error] [n8n] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) 2025-06-05T13:58:21.830Z [info] [n8n] Server transport closed 2025-06-05T13:58:21.830Z [info] [n8n] Client transport closed

and

supergateway] Request error: ReferenceError: fetch is not defined
    at fetch (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:39:17)
    at EventTarget.connect_fn (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:204:135)
    at new EventSource (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:125:435)
    at file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:53:33
    at new Promise (<anonymous>)
    at SSEClientTransport._startOrAuth (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:51:16)
    at SSEClientTransport.start (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:112:27)
    at Client.connect (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:88:31)
    at Client.connect (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js:56:21)
    at StdioServerTransport.stdioServer.transport.onmessage (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:83:41)
2025-06-02T11:58:21.675Z [n8n] [info] Message from server: {"jsonrpc":"2.0","id":0,"error":{"code":-32000,"message":"fetch is not defined"}}
2025-06-02T11:58:21.676Z [n8n] [info] Client transport closed
[supergateway] Caught SIGTERM. Exiting...
2025-06-02T11:58:21.676Z [n8n] [info] Server transport closed
2025-06-02T11:58:21.676Z [n8n] [info] Client transport closed
2025-06-02T11:58:21.676Z [n8n] [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-06-02T11:58:21.677Z [n8n] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-06-02T11:58:21.683Z [n8n] [info] Server transport closed
2025-06-02T11:58:21.683Z [n8n] [info] Client transport closed
2025-06-05T13:58:19.961Z [n8n] [info] Initializing server...
2025-06-05T13:58:20.008Z [n8n] [info] Server started and connected successfully
2025-06-05T13:58:20.200Z [n8n] [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}
[supergateway] Starting...
[supergateway] Supergateway is supported by Supermachine (hosted MCPs) - https://supermachine.ai
[supergateway]   - outputTransport: stdio
[supergateway]   - sse: https://...dia.app.n8n.cloud/mcp/google-contacts/sse
[supergateway]   - Headers: (none)
[supergateway] Connecting to SSE...
[supergateway] Stdio server listening
[supergateway] Stdio → SSE: {
  jsonrpc: '2.0',
  id: 0,
  method: 'initialize',
  params: {
    protocolVersion: '2024-11-05',
    capabilities: {},
    clientInfo: { name: 'claude-ai', version: '0.1.0' }
  }
}
[supergateway] Request error: ReferenceError: fetch is not defined
    at fetch (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:39:17)
    at EventTarget.connect_fn (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:204:135)
    at new EventSource (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:125:435)
    at file:///Users/martijn/.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:53:33
    at new Promise (<anonymous>)
    at SSEClientTransport._startOrAuth (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:51:16)
    at SSEClientTransport.start (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:112:27)
    at Client.connect (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:88:31)
    at Client.connect (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js:56:21)
    at StdioServerTransport.stdioServer.transport.onmessage (file:///Users/.../.npm/_npx/85d60ba1adc82a16/node_modules/supergateway/dist/gateways/sseToStdio.js:83:41)
2025-06-05T13:58:21.809Z [n8n] [info] Message from server: {"jsonrpc":"2.0","id":0,"error":{"code":-32000,"message":"fetch is not defined"}}
2025-06-05T13:58:21.810Z [n8n] [info] Client transport closed
[supergateway] Caught SIGTERM. Exiting...
2025-06-05T13:58:21.811Z [n8n] [info] Server transport closed
2025-06-05T13:58:21.811Z [n8n] [info] Client transport closed
2025-06-05T13:58:21.811Z [n8n] [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-06-05T13:58:21.811Z [n8n] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-06-05T13:58:21.830Z [n8n] [info] Server transport closed
2025-06-05T13:58:21.830Z [n8n] [info] Client transport closed

@Martijn_Assinck very weird indeed - which command do you run? And do you run this on local machine? I assumed something is run inside n8n and maybe the version there is older. If you gave me a command that you try to run and errors, I could try it on my machine.

@Domas I don’t run it on local machine, but in native N8n Running version [email protected].

The command I run, just as a test, is: