Back to all posts
Troubleshooting Claude’s Remote Connection to MCP Servers

Troubleshooting Claude’s Remote Connection to MCP Servers

K

Kyle Czajkowski

May 2, 2025

Troubleshooting & Debugging

I was very excited to hear about Anthropic’s announcement yesterday that we now have the ability to add integrations to Claude. Connecting to remote MCP (Model Context Protocol) servers and not just local ones is a major step forward. AI systems like Claude are no longer limited by the age of their training data. They can pull in up-to-date context and use tools provided by these integrations (MCP servers).


Diagnosing the Initial Connection Failure

Adding MCP servers to Claude desktop is relatively straightforward, so I jumped right in. I already have a remote MCP server running and a few examples from other companies I wanted to try. Since I’ve been exploring Cloudflare’s offerings lately, I decided to start with their documentation server. After restarting Claude, I saw error messages saying that it couldn’t connect to the Cloudflare server. I double checked my config, everything looked correct, so I went to the troubleshooting documentation.

1"cloudflare-docs": {
2    "command": "npx",
3    "args": [
4        "mcp-remote",
5        "https://docs.mcp.cloudflare.com/sse"
6    ]
7}
8



Inspecting Claude Desktop Logs

I walked through the debugging checklist in the MCP docs. The MCP inspector confirmed the Cloudflare server was up and running. Next I checked Claude’s logs:

1tail -n 20 -F ~/Library/Logs/Claude/mcp*.log



I was able to quickly see that I was running into an issue importing something from node:fs/promises.

1file:///Users/kyle/.npm/_npx/705d23756ff7dacc/node_modules/open/index.js:7
2import fs, {constants as fsConstants} from 'node:fs/promises';
3				^^^^^^^^^
4SyntaxError: The requested module 'node:fs/promises' does not provide an export named 'constants'


I noticed that this was coming from my .npm/_npx directory, so I wondered about my Node version. I was already on the latest Node (22.15.0) and npm was up to date too, but I ran an upgrade anyway:

1npm install -g npm@latest


Then cleaned the cache

1npm cache clean --force


After reinstalling and cleaning, I restarted Claude Desktop and the server connected! Amazing! I could ask Claude about workers, durable objects, whatever I needed, and I would get the most up to date information.


Encountering the TransformStream Error

When I tried to add another server, the connection failed again. The logs showed a different error in the mcp-remote package:

1file:///Users/kyle/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-YJSTSVFG.js:6264
2var EventSourceParserStream = class extends TransformStream {
3                              ^
4
5ReferenceError: TransformStream is not defined


This was odd because the mcp-remote package doesn’t using the TransformStream functionality. It’s a browser standard not implemented in Node.js. I double checked, and saw that my node and npm versions were still up to date. So this made me think that Claude was somehow invoking a version of node that I hadn’t used in a while.


Ensuring Claude Uses the Right Node Binary

Checking around the internet I found a GitHub Issue thread that confirmed my suspicions. Apparently nvm does not always play nicely with host apps like Claude Desktop. The thread offered several workarounds.

One reliable fix was to point directly to the Node binary instead of using npx:

1{  
2  "mcpServers": {
3    "YOUR SERVER NAME": {
4      "command": "/Users/username/.nvm/versions/node/v22.15.0/bin/node",
5      "args": [
6        "mcp-remote",
7        "PATH TO THE MCP SERVER YOUR'E USING"
8      ]
9    }
10  }
11}


You can also keep npx as the command and set the PATH explicitly:

1{  
2  "mcpServers": {
3    "YOUR SERVER NAME": {
4      "command": "npx"
5      "args": [
6        "mcp-remote",
7        "PATH TO THE MCP SERVER YOUR'E USING"
8      ],
9      "env": {
10      "PATH": "/Users/username/.nvm/versions/node/v20.15.0/bin:/bin"
11    }
12    }
13  }
14}



Another option is to remove older Node versions below 18.20.4 from your system. That may not suit everyone but it ensures Claude Desktop always uses a compatible Node version.

I hope this post offers a bit more insight into debugging remote MCP servers with Claude Desktop. My issues were resolved by ensuring Claude always runs the correct Node binary. These tips should help you avoid version mismatches and get your integrations up and running more smoothly. If you’d like to explore more MCP server examples, check out Cloudflare’s Demo Day write-up and 13 servers you can use today.