MCP Server trigger not loading in Claude Desktop

I’m testing the new MCP Server Trigger with no success so far.
The workflow is very simple - a Server trigger with a single tool attached (google sheets in this case).

My expectation was that I’d see the Google sheets tool in my Claude Desktop, but instead I’m getting an error.

Any ideas or hints on where I should start looking?

Claude’s logs:

==> /Users/ME/Library/Logs/Claude/mcp.log <==
2025-04-16T09:21:41.586Z [info] [n8nSupergateway] Initializing server...

==> /Users/ME/Library/Logs/Claude/mcp-server-n8nSupergateway.log <==
2025-04-16T09:21:41.613Z [n8nSupergateway] [info] Server started and connected successfully

==> /Users/ME/Library/Logs/Claude/mcp.log <==
2025-04-16T09:21:41.613Z [info] [n8nSupergateway] Server started and connected successfully

==> /Users/ME/Library/Logs/Claude/mcp-server-n8nSupergateway.log <==
2025-04-16T09:21:41.615Z [n8nSupergateway] [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}

==> /Users/ME/Library/Logs/Claude/mcp.log <==
2025-04-16T09:21:41.615Z [info] [n8nSupergateway] Message from client: {"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}

==> /Users/ME/Library/Logs/Claude/mcp-server-n8nSupergateway.log <==
[supergateway] Starting...
[supergateway] Supergateway is supported by Supermachine (hosted MCPs) - https://supermachine.ai
[supergateway]   - outputTransport: stdio
[supergateway]   - sse: https://my.local.n8n/mcp/ce6b...02cd6/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' }
  }
}
2025-04-16T09:22:41.617Z [n8nSupergateway] [info] Message from client: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}
2025-04-16T09:22:41.619Z [n8nSupergateway] [info] Client transport closed
2025-04-16T09:22:41.620Z [n8nSupergateway] [info] Server transport closed
2025-04-16T09:22:41.621Z [n8nSupergateway] [info] Client transport closed
2025-04-16T09:22:41.621Z [n8nSupergateway] [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-04-16T09:22:41.621Z [n8nSupergateway] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}

Claude MCP config:

{
  "mcpServers": {
    "n8nSupergateway": {
      "command": "npx",
      "args": [
        "-y",
        "supergateway",
        "--sse",
        "https://my.local.n8n/mcp/ce6b...02cd6/sse"
      ]
    }
  }
}

The sample workflow

Information on your n8n setup

core

  • n8nVersion: 1.88.0
  • platform: docker (self-hosted)
  • nodeJsVersion: 20.19.0
  • database: postgres
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: memory

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/134.0.0.0 safari/537.36
  • isTouchDevice: false

Generated at: 2025-04-16T09:19:36.298Z

OK, using n8n.cloud works almost perfectly so I imagine the problem lies somewhere in my nginx proxy.

However, my MCP log is full of error messages now:

2025-04-16T11:22:20.112Z [n8nSupergateway] [info] Message from server: {"jsonrpc":"2.0","id":31,"error":{"code":-32601,"message":"Method not found"}}

==> /Users/ME/Library/Logs/Claude/mcp.log <==
2025-04-16T11:22:20.112Z [info] [n8nSupergateway] Message from server: {"jsonrpc":"2.0","id":31,"error":{"code":-32601,"message":"Method not found"}}

==> /Users/ME/Library/Logs/Claude/mcp-server-n8nSupergateway.log <==
2025-04-16T11:22:24.835Z [n8nSupergateway] [info] Message from client: {"method":"resources/list","params":{},"jsonrpc":"2.0","id":32}

==> /Users/ME/Library/Logs/Claude/mcp.log <==
2025-04-16T11:22:24.836Z [info] [n8nSupergateway] Message from client: {"method":"resources/list","params":{},"jsonrpc":"2.0","id":32}

