Summary
Let your AI read your Home Assistant: the current state of every sensor, light, door and thermostat, the recorded history, the logbook of what happened when, and your calendars. Read-only: it never controls devices. Works with self-hosted Home Assistant.
Guided setup
Connect Home Assistant to Gemini in 2 minutes
Start a free trial on AnythingMCP Cloud, connect Home Assistant in the guided setup, then add your MCP URL to Gemini. No code and no server to run.
No credit card · 7-day trial · Self-host alternative available
Try asking
Example prompts for Home Assistant
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Home Assistant, paste your credentials, mint an MCP API key — done. No Docker, no
git clone, no local server.
Home Assistant + Gemini
Let your AI read your Home Assistant: the current state of every sensor, light, door and thermostat, the recorded history, the logbook of what happened when, and your calendars. Read-only: it never controls devices. Works with self-hosted Home Assistant.
Prerequisites
See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:
HOME_ASSISTANT_URL, HOME_ASSISTANT_TOKEN
Step 1 — Get credentials
Setting up takes about 3 minutes. You need a Home Assistant instance that AnythingMCP can reach, and a long-lived access token, ideally from a dedicated non-admin user.
- Set
HOME_ASSISTANT_URLto the address you open Home Assistant at, without a trailing slash and without/api, for examplehttps://home.example.comorhttp://192.168.1.10:8123(the default port is 8123). - Recommended: create a dedicated Home Assistant user for AnythingMCP under Settings → People → Users → Add user, with Administrator switched off. None of the endpoints the connector uses needs admin rights.
- Log in as that user and click your name at the bottom left to open your profile. Open the Security tab and, under Long-lived access tokens, click Create token. Copy the token (it is shown once and stays valid for 10 years) and paste it into
HOME_ASSISTANT_TOKEN, without the word Bearer. - Install the connector and run
home_assistant_get_config: it returns the version, location name and time zone, and confirms that address and token work.
What it reads: the current state of every entity (sensors, lights, climate, doors, presence) with its attributes, the recorded history of values over a period, the logbook of what happened when (for example when the garage door last opened), your calendars and their events, and the instance configuration. Entity ids look like sensor.living_room_temperature or binary_sensor.garage_door.
Read-only: every tool is a GET request. The connector cannot call actions (services), turn anything on or off, unlock doors, run scripts or change states. Home Assistant's own action endpoint is not admin-only, so this guarantee comes from the connector exposing only reads, not from the token.
Where Home Assistant runs: on a self-hosted AnythingMCP, an instance on a private network (http://192.168.x.x:8123, homeassistant.local) needs an administrator to allow the host in SSRF_ALLOWED_HOSTS or in the allowlist in the admin settings. AnythingMCP Cloud can only reach an instance exposed on the public internet over HTTPS, for example behind a reverse proxy or Home Assistant Cloud remote access.
Privacy: home data shows who is at home and the household's daily routines. Assign the connector only to MCP servers whose users may see this data.
Times: timestamps go in as ISO 8601 in UTC with a Z suffix, for example 2026-10-01T00:00:00Z. home_assistant_get_config returns the home's time zone for presenting results.
Common errors: 401 means the token is wrong or was deleted. 404 on one entity or its calendar events means no entity has that id; 404 on every call means HOME_ASSISTANT_URL is wrong or already ends in /api. 400 on calendar events means start or end is missing or not a valid timestamp. A refused or blocked connection means the host is not allowed in the SSRF allowlist (self-hosted) or not public over HTTPS (Cloud).
The connector does not call actions or services, write or delete states, fire events, render templates, show camera images, or read the event stream, the error log or the WebSocket API (areas, devices, entity registry).
Step 2 — Install the adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Step 3 — Add the connector in Gemini
Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (
https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide showsYOUR_SERVER_ID.
Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart
gemini. - Run
/mcpinside Gemini CLI (orgemini mcp listin your shell) —anythingmcpshould show as connected. - Start prompting — Gemini CLI can now call the
Home Assistanttools.
Available tools
| Tool | What it does |
|---|---|
home_assistant_get_config | Get the Home Assistant configuration: version, location name, time zone, unit system, coordinates and loaded components |
home_assistant_list_states | List every entity the token may read, shortened to entity_id, state, friendly name, unit and last_changed |
home_assistant_get_state | Get the current state of one entity with all its attributes, last_changed and last_updated, e.g. a thermostat's target temperature or… |
home_assistant_get_history | Get the recorded state changes of one or more entities over a period, e.g. the living room temperature overnight |
home_assistant_get_logbook | Get logbook entries from a start time: human-readable events such as a door opening, a light turning on or a person arriving home, with… |
home_assistant_list_calendars | List the calendar entities of this Home Assistant instance (entity_id and name, e.g. calendar.family) |
home_assistant_get_calendar_events | Get the events of one calendar between start and end: summary, start, end, description and location |
FAQ
Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.
Next steps
Was this guide helpful?