Failed to connect to MCP server: MCP error -32001: Request timed out

Hey @Jetzoom and welcome to the n8n community!
Could you please share a few more details about how you are trying to connect to the MCP server?
What client are you using? Are you using the production URL and is the workflow active?

Same issue here with both prod or test urls.
Workflow is saved and active.
I can access my n8n instance (obviously to setup the nodes :smile: )

The workflow is super simple, basically just the mcp server connected to calculator node.

I can actually see in my N8N logs the call received

2|n8n      | 13:43:31.430   debug   Received webhook "GET" for path "xxxx/sse" { "file": "live-webhooks.js", "function": "executeWebhook" }
2|n8n  | 13:44:08.653   debug   Querying database for waiting executions { "scopes": ["waiting-executions"], "file": "wait-tracker.js", "function": "getWaitingExecutions" }
2|n8n  | 13:44:30.761   debug   Deleting transport for some-uuid { "file": "McpServer.js" }
2|n8n  | 13:44:30.762   debug   Closing MCP Server { "file": "McpServer.js", "function": "server.onclose" }

(url and id have been anonymize)

Some more context:

  • behind a very simple nginx proxy_pass
  • No auth (for testing)
  • used the config suggested in the doc to setup Claude (without the authentication part of course)
  • self hosted n8n, version 1.89.1 (on an Ubuntu)
  • npm setup of n8n

Any clue/hint/guidance to debug it is welcome :hugs:

Thanks in advance!

ALRIGHT! Figured it out :slightly_smiling_face:

In my case it was due to the nginx proxy_pass config… After some research, I found out that nginx needs a more specific config to support Server-Sent Events (SSE).

You can read more here, but basically what I needed to do, is add 2 location to my nginx file, (/mcp and /mcp-test), which had the correct config to support SSE.

My nginx config now looks like this:

upstream n8n_upstream {
    server 127.0.0.1:5678;
    keepalive 64;
}

server {
    server_name n8n.my-domain.com
   
    location / {
    	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
    	proxy_set_header Host $http_host;
        
    	proxy_http_version 1.1;
    	proxy_set_header Upgrade $http_upgrade;
    	proxy_set_header Connection "upgrade";
        
    	proxy_pass http://n8n_upstream/;
    	proxy_redirect off;
    	proxy_read_timeout 240s;
    }

    location /mcp {
        proxy_pass http://n8n_upstream/mcp;
        proxy_http_version 1.1;
        proxy_set_header Connection '';
        proxy_buffering off;
        proxy_cache off;
        proxy_read_timeout 86400;
    }

    location /mcp-test {
        proxy_pass http://n8n_upstream/mcp-test;
        proxy_http_version 1.1;
        proxy_set_header Connection '';
        proxy_buffering off;
        proxy_cache off;
        proxy_read_timeout 86400;
    }

  # Rest of the config (e.g SSL)
  # ...
}

I hope this helps!

it’s not working in my case, my sub workflow takes around 9m to finish, the MCP Client tool just wait til 60s them timed out. try to remove all time out limit on my server but no hope.