==> /Users/ME/Library/Logs/Claude/mcp-server-n8nSupergateway.log <==
[supergateway] Stdio → SSE: { jsonrpc: '2.0', id: 32, method: 'resources/list', params: {} }
[supergateway] Request error: McpError: MCP error -32601: Method not found
    at Client._onresponse (file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:205:27)
    at _transport.onmessage (file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js:76:22)
    at _eventSource.onmessage (file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:104:79)
    at file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:106:119
    at dispatchEvent (file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/eventsource-parser/dist/index.js:70:24)
    at parseLine (file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/eventsource-parser/dist/index.js:23:7)
    at Object.feed (file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/eventsource-parser/dist/index.js:18:7)
    at file:///Users/ME/.npm/_npx/85d60ba1adc82a16/node_modules/eventsource/dist/index.js:95:46
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: -32601,
  data: undefined

I have changed my nginx configuration, and now I’m down to this timeout error:

2025-04-16T12:22:33.540Z [info] [n8nSupergateway] 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-04-16T12:22:33.540Z [error] [n8nSupergateway] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging)

==> /Users/ME/Library/Logs/Claude/mcp-server-n8nSupergateway.log <==
[supergateway] SSE → Stdio: {
  jsonrpc: '2.0',
  method: 'notifications/cancelled',
  params: {
    requestId: 0,
    reason: 'Error: MCP error -32001: Request timed out'
  }
}
2025-04-16T12:22:33.556Z [n8nSupergateway] [info] Message from server: {"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":0,"reason":"Error: MCP error -32001: Request timed out"}}

The error as it was logged in nginx:
146.70.194.54 - - [16/Apr/2025:14:26:35 +0200] "POST /mcp/ultimate-mcp-server/messages?sessionId=78ed....c8a2 HTTP/1.1" 401 32 "-" "undici"

My nginx config:

# Add MCP protocol endpoint handling
    location /mcp/ {
      proxy_pass http://localhost:5678/mcp/;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header Authorization $http_authorization;
      proxy_pass_header Authorization;
      
      # CORS headers for API
      add_header 'Access-Control-Allow-Origin' '*' always;
      add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
      add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always;
      add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range,Authorization' always;
      
      # Handle preflight requests
      if ($request_method = 'OPTIONS') {
          add_header 'Access-Control-Allow-Origin' '*';
          add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
          add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
          add_header 'Access-Control-Max-Age' 1728000;
          add_header 'Content-Type' 'text/plain; charset=utf-8';
          add_header 'Content-Length' 0;
          return 204;
      }

      # Longer timeouts for webhooks that might take time
      proxy_read_timeout 300s;
      proxy_send_timeout 300s; 
    }

I have the same issue. Did you find a solution?

Not yet but I’ll keep documenting my findings here.
I believe the next step is a thorough inspection of my entire nginx config.
(I didn’t find any official docs about it)

1 Like

@Philippe_Greenleaf Care to try the following configuration and let me know if everything works well for you?

Note: there is no special treatment for any websocket or mcp paths. These can be added via dedictaed location blocks, but it seems that things work well as such.

LMK?

# Configuration for n8n
# Make sure to adjust: server_name, SSL certificate paths, and proxy_pass settings

##############################################################################
# HTTP Server Block - Redirects all HTTP traffic to HTTPS
##############################################################################
server {
    # Listen directives
    listen 80;                  # IPv4
    listen [::]:80;             # IPv6
    
    # Server identification
    server_name n8n.example.com;
    
    # Logging configuration
    access_log /var/log/nginx/n8n.access.log;
    error_log /var/log/nginx/n8n.error.log;
    
    # Redirect all HTTP traffic to HTTPS
    return 301 https://n8n.example.com$request_uri;
}

