SuperAPIAI Directory

hass-mcp

github.com · AI developer platforms

hass-mcp is a Model Context Protocol (MCP) server for Home Assistant that enables large language models such as Claude to directly query and control smart home devices. It supports querying device and sensor states, controlling lights and switches, getting smart home summaries, troubleshooting automation issues, searching entities, and providing guided conversation prompts. The project also supports real-time reading and editing of Lovelace dashboards via the WebSocket API, with automatic backups and dry-run preview functionality. Deployment options include Docker (recommended) or Python 3.13+ with uv, and it can be integrated with MCP clients such as Claude Desktop, Cursor, and Claude Code, and also supports HTTP transport mode.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

hass-mcp is a Model Context Protocol (MCP) server for integrating Home Assistant with Claude and other large language models. Through it, AI assistants can interact directly with Home Assistant instances.

Main capabilities include: querying device and sensor states; controlling entities such as lights and switches; getting high-level summaries of the smart home; troubleshooting automations and entity issues; searching entities by name, type, or state; listing and controlling automations; providing guided conversation prompts for common tasks; reading and editing Lovelace dashboards (cards and views) via Home Assistant's WebSocket API, with changes appearing immediately in open browsers, and supporting automatic backups and dry-run previews; using compact JSON responses to reduce token consumption.

Usage: requires a Home Assistant instance and a Long-Lived Access Token, as well as one of Docker (recommended) or Python 3.13+ and uv. The Docker method requires pulling the image voska/hass-mcp:latest and adding the MCP server configuration in Claude Desktop's claude_desktop_config.json, setting the HA_URL and HA_TOKEN environment variables. The Python method requires installing uv and configuring with the uvx hass-mcp command. Other MCP clients (such as Cursor) can be added via command. The Claude Code CLI can be added using the mcp add command. The project also supports MCP streamable HTTP transport, suitable for deployment scenarios where stdio cannot be used (such as MCP gateways, Smithery hosting, multi-client sharing, network tools like LibreChat or OpenWebUI); the server runs in stateless mode, with the MCP endpoint at /mcp.

Use cases: smart home state querying and control, automation creation and debugging, entity issue diagnosis, dashboard layout editing, log and history data analysis, etc.

Limitations and caveats: HTTP mode exposes full Home Assistant control capabilities over the network; anyone who can access the port caninvoke tools; the current server has no built-in authentication layer and must be placed behind a reverse proxy (basic-auth or bearer-token verification), a VPN/zero-trust network, or bound only to localhost. It binds to 127.0.0.1 by default; in Docker, --host 0.0.0.0 is required, and it is recommended to bind the published port to 127.0.0.1. Dashboard editing requires an admin token and only supports storage-mode dashboards; YAML-mode dashboards will be rejected. Before each write, an automatic backup is made to HASS_MCP_BACKUP_DIR (default ~/.hass-mcp/dashboard-backups/); in Docker, a volume must be mounted to retain backups. Custom CAs can be configured via the system trust store or the SSL_CERT_FILE environment variable; verify=False is not supported.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools