Skip to main content
Glama

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: mcp-homeassistant

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

13 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), transition, brightness_pct.

ha_call_serviceC

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

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

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.

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 13 tools

    Disambiguation4/5

    Most tools have distinct purposes (get vs list vs control), but ha_call_service can duplicate any service-specific tool like ha_light_turn_on. Descriptions clearly delineate scope, so selection is unambiguous in practice.

    Naming Consistency4/5

    All tools share the 'ha_' prefix and snake_case, but the order varies: 'ha_light_turn_on' (noun_verb) vs 'ha_get_state' (verb_noun). This is a minor deviation from a fully consistent pattern.

    Tool Count5/5

    13 tools is well within the ideal range and matches the server's clear purpose for Home Assistant integration. Each tool covers a meaningful operation without redundancy.

    Completeness4/5

    Covers state reads, lists, registries, light control (individual and area), logbook, history, and a generic service caller, so most workflows are possible. Specific controls are limited to lights, but ha_call_service fills the gap for other domains.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with Home Assistant smart home devices through natural language. Control devices, manage automations, query entity states, and retrieve historical data across your home automation system.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to control Home Assistant devices, including lights, switches, and climate devices, through natural language commands.
      -