Fix Dify MCP Server 403 Forbidden Error: SSRF Proxy Blocking SSE Connection

1 months ago 高效码农

How to Fix Dify MCP Server 403 Forbidden Error (SSE Connection Failed) TL;DR: If Dify throws httpx.ProxyError: 403 Forbidden when connecting to an MCP Server, the request is being blocked by Dify’s built-in SSRF protection proxy (Squid). The fix is to whitelist your MCP Server’s address in squid.conf and restart the proxy container. The Problem When adding an MCP tool provider in the Dify console, you may encounter the following error in your API container logs: api-1 | ERROR [sse_client.py:300] – Error connecting to SSE endpoint … httpcore.ProxyError: 403 Forbidden The above exception was the direct cause of the following …