Skip to main content
Glama
hass-mcp

hass-mcp

by TheWhykiki

hass-mcp

An open-source MCP server for controlling and querying Home Assistant.

  • Transport: stdio

  • Auth: Home Assistant long-lived token

  • API: Home Assistant REST API

Features

Tools exposed:

  • ha_get_state — get state for an entity

  • ha_list_states — list all states (can be large)

  • ha_call_service — call any service

Related MCP server: ha-mcp

Install

pnpm install
pnpm build

Run

export HASS_URL="http://homeassistant.local:8123"
export HASS_TOKEN="<your long-lived access token>"

pnpm start

Configure in an MCP client

Example (conceptual):

{
  "mcpServers": {
    "homeassistant": {
      "command": "npx",
      "args": ["-y", "hass-mcp"],
      "env": {
        "HASS_URL": "http://homeassistant.local:8123",
        "HASS_TOKEN": "..."
      }
    }
  }
}

Security

  • Treat tokens as secrets.

  • Prefer running this server on the same LAN as Home Assistant.

  • If your HA is behind Cloudflare Access, run this MCP server on the LAN side.

License

MIT

Available Tools

16 tools
ha_area_lights_offA

Turn off all lights in an area (by area_id).

Inputs: area_id (required), transition.

ha_area_lights_onA

Turn on all lights in an area (by area_id).

Inputs: area_id (required), brightness_pct, transition.

ha_call_serviceC

Call a Home Assistant service (domain/service) with data payload.

Inputs: domain (required), service (required), data.

ha_get_error_logsB

Fetch the latest Home Assistant error logs.

Inputs: no named parameters.

ha_get_historyC

Fetch history since an ISO time (optionally for an entity).

Inputs: since (required), end, entity_id, minimal_response.

ha_get_logbookA

Fetch logbook entries since an ISO time (optionally for an entity).

Inputs: since (required), end, entity_id.

ha_get_stateB

Get Home Assistant entity state by entity_id.

Inputs: entity_id (required).

ha_light_turn_offB

Turn off a light by entity_id.

Inputs: entity_id (required).

ha_light_turn_onC

Turn on a light by entity_id.

Inputs: entity_id (required).

ha_list_areasA

List Home Assistant areas from the area registry.

Inputs: no named parameters.

ha_list_devicesA

List Home Assistant devices from the device registry.

Inputs: no named parameters.

ha_list_entity_registryA

List Home Assistant entity registry entries.

Inputs: no named parameters.

ha_list_servicesA

List Home Assistant services and their fields.

Inputs: no named parameters.

ha_list_statesA

List Home Assistant entity states (can be large).

Inputs: no named parameters.

ha_render_templateC

Render a Jinja2 template and return the result.

Inputs: template (required).

ha_update_entity_registryC

Update an entity registry entry (e.g., change name, entity_id, or area_id).

Inputs: entity_id (required), new_entity_id, name, area_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool has a distinct purpose with clear boundaries. Light control by area vs by entity are separate, state retrieval is split between single and list, and generic service call covers remaining operations without overlap.

    Naming Consistency5/5

    All tools follow consistent ha_verb_noun pattern using snake_case, e.g., ha_area_lights_off, ha_get_state, ha_list_areas. No mixing of conventions.

    Tool Count5/5

    16 tools is well-scoped for a Home Assistant server, covering core operations like state management, entity/area/device queries, history/logs, and template rendering without being overwhelming.

    Completeness4/5

    Covers all essential Home Assistant interactions: state queries, listings, light control, service calls, logs, history, and templates. Missing specific tools for common entities like switches or covers, but the generic ha_call_service fills gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      Not graded
      maintenance
      Enables control and monitoring of Home Assistant smart home devices through MCP, allowing users to list entities, check device states, and call services to control lights, switches, sensors, and other connected devices.
      4
      -
    • 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
      112 npm
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      A comprehensive MCP server that enables AI assistants to interact with Home Assistant, control smart home devices, query states, execute services, and manage automations via natural language.
      77
      196,503 PyPI
      5,847
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that exposes Home Assistant's REST and WebSocket APIs as 182 tools, enabling clients like Claude Code to control lights, climate, media, automations, and more. It also provides a status dashboard and supports running as a Home Assistant app or container.
      AGPL 3.0