There was an error while loading. Please reload this page.
1 parent c7c5630 commit 09a3614Copy full SHA for 09a3614
1 file changed
server.py
@@ -4,6 +4,7 @@
4
import uvicorn
5
from contextlib import contextmanager
6
from mcp.server.fastmcp import FastMCP
7
+from starlette.middleware.trustedhost import TrustedHostMiddleware
8
9
# Initialize MCP Server
10
mcp = FastMCP("DuckDB-S3-Geo-Isolated")
@@ -97,6 +98,10 @@ def query(sql_query: str) -> str:
97
98
# Streamable HTTP uses a single endpoint (default: /mcp)
99
# It supports both GET (handshake) and POST (messages) on the same URL.
100
app = mcp.streamable_http_app()
101
+
102
+ # Allow requests from ingress with any host header
103
+ app.add_middleware(TrustedHostMiddleware, allowed_hosts=["*"])
104
105
uvicorn.run(
106
app,
107
host="0.0.0.0",
0 commit comments