Install
Two environment variables and you are connected.
It runs locally over stdio through npx. You need Node.js 20+ and a Home
Assistant long-lived access token (Profile → Security). No HTTPS endpoint, no port
forwarding, no add-on.
claude mcp add homeassistant \ --env HASS_URL=http://homeassistant.local:8123 \ --env HASS_TOKEN=your-long-lived-access-token \ -- npx -y @orellbuehler/homeassistant-mcp
{
"mcpServers": {
"homeassistant": {
"command": "npx",
"args": ["-y", "@orellbuehler/homeassistant-mcp"],
"env": {
"HASS_URL": "http://homeassistant.local:8123",
"HASS_TOKEN": "your-long-lived-access-token"
}
}
}
}
What you can ask
Jobs that used to mean clicking through Settings.
Each of these is a real multi-step task the agent can finish and verify on its own.
Write an automation that closes the blinds when the sun is low and the living room is above 25 °C.list_entities → validate_automation_config → upsert_automation
Why didn't the hallway motion light fire last night?list_traces → get_trace → get_history
The Shelly integration failed to load after the update. What happened?list_config_entries → get_error_log → reload_config_entry
Put every device in the basement on a new "Keller" floor and label the Zigbee ones.create_floor → update_area → update_device
Add a vacation-mode toggle and use it as a condition in my heating automations.create_helper → get_automation_config → upsert_automation
Clean up the entities left over from the integration I removed.list_registry_entities → remove_entity
Comparison
How it differs from Home Assistant's built-in MCP server.
Home Assistant ships its own MCP server integration. It is built for using the home: reading state and calling actions. This project is built for changing how the home is set up. They work well side by side.
| Capability | Built-in mcp_server | homeassistant-mcp |
|---|---|---|
| Read states, history, logs, render templates | Yes | Yes |
| Call actions and control devices | Yesits main purpose |
Opt-incontrol toolset, off by default
|
| List and reload integrations | Yes | Yesplus config flows, enable/disable, delete, diagnostics |
| Write automations, scripts and scenes | No | Yesvalidated by HA, then reloaded |
| Debug with automation traces | No | Yes |
| Rename, enable, remove entities and devices | No | Yes |
| Areas, floors, labels, categories | No | Yes |
| Helpers, dashboards, Lovelace resources, blueprints | No | Yes |
| Check config, energy dashboard, ZHA groups, HACS | No | Yes |
| Limit access to entities exposed to Assist | YesDevice control set | Nosees what the token's user sees |
| Choose which tools the agent gets | Per tool setplus a read-only mode | Per toolset and per toolplus a read-only mode |
| Connection |
HTTP at /api/mcp, OAuthClaude Code needs HTTPS
|
Local stdio via npxlong-lived access token |
Use the built-in server when…
you want an assistant that operates the home: turn things on, answer "is the garage open", play media — scoped to the entities you expose to voice assistants.
Use homeassistant-mcp when…
you want an agent that maintains the home: authoring automations, fixing integrations, reorganising devices and cleaning up registries. Most of that has no action to call, only an admin API.
Tools
216 tools in 25 toolsets.
Pick a toolset to see what is in it, or search across everything. Toolsets marked opt-in
stay off until you name them in HASS_TOOLSETS.
tools.json. See
TOOLS.md
for the full reference.
Feature flags
Give the agent exactly the surface you are comfortable with.
Config authoring and inspection are on by default. Device control, raw API passthrough, backups, user management and household lists are opt-in. Three environment variables decide what gets registered.
- HASS_TOOLSETS
-
Comma-separated toolsets. Use
default,all, a name to add it, or-nameto drop it. - HASS_READ_ONLY
-
Set to
trueto remove every tool that changes anything in Home Assistant. - HASS_DISABLED_TOOLS
- Comma-separated tool names to hide, whatever toolset they belong to.
# the defaults plus device control HASS_TOOLSETS=default,control # everything except the raw passthrough HASS_TOOLSETS=all,-raw # a look-but-don't-touch agent HASS_READ_ONLY=true # authoring only, and never delete automations HASS_TOOLSETS=entities,services,templates,automations,trace HASS_DISABLED_TOOLS=delete_automation
API drift
Checked against every Home Assistant release.
Home Assistant's WebSocket API has no published schema and changes between releases. A
scheduled job reads the commands and routes straight out of the Home Assistant source
and compares them with what the tools call. The snapshot in this repository currently
tracks Home Assistant
the latest release.
-
Extract
Every WebSocket command, its parameters and every REST route is read from the Home Assistant core source.
-
Snapshot
The result is committed as
ha-api/snapshot.json, pinned to a Home Assistant version. -
Verify
CI fails if a tool calls a command or route that is not in the snapshot.
-
Watch
Weekly, a new release is diffed against the snapshot and a pull request lists what changed and which tools it touches.