Skip to main content

Home Assistant MCP Server - Complete control of Home Assistant through MCP

Project description

Breaking change (v7.3.0): ha_config_set_yaml has been moved to beta.

Home Assistant MCP Server Logo

The Unofficial and Awesome Home Assistant MCP Server

95+ Tools Release E2E Tests License
Activity Built with FastMCP Python Version GitHub Sponsors Website

A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with Home Assistant.
Using natural language, control smart home devices, query states, execute services and manage your automations.


Demo with Claude Desktop


๐Ÿš€ Get Started

Full guide to get you started with Claude Desktop (~10 min)

No paid subscription required. Click on your operating system:

Setup Guide for macOSย ย ย ย Setup Guide for Windows

Quick install (~5 min)

๐ŸŽ macOS
  1. Go to claude.ai and sign in (or create a free account)
  2. Open Terminal and run:
    curl -LsSf https://raw.githubusercontent.com/homeassistant-ai/ha-mcp/master/scripts/install-macos.sh | sh
    
  3. Download Claude Desktop (or restart: Claude menu โ†’ Quit)
  4. Ask Claude: "Can you see my Home Assistant?"

You're now connected to the demo environment! Connect your own Home Assistant โ†’

๐ŸชŸ Windows
  1. Go to claude.ai and sign in (or create a free account)
  2. Open Windows PowerShell (from Start menu) and run:
    irm https://raw.githubusercontent.com/homeassistant-ai/ha-mcp/master/scripts/install-windows.ps1 | iex
    
  3. Download Claude Desktop (or restart: File โ†’ Exit)
  4. Ask Claude: "Can you see my Home Assistant?"

You're now connected to the demo environment! Connect your own Home Assistant โ†’

๐Ÿ  Home Assistant OS (Add-on)
  1. Add the repository to your Home Assistant instance:

    Add Repository

  2. Install "Home Assistant MCP Server" from the Add-on Store and wait for it to complete

  3. Click Start, then open the Logs tab to find your unique MCP URL

  4. Configure your AI client with that URL

No token or credential setup needed โ€” the add-on connects to Home Assistant automatically.

Full add-on documentation โ†’

๐ŸŒ Remote Access (Nabu Casa / Webhook Proxy)

Already have Nabu Casa or another reverse proxy pointing at your Home Assistant? The Webhook Proxy add-on routes MCP traffic through your existing setup โ€” no separate tunnel or port forwarding needed.

  1. Install the MCP Server add-on (see above) and the Webhook Proxy add-on from the same store
  2. Start the webhook proxy and restart Home Assistant when prompted
  3. Copy the webhook URL from the add-on logs:
    MCP Server URL (remote): https://xxxxx.ui.nabu.casa/api/webhook/mcp_xxxxxxxx
    
  4. Configure your AI client with that URL

For other remote access methods (Cloudflare Tunnel, custom reverse proxy), see the Setup Wizard.

Webhook proxy documentation โ†’

๐Ÿง™ Setup Wizard for 15+ clients

Claude Code, Gemini CLI, ChatGPT, Open WebUI, VSCode, Cursor, and more.

Open Setup Wizard

Having issues? Check the FAQ & Troubleshooting


๐Ÿ’ฌ What Can You Do With It?

Just talk to Claude naturally. Here are some real examples:

You Say What Happens
"Create an automation that turns on the porch light at sunset" Creates the automation with proper triggers and actions
"Add a weather card to my dashboard" Updates your Lovelace dashboard with the new card
"The motion sensor automation isn't working, debug it" Analyzes execution traces, identifies the issue, suggests fixes
"Make my morning routine automation also turn on the coffee maker" Reads the existing automation, adds the new action, updates it
"Create a script that sets movie mode: dim lights, close blinds, turn on TV" Creates a reusable script with the sequence of actions

Spend less time configuring, more time enjoying your smart home.


โœจ Features

