Home automation edition
Home Assistant News

Reporting the local stack, from radio to automations.

Guide · Home Assistant + AI

Home Assistant MCP: connect Claude and ChatGPT to your home

MCP, the Model Context Protocol, is the common standard that lets AI applications call tools. Home Assistant speaks it in both directions, which is why "Home Assistant MCP" is suddenly a search term. Two integrations look similar and do opposite things. The Model Context Protocol integration (mcp_server) makes Home Assistant an MCP server: an outside AI application such as Claude or ChatGPT connects in and controls your home. The Model Context Protocol Client integration (mcp) does the reverse: your Home Assistant conversation agent picks up tools from an external MCP server. Both are built in; neither needs a custom add-on. This guide covers what each one does, how to set up the server side, which agents connect and how, what the AI can actually see and touch, and the gotchas that trip people up — per the Home Assistant documentation, not guesswork.

The two integrations, in one table

IntegrationDirectionWhat it gives you
Model Context Protocol (mcp_server)Outside AI → Home AssistantA URL you paste into Claude, ChatGPT, Codex or OpenCode so the agent can control Home Assistant
Model Context Protocol Client (mcp)External MCP server → Home AssistantTools from any external MCP server, usable by your HA conversation agent

Most people searching for Home Assistant MCP want the first one: an AI assistant that can flip scenes, check sensor values and — the real prize — write and debug automations with full context of the house. The rest of this guide focuses on the server side, then comes back to the client.

Tool sets: how much the AI gets

With mcp_server, Home Assistant groups the tools it offers into sets, which the docs call API definitions for LLMs (Assist LLM APIs). The AI agent can use any set you allow, and the default is all of them. The two sets are not equivalent, and choosing between them is the single most consequential decision in this setup:

  • Device control — the same tools Assist uses. The AI can only control and see the entities you have put on the exposed entities page. It cannot read logs, history or unlisted devices.
  • Home Assistant — the full set. The AI can read all entities, logs and history, and perform any action. That is a big capability and a big trust step: the agent effectively sees your whole instance.

If you only want Claude to switch lights and check the thermostat, expose a limited set of entities and allow Device control. If you want an AI pair-programmer that reads automation traces and hunts bugs, it needs the Home Assistant set. The per-tool-set Individual URLs let you hand different agents different sets: one URL exposes only Device control tools, another everything.

Setup: getting the server URL

  1. In Home Assistant, go to Settings, then System, then AI.
  2. If the card shows an Enable button, select it.
  3. Copy the Main URL, or a per-tool-set Individual URL. The Main URL exposes all tools of the default APIs.
  4. Paste that URL into your AI client (examples below).

One prerequisite that matters: if the AI agent runs in the cloud — Claude on claude.ai, ChatGPT on chatgpt.com — your Home Assistant instance must be reachable from the internet. Home Assistant Cloud handles that without port forwarding; other remote-access routes work too. If the agent runs locally on the same network as your server, like Claude Code on a laptop at home, the plain local URL is fine.

Connecting the agents, per the docs

The official mcp_server page documents four clients besides claude.ai itself. The commands are short enough to keep here:

  • ChatGPT — open the Plugins page, choose Add custom MCP server, paste the URL, and complete the OAuth flow.
  • Claude Code — claude mcp add --transport http home-assistant <url>, then claude mcp login home-assistant. Claude Code connects over HTTPS only.
  • Codex — codex mcp add homeassistant --url <url>. The docs use http://homeassistant.local:8123/api/mcp as the example URL.
  • OpenCode — opencode mcp add home-assistant --url <url>, then opencode mcp auth home-assistant.

Note what each client needs. ChatGPT and claude.ai live in the cloud and need your instance exposed. Codex happily points at a local .local address. Claude Code works, per the docs, over HTTPS — so plan for a proper certificate if Claude Code is your client of choice.

What MCP actually passes through

Home Assistant's MCP server supports Prompts, Tools, and Resources. Resources work only for the Device control set. Sampling and Notifications are not supported. In practice, everything useful is in Tools: the device-control tools from Assist, plus the broader read-and-act tools from the full set.

One extra resource is worth knowing about. When your configured LLM API includes the GetLiveContext tool, Home Assistant exposes a read-only MCP Resource at homeassistant://assist/context-snapshot that returns a plain-text snapshot of the current context. Home Assistant describes it as intended for inspection, debugging, and explanation workflows — that is, for when you want a second AI to look at what the assistant knows about the house, rather than to act on anything.

The OAuth gotcha

The most common failure in this setup is also the easiest to fix. Home Assistant authenticates MCP clients with OAuth built on IndieAuth, and IndieAuth requires the redirect URI to be on the same scheme and domain as the Client ID. The Client ID must therefore be the base URL of the AI client application — https://claude.ai for Claude or https://chatgpt.com for ChatGPT — never your Home Assistant instance's URL. Put the wrong URL there and login fails repeatedly, and the fix is not obvious from the error.

