ha-mcp and OpenCode: Home Assistant setup and comparison

Learn to connect ha-mcp to OpenCode with a webhook URL, then create an 11 p.m. smart plug automation and a Home Assistant dashboard.

Player not loading? Watch on YouTube

This tutorial connects the ha-mcp custom component to OpenCode so an AI agent can manage Home Assistant through natural language requests. The speaker compares it with Home Assistant's built-in MCP server, which they describe as limited to querying and controlling exposed devices. They present ha-mcp as a broader option for editing automations, building dashboards and maintaining the system.

The manual setup starts with a release download from the author's GitHub page. The speaker places the component's tools folder in Home Assistant's custom components directory, restarts Home Assistant and adds the integration through Settings, then Devices and Services. They copy the integration's webhook URL into OpenCode's JSON configuration, restart OpenCode and check for a connected MCP status in its web dashboard. HACS and the app store are also mentioned as installation options.

Two examples test the connection: an automation that turns off a smart plug every night at 11 p.m., and a dashboard named test with the plug's card and a sidebar entry. The speaker reports that both succeed on the first attempt and that the automation appears without another Home Assistant restart. These are results from the demonstrated setup, rather than a guarantee for other installations. The overview also covers history, automation traces and system maintenance, plus a read-only toggle, per-tool overrides and user approval policies.