Skip to main content
Glama
TheWhykiki

hass-mcp

by TheWhykiki
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 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 issues