hass-mcp
hass-mcp — HiTech Lab Edition
Поддерживается и оптимизируется HiTech Lab Исходный код: https://github.com/voska/hass-mcp
Hass-MCP
Сервер Model Context Protocol (MCP) для интеграции Home Assistant с Claude и другими LLM.
Обзор
Hass-MCP позволяет ИИ-ассистентам, таким как Claude, напрямую взаимодействовать с вашим экземпляром Home Assistant, давая им возможность:
Запрашивать состояние устройств и датчиков
Управлять светом, выключателями и другими сущностями
Получать сводки по вашему умному дому
Диагностировать автоматизации и сущности
Искать конкретные сущности
Создавать направляющие диалоги для типовых задач
Related MCP server: Hass-MCP
Скриншоты
Возможности
Управление сущностями: Получение состояний, управление устройствами и поиск сущностей
Сводки по доменам: Получение высокоуровневой информации о типах сущностей
Поддержка автоматизаций: Список и управление автоматизациями
Направляющие диалоги: Использование подсказок для типовых задач, например создания автоматизаций
Умный поиск: Поиск сущностей по имени, типу или состоянию
Живое редактирование панелей: Чтение и редактирование панелей Lovelace (карточек и представлений) через WebSocket API Home Assistant — изменения мгновенно появляются в открытых браузерах, с автоматическим резервным копированием и предпросмотром (dry-run)
Экономия токенов: Компактные JSON-ответы для минимизации расхода токенов
Установка
Предварительные требования
Экземпляр Home Assistant с долгоживущим токеном доступа (Long-Lived Access Token)
Одно из следующего:
Docker (рекомендуется)
Python 3.13+ и uv
Настройка с Claude Desktop
Установка через Docker (рекомендуется)
Загрузите Docker-образ:
docker pull voska/hass-mcp:latestДобавьте MCP-сервер в Claude Desktop:
a. Откройте Claude Desktop и перейдите в Настройки b. Перейдите в раздел Developer > Edit Config c. Добавьте следующую конфигурацию в файл
claude_desktop_config.json:{ "mcpServers": { "hass-mcp": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "HA_URL", "-e", "HA_TOKEN", "voska/hass-mcp" ], "env": { "HA_URL": "http://homeassistant.local:8123", "HA_TOKEN": "YOUR_LONG_LIVED_TOKEN" } } } }d. Замените
YOUR_LONG_LIVED_TOKENна ваш фактический долгосрочный токен доступа Home Assistant e. ОбновитеHA_URL:Если Home Assistant работает на том же компьютере: используйте
http://host.docker.internal:8123(Docker Desktop на Mac/Windows)Если Home Assistant работает на другом компьютере: используйте фактический IP-адрес или имя хоста
f. Сохраните файл и перезапустите Claude Desktop
Инструмент "Hass-MCP" должен появиться в меню инструментов Claude Desktop
Примечание: Если вы запускаете Home Assistant в Docker на том же компьютере, возможно, потребуется добавить
--network hostк аргументам Docker, чтобы контейнер мог получить доступ к Home Assistant. В качестве альтернативы используйте IP-адрес вашего компьютера вместоhost.docker.internal.
uv/uvx
Установите uv в вашей системе.
Добавьте MCP-сервер в Claude Desktop:
a. Откройте Claude Desktop и выберите Настройки b. Перейдите в раздел Developer > Edit Config c. Добавьте следующую конфигурацию в файл
claude_desktop_config.json:{ "mcpServers": { "hass-mcp": { "command": "uvx", "args": ["hass-mcp"], "env": { "HA_URL": "http://homeassistant.local:8123", "HA_TOKEN": "YOUR_LONG_LIVED_TOKEN" } } } }d. Замените
YOUR_LONG_LIVED_TOKENна ваш реальный долгосрочный токен доступа Home Assistant e. ОбновитеHA_URL:Если Home Assistant работает на том же компьютере: используйте
http://host.docker.internal:8123(Docker Desktop на Mac/Windows)Если Home Assistant работает на другом компьютере: используйте фактический IP-адрес или имя хоста
f. Сохраните файл и перезапустите Claude Desktop
Инструмент "Hass-MCP" должен появиться в меню инструментов Claude Desktop
Другие MCP-клиенты
Cursor
Перейдите в Cursor Settings > MCP > Add New MCP Server
Заполните форму:
Имя:
Hass-MCPТип:
commandКоманда:
docker run -i --rm -e HA_URL=http://homeassistant.local:8123 -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN voska/hass-mcpЗамените
YOUR_LONG_LIVED_TOKENна ваш реальный токен Home AssistantОбновите HA_URL, чтобы он соответствовал адресу вашего экземпляра Home Assistant
Нажмите "Add" для сохранения
Claude Code (CLI)
Для использования с Claude Code CLI вы можете добавить MCP-сервер напрямую с помощью команды mcp add:
Использование Docker (рекомендуется):
claude mcp add hass-mcp -e HA_URL=http://homeassistant.local:8123 -e HA_TOKEN=YOUR_LONG_LIVED_TOKEN -- docker run -i --rm -e HA_URL -e HA_TOKEN voska/hass-mcpЗамените YOUR_LONG_LIVED_TOKEN на ваш реальный токен Home Assistant и обновите HA_URL, чтобы он соответствовал адресу вашего экземпляра Home Assistant.
HTTP-транспорт (Streamable)
Для развертываний, которые не могут использовать stdio — работающих за MCP-шлюзом, размещенных на Smithery, использующих один сервер для нескольких клиентов или подключающихся из сетевых инструментов, таких как LibreChat или OpenWebUI, — Hass-MCP поддерживает MCP streamable HTTP transport. Сервер работает в режиме без сохранения состояния (без Mcp-Session-Id, JSON-ответы), подходящем для горизонтально масштабируемых хостов.
[!CAUTION] HTTP-режим открывает полный контроль над Home Assistant через сеть. Любой, кто может получить доступ к порту, может вызывать любой инструмент — выключать свет, разблокировать двери, запускать автоматизации, перезапускать HA. Спецификация MCP пока не предоставляет встроенный уровень аутентификации в этом сервере. Пока этого нет, вы обязаны разместить его за одним из следующих:
Обратный прокси (nginx, Caddy, Traefik) с проверкой basic-auth или bearer-токена
VPN или сеть с нулевым доверием (Tailscale, WireGuard, Cloudflare Access)
Привязка только к localhost (по умолчанию — изменяйте
--hostтолько если вы знаете, что делаете)Не открывайте
:8000в открытый интернет без аутентификации.
Локальный запуск
Использование uvx:
HA_URL=http://homeassistant.local:8123 \
HA_TOKEN=YOUR_LONG_LIVED_TOKEN \
uvx hass-mcp --http --port 8000Сервер по умолчанию привязывается к 127.0.0.1. Переопределите с помощью --host 0.0.0.0 только в том случае, если вы также настроили аутентификацию перед ним.
Запуск в Docker
docker run --rm -p 8000:8000 \
-e HA_URL=http://homeassistant.local:8123 \
-e HA_TOKEN=YOUR_LONG_LIVED_TOKEN \
voska/hass-mcp:latest --http --host 0.0.0.0 --port 8000--host 0.0.0.0 обязателен внутри Docker, чтобы порт был доступен через мост. Привяжите публикацию (-p) к 127.0.0.1:8000:8000, если вы хотите, чтобы он был доступен только с хоста, или разместите обратный прокси перед ним.
Конечная точка
Конечная точка MCP находится по адресу /mcp. Направьте клиент на http://<host>:<port>/mcp.
Smithery / PaaS
Сервер учитывает переменную окружения PORT (соглашение Smithery) в дополнение к MCP_PORT. Развертывание на Smithery требует режима --http и автоматически считывает PORT.
Пользовательский / частный CA
Если ваш экземпляр Home Assistant обслуживает сертификат, подписанный вашим собственным CA (step-ca, smallstep, homelab OpenSSL), hass-mcp может проверить его без отключения TLS:
Локально: установите корневой CA в хранилище доверия вашей ОС (связка ключей macOS, хранилище сертификатов Windows или
update-ca-certificatesв Linux). hass-mcp подхватит его автоматически через truststore.В Docker (или в любой изолированной среде выполнения): смонтируйте файл CA и укажите на него
SSL_CERT_FILE.
docker run --rm \
-v /path/to/your-ca.crt:/etc/ssl/certs/your-ca.crt:ro \
-e SSL_CERT_FILE=/etc/ssl/certs/your-ca.crt \
-e HA_URL=https://homeassistant.example.internal:8123 \
-e HA_TOKEN=YOUR_LONG_LIVED_TOKEN \
voska/hass-mcp:latestSSL_CERT_FILE всегда имеет приоритет над хранилищем ОС, когда он задан. verify=False намеренно не поддерживается — используйте HA_URL=http://..., если вы действительно хотите незашифрованный локальный LAN-трафик.
Примеры использования
Вот несколько примеров запросов, которые вы можете использовать с Claude после настройки Hass-MCP:
"Каково текущее состояние света в моей гостиной?"
"Выключи весь свет на кухне"
"Какая температура в главной спальне?"
"Перечисли все, что находится в гостевой комнате"
"Перечисли все мои датчики, содержащие данные о температуре"
"Дай мне сводку по моим климатическим сущностям"
"Создай автоматизацию, которая включает свет на закате"
"Помоги мне диагностировать, почему не работает моя автоматизация датчика движения в спальне"
"Найди сущности, связанные с моей гостиной"
"Покажи последние 50 строк ERROR из журнала Home Assistant"
"Что сегодня не работало в интеграции mqtt?"
"Покажи потребление электроэнергии по дням за последний месяц"
"Что произошло с датчиком входной двери во вторник?"
Доступные инструменты
Hass-MCP предоставляет несколько инструментов для взаимодействия с Home Assistant:
get_version: Получить версию Home Assistantget_entity: Получить состояние конкретной сущности с необязательной фильтрацией полейentity_action: Выполнить действия с сущностями (включить, выключить, переключить)list_entities: Получить список сущностей с необязательной фильтрацией по домену и поискомsearch_entities_tool: Поиск сущностей по запросуdomain_summary_tool: Получить сводку по сущностям доменаlist_automations: Получить список всех автоматизацийcall_service_tool: Вызвать любую службу Home Assistantrestart_ha: Перезапустить Home Assistantget_history: Получить историю состояний сущности (за последние N часов)get_history_range: Получить историю изменений состояний сущности за явный диапазон дат/времени (start_time/end_time, ISO-8601)get_statistics: Получить долгосрочную агрегированную статистику (среднее / мин / макс за сегмент) для сущности за последние N часов — работает для данных старше окна краткосрочного хранения рекордераget_statistics_range: То же, но для явного диапазона дат/времени — полезно для запросов месячных / годовых тенденцийget_error_log: Получить журнал ошибок Home Assistant с необязательными фильтрамиlevel/integration/search_term/lines, применяемыми на стороне сервера, чтобы шумные журналы не раздували контекст Claudeget_entities_by_area: Список сущностей в конкретной области / комнате
Редактирование панелей (Lovelace)
Чтение и живое редактирование панелей через WebSocket API Home Assistant. Сохранение мгновенно отправляет изменения во все открытые браузеры — без перезапуска.
list_dashboards: Список панелей (по умолчанию плюс любые пользовательские панели), каждая сurl_pathиmode(storage/yaml)get_dashboard_config: Получить полную конфигурацию панелиset_dashboard_config: Заменить полную конфигурацию панели (низкоуровнево)add_card/update_card/remove_card/move_card: Редактировать карточки в представлении (представление выбирается по индексу или по егоpath/title)list_view_sections: Список секций представления типа "sections"add_view/remove_view/update_view: Редактировать представления панелиlist_dashboard_backups/restore_dashboard: Список и откат к автоматическим резервным копиям перед сохранением
Представления секций: Современный тип представления Home Assistant (type: sections) хранит свои карточки внутри секций, а не в едином списке верхнего уровня. Для таких представлений вызовите list_view_sections и передайте аргумент section (индекс, заголовок или заголовок) в инструменты карточек. Редактирование карточек в представлении секций без section отклоняется со списком доступных секций — вместо того чтобы молча сохранять карточку там, где она никогда не отобразится.
Каждый инструмент редактирования принимает dry_run=true для предпросмотра результирующей конфигурации и сводки изменений без сохранения.
Важные примечания:
Требуется токен администратора. Сохранение конфигурации Lovelace требует, чтобы долгосрочный токен принадлежал пользователю-администратору.
Только режим хранения. Редактировать можно только панели, управляемые через UI ("storage"). Панели в режиме YAML обнаруживаются и отклоняются с понятным сообщением — редактируйте их YAML-файлы напрямую.
Запись всей конфигурации. У Home Assistant нет API частичного редактирования; каждое изменение — это чтение-изменение-запись всей панели. Инструменты высокого уровня для карточек/представлений делают это за вас.
Автоматические резервные копии. Перед каждой записью текущая конфигурация сохраняется в
HASS_MCP_BACKUP_DIR(по умолчанию~/.hass-mcp/dashboard-backups/). При запуске в Docker смонтируйте том по этому пути, иначе резервные копии будут потеряны при пересоздании контейнера.
Подсказки для направляющих диалогов
Hass-MCP включает несколько подсказок для направляющих диалогов:
create_automation: Руководство по созданию автоматизаций Home Assistant на основе типа триггераdebug_automation: Помощь в устранении неполадок для автоматизаций, которые не работаютtroubleshoot_entity: Диагностика проблем с сущностямиroutine_optimizer: Анализ паттернов использования и предложение оптимизированных сценариев на основе фактического поведенияautomation_health_check: Проверка всех автоматизаций, поиск конфликтов, избыточности или возможностей для улучшенияentity_naming_consistency: Аудит имён сущностей и предложение улучшений по стандартизацииdashboard_layout_generator: Создание оптимизированных дашбордов на основе предпочтений пользователя и паттернов использования
Доступные ресурсы
Hass-MCP предоставляет следующие конечные точки ресурсов:
hass://entities/{entity_id}: Получить состояние конкретной сущностиhass://entities/{entity_id}/detailed: Получить подробную информацию о сущности со всеми атрибутамиhass://entities: Список всех сущностей Home Assistant, сгруппированных по доменамhass://entities/domain/{domain}: Получить список сущностей для конкретного доменаhass://search/{query}/{limit}: Поиск сущностей, соответствующих запросу, с настраиваемым лимитом результатов
Разработка
Запуск тестов
uv run pytest tests/Лицензия
Available Tools
29 toolsadd_cardA
Add a card to a dashboard view (live)
Args:
url_path: Dashboard URL path, or None for the default dashboard.
view: Target view — an integer index, or a string matching the view's
path or title.
card: The card config dict (must include a string type), e.g.
{"type": "markdown", "content": "Hello"}.
position: Insert index within the target card list (default: append).
section: For a "sections"-type view, which section to add into — an
index, section title, or heading text. REQUIRED for sections
views (use list_view_sections to see them); omit for classic
views.
dry_run: Preview without saving.
Returns:
Save result with a backup_id, or a dry-run preview.
Inputs: card, view, dry_run, section, +2 more. Returns: result
add_viewA
Add a new view to a dashboard (live)
Args: url_path: Dashboard URL path, or None for the default dashboard. view_config: The view config dict, e.g. {"title": "Garage", "path": "garage"}. position: Insert index among views (default: append). dry_run: Preview without saving.
Returns:
Save result with a backup_id, or a dry-run preview.
Inputs: dry_run, position, url_path, view_config. Returns: result
call_service_toolA
Call any Home Assistant service (low-level API access)
Args: domain: The domain of the service (e.g., 'light', 'switch', 'automation') service: The service to call (e.g., 'turn_on', 'turn_off', 'toggle') data: Optional data to pass to the service (e.g., {'entity_id': 'light.living_room'})
Returns: A dictionary with success status, the domain/service called, and the list of affected entity states returned by Home Assistant.
Examples: domain='light', service='turn_on', data={'entity_id': 'light.x', 'brightness': 255} domain='automation', service='reload' domain='fan', service='set_percentage', data={'entity_id': 'fan.x', 'percentage': 50}
Inputs: domain (required), service (required), data. Returns: result
domain_summary_toolA
Get a summary of entities in a specific domain
Args: domain: The domain to summarize (e.g., 'light', 'switch', 'sensor') example_limit: Maximum number of examples to include for each state
Returns: A dictionary containing: - total_count: Number of entities in the domain - state_distribution: Count of entities in each state - examples: Sample entities for each state - common_attributes: Most frequently occurring attributes
Examples: domain="light" - get light summary domain="climate", example_limit=5 - climate summary with more examples Best Practices: - Use this before retrieving all entities in a domain to understand what's available
Inputs: domain (required), example_limit. Returns: result
entity_actionA
Perform an action on a Home Assistant entity (on, off, toggle)
Args: entity_id: The entity ID to control (e.g. 'light.living_room') action: The action to perform ('on', 'off', 'toggle') params: Optional dictionary of additional parameters for the service call
Returns: The response from Home Assistant
Examples: entity_id="light.living_room", action="on", params={"brightness": 255} entity_id="switch.garden_lights", action="off" entity_id="climate.living_room", action="on", params={"temperature": 22.5}
Domain-Specific Parameters: - Lights: brightness (0-255), color_temp, rgb_color, transition, effect - Covers: position (0-100), tilt_position - Climate: temperature, target_temp_high, target_temp_low, hvac_mode - Media players: source, volume_level (0-1)
Inputs: action (required), entity_id (required), params.
get_dashboard_configA
Get a dashboard's full configuration
Args: url_path: The dashboard's URL path (e.g. "my-dash"). Omit or pass None for the default "Overview" dashboard.
Returns:
The dashboard config dict (a top-level views list of cards). If the
dashboard has no stored config yet, returns an empty {"views": []}
scaffold with a note.
Inputs: url_path. Returns: result
get_entities_by_areaA
Get all entities assigned to a specific Home Assistant area (room).
Area lookup is case-insensitive and matches the area's name as configured in Home Assistant (e.g., "Kitchen", "Living Room"). Entities inherit their area from their parent device when no area is set directly, matching HA's own resolution behavior.
Args: area: Name of the area to filter by (case-insensitive) domain: Optional domain to further filter results (e.g., 'light') lean: If True (default), returns token-efficient entity records
Returns: A dictionary containing: - area: The matched area name (as canonicalized by HA) - count: Number of matching entities - entities: List of entity records with their state and area
Examples: get_entities_by_area(area="Kitchen") - everything in the kitchen get_entities_by_area(area="Living Room", domain="light") - lights only
Inputs: area (required), lean, domain. Returns: result
get_entityA
Get the state of a Home Assistant entity with optional field filtering
Args: entity_id: The entity ID to get (e.g. 'light.living_room') fields: Optional list of fields to include (e.g. ['state', 'attr.brightness']) detailed: If True, returns all entity fields without filtering
Examples: entity_id="light.living_room" - basic state check entity_id="light.living_room", fields=["state", "attr.brightness"] - specific fields entity_id="light.living_room", detailed=True - all details
Inputs: entity_id (required), fields, detailed.
get_error_logA
Get the Home Assistant error log for troubleshooting.
All filters are optional and combine (AND semantics). Stats (error_count, warning_count, integration_mentions, total_lines) are computed over the filtered output so they match what's returned.
Args:
level: Filter to lines containing this log level — ERROR, WARNING,
INFO, or DEBUG. Case-insensitive.
integration: Filter to lines mentioning this integration. Matches
[name] or [homeassistant.components.name].
Case-insensitive.
search_term: Case-insensitive substring filter applied per line.
Useful for entity IDs, exception names, etc.
lines: Return only the most recent N lines (applied after other
filters). Useful when you only care about the tail.
Returns: A dictionary containing: - log_text: The (possibly filtered) error log text - error_count: Number of ERROR entries in the filtered output - warning_count: Number of WARNING entries in the filtered output - integration_mentions: Map of integration names to mention counts - total_lines: Number of lines in the filtered output - filters_applied: Map of which filter args were supplied - error: Error message if retrieval failed
Examples: get_error_log() # full log get_error_log(level="ERROR") # errors only get_error_log(integration="zwave_js") # one integration get_error_log(search_term="light.kitchen") # specific entity get_error_log(level="ERROR", lines=50) # last 50 errors
Best Practices:
- Filter on the server side (here) rather than pulling the full
log into Claude's context — saves tokens on noisy logs.
- Combine integration + level="ERROR" to triage a single
integration that's misbehaving.
- Use lines to bound output when scanning a long-running HA.
Inputs: level, lines, integration, search_term. Returns: result
get_historyA
Get the history of an entity's state changes
Args: entity_id: The entity ID to get history for hours: Number of hours of history to retrieve (default: 24)
Returns: A dictionary containing: - entity_id: The entity ID requested - states: List of state objects with timestamps - count: Number of state changes found - first_changed: Timestamp of earliest state change - last_changed: Timestamp of most recent state change
Examples: entity_id="light.living_room" - get 24h history entity_id="sensor.temperature", hours=168 - get 7 day history Best Practices: - Keep hours reasonable (24-72) for token efficiency - Use for entities with discrete state changes rather than continuously changing sensors - Consider the state distribution rather than every individual state
Inputs: entity_id (required), hours. Returns: result
get_history_rangeA
Get raw state-change history for an entity over a date/time range.
Like get_history, but takes an explicit window instead of "N hours
from now". Useful for inspecting what happened on a specific day or
correlating with an external event.
Args:
entity_id: The entity to fetch history for.
start_time: ISO-8601 start (e.g. 2026-05-15 or
2026-05-15T08:00:00Z). Treated as UTC if no offset.
end_time: ISO-8601 end. Defaults to now (UTC).
Returns:
Same shape as get_history: entity_id, states, count,
first_changed, last_changed.
Examples: get_history_range("light.kitchen", "2026-05-15") get_history_range("sensor.power", "2026-05-15T00:00:00Z", "2026-05-16T00:00:00Z")
Best Practices:
- Bound the window — wider ranges return more data and more tokens.
- For aggregated long-term data, prefer get_statistics_range.
Inputs: entity_id (required), start_time (required), end_time. Returns: result
get_statisticsA
Get long-term aggregated statistics for an entity over the last N hours.
Uses HA's recorder statistics (over WebSocket) — aggregated buckets
(mean / min / max per period) that survive the short-term retention
window. Use this instead of get_history when:
- You want data older than the recorder's default 10-day window.
- You want aggregated values rather than every individual change.
- The entity is a high-frequency sensor (temperature, power) and
raw history would be too many tokens.
Args:
entity_id: The entity (must have a state_class HA records as
statistics — measurement, total, total_increasing).
hours: How far back from now. Defaults to 24.
period: Bucket size — 5minute, hour, day, week, month.
Defaults to hour.
Returns:
entity_id, period, start_time, end_time, statistics
(list of {start, end, mean, min, max, ...} points).
Examples: get_statistics("sensor.power_usage", hours=168, period="day") get_statistics("sensor.temperature", hours=24)
Inputs: entity_id (required), hours, period. Returns: result
get_statistics_rangeA
Get long-term aggregated statistics for an entity over a date/time range.
Same data source as get_statistics, but with an explicit window —
useful for "what was my power usage from Jan 1 to Jan 31?" type
questions. Aggregated bucket data survives the short-term retention
window, so this works for data months/years old.
Args:
entity_id: The entity (must be statistics-tracked).
start_time: ISO-8601 start (2026-01-01 or
2026-01-01T00:00:00Z). UTC if no offset.
end_time: ISO-8601 end. Defaults to now.
period: 5minute, hour, day, week, or month.
Returns:
entity_id, period, start_time, end_time, statistics.
Examples: get_statistics_range("sensor.energy", "2026-01-01", "2026-02-01", period="day") get_statistics_range("sensor.temperature", "2026-05-01", period="hour")
Inputs: entity_id (required), start_time (required), period, end_time. Returns: result
get_versionA
Get the Home Assistant version
Returns: A string with the Home Assistant version (e.g., "2025.3.0")
Inputs: no named parameters. Returns: result
list_automationsA
Get a list of all automations from Home Assistant
This function retrieves all automations configured in Home Assistant, including their IDs, entity IDs, state, and display names.
Returns: A list of automation dictionaries, each containing id, entity_id, state, and alias (friendly name) fields.
Examples: Returns all automation objects with state and friendly names
Inputs: no named parameters. Returns: result
list_dashboard_backupsA
List on-disk backups of a dashboard's config
Backups are written automatically before every dashboard write. NOTE: in Docker, backups persist only if HASS_MCP_BACKUP_DIR is volume-mounted.
Args: url_path: Dashboard URL path, or None for the default dashboard.
Returns: A list of {backup_id, path}, oldest first.
Inputs: url_path. Returns: result
list_dashboardsA
List Home Assistant dashboards (Lovelace)
Returns:
A list of dashboards. Each entry has url_path (None for the default
"Overview" dashboard), title, and mode ("storage" or "yaml"). Only
"storage"-mode dashboards can be edited via these tools.
Inputs: no named parameters. Returns: result
list_entitiesA
Get a list of Home Assistant entities with optional filtering
Args: domain: Optional domain to filter by (e.g., 'light', 'switch', 'sensor') search_query: Optional search term to filter entities by name, id, or attributes (Note: Does not support wildcards. To get all entities, leave this empty) limit: Maximum number of entities to return (default: 100) fields: Optional list of specific fields to include in each entity detailed: If True, returns all entity fields without filtering
Returns: A list of entity dictionaries with lean formatting by default
Examples: domain="light" - get all lights search_query="kitchen", limit=20 - search entities domain="sensor", detailed=True - full sensor details
Best Practices: - Use lean format (default) for most operations - Prefer domain filtering over no filtering - For domain overviews, use domain_summary_tool instead of list_entities - Only request detailed=True when necessary for full attribute inspection - To get all entity types/domains, use list_entities without a domain filter, then extract domains from entity_ids
Inputs: limit, domain, fields, detailed, +1 more. Returns: result
list_view_sectionsA
List the sections of a "sections"-type dashboard view
Modern Home Assistant views of type: sections hold their cards inside
sections (not a top-level card list). Use this to discover which section
to target with the card tools' section argument.
Args:
url_path: Dashboard URL path, or None for the default dashboard.
view: Target view (index, or matching path/title).
Returns: A list of {index, title, heading, card_count}, one per section. Errors if the view is not a sections view.
Inputs: view, url_path. Returns: result
move_cardB
Reorder a card within a dashboard view (live)
Args:
url_path: Dashboard URL path, or None for the default dashboard.
view: Target view (index, or matching path/title).
card_index: Current index of the card.
new_index: Destination index within the same card list.
section: For a "sections"-type view, which section the card is in
(index/title/heading). Required for sections views.
dry_run: Preview without saving.
Returns:
Save result with a backup_id, or a dry-run preview.
Inputs: view, dry_run, section, url_path, +2 more. Returns: result
remove_cardA
Remove a card from a dashboard view (live)
Args:
url_path: Dashboard URL path, or None for the default dashboard.
view: Target view (index, or matching path/title).
card_index: Index of the card to remove within the target card list.
section: For a "sections"-type view, which section the card is in
(index/title/heading). Required for sections views.
dry_run: Preview without saving.
Returns:
Save result with a backup_id, or a dry-run preview.
Inputs: view, dry_run, section, url_path, +1 more. Returns: result
remove_viewA
Remove a view from a dashboard (live)
⚠️ Removes the view and all its cards.
Args:
url_path: Dashboard URL path, or None for the default dashboard.
view: Target view (index, or matching path/title).
dry_run: Preview without saving.
Returns:
Save result with a backup_id, or a dry-run preview.
Inputs: view, dry_run, url_path. Returns: result
restart_haA
Restart Home Assistant
⚠️ WARNING: Temporarily disrupts all Home Assistant operations
Returns: Result of restart operation
Inputs: no named parameters. Returns: result
restore_dashboardA
Restore a dashboard from a backup (live)
Restores the most recent backup unless backup_id is given. The current
config is itself backed up first, so a restore can be undone.
Args: url_path: Dashboard URL path, or None for the default dashboard. backup_id: A specific backup id from list_dashboard_backups (default: newest). dry_run: Preview without saving.
Returns:
Save result plus restored_from, or a dry-run preview.
Inputs: dry_run, url_path, backup_id. Returns: result
search_entities_toolA
Search for entities matching a query string
Args: query: The search query to match against entity IDs, names, and attributes. (Note: Does not support wildcards. To get all entities, leave this blank or use list_entities tool) limit: Maximum number of results to return (default: 20)
Returns: A dictionary containing search results and metadata: - count: Total number of matching entities found - results: List of matching entities with essential information - domains: Map of domains with counts (e.g. {"light": 3, "sensor": 2})
Examples: query="temperature" - find temperature entities query="living room", limit=10 - find living room entities query="", limit=500 - list all entity types
Inputs: query (required), limit. Returns: result
set_dashboard_configA
Replace a dashboard's full configuration (low-level write)
⚠️ WARNING: Overwrites the ENTIRE dashboard and updates every open browser live. The prior config is backed up first (use restore_dashboard to undo). Requires an admin token; only storage-mode dashboards can be saved.
Args:
url_path: Dashboard URL path, or None for the default dashboard.
config: The complete new config dict (must contain a views list).
dry_run: If True, validate and return the resulting config + a change
summary WITHOUT saving.
Returns: On save: {success, url_path, backup_id, summary}. On dry_run: {dry_run: True, url_path, summary, config}.
Inputs: config, dry_run, url_path. Returns: result
system_overviewA
Get a comprehensive overview of the entire Home Assistant system
Returns: A dictionary containing: - total_entities: Total count of all entities - domains: Dictionary of domains with their entity counts and state distributions - domain_samples: Representative sample entities for each domain (2-3 per domain) - domain_attributes: Common attributes for each domain - area_distribution: Entities grouped by area (if available)
Examples: Returns domain counts, sample entities, and common attributes Best Practices: - Use this as the first call when exploring an unfamiliar Home Assistant instance - Perfect for building context about the structure of the smart home - After getting an overview, use domain_summary_tool to dig deeper into specific domains
Inputs: no named parameters. Returns: result
update_cardB
Replace a card in a dashboard view (live)
Args:
url_path: Dashboard URL path, or None for the default dashboard.
view: Target view (index, or matching path/title).
card_index: Index of the card to replace within the target card list.
card: The new card config dict (must include a string type).
section: For a "sections"-type view, which section the card is in
(index/title/heading). Required for sections views.
dry_run: Preview without saving.
Returns:
Save result with a backup_id, or a dry-run preview.
Inputs: card, view, dry_run, section, +2 more. Returns: result
update_viewA
Update a view's properties — title, path, icon, etc. (live)
Cards in the view are preserved unless changes includes a cards key.
Args:
url_path: Dashboard URL path, or None for the default dashboard.
view: Target view (index, or matching path/title).
changes: Dict of view properties to merge in, e.g. {"title": "New Title"}.
dry_run: Preview without saving.
Returns:
Save result with a backup_id, or a dry-run preview.
Inputs: view, changes, dry_run, url_path. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
There are several overlapping tools for entity queries (list_entities, search_entities_tool, get_entities_by_area, domain_summary_tool, system_overview) and history (get_history, get_history_range, get_statistics, get_statistics_range). While each has a distinct primary purpose, the entity discovery/query tools especially overlap in what an agent might use to 'find entities,' requiring careful reading of descriptions to pick correctly. Dashboard tools and service/entity_action tools are more clearly distinct.
Naming is inconsistent: many use snake_case verbs (list_entities, get_entity, add_card, remove_view) but several use different patterns: call_service_tool, entity_action, search_entities_tool, domain_summary_tool, system_overview, restore_dashboard, list_dashboard_backups. Mixed conventions like search_entities_tool/suffix '_tool' and camelCase-less words like 'system_overview' create inconsistency, though most are readable.
29 tools is on the heavy side. The dashboard CRUD cluster (add_card, update_card, remove_card, move_card, add_view, remove_view, update_view, list_view_sections, restore_dashboard, set_dashboard_config, get_dashboard_config) plus history/statistics tools and system overview tools make the surface feel broad. While each tool serves a real purpose, the count is approaching the upper bound where agents may struggle to select among many options.
Core coverage is strong: entity reads, writes, service calls, dashboard CRUD with backups and restore, history and statistics queries, plus system diagnostics. Minor gaps: no explicit entity create/delete (though call_service_tool can cover some), no persistent state management, and no dashboard section mutation beyond listing. But the lifecycle for the stated domain (entity control, dashboard editing, history) is well covered.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.3MIT
- AlicenseAqualityBmaintenanceA Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.29353MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows large language models to control and query Home Assistant smart home systems through natural language interactions.22 npm5MIT
- AlicenseAqualityCmaintenanceA self-hosted MCP server for Home Assistant that exposes full control over entity states, service calls, history, templates, and areas via local stdio, enabling AI assistants to manage your smart home.9MIT