Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. N8N
  3. Could not connect to your MCP server

Could not connect to your MCP server

Scheduled Pinned Locked Moved N8N
7 Posts 3 Posters 766 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z Offline
      Z Offline
      zonzonzon
      wrote on last edited by
      #1

      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?

      https://community.n8n.io/t/error-could-not-connect-to-your-mcp-server-when-integrating-external-tool-via-sse-in-ai-agent/100957/6

      1 Reply Last reply
      1
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #2

        @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
        1 Reply Last reply
        1
        • Z Offline
          Z Offline
          zonzonzon
          wrote on last edited by
          #3
          1. search for gzip_proxied any;

          2. 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;
          

          }

          1. After adding this code, check the NGINX configuration:

          nginx -t

          1. 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

          1 Reply Last reply
          0
          • girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #4

            @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;
            
            
            1 Reply Last reply
            1
            • BrutalBirdieB BrutalBirdie referenced this topic on
            • Z Offline
              Z Offline
              zonzonzon
              wrote on last edited by zonzonzon
              #5

              @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;
              }
              
              1 Reply Last reply
              3
              • B Offline
                B Offline
                basiliolp
                wrote on last edited by
                #6

                I also tested both solutions, and only yours worked properly.
                Thank you for the help @zonzonzon

                1 Reply Last reply
                2
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote last edited by
                  #7

                  The correct fix needs to come from n8n - https://github.com/n8n-io/n8n/issues/14546#issuecomment-2858048370 . I guess if they don't fix it upstream , the package can bundle it's own nginx as a workaround .

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Bookmarks
                    • Search