Skip to main content
Glama
README.md
# 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

## Install

```bash
pnpm install
pnpm build
```

## Run

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

pnpm start
```

## Configure in an MCP client

Example (conceptual):

```json
{
  "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

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
ResponsivenessNo issues