How to connect Claude Code to Home Assistant with ha-mcp
ha-mcp is an open-source MCP server for Home Assistant. Once it is connected, you can ask Claude Code about device states and have it create or edit automations in plain language. Version 9.1.2 shipped on November 8.
- Try the demo environment first. On macOS or Linux, this one line installs uv and registers a
home-assistantserver in Claude Code at user scope. It requires a paid Claude plan.
curl -LsSf https://raw.githubusercontent.com/homeassistant-ai/ha-mcp/master/scripts/install.sh | sh -s -- --claude-code
Start claude, check the connection with /mcp, then ask "Can you see my Home Assistant?"
-
For your own Home Assistant, the recommended setup is the HA-MCP integration. On Home Assistant 2026.11 or newer, install HA-MCP from Settings → Marketplace; on 2026.8–2026.10, install it from HACS. Then restart Home Assistant.
-
In Settings → Devices & Services → Add Integration, choose HA-MCP Server and enter an administrator token. A dedicated HA-MCP administrator account (local access only) is safer than a token from your own account. Turn on at least one connection method (remote Secret URL or local network) and submit. The connect URL is on the entry's Configure screen.
-
Remove the demo entry and register your own URL. Two entries for the same server in one client is a known cause of connection hangs.
claude mcp remove home-assistant --scope user
claude mcp add --transport http home-assistant <your connect URL>
The server exposes about 87 tools, but Claude Code loads tools on demand, so leave ha-mcp's ENABLE_TOOL_SEARCH off.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.