Skip to content

Fix http transport rejecting remote clients with 421#4

Merged
xTITUSMAXIMUSX merged 2 commits into
mainfrom
fix/http-host-allowlist
Jul 1, 2026
Merged

Fix http transport rejecting remote clients with 421#4
xTITUSMAXIMUSX merged 2 commits into
mainfrom
fix/http-host-allowlist

Conversation

@xTITUSMAXIMUSX

Copy link
Copy Markdown
Collaborator

FastMCP is constructed at import time with the default host 127.0.0.1, which auto-locks DNS-rebinding protection to a localhost-only Host allowlist. Rebinding the host to 0.0.0.0 in main() does not update that frozen allowlist, so remote clients get "421 Invalid Host header".

Set transport_security explicitly in http mode: derive allowed hosts from VYMCP_PUBLIC_URL (overridable via VYMCP_ALLOWED_HOSTS, or "*" to disable the check behind a trusted proxy).

FastMCP is constructed at import time with the default host 127.0.0.1,
which auto-locks DNS-rebinding protection to a localhost-only Host
allowlist. Rebinding the host to 0.0.0.0 in main() does not update that
frozen allowlist, so remote clients get "421 Invalid Host header".

Set transport_security explicitly in http mode: derive allowed hosts from
VYMCP_PUBLIC_URL (overridable via VYMCP_ALLOWED_HOSTS, or "*" to disable
the check behind a trusted proxy).
@xTITUSMAXIMUSX
xTITUSMAXIMUSX merged commit f39840d into main Jul 1, 2026
4 checks passed
@xTITUSMAXIMUSX
xTITUSMAXIMUSX deleted the fix/http-host-allowlist branch July 1, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant