Skip to main content
Glama
hass-mcp

hass-mcp

by HiTechLabTN

hass-mcp — HiTech Lab 에디션

HiTech Lab이 유지 관리 및 최적화 출처: https://github.com/voska/hass-mcp

Hass-MCP

MCP Toplist

Home Assistant를 Claude 및 기타 LLM과 통합하기 위한 MCP(Model Context Protocol) 서버입니다.

개요

Hass-MCP는 Claude와 같은 AI 어시스턴트가 Home Assistant 인스턴스와 직접 상호작용할 수 있게 해주며, 다음과 같은 작업을 수행할 수 있습니다:

  • 기기 및 센서의 상태 조회

  • 조명, 스위치 및 기타 엔티티 제어

  • 스마트 홈 요약 가져오기

  • 자동화 및 엔티티 문제 해결

  • 특정 엔티티 검색

  • 일반적인 작업을 위한 안내형 대화 생성

Related MCP server: Hass-MCP

스크린샷

기능

  • 엔티티 관리: 상태 조회, 기기 제어, 엔티티 검색

  • 도메인 요약: 엔티티 유형에 대한 상위 수준 정보 제공

  • 자동화 지원: 자동화 목록 및 제어

  • 안내형 대화: 자동화 생성과 같은 일반적인 작업을 위한 프롬프트 사용

  • 스마트 검색: 이름, 유형 또는 상태로 엔티티 찾기

  • 실시간 대시보드 편집: Home Assistant의 WebSocket API를 통해 Lovelace 대시보드(카드 및 뷰)를 읽고 편집 — 변경 사항이 열려 있는 브라우저에 즉시 반영되며, 자동 백업 및 dry-run 미리보기 지원

  • 토큰 효율성: 토큰 사용량을 최소화하는 간결한 JSON 응답

설치

사전 요구 사항

  • Long-Lived Access Token이 있는 Home Assistant 인스턴스

  • 다음 중 하나:

    • Docker(권장)

    • Python 3.13+ 및 uv

Claude Desktop 설정

Docker 설치(권장)

  1. Docker 이미지를 가져옵니다:

    docker pull voska/hass-mcp:latest
  2. MCP 서버를 Claude Desktop에 추가합니다:

    a. Claude Desktop을 열고 설정으로 이동합니다 b. 개발자 > 구성 편집으로 이동합니다 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 long-lived access token으로 교체합니다 e. HA_URL을 업데이트합니다:

    • Home Assistant가 같은 머신에서 실행 중인 경우: http://host.docker.internal:8123 사용(Mac/Windows의 Docker Desktop)

    • Home Assistant가 다른 머신에서 실행 중인 경우: 실제 IP 또는 호스트 이름 사용

    f. 파일을 저장하고 Claude Desktop을 다시 시작합니다

  3. "Hass-MCP" 도구가 이제 Claude Desktop 도구 메뉴에 표시됩니다

참고: 같은 머신의 Docker에서 Home Assistant를 실행 중인 경우, 컨테이너가 Home Assistant에 접근할 수 있도록 Docker 인수에 --network host를 추가해야 할 수 있습니다. 또는 host.docker.internal 대신 머신의 IP 주소를 사용하세요.

uv/uvx

  1. 시스템에 uv를 설치합니다.

  2. MCP 서버를 Claude Desktop에 추가합니다:

    a. Claude Desktop을 열고 설정으로 이동합니다 b. 개발자 > 구성 편집으로 이동합니다 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 long-lived access token으로 교체합니다 e. HA_URL을 업데이트합니다:

    • Home Assistant가 같은 머신에서 실행 중인 경우: http://host.docker.internal:8123 사용 (Mac/Windows의 Docker Desktop)

    • Home Assistant가 다른 머신에서 실행 중인 경우: 실제 IP 또는 호스트 이름 사용

    f. 파일을 저장하고 Claude Desktop을 다시 시작합니다

  3. "Hass-MCP" 도구가 이제 Claude Desktop 도구 메뉴에 표시되어야 합니다

기타 MCP 클라이언트

Cursor

  1. Cursor 설정 > MCP > 새 MCP 서버 추가로 이동합니다

  2. 양식을 작성합니다:

    • 이름: 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 인스턴스 주소에 맞게 업데이트합니다

  3. "추가"를 클릭하여 저장합니다

Claude Code (CLI)

Claude Code CLI에서 사용하려면 mcp add 명령을 사용하여 MCP 서버를 직접 추가할 수 있습니다:

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 사양에는 아직 이 서버에 내장 인증 계층이 포함되어 있지 않습니다. 그때까지는 반드시 다음 중 하나 뒤에 배치해야 합니다:

  • 기본 인증 또는 bearer-token 검증을 수행하는 리버스 프록시(nginx, Caddy, Traefik)

  • 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

Docker 내부에서는 포트가 브리지를 통해 접근 가능하도록 --host 0.0.0.0이 필요합니다. 호스트에서만 접근 가능하게 하려면 게시(-p)를 127.0.0.1:8000:8000으로 바인딩하거나 앞에 리버스 프록시를 배치하세요.

엔드포인트

MCP 엔드포인트는 /mcp에 있습니다. 클라이언트를 http://<host>:<port>/mcp로 연결하세요.

Smithery / PaaS

서버는 MCP_PORT 외에도 PORT 환경 변수(Smithery의 규칙)를 인식합니다. Smithery 배포에는 --http 모드가 필요하며 PORT를 자동으로 읽습니다.

사용자 지정 / 개인 CA

Home Assistant 인스턴스가 자체 CA(step-ca, smallstep, homelab OpenSSL)가 서명한 인증서를 제공하는 경우, hass-mcp는 TLS를 비활성화하지 않고도 이를 검증할 수 있습니다:

  • 로컬: OS 신뢰 저장소(macOS 키체인, Windows 인증서 저장소, Linux의 update-ca-certificates)에 CA 루트를 설치합니다. 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:latest

SSL_CERT_FILE은 설정 시 OS 저장소보다 항상 우선합니다. verify=False는 의도적으로 지원되지 않습니다 — 암호화되지 않은 로컬 LAN 트래픽을 원한다면 HA_URL=http://...를 사용하세요.

사용 예시

Hass-MCP가 설정된 후 Claude와 함께 사용할 수 있는 프롬프트 예시입니다:

  • "거실 조명의 현재 상태는 무엇인가요?"

  • "주방의 모든 조명을 꺼주세요"

  • "안방의 온도는 몇 도인가요?"

  • "게스트 룸의 모든 것을 나열해주세요"

  • "온도 데이터가 포함된 모든 센서를 나열해주세요"

  • "기후 엔티티에 대한 요약을 제공해주세요"

  • "일몰 시 조명이 켜지는 자동화를 만들어주세요"

  • "침실 모션 센서 자동화가 작동하지 않는 문제를 해결하는 데 도움을 주세요"

  • "거실과 관련된 엔티티를 검색해주세요"

  • "Home Assistant 로그에서 마지막 50개의 ERROR 줄을 보여주세요"

  • "오늘 mqtt 통합에서 실패한 것은 무엇인가요?"

  • "지난 달의 일별 전력 사용량을 보여주세요"

  • "지난 화요일에 현관문 센서에 무슨 일이 있었나요?"

사용 가능한 도구

Hass-MCP는 Home Assistant와 상호작용하기 위한 여러 도구를 제공합니다:

  • get_version: Home Assistant 버전 가져오기

  • get_entity: 선택적 필드 필터링으로 특정 엔티티의 상태 가져오기

  • entity_action: 엔티티에 대한 작업 수행(켜기, 끄기, 토글)

  • list_entities: 선택적 도메인 필터링 및 검색으로 엔티티 목록 가져오기

  • search_entities_tool: 쿼리와 일치하는 엔티티 검색

  • domain_summary_tool: 도메인의 엔티티 요약 가져오기

  • list_automations: 모든 자동화 목록 가져오기

  • call_service_tool: 모든 Home Assistant 서비스 호출

  • restart_ha: Home Assistant 재시작

  • get_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 필터가 서버 측에서 적용되어 시끄러운 로그가 Claude의 컨텍스트를 소모하지 않음

  • get_entities_by_area: 특정 영역 / 방의 엔티티 목록

대시보드(Lovelace) 편집

Home Assistant의 WebSocket API를 통해 대시보드를 읽고 실시간 편집합니다. 저장하면 변경 사항이 열려 있는 모든 브라우저에 즉시 푸시됩니다 — 재시작 불필요.

  • 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 구성 저장에는 long-lived token이 관리자 사용자에 속해야 합니다.

  • 저장소 모드만. 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/

라이선스

MIT License

Available Tools

29 tools
add_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

    A3.7/5.0

    Scored across 29 tools

    Disambiguation3/5

    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 Consistency3/5

    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.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A 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.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A 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.
      29
      353
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      A 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.
      9
      MIT