io.github.homeassistant-ai/ha-mcp
AI 与智能体编辑精选by homeassistant-ai
io.github.homeassistant-ai/ha-mcp 是让 AI 助手直接控制你的 Home Assistant 智能家居的 MCP 服务器。
这个服务器解决了智能家居自动化中需要手动配置的痛点,最适合那些想用 Claude 或类似 AI 来语音或文本控制灯光、温度等设备的开发者。不过,由于它依赖 Home Assistant 的 API 稳定性,在复杂场景下可能需要额外调试。
什么是 io.github.homeassistant-ai/ha-mcp?
io.github.homeassistant-ai/ha-mcp 是让 AI 助手直接控制你的 Home Assistant 智能家居的 MCP 服务器。
README
<div align="center"> <img src="docs/img/ha-mcp-logo.png" alt="Home Assistant MCP Server Logo" width="300"/>⚠️ Breaking change in OAuth mode (v7.0.0) — Set
HOMEASSISTANT_URLserver-side. The consent form now accepts only the token. Migration guide →
The Unofficial and Awesome Home Assistant MCP Server
<!-- mcp-name: io.github.homeassistant-ai/ha-mcp --> <p align="center"> <img src="https://img.shields.io/badge/tools-92-blue" alt="95+ Tools"> <a href="https://github.com/homeassistant-ai/ha-mcp/releases"><img src="https://img.shields.io/github/v/release/homeassistant-ai/ha-mcp" alt="Release"></a> <a href="https://github.com/homeassistant-ai/ha-mcp/actions/workflows/e2e-tests.yml"><img src="https://img.shields.io/github/actions/workflow/status/homeassistant-ai/ha-mcp/e2e-tests.yml?branch=master&label=E2E%20Tests" alt="E2E Tests"></a> <a href="LICENSE.md"><img src="https://img.shields.io/github/license/homeassistant-ai/ha-mcp.svg" alt="License"></a> <br> <a href="https://github.com/homeassistant-ai/ha-mcp/commits/master"><img src="https://img.shields.io/github/commit-activity/m/homeassistant-ai/ha-mcp.svg" alt="Activity"></a> <a href="https://github.com/jlowin/fastmcp"><img src="https://img.shields.io/badge/Built%20with-FastMCP-purple" alt="Built with FastMCP"></a> <img src="https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fhomeassistant-ai%2Fha-mcp%2Fmaster%2Fpyproject.toml" alt="Python Version"> <a href="https://github.com/sponsors/julienld"><img src="https://img.shields.io/badge/GitHub_Sponsors-☕-blueviolet" alt="GitHub Sponsors"></a> </p> <p align="center"> <em>A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with Home Assistant.<br> Using natural language, control smart home devices, query states, execute services and manage your automations.</em> </p> </div>
🚀 Get Started
Full guide to get you started with Claude Desktop (~10 min)
No paid subscription required. Click on your operating system:
<p> <a href="https://homeassistant-ai.github.io/ha-mcp/guide-macos/"><img src="https://img.shields.io/badge/Setup_Guide_for_macOS-000000?style=for-the-badge&logo=apple&logoColor=white" alt="Setup Guide for macOS" height="120"></a> <a href="https://homeassistant-ai.github.io/ha-mcp/guide-windows/"><img src="https://img.shields.io/badge/Setup_Guide_for_Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white" alt="Setup Guide for Windows" height="120"></a> </p>Quick install (~5 min)
<details> <summary><b>🍎 macOS</b></summary>- Go to claude.ai and sign in (or create a free account)
- Open Terminal and run:
sh
curl -LsSf https://raw.githubusercontent.com/homeassistant-ai/ha-mcp/master/scripts/install-macos.sh | sh - Download Claude Desktop (or restart: Claude menu → Quit)
- Ask Claude: "Can you see my Home Assistant?"
You're now connected to the demo environment! Connect your own Home Assistant →
</details> <details> <summary><b>🪟 Windows</b></summary>- Go to claude.ai and sign in (or create a free account)
- Open Windows PowerShell (from Start menu) and run:
powershell
irm https://raw.githubusercontent.com/homeassistant-ai/ha-mcp/master/scripts/install-windows.ps1 | iex - Download Claude Desktop (or restart: File → Exit)
- Ask Claude: "Can you see my Home Assistant?"
You're now connected to the demo environment! Connect your own Home Assistant →
</details> <details> <summary><b>🏠 Home Assistant OS (Add-on)</b></summary>-
Add the repository to your Home Assistant instance:
-
Install "Home Assistant MCP Server" from the Add-on Store and wait for it to complete
-
Click Start, then open the Logs tab to find your unique MCP URL
-
Configure your AI client with that URL
No token or credential setup needed — the add-on connects to Home Assistant automatically.
</details>🧙 Setup Wizard for 15+ clients
Claude Code, Gemini CLI, ChatGPT, Open WebUI, VSCode, Cursor, and more.
<p> <a href="https://homeassistant-ai.github.io/ha-mcp/setup/"><img src="https://img.shields.io/badge/Open_Setup_Wizard-4A90D9?style=for-the-badge" alt="Open Setup Wizard" height="40"></a> </p>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 |
| Category | Tools |
|---|---|
| Add-ons | ha_call_addon_api, ha_get_addon |
| Areas & Floors | ha_config_list_areas, ha_config_list_floors, ha_config_remove_area, ha_config_remove_floor, ha_config_set_area, ha_config_set_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, ha_dashboard_find_card |
| Device Registry | ha_get_device, ha_remove_device, ha_rename_entity, ha_update_device |
| Entity Registry | ha_get_entity_exposure, ha_get_entity, ha_set_entity |
| Files | ha_delete_file, ha_list_files, ha_read_file, ha_write_file |
| Groups | ha_config_list_groups, ha_config_remove_group, ha_config_set_group |
| HACS | ha_hacs_add_repository, ha_hacs_download, ha_hacs_info, ha_hacs_list_installed, ha_hacs_repository_info, ha_hacs_search |
| Helper Entities | ha_config_list_helpers, ha_config_remove_helper, ha_config_set_helper, ha_get_helper_schema, ha_set_config_entry_helper |
| History & Statistics | ha_get_automation_traces, ha_get_history, ha_get_logs, ha_get_statistics |
| Integrations | ha_delete_config_entry, 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 |
| 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_get_states, ha_search_entities |
| Service & Device Control | ha_bulk_control, ha_call_service, ha_get_operation_status, ha_list_services |
| System | ha_backup_create, ha_backup_restore, ha_check_config, ha_config_set_yaml, ha_get_system_health, ha_get_updates, ha_reload_core, ha_restart |
| Todo Lists | ha_add_todo_item, ha_get_todo, ha_remove_todo_item, ha_update_todo_item |
| Utilities | ha_eval_template, ha_install_mcp_tools, ha_report_issue |
| Zones | ha_get_zone, ha_remove_zone, ha_set_zone |
🧠 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.
| Setting | Default | Description |
|---|---|---|
ENABLE_SKILLS | true | Serve skills as MCP resources. Resources are not auto-injected into context — clients must explicitly request them. |
ENABLE_SKILLS_AS_TOOLS | true | Expose skills and doc resources via list_resources/read_resource tools. Resource-capable clients can set to false to reduce tool count. |
Skills can still be installed manually for clients that prefer local skill files — see the skills repo for instructions.
🧪 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
- Home Assistant: Amazing smart home platform (!)
- FastMCP: Excellent MCP server framework
- Model Context Protocol: Standardized AI-application communication
- Claude Code: AI-powered coding assistant
👥 Contributors
Maintainers
- @julienld — Project creator & core maintainer.
- @sergeykad — Core maintainer.
- @kingpanther13 — Core maintainer.
Contributors
- @bigeric08 — Explicit
mcpdependency for protocol version 2025-11-25 support. - @airlabno — Support for
datafield 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_overviewfor entities assigned through their parent device. - @zorrobyte — Per-client WebSocket credentials in OAuth mode, fixing WebSocket tool failures.
- @deanbenson — Fixed
ha_deep_searchtimeout 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_integrationschema 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.
💬 Community
- GitHub Discussions — Ask questions, share ideas
- Issue Tracker — Report bugs, request features, or suggest tool behavior improvements
⭐ Star History
常见问题
io.github.homeassistant-ai/ha-mcp 是什么?
Comprehensive Model Context Protocol server for managing Home Assistant through AI assistants.
相关 Skills
Claude接口
by anthropics
面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。
✎ 想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心
提示工程专家
by alirezarezvani
覆盖Prompt优化、Few-shot设计、结构化输出、RAG评测与Agent工作流编排,适合分析token成本、评估LLM输出质量,并搭建可落地的AI智能体系统。
✎ 把提示优化、LLM评测到RAG与智能体设计串成一套方法,适合想系统提升AI开发效率的人。
智能体流程设计
by alirezarezvani
面向生产级多 Agent 编排,梳理顺序、并行、分层、事件驱动、共识五种工作流设计,覆盖 handoff、状态管理、容错重试、上下文预算与成本优化,适合搭建复杂 AI 协作系统。
✎ 帮你把多智能体流程设计、编排和自动化统一起来,复杂工作流也能更稳地落地,适合追求强控制力的团队。
相关 MCP Server
顺序思维
编辑精选by Anthropic
Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。
✎ 这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。
知识图谱记忆
编辑精选by Anthropic
Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。
✎ 帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。
PraisonAI
编辑精选by mervinpraison
PraisonAI 是一个支持自反思和多 LLM 的低代码 AI 智能体框架。
✎ 如果你需要快速搭建一个能 24/7 运行的 AI 智能体团队来处理复杂任务(比如自动研究或代码生成),PraisonAI 的低代码设计和多平台集成(如 Telegram)让它上手极快。但作为非官方项目,它的生态成熟度可能不如 LangChain 等主流框架,适合愿意尝鲜的开发者。