fix: disable MCP DNS rebinding protection for Docker/proxy deployment (fixes 421 Invalid Host header)

This commit is contained in:
Agent Zero
2026-07-13 10:07:23 +02:00
parent 6483453437
commit 80cb971308
+3 -1
View File
@@ -122,7 +122,9 @@ _STATIC_COMPONENTS = [
# streamable_http_path="/" so that when mounted at /mcp the endpoint is /mcp/
# stateless_http=True: each request is independent (no session management)
# Disable DNS rebinding protection for Docker deployment
mcp = FastMCP("hms-cms", streamable_http_path="/", stateless_http=True)
from mcp.server.transport_security import TransportSecuritySettings
mcp = FastMCP("hms-cms", streamable_http_path="/", stateless_http=True, transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False))
# ---------------------------------------------------------------------------#
# Bearer token authentication wrapper