local-web-search/services/orchestrator/app
User 382cc97e98 Fix MCP transport for reverse-proxy deployment (Invalid Host header + http redirect)
Two bugs surfaced deploying behind Cloudflare+Caddy at a public domain:

1. MCP streamable-HTTP DNS-rebinding protection has empty allowed_hosts by
   default, so a proxied public Host returns 421 'Invalid Host header'. Added
   MCP_ALLOWED_HOSTS (comma-separated; '*' disables) wiring into the FastMCP
   transport_security settings; localhost added automatically.
2. The /mcp -> /mcp/ mount redirect downgraded to http:// because uvicorn
   ignored X-Forwarded-Proto. Run uvicorn with --proxy-headers
   --forwarded-allow-ips='*' so redirects stay https behind the proxy.

Verified locally: valid Host+token initializes (200 SSE), redirect Location is
https, spoofed Host still 421, missing token still 401.

Set MCP_ALLOWED_HOSTS=websearch.neilbantoc.dev on the deployment and redeploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 11:08:48 -07:00
..
auth.py Prepare for public release: AGPL license, curl installer, bearer-token auth 2026-07-06 00:43:04 -07:00
cache.py M2: extraction quality — fallback extractors, thin-content detection, result cache 2026-07-05 22:05:04 -07:00
config.py Fix MCP transport for reverse-proxy deployment (Invalid Host header + http redirect) 2026-07-06 11:08:48 -07:00
logging_setup.py M1: scrape spine — renderer, extractor, orchestrator /scrape, compose, health, render cache 2026-07-05 22:02:38 -07:00
main.py Prepare for public release: AGPL license, curl installer, bearer-token auth 2026-07-06 00:43:04 -07:00
mcp_server.py Fix MCP transport for reverse-proxy deployment (Invalid Host header + http redirect) 2026-07-06 11:08:48 -07:00
pipeline.py Handle bot-blocked pages honestly: fetch fallback, degradation flags, thin threshold 2026-07-06 00:12:36 -07:00