Two related details from the docs: Home Assistant uses no client secret, so if the client demands one, enter any text. And if IP bans are enabled on your instance, repeated failed logins can add your IP to ip_bans.yaml — which presents as your whole LAN being locked out, a far scarier symptom than the cause deserves.

The MCP Client integration, briefly

The other direction — mcp, the Model Context Protocol Client — attaches tools from an external MCP server to your Home Assistant conversation agent. Prerequisites: an AI conversation agent that can use tools (the docs name Anthropic, Google Gemini, Ollama and OpenAI) and a network-reachable MCP server URL. A server that only speaks stdio and runs locally needs an MCP proxy, such as mcp-proxy, to become reachable over the network. This is how Assist gains, say, a specialist tool from some third-party service while your automations keep running locally. It is the quieter of the two integrations, but if you have already standardized on Assist as your voice interface, it is the one that extends it.

What it looks like in practice

The Home Assistant docs tell you what is possible; a real deployment shows what it is good for. Adam Beguelin, HA News's editor, uses Claude Code against his own instance over MCP and wrote up the workflow in April 2026, with his Home Assistant configuration in git and automations kept as individual YAML files. The working loop he described: edit an automation locally, copy it to the server, reload automations, verify in Home Assistant, then commit to git. Claude Code reads entity states, searches entities, reloads configs and, crucially, reads automation traces.

Two cases from that setup are worth recounting, because they show both halves of the value. First, debugging: a presence automation fired five times in 40 minutes on home-to-home GPS updates. The state trigger had no from/to filter, so every GPS refresh of the same state re-triggered it. Reading the automation trace through MCP showed the cause in seconds, and adding explicit filters fixed it — from question to deployed fix in under two minutes. Anyone who has chased a mystery trigger through the UI's trace viewer will recognize the shape of that win: the answer was in the trace all along; an AI with tool access just reads it faster than a human scrolling.

Second, building: a motion-light automation for a shed, written from scratch in conversation. Claude reused the house's existing motion-automation patterns, asked clarifying questions where its instructions were ambiguous, and proposed something a careful human would: snapshot each light's prior state into variables so that lights already on before the motion are not switched off after the 10-minute delay, with mode: restart. The overhead point generalizes — with the setup, writing a new automation costs little enough that you build the ones you had been postponing.

Two housekeeping notes from the same deployment. Claude Code uses project skills files (in that setup, ha and openwrt skills) that auto-load and teach conventions: automation file format, trigger patterns (including a quirk where Inovelli switch same-type consecutive presses don't fire attribute-based triggers), entity naming, and known bugs such as a Tuya double-conversion problem. And for safety's sake: Claude Code asks permission before calling any MCP tool, which keeps a debugging session from rearranging your house unbidden.

Security in brief

  • Choose tool sets deliberately. Device control plus a curated exposed-entities list is a hard ceiling; the full set is not.
  • Cloud agents need remote access. Home Assistant Cloud is the documented path; weigh any self-hosted alternative on its own merits.
  • The Client ID is the AI app's base URL, not your instance's. Get this right first and you skip the most common failure mode.
  • If IP bans are enabled, repeated failed logins can ban your IP. Fix the Client ID before hammering login.

FAQ

How do I connect Claude to Home Assistant via MCP?

Copy the MCP server URL from Settings, then System, then AI in Home Assistant. In Claude Code, run claude mcp add --transport http home-assistant <url> and then claude mcp login home-assistant. Claude Code connects over HTTPS only.

Which entities can an AI agent see and control through the Home Assistant MCP server?

With the Device control tool set, the agent can only control or see entities exposed on the exposed entities page. With the Home Assistant tool set, it can read all entities, logs and history and perform any action.

Does the Home Assistant MCP integration expose my whole instance or only exposed devices?

It depends on the tool set you allow. The Device control set is limited to exposed entities. The Home Assistant set hands the agent access to everything, including logs and history, and by default the Main URL exposes all tool sets, so turn off Expose all AI tools in the integration options if you want to limit it.

How do I fix repeated OAuth failures when connecting ChatGPT or Claude to Home Assistant?

Set the Client ID to the base URL of the AI client application, such as https://claude.ai or https://chatgpt.com, never your Home Assistant URL. IndieAuth requires the redirect URI to be on the same scheme and domain as the client ID.

What is the difference between Home Assistant's two MCP integrations?

The Model Context Protocol integration (mcp_server) makes Home Assistant an MCP server so an outside AI application can control it. The Model Context Protocol Client integration (mcp) does the opposite: your HA conversation agent gains tools from an external MCP server.

Can Home Assistant's Assist use tools from external MCP servers?

Yes, through the Model Context Protocol Client integration. You need an AI conversation agent that can use tools — Anthropic, Google Gemini, Ollama or OpenAI — and a network-reachable MCP server URL. A stdio-only local server needs an MCP proxy such as mcp-proxy.

Primary sources
Home Assistant Model Context Protocol (mcp_server) integration; Home Assistant Model Context Protocol Client (mcp) integration; Claude Code + Home Assistant (Adam Beguelin's blog)

As an Amazon Associate, HA News earns from qualifying purchases.