Skip to main content
Glama
crunchypancake1

Home Assistant MCP

Home Assistant MCP

An MCP server that exposes a Home Assistant instance as a tool set, running as a stateful agent on Cloudflare Workers. Point an MCP client (Claude, etc.) at the deployed endpoint and it can read entity states, call services, run scripts and automations, and send commands to phones via the HA companion app — all against your own Home Assistant instance.

How it works

MCP client ──HTTP/SSE──► Worker (/mcp) ──► HomeAssistantMCP (Durable Object)
                                                    │
                                          HomeAssistantClient
                                                    │
                                      Home Assistant REST API (Bearer auth)

HomeAssistantMCP is a McpAgent hosted on a Durable Object; each tool call goes through HomeAssistantClient, a thin wrapper around the HA REST API that handles auth, path-safe entity IDs, and error normalization. Areas have no dedicated REST endpoint in HA, so listAreas / getEntitiesByArea go through /api/template with a small Jinja template instead.

Related MCP server: hass-mcp

Tools

Tool

Description

get_entities

List entity states, optionally filtered by domain

get_entity_state

Full state and attributes for one entity

call_service

Call any HA service (light.turn_on, lock.lock, ...)

list_areas

List configured areas (rooms)

get_entities_by_area

Entity IDs belonging to an area

list_automations

Automations with state and last-triggered time

trigger_automation

Trigger an automation, bypassing conditions

list_scripts

Scripts with their running state

run_script

Run a script

get_entity_history

Recent state history for an entity

phone_list_capabilities

List commands sendable to the HA mobile app

phone_send_command

Send a command (e.g. DND toggle) to a phone

Setup

npm install

HA_URL is set in wrangler.jsonc under vars — point it at your own Home Assistant instance before deploying.

HA_TOKEN (a long-lived access token from HA) is read from Cloudflare's Secrets Store, not a plain Wrangler secret. Create it once per account and it's reusable across Workers:

wrangler secrets-store secret create <store-id> \
  --name home-assistant-token --scopes workers --remote

wrangler.jsonc then binds it via secrets_store_secrets:

"secrets_store_secrets": [
  { "binding": "HA_TOKEN", "store_id": "<store-id>", "secret_name": "home-assistant-token" }
]

For local dev, create a local-only secret with the same name (omit --remote) so wrangler dev has something to read.

Development

npm run dev         # wrangler dev
npm test             # vitest run
npm run test:watch   # vitest watch mode

Tests cover HomeAssistantClient by mocking fetch — no live Home Assistant instance is required to run them.

Deploy

npm run deploy

Or connect this repository to a Cloudflare Worker for git-based deploys. Either way, the home-assistant-token secret must exist in the account's Secrets Store — it is never stored in the repo.

Stack

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    MCP server for controlling and querying Home Assistant via its REST API, exposing tools to get entity states, list all states, and call services.
    16
    245
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server for full Home Assistant control, enabling AI agents to manage dashboards, automations, files, apps, entities, and more via REST API, WebSocket, and SSH.
    66
    90
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/crunchypancake1/home-assistant-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server