Category Capabilities
๐Ÿ” Search Fuzzy entity search, deep config search, system overview
๐Ÿ  Control Any service, bulk device control, real-time states
๐Ÿ”ง Manage Automations, scripts, helpers, dashboards, areas, zones, groups, calendars, blueprints
๐Ÿ“Š Monitor History, statistics, camera snapshots, automation traces, ZHA devices
๐Ÿ’พ System Backup/restore, updates, add-ons, device registry
Complete Tool List (88 tools)
Category Tools
Add-ons ha_get_addon, ha_manage_addon
Areas & Floors ha_config_list_areas, ha_config_list_floors, ha_list_floors_areas, ha_remove_area_or_floor, ha_set_area_or_floor
Automations ha_config_get_automation, ha_config_remove_automation, ha_config_set_automation
Blueprints ha_get_blueprint, ha_import_blueprint
Calendar ha_config_get_calendar_events, ha_config_remove_calendar_event, ha_config_set_calendar_event
Camera ha_get_camera_image
Dashboards ha_config_delete_dashboard_resource, ha_config_delete_dashboard, ha_config_get_dashboard, ha_config_list_dashboard_resources, ha_config_set_dashboard_resource, ha_config_set_dashboard
Device Registry ha_get_device, ha_remove_device, ha_update_device
Energy ha_manage_energy_prefs
Entity Registry ha_get_entity_exposure, ha_get_entity, ha_remove_entity, ha_set_entity
Files ha_delete_file (beta), ha_list_files (beta), ha_read_file (beta), ha_write_file (beta)
Groups ha_config_list_groups, ha_config_remove_group, ha_config_set_group
HACS ha_hacs_add_repository, ha_hacs_download, ha_hacs_repository_info, ha_hacs_search
Helper Entities ha_config_list_helpers, ha_config_set_helper, ha_delete_helpers_integrations
History & Statistics ha_get_automation_traces, ha_get_history, ha_get_logs
Integrations ha_get_integration, ha_set_integration_enabled
Labels & Categories ha_config_get_category, ha_config_get_label, ha_config_remove_category, ha_config_remove_label, ha_config_set_category, ha_config_set_label
Scenes ha_config_get_scene, ha_config_remove_scene, ha_config_set_scene
Scripts ha_config_get_script, ha_config_remove_script, ha_config_set_script
Search & Discovery ha_deep_search, ha_get_overview, ha_get_state, ha_search_entities
Service & Device Control ha_bulk_control, ha_call_event, ha_call_service, ha_get_operation_status, ha_list_services
System ha_backup_create, ha_backup_restore, ha_check_config, ha_config_set_yaml (beta), ha_get_system_health, ha_get_updates, ha_manage_custom_tool (beta), ha_reload_core, ha_restart
Todo Lists ha_get_todo, ha_remove_todo_item, ha_set_todo_item
Utilities ha_eval_template, ha_install_mcp_tools (beta), ha_report_issue
Zones ha_get_zone, ha_remove_zone, ha_set_zone

๐Ÿ”Œ Custom Component (ha_mcp_tools) (beta)

Some tools require a companion custom component installed in Home Assistant. Standard HA APIs do not expose file system access or YAML config editing. This component provides both.

Tools that require the component:

Tool Description
ha_config_set_yaml (beta) Safely add, replace, or remove top-level YAML keys in configuration.yaml and package files (automatic backup, validation, and config check)
ha_list_files (beta) List files in allowed directories (www/, themes/, custom_templates/)
ha_read_file (beta) Read files from allowed paths (config YAML, logs, www/, themes/, custom_templates/, custom_components/)
ha_write_file (beta) Write files to allowed directories
ha_delete_file (beta) Delete files from allowed directories

All other tools work without the component. These five return an error with installation instructions if the component is missing.

These tools also require feature flags: HAMCP_ENABLE_FILESYSTEM_TOOLS=true (file tools) and ENABLE_YAML_CONFIG_EDITING=true (YAML editing). To enable the ha_install_mcp_tools installer tool, set HAMCP_ENABLE_CUSTOM_COMPONENT_INTEGRATION=true.

Install using HACS (recommended)

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

To add manually: open HACS > Integrations > three-dot menu > Custom repositories > add https://github.com/homeassistant-ai/ha-mcp (category: Integration) > Download.

After installing, restart Home Assistant. Then open Settings > Devices & Services > Add Integration and search for HA MCP Tools.

Install manually

Copy custom_components/ha_mcp_tools/ from this repository into your HA config/custom_components/ directory. Restart Home Assistant, then add the integration as described above.


๐Ÿง  Better Results with Agent Skills

This server gives your AI agent tools to control Home Assistant. For better configurations, pair it with Home Assistant Agent Skills โ€” domain knowledge that teaches the agent Home Assistant best practices.

An MCP server can create automations, helpers, and dashboards, but it has no opinion on how to structure them. Without domain knowledge, agents tend to over-rely on templates, pick the wrong helper type, or produce automations that are hard to maintain. The skills fill that gap: native constructs over Jinja2 workarounds, correct helper selection, safe refactoring workflows, and proper use of automation modes.

Bundled Skills (built-in)

