ha-ai
Provides tools for interacting with Home Assistant, enabling AI agents to inspect and configure dashboards, manage automations and scripts, list entities, retrieve logs, and create or restore backups, with visual rendering capabilities for UI validation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ha-aitake a screenshot of my dashboard on mobile viewport"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Home Assistant AI Helper (ha-ai)
Lightweight, paranoid-secure Home Assistant MCP Server and OS App with client-side Playwright visual feedback for autonomous AI agents.
Overview
The ha-ai platform enables autonomous AI coding agents (such as Antigravity, Gemini CLI, Claude Code, OpenCode, and Cursor) to safely inspect, configure, iterate on, and visually validate a remote Home Assistant instance.
Primary Capabilities
ðïļ Visual Dashboard Iteration: Render Lovelace dashboards headlessly via client-side Playwright, capture full or card-level screenshots across desktop, tablet, and mobile viewports, and visually iterate until UI design is perfected.
⥠Full Lifecycle Automation & Script Authoring: Safely read, write, validate, and trigger automations and scripts with automatic syntax checks and zero-downtime service reloads.
ðĄïļ Paranoid Security: Strict path jailing within
/config, constant-time API key verification, automatic secret redaction, and zero unauthorized command execution.ðŠķ Minimal Server Footprint: Lightweight Python FastAPI container running as a Home Assistant OS App (< 35MB RAM, ~0% idle CPU) with zero heavy browser or ML dependencies on the HA host.
ð Atomic Snapshots & One-Click Rollback: Automatic pre-edit snapshots created before every file modification, with instant atomic rollback capabilities.
Related MCP server: pagelens
Architecture
flowchart TD
subgraph Workstation["Local Workstation / AI Agent Host"]
Agent["AI Coding Agent<br/>(Antigravity / Claude / OpenCode)"]
MCPServer["Local MCP Server<br/>(TypeScript / Stdio)"]
Renderer["Playwright Browser Engine<br/>(Client-Side Headless)"]
Agent <-->|"Model Context Protocol"| MCPServer
MCPServer -->|"Render Requests"| Renderer
end
subgraph HAHost["Remote Home Assistant OS Instance"]
HACore["Home Assistant Core<br/>(REST & WebSocket APIs)"]
Addon["AI Helper App<br/>(FastAPI / Alpine Container)"]
Storage["HA Filesystem (/config)<br/>- automations.yaml<br/>- ui-lovelace.yaml<br/>- .snapshots/<br/>- home-assistant.log"]
Addon -->|"Mounts rw"| Storage
end
MCPServer <-->|"HTTPS / WSS :8123"| HACore
MCPServer <-->|"HTTP :8099 (X-Addon-API-Key)"| Addon
Renderer -.->|"HTTP/S (Render Web UI)"| HACoreSecurity & Safety Highlights
Security Guard | Implementation | Protection |
Path Traversal Jail |
| Prevents access to |
Constant-Time Auth |
| Eliminates timing-attack vulnerabilities against app API authentication. |
Deny-List Protection | File path blocking on | Protects sensitive user credentials and tokens from being read or overwritten. |
Secret Redaction | Regex redaction filters on log streaming | Automatically sanitizes passwords, long-lived tokens, and API keys from tail logs. |
Atomic Pre-Edit Snapshots | Automated | Guarantees safe rollback to the exact prior disk state upon syntax or runtime errors. |
Quickstart
1. Prerequisites
Node.js 20+ and npm installed locally.
Python 3.11+ with
uv(for running app tests locally).Running Home Assistant OS instance.
2. Installation & Build
# Clone the repository
git clone https://github.com/sserhii-tech/home-assistant-mcp.git
cd home-assistant-mcp
# Install root dependencies
npm install
# Build the TypeScript MCP server
npm run build3. Developer Workflows & Commands
# Local Development: Start App daemon with hot-reloading on :8099
npm run dev:addon
# Local Development: Start MCP server in TypeScript watch mode
npm run dev:mcp
# Run full test suites (TypeScript Vitest & Python Pytest)
npm test
npm run test:addon
# Synchronize versions across all manifests and code atomically
npm run version:bump patch # e.g. 0.1.0 -> 0.1.1
npm run version:bump minor # e.g. 0.1.0 -> 0.2.0
npm run version:bump 1.0.0 # explicit version targetMCP Tools Reference
The server exposes 12 specialized tools under the Model Context Protocol:
ð Dashboard Tools
Tool Name | Parameters | Description |
|
| Retrieve Lovelace dashboard configuration via WebSocket or storage file. |
|
| Validate YAML schema, trigger automatic safety snapshot, and commit dashboard updates. |
|
| Render high-resolution PNG screenshot via Playwright (presets: |
âïļ Automation & Script Tools
Tool Name | Parameters | Description |
|
| List active automations/scripts with entity IDs, friendly names, and trigger times. |
|
| Fetch the exact YAML definition of a specific automation or script. |
|
| Validate YAML syntax, snapshot file, update automation block, and trigger service reload. |
|
| Manually trigger an automation or script entity to verify execution. |
ð ïļ System, Diagnostics & Safety Tools
Tool Name | Parameters | Description |
| (none) | Check health and connectivity of both Home Assistant Core and the App daemon. |
|
| Search and filter entities by domain (e.g. |
|
| Invoke any Home Assistant domain service (e.g. |
|
| Retrieve the last $N$ lines of Home Assistant core logs with automatic secret redaction. |
|
| Create a named manual snapshot backup in |
|
| Atomically restore a file from a snapshot ID with safety backup preservation. |
AI Skill Pack (skills/)
This repository includes 4 production-ready AI agent skills:
ðŪ
ha-device-controller: Standard Operating Procedure for querying entity states, executing domain service requests (lights, switches, climate, media), and verifying post-execution state transitions.ðĻ
ha-dashboard-designer: Standard Operating Procedure for entity discovery, Lovelace card drafting, responsive layout verification, and iterative screenshot-based visual feedback loops.ð§
ha-automation-builder: Standard Operating Procedure for drafting automations, validating trigger conditions, safe saving with automatic reloads, and log trace verification.ðĻ
ha-troubleshooter: Safety SOP for diagnosing integration errors, analyzing sanitized logs, and triggering immediate rollback restorations.
Documentation
For full installation instructions, app configuration, agent integration guides (Antigravity, Gemini CLI, Claude Desktop, OpenCode, Cursor), and network architecture details, see:
ð Full Installation & Setup Guide
License
This project is licensed under the Apache License, Version 2.0. See LICENSE for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Autonomous cloud agent tasks: real browser + your tools, structured evidence-backed results.
Browser-based QA for AI-built software. Test pages with real browsers via agents.
Related MCP Servers
FlicenseNot gradedqualityCmaintenanceEnables AI agents to capture screenshots and inspect DOM elements from connected browser pages via WebSocket.- AlicenseNot gradedqualityDmaintenanceEnables AI coding agents to visually interact with frontend apps by taking screenshots, clicking elements, reading console logs, and performing visual diffs.3MIT
- AlicenseAqualityBmaintenanceEnables AI coding assistants to visually inspect local web pages by providing screenshots, console errors, and sanitized DOM snapshots.18MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to see and interact with real Chrome pages through structured DOM inspection, targeted screenshots, recordings, and human-in-the-loop approvals across major coding-agent hosts.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sserhii-tech/home-assistant-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server