Skip to content

fix(termux-connect): Cloudflare Host header 421 - #16

Merged
FineComputer14451 merged 1 commit into
mainfrom
fix/termux-connect-host-header
Sep 7, 2026
Merged

FineComputer14451 merged 1 commit into
mainfrom
fix/termux-connect-host-header

Conversation

@FineComputer14451

Copy link
Copy Markdown
Owner

Summary

  • Connector termux-connect failed_to_load because /mcp returned 421 Invalid Host through the Cloudflare quick tunnel.
  • FastMCP’s default DNS-rebinding allowlist only permits 127.0.0.1 / localhost.
  • Disable that check by default (still bind loopback + Bearer). Optional TERMUX_CONNECT_ALLOWED_HOSTS for an explicit list.

Test plan

  • On phone: git pull + reinstall + restart tc (keep tunnel running)
  • curl tunnel /mcp with Bearer no longer returns 421
  • Restart MCP connector in Grok Bot → tools appear

FastMCP DNS-rebinding protection only allows 127.0.0.1/localhost,
so requests via *.trycloudflare.com returned 421 Invalid Host and
the Grok Bot connector failed_to_load. Disable that check by default
(loopback bind + Bearer still gate access); optional
TERMUX_CONNECT_ALLOWED_HOSTS re-enables an explicit allowlist.
@FineComputer14451
FineComputer14451 merged commit 7bbd04b into main Sep 7, 2026
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