Skip to content

Commit 5de6e43

Browse files
committed
docs: explain reverse-proxy geo-blocking on the browser landing page
The landing page served on GET to the MCP URL is the splash users see when they open their connection URL in a browser. The most common "I see the welcome page but my AI client can't connect" cause is a reverse-proxy/CDN geo-blocking rule that drops US IP addresses, where most AI/LLM services connect from (e.g. Anthropic's 160.79.104.0/21). Add a section telling users that seeing this page means the URL is set up correctly, that the block is on the proxy/CDN side rather than HA-MCP, and pointing them at geo/country rules and their proxy access logs. Closes homeassistant-ai#1669.
1 parent 3e07aab commit 5de6e43

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/ha_mcp/__main__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,21 @@ def register_browser_landing(
993993
"connector or MCP settings of your AI/LLM client. No username or password required.\n"
994994
"Setup instructions: https://homeassistant-ai.github.io/ha-mcp/\n"
995995
"\n"
996+
"--- Seeing this page? Your URL is set up correctly ---\n"
997+
"\n"
998+
"If this page loads in your browser, the MCP server is reachable and the\n"
999+
"URL is correct. If your AI client still cannot connect, the problem is\n"
1000+
"not on HA-MCP's side -- it is likely due to your reverse proxy / CDN\n"
1001+
"(Cloudflare, NGINX, Traefik, etc.). The most common pitfall is geo /\n"
1002+
"country blocking: most AI/LLM services connect from US-based cloud\n"
1003+
"infrastructure, so if you block US IP addresses (or only allow your own\n"
1004+
"country), that is why your client cannot connect. Allow your provider's\n"
1005+
"IP ranges (or your client's egress IPs). For example, Claude.ai connects\n"
1006+
"from Anthropic's network, 160.79.104.0/21.\n"
1007+
"\n"
1008+
"Your proxy's access logs will show the blocked attempt -- look for the\n"
1009+
"request from your AI provider's IP (e.g. an Anthropic 160.79.x.x address).\n"
1010+
"\n"
9961011
"--- Cloudflare Users ---\n"
9971012
"\n"
9981013
'If your LLM cannot connect, Cloudflare\'s "Block AI training bots"\n'

tests/src/unit/test_browser_landing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ async def test_get_returns_405_with_helpful_message(mcp_app):
4646
assert "Block AI training bots" in resp.text
4747
assert '"do not block (allow crawlers)"' in resp.text
4848
assert "dash.cloudflare.com" in resp.text
49+
# Reverse-proxy / geo-blocking guidance (issue #1669)
50+
assert "Your URL is set up correctly" in resp.text
51+
assert "160.79.104.0/21" in resp.text
4952
assert resp.headers["allow"] == "POST, DELETE"
5053

5154

0 commit comments

Comments
 (0)