ha-mcp

by zorak1103

Not rated
GitHub

About

A Model Context Protocol (MCP) server that provides AI assistants with access to Home Assistant, enabling smart home control and automation management.

Details

Author
zorak1103
Categories
Other

Setup

Install ha-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/zorak1103/ha-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol (MCP) server that provides AI assistants with access to Home Assistant, enabling smart home control and automation management.

- 40 Specialized Tools: Entity queries, automation CRUD, helper management, scripts, scenes, devices, areas, labels, floors, zones, persons, tags, traces, blueprints, updates, todos, calendars, cameras, dashboards, system log, and more
- Hybrid Architecture: WebSocket for most operations, REST API for automation/script/scene CRUD
- Complete CRUD: Create, read, update, delete automations/scripts/scenes/helpers
- Deep System Access: Query registries, analyze dependencies, access logbook, validate config
- Flexible Output: Natural language (LLM-optimized) and JSON formats
- Access Control: Read-only mode, whitelist/blacklist, fine-grained action-level control
- Auto-Reconnect: Automatic reconnection with exponential backoff
- Post-Mutation Confirmation: Automatic state polling after create/update/delete confirms changes

vs. Other MCP Servers for Home Assistant

Two alternatives exist: theofficial HA MCP integration(built-in, ~10 intent-based tools) and the communityhomeassistant-ai/ha-mcp(Python/FastMCP, 95+ tools).

- Full automation/script/scene/helper lifecycle management (create, edit, delete)
- Advanced analysis (dependencies, cross-references, automation coverage)
- System administration (registry queries, config validation, logbook, history)
- Media management (browser, camera streams), HACS, and dashboard access
- Reliable LLM tool selection — 41 consolidated tools reduce selection errors compared to 95+ fine-grained alternatives

Choose the official integration if you need entity-level security or no external infrastructure.

Seedocs/feature-comparison.mdfor a detailed three-way feature matrix.

Download the latest release from theReleasespage.

# Linux/macOS tar -xzf ha-mcp_linux_amd64.tar.gz chmod +x ha-mcp sudo mv ha-mcp /usr/local/bin/ # Windows: extract ha-mcp_windows_amd64.zip and add to PATH
git clone https://github.com/zorak1103/ha-mcp.git cd ha-mcp task install-hooks # install git pre-commit hook (auto-fixes gofmt on every commit) go build -o ha-mcp ./cmd/ha-mcp

RPM and DEB packages are available in the releases:

sudo dpkg -i ha-mcp_amd64.deb # Debian/Ubuntu sudo rpm -i ha-mcp_amd64.rpm # RHEL/Fedora
docker pull zorak1103/ha-mcp:latest docker run -d --name ha-mcp -p 8080:8080 \ -e HA_URL=http://homeassistant.local:8123 \ zorak1103/ha-mcp:latest

Seedocs/configuration.mdfor Docker options, HTTPS/WSS, proxy support, and all environment variables.
-

Get a long-lived access token from your Home Assistant profile page.

# With flags ha-mcp --ha-url http://homeassistant.local:8123 --ha-token your-token # Or initialize config files first ha-mcp init # creates config.yaml and .env ha-mcp # start with config file

- Connect your AI client. Example for Claude Desktop:

{ "mcpServers": { "homeassistant": { "type": "http", "url": "http://localhost:8080", "headers": { "Authorization": "Bearer your-ha-access-token" } } } }

Seedocs/configuration.mdfor Cline, opencode, and other client configurations.

41 tools organized by domain. Full reference atdocs/tools.md.

Seven guidance topics are also available as MCP resources underskill://ha-mcp/<slug>URIs (format-selection, automation-patterns, template-resilience, helper-selection, dashboard-safety, entity-renaming, debugging-workflow).

ha-mcp provides read-only mode, whitelist, and blacklist filtering at the tool and action level:

# config.yaml — read-only monitoring server: read_only: true # Or block specific operations server: tool_filter: blacklist: - "call_service" - "manage_:delete"

Seedocs/access-control.mdfor glob patterns, category filtering (:write), and example scenarios.

AI Client → HTTP/JSON-RPC → ha-mcp MCP Server │ ┌────────────────────┴────────────────────┐ │ WebSocket (primary) │ REST API │ - State queries, service calls │ - Automation CRUD │ - Helper CRUD, Registry access │ - Script/Scene CRUD └────────────────────┬────────────────────┘ │ Home Assistant

Seedocs/architecture.mdfor project structure, build commands, and integration test setup.

Seedocs/troubleshooting.mdfor WebSocket connection issues, debug mode, and common error solutions.

Prerequisites:Go 1.26+, golangci-lint v2, Docker (optional)

go build -o ha-mcp ./cmd/ha-mcp # Build go test ./... # Unit tests golangci-lint run --timeout=5m ./... # Lint

Seedocs/architecture.mdfor integration test setup anddocs/integration-tests.mdfor the full test suite documentation.

SeeCONTRIBUTING.mdfor the full workflow (task commands, TDD requirement, integration test setup, linter rules, and the docs checklist for new tools). Please also read theCode of Conduct.

GPL-3.0 License - seeLICENSEfor details.

- Model Context Protocolspecification
-
Home Assistant WebSocket API
-
coder/websocket- Pure Go WebSocket library

A free, private, and secure remote MCP server for Home Assistant.

A safe-by-default MCP server that exposes your Control4 home automation (lights, scenes, locks, thermostats, and media) as structured tools over HTTP and Claude Desktop STDIO for reliable AI-powered control on your local network.

An MCP integration for controlling Home Assistant devices with AI assistants.

MCP server for Google Cast — discover devices, play media, control volume, launch apps, and manage queues over stdio

Control and query the status of Ecovacs cleaning robots using the MCP protocol.

Control AVM FRITZ!Box routers - manage devices, WiFi, network settings, parental controls, and schedule time-delayed actions

Allows an LLM agent to control your Gaggimate espresso machine

An MCP server for the Gaggiuino open-source espresso machine, providing real-time local network access to machine status and shot data.

Read-only MCP (Model Context Protocol) server for Home Assistant. Gives AI assistants (Claude Desktop, LibreChat, Cline) full observability into your smart home — entity states, automations, scripts, devices, logs, diagnostics — without any write access. Also generates static AI context snapshots for RAG systems, ChatGPT Projects, Qwen, and other tools that accept custom knowledge files. Built in Python, runs anywhere — locally, in Docker, or as an MCP integration.

Native macOS HomeKit integration for AI assistants via Model Context Protocol

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.