Skills from homeassistant-ai/skills are bundled and served as MCP resources via skill:// URIs. Any MCP client that supports resources can discover them automatically โ€” no manual installation needed. For tool-only clients (claude.ai, etc.), the same skills are reachable through the polymorphic ha_get_skill_guide tool โ€” call it with no args to list bundled skills, with a skill arg to list its files, or with skill + file to read content. Resources are not auto-injected into context โ€” clients must explicitly request them, so idle context cost is just the metadata listing.

ha_get_skill_guide is mandatory-pinned: the catalog always exposes it so tool-only clients never see a silently missing skill surface.

Skills can still be installed manually for clients that prefer local skill files โ€” see the skills repo for instructions.


๐Ÿ” Tool Discovery for AI Agents

By default, the full tool catalog (~86 tools) is listed to the client through the standard MCP tools/list response. Clients with deferred / on-demand tool loading (Claude Sonnet, Claude Opus,) handle that fine โ€” tools are pulled into context only when needed, so idle context cost is near-zero.

For models without deferred tool support โ€” Claude Haiku, Gemini, ChatGPT OpenAI-compatible local models, smaller open-weights models โ€” listing 86 tools eats ~46K tokens of idle context. To address that, the server ships with a search-based discovery mode built on top of FastMCP's BM25 search transform.

Enable search-based discovery

Set ENABLE_TOOL_SEARCH=true (or toggle the option in the HA add-on). The full catalog is replaced in the tool list with four entry points plus a small set of always-visible "pinned" tools (ha_search_entities, ha_get_overview, ha_restart, etc.). All tools remain callable directly by name once discovered:

Tool Purpose
ha_search_tools BM25 keyword search across all tools. Returns name, description, parameters, and annotations (readOnlyHint / destructiveHint) so the agent can pick the right one.
ha_call_read_tool Execute a readOnlyHint tool by name. Safe โ€” clients can auto-approve.
ha_call_write_tool Execute a write tool that creates or updates data.
ha_call_delete_tool Execute a tool that removes / deletes data.

The proxy split lets MCP clients apply different permission policies per category (e.g. auto-approve reads, prompt for writes, confirm deletes) without parsing tool docstrings.

Setting Default Description
ENABLE_TOOL_SEARCH false Replace full tool catalog with search-based discovery (~46K โ†’ ~5K idle tokens).
TOOL_SEARCH_MAX_RESULTS 5 Max results returned by ha_search_tools (range 2โ€“10).
PINNED_TOOLS empty Comma-separated tool names to keep always visible. The web settings UI is the primary way to manage this.

When to enable

  • Claude Haiku, OpenAI-compatible local models, Gemini, ChatGPT or any model without native deferred tool support โ€” large idle-context savings.
  • MCP clients that cap total tool count (some cap at 100) โ€” surfaces a minimal set (~10 tools) instead of 86.
  • Cost-sensitive deployments โ€” fewer idle tokens per turn.

Leave it off when using Claude Sonnet/Opus or any client with deferred tool loading; the full catalog has no idle cost there and direct calls skip the search step. If you choose to use our toolsearch then you should disable the native Claude Opus/Sonnet toolsearch, which is called deferred tools in the settings.

For the HA add-on, the same option is documented in homeassistant-addon/DOCS.md along with the in-add-on settings UI for fine-grained tool enable/disable/pin.


๐Ÿงช Dev Channel

Want early access to new features and fixes? Dev releases (.devN) are published on every push to master.

Dev Channel Documentation โ€” Instructions for pip/uvx, Docker, and Home Assistant add-on.


๐Ÿค Contributing

For development setup, testing instructions, and contribution guidelines, see CONTRIBUTING.md.

For comprehensive testing documentation, see tests/README.md.


๐Ÿ”’ Privacy

Ha-mcp runs locally on your machine. Your smart home data stays on your network.

  • Configurable telemetry โ€” optional anonymous usage stats
  • No personal data collection โ€” we never collect entity names, configs, or device data
  • User-controlled bug reports โ€” only sent with your explicit approval

For full details, see our Privacy Policy.


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

๐Ÿ‘ฅ Contributors

Maintainers