##############################################################################
# HTTPS Server Block - Main configuration
##############################################################################
server {
    # Logging configuration
    access_log /var/log/nginx/n8n.access.log;
    error_log /var/log/nginx/n8n.error.log;
    
    #####################################
    # Basic Server Configuration
    #####################################
    # Listen directives
    listen 443 ssl http2;       # IPv4
    listen [::]:443 ssl http2;  # IPv6
    
    # Server identification
    server_name n8n.example.com;
    
    #####################################
    # SSL Configuration
    #####################################
    # Certificate paths - Ensure these paths are correct for your setup.
    # Typically managed by Certbot or another ACME client.
    ssl_certificate     /etc/letsencrypt/live/n8n.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/n8n.example.com/privkey.pem;
    
    # The following configuration can also be included from LetsEncrypt's config by uncommenting this line and commenting the other lines in this block:
    # include /etc/letsencrypt/options-ssl-nginx.conf;

    # SSL optimizations
    ssl_session_cache shared:le_nginx_SSL:10m;
    ssl_session_timeout 1440m;
    ssl_session_tickets off;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers off;
    ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384";
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
    
    # OCSP Stapling - Uncomment after verifying SSL setup
    # ssl_stapling on;
    # ssl_stapling_verify on;
    # ssl_trusted_certificate /etc/letsencrypt/live/n8n.example.com/chain.pem;
    # resolver 8.8.8.8 8.8.4.4 valid=300s;
    # resolver_timeout 5s;
    
    #####################################
    # Security Headers
    #####################################
    # HSTS (HTTP Strict Transport Security) - Uncomment after verifying HTTPS works
    # add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
    
    # Additional security headers could be added here
    # add_header X-Content-Type-Options "nosniff" always;
    # add_header X-Frame-Options "SAMEORIGIN" always;
    # add_header X-XSS-Protection "1; mode=block" always;
    # add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    
    #####################################
    # Rate Limiting - This should be added to the http{} block in main nginx.conf
    #####################################
    # limit_req_zone $binary_remote_addr zone=n8n_limit:10m rate=10r/s;
    
    #####################################
    # Proxy Configuration
    #####################################
    # Buffer sizes for handling large payloads
    client_max_body_size 100M;
    client_body_buffer_size 20M;
    proxy_buffer_size 128k;
    proxy_buffers 4 256k;
    proxy_busy_buffers_size 256k;
    
    # Timeouts
    proxy_connect_timeout 180s;
    proxy_send_timeout 300s;
    proxy_read_timeout 300s;
    
    # Proxy headers
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    
    # WebSocket and Server-Sent Events (SSE) support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    
    # Optional header handling - uncomment if needed
    # proxy_set_header Authorization $http_authorization;
    # proxy_pass_header Authorization;
    # proxy_cookie_path / "/; SameSite=None; Secure";
    
    # Disable buffering for real-time updates
    proxy_buffering off;
    
    #####################################
    # Compression Settings
    #####################################
    gzip on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;
    
    #####################################
    # Location Blocks
    #####################################
    # Static content with caching
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        proxy_pass http://localhost:5678;
        expires 30d;
        add_header Cache-Control "public, no-transform";
    }
    
    # Main application
    location / {
        proxy_pass http://localhost:5678;
        limit_req zone=n8n_limit burst=20 nodelay;
    }

}
1 Like

Added the above to gist so it can be collaborated on: nginx config for N8N proxy · GitHub

Note the edit:

#####################################
    # Rate Limiting - This should be added to the http{} block in main nginx.conf
    #####################################
    # limit_req_zone $binary_remote_addr zone=n8n_limit:10m rate=10r/s;

I tried but I’m still getting “Server disconnected” error:

2025-04-18T11:28:15.394Z [n8n] [info] Server transport closed
2025-04-18T11:28:15.394Z [n8n] [info] Client transport closed
2025-04-18T11:28:15.395Z [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-04-18T11:28:15.395Z [n8n] [error] Server disconnected. For troubleshooting guidance, please visit our [debugging documentation](https://modelcontextprotocol.io/docs/tools/debugging) {"context":"connection"}
2025-04-18T11:28:15.395Z [n8n] [info] Client transport closed

Maybe it’s because it’s not usable with Docker for the moment

@Philippe_Greenleaf I’m using n8n in a Docker (based on n8n’s starter kit). It’s running on raspberry pi which is accessible from the internet.
On the same machine I have the nginx proxy.

So I guess it should work.
Do you want to share your local configuration?
I can’t promise I can help but I can try :slight_smile:

If so, share your nginx configuration (especially the n8n config), and your n8n config (i.e. environment variables). Make sure to sanitize them first :wink:

Hello there, where did you past this config file? Thank you

@code01 see higher in this thread

I had the same issue and the Solution that worked for me is in the code snipped provided by @Zohar .

proxy_buffering off;

I didn’t update all the other fields. The only thing I did was to add the buffering off field at the end of my n8n file that is within

/etc/nginx/sites-available

1 Like

You may have it twice now :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.