·
9 commits
to main
since this release
Patch release: fixes 421 Misdirected Request on the plugin's /mcp/v1/ endpoint with FastMCP 3.4.3+, and pins fastmcp to a bounded range.
What's fixed since 0.9.0
Fix 421 Misdirected Request from FastMCP's host guard (#241)
FastMCP 3.4.3 shipped HostOriginGuardMiddleware enabled by default: it only accepts loopback Host headers (127.0.0.1/localhost/::1) plus the ASGI scope["server"] host, and returns 421 Misdirected Request for anything else. In plugin mode the MCP app is embedded in the Airflow webserver and reached over the Deployment's own hostname, so with an unpinned install that resolved fastmcp 3.4.3, every request to /mcp/v1/ was rejected with 421.
- The plugin now keeps the guard enabled but scopes
allowed_hoststo the Deployment's hostname, read from theAIRFLOW__WEBSERVER__BASE_URLenv var (present at plugin import, unlike Airflow'sconf). DNS-rebinding protection stays on rather than being turned off. ASTRO_MCP_ALLOWED_HOSTS(comma-separated) overrides the allowlist for custom domains; the plugin falls back to disabling the guard only when no hostname is derivable (non-Astro embeddings).- Standalone mode (
mcp.run) is unchanged — it keeps FastMCP's default loopback protection, which is what a locally-bound server needs. - Pins
fastmcp>=3.4.3,<4so behavior is deterministic and can't silently change on the next FastMCP default flip.
Install
uvx --from 'astro-airflow-mcp==0.9.1' af
Upgrade notes
If you pinned fastmcp<3.4.3 as an interim workaround, you can drop that pin after upgrading to 0.9.1.