Contributors

  • @bigeric08 โ€” Explicit mcp dependency for protocol version 2025-11-25 support.
  • @airlabno โ€” Support for data field in schedule time blocks.
  • @ryphez โ€” Codex Desktop UI MCP quick setup guide.
  • @Danm72 โ€” Entity registry tools (ha_set_entity, ha_get_entity) for managing entity properties.
  • @Raygooo โ€” SOCKS proxy support.
  • @cj-elevate โ€” Integration & entity management tools (enable/disable/delete); person/zone/tag config store routing.
  • @maxperron โ€” Beta testing.
  • @kingbear2 โ€” Windows UV setup guide.
  • @konradwalsh โ€” Financial support via GitHub Sponsors. Thank you! โ˜•
  • @knowald โ€” Area resolution via device registry in ha_get_system_overview for entities assigned through their parent device. Financial support via GitHub Sponsors. Thank you! โ˜•
  • @zorrobyte โ€” Per-client WebSocket credentials in OAuth mode, fixing WebSocket tool failures.
  • @deanbenson โ€” Fixed ha_deep_search timeout on large Home Assistant instances with many automations.
  • @saphid โ€” Config entry options flow tools (initial design, #590).
  • @adraguidev โ€” Fix menu-based config entry flows for group helpers (#647).
  • @transportrefer โ€” Integration options inspection (ha_get_integration schema support, #689).
  • @teh-hippo โ€” Fix blueprint import missing save step.
  • @smenzer โ€” Documentation fix.
  • @The-Greg-O โ€” REST API for config entry deletion.
  • @restriction โ€” Responsible disclosure: python_transform sandbox missing call target validation.
  • @lcrostarosa โ€” Diagnostic and health monitoring tools concept (#675), inspiring system/error logs, repairs, and ZHA radio metrics integration.
  • @roysha1 โ€” Copilot CLI support in the installation wizard; replaced placeholder logo SVGs with real brand icons on the documentation site.
  • @Patch76 โ€” ha_remove_entity tool, history/statistics pagination and validation, docs sync automation, docstring guidelines, dashboard tool consolidation.
  • @teancom โ€” Fix add-on stats endpoint (/addons/{slug}/stats).
  • @TomasDJo โ€” Category support for automations, scripts, and scenes.
  • @bzelch โ€” python_transform support for automations and scripts.
  • @gcormier โ€” Windows installer improvements: removed unused variable and fixed terminal closing after install.
  • @ekobres โ€” Feature flags for HAMCP_ENABLE_FILESYSTEM_TOOLS and HAMCP_ENABLE_CUSTOM_COMPONENT_INTEGRATION in the add-on config, with beta tagging in source and docs.
  • @w3z315 โ€” Financial support via GitHub Sponsors. Thank you! โ˜•
  • @griffinmartin โ€” Added OpenCode (by Anomaly) as a selectable AI client in the setup wizard, with both stdio and streamable HTTP support.
  • @hhopke โ€” Fixed addon API calls to route through HA Core ingress proxy instead of direct container connections, fixing ha_manage_addon proxy mode on addon installs.

๐Ÿ’ฌ Community


โญ Star History

Star History Chart

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ha_mcp_dev-7.5.0.dev532.tar.gz (514.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ha_mcp_dev-7.5.0.dev532-py3-none-any.whl (563.2 kB view details)

Uploaded Python 3

File details

Details for the file ha_mcp_dev-7.5.0.dev532.tar.gz.

File metadata

  • Download URL: ha_mcp_dev-7.5.0.dev532.tar.gz
  • Upload date:
  • Size: 514.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ha_mcp_dev-7.5.0.dev532.tar.gz
Algorithm Hash digest
SHA256 090f823bdbae2a14aaed3f4d9648ff89f44e36f3deac35a5c07a8a59fd34aeba
MD5 25072a2c19e2b8633131553bb0e353cd
BLAKE2b-256 e51c435f18b18f1ebb293c808fb4826e10c805b260488e17feeed6512510b505

See more details on using hashes here.

Provenance

The following attestation bundles were made for ha_mcp_dev-7.5.0.dev532.tar.gz:

Publisher: publish-dev.yml on homeassistant-ai/ha-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ha_mcp_dev-7.5.0.dev532-py3-none-any.whl.

File metadata

File hashes

Hashes for ha_mcp_dev-7.5.0.dev532-py3-none-any.whl
Algorithm Hash digest
SHA256 dba3406eb4f96f8bb149c444238897cffa067ee574e9070a838122ebce6be11f
MD5 54f6cbac9842a10fc7a71c7eee2427d3
BLAKE2b-256 96761d8c3e8fb768bedb8100495b80ffb5ef7f8adea9a6acc43235b35cd98592

See more details on using hashes here.

Provenance

The following attestation bundles were made for ha_mcp_dev-7.5.0.dev532-py3-none-any.whl:

Publisher: publish-dev.yml on homeassistant-ai/ha-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page