Skip to content

Commit ee3dcc9

Browse files
docs: explain reverse-proxy geo-blocking on the browser landing page (#1687)
* 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 #1669. * docs: anchor the Anthropic IP range to its source-of-truth doc Add an inline code comment next to the 160.79.104.0/21 literal pointing at Anthropic's published IP-addresses doc, so a future maintainer knows where to re-verify the range if it ever changes. * docs: broaden landing-page connection guidance Restructure the reverse-proxy section into a list of common causes and add the ones drawn from issue #1669: name Zoraxy alongside the other proxy examples (the OP's reverse proxy), restore the WAF/bot-blocking/rate-limiting check (from the OP's own diagnostic checklist), and note that AI-client network blips and the client refusing certain domains/proxies can also prevent a connection. --------- Co-authored-by: kingpanther13 <kingpanther13@users.noreply.github.com>
1 parent 3e07aab commit ee3dcc9

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

src/ha_mcp/__main__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,31 @@ 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. Common causes:\n"
1001+
"\n"
1002+
"- Geo / country blocking in your reverse proxy / CDN (Cloudflare, NGINX,\n"
1003+
" Traefik, Zoraxy, etc.). Most AI/LLM services connect from US-based\n"
1004+
" cloud infrastructure, so if you block US IP addresses (or only allow\n"
1005+
" your own country), that is why your client cannot connect. Allow your\n"
1006+
" provider's IP ranges (or your client's egress IPs). For example,\n"
1007+
# Anthropic's documented outbound range; re-verify at
1008+
# https://platform.claude.com/docs/en/api/ip-addresses if it ever changes.
1009+
" Claude.ai connects from Anthropic's network, 160.79.104.0/21.\n"
1010+
"- WAF, bot-blocking, or rate-limiting rules on the proxy that drop or\n"
1011+
" challenge the request.\n"
1012+
"- The AI client's network can sometimes be spotty -- you may just need\n"
1013+
" to try connecting again.\n"
1014+
"- The AI client itself refusing certain domains or proxy providers on\n"
1015+
" its end. This is rare and outside your control; try a different\n"
1016+
" hostname or proxy if you suspect it.\n"
1017+
"\n"
1018+
"Your proxy's access logs will show the blocked attempt -- look for the\n"
1019+
"request from your AI provider's IP (e.g. an Anthropic 160.79.x.x address).\n"
1020+
"\n"
9961021
"--- Cloudflare Users ---\n"
9971022
"\n"
9981023
'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)