Google's Antigravity w/ self-hosted n8n+mcp
https://www.loom.com/share/a32d04f79ab94269ae65a0af337aad02 https://dashboard.n8n-mcp.com/ https://github.com/czlonkowski/n8n-mcp/tree/main Below is a structured "Deep Dive" blueprint designed to be a definitive resource for self-hosting **n8n + MCP**. --- ## 🏗️ The "Direct Pipe" Architecture Guide This setup ensures a 100% stable, unbuffered stream between your Raspberry Pi and Google Antigravity. ### **Phase 1: The Docker Engine (.env & Compose)** The goal here is to stop n8n from "over-processing" the data before it leaves the Pi. * **Key `.env` Nuances**: * `N8N_SKIP_RESPONSE_COMPRESSION=true`: **Crucial.** Prevents n8n from gzipping the stream, which causes "Connection Closed: EOF" errors in strict AI agents. * `N8N_TRUST_PROXY=all`: Tells n8n to trust the headers (like `Authorization`) passed by Nginx and Cloudflare. * `N8N_CORS_ALLOWED_ORIGINS=https://n8n.yourdomain.com`: Prevents security rejections when the agent initiates the handshake. * **Docker Compose Secret**: * Ensure your `N8N_ENCRYPTION_KEY` is at least 32 characters. If you recreate your container without this being static, your MCP tokens will instantly become invalid. --- ### **Phase 2: The Nginx Location Block (The Pipe)** Standard Nginx settings "buffer" data, which is death for real-time MCP streams. You need a dedicated location block for the `/mcp-server/` path. ```nginx location ^~ /mcp-server/http { proxy_pass http://n8n:5678; proxy_set_header Host $host; proxy_set_header Authorization $http_authorization; # --- SSE STABILITY --- proxy_http_version 1.1; proxy_set_header Connection "keep-alive"; # Keeps the pipe open during AI "thinking" proxy_buffering off; # Forces data to flow instantly proxy_cache off; # Prevents serving stale tool definitions gzip off; # Essential: compression breaks SSE