Could not connect to your MCP server
-
When running the new version of n8n with the MCP server, it does not work. I have identified some causes. Is it possible to configure this in Cloudron?
-
@zonzonzon I read up on this a bit. It seems we have to disable gzip compression for SSE . Can you try this change - https://git.cloudron.io/platform/box/-/commit/51d1efead6438fec879b661237a893d8e65f4a57 ?
- Edit
/etc/nginx/applications/<n8n-appid>/*.conf
. - search for
gzip_proxied any;
and add the lines in the commit (careful , don't add the '+' in front of the lines, since it's patch) . systemctl reload nginx
- Edit
-
-
search for gzip_proxied any;
-
Add this location block right after the existing location block in the NGINX configuration file:
location /mcp {
gzip off;
proxy_buffering off;
proxy_cache off;proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_pass http://ip:5678;
}
- After adding this code, check the NGINX configuration:
nginx -t
- If there are no errors, reload NGINX:
systemctl reload nginx
The n8n MCP server has connected and is working properly. Thank you for your guidance. @girish
-
-
@zonzonzon are you able to try just the below instead of adding /mcp route ? This is more generic and I hope it works across all routes.
# compression chunking logic will interfere with SSE packet flushing gzip_disable "text/event-stream"; # what responses are proxied gzip_proxied no-cache no-store private expired auth;
-
B BrutalBirdie referenced this topic
-
@girish I added your code snippet above, and it doesn't work. But when I add a block like mine, it works.
location /mcp { gzip off; proxy_buffering off; proxy_cache off; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_pass http://172.18.20.102:5678; }
-
I also tested both solutions, and only yours worked properly.
Thank you for the help @zonzonzon