Get the FREE Ultimate OpenClaw Setup Guide →

Homeassistant

A Model Context Protocol (MCP) server for interacting with Home Assistant. This server provides tools to control and monitor your Home Assistant devices through MCP-enabled applications.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hekmon8-homeassistant-server-mcp node /path/to/homeassistant-mcp/homeassistant-server/build/index.js \
  --env HA_URL="http://your-homeassistant-url:8123" \
  --env HA_TOKEN="your-long-lived-access-token"

How to use

This MCP server exposes tools to interact with your Home Assistant instance via the MCP framework. You can query device states, toggle devices on or off, trigger automations, and list entities. The tools are designed to integrate with MCP-enabled applications and clients, allowing you to manage Home Assistant devices programmatically through the MCP bridge. Typical workflows include reading the current state of an entity, turning lights on or off, kicking off automations, and retrieving a filtered list of entities by domain such as lights or switches. Example tool calls demonstrate how to pass entity identifiers, automation IDs, and optional filters to tailor results to your setup.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to the repository (clone or download)
  • A running Home Assistant instance with a long-lived access token

Installation steps:

  1. Clone the repository:
git clone https://github.com/yourusername/homeassistant-server-mcp.git
cd homeassistant-server-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Configure the MCP server by adding the following to your MCP settings file (example path provided; adjust to your environment):
{
  "mcpServers": {
    "homeassistant": {
      "command": "node",
      "args": ["/path/to/homeassistant-mcp/homeassistant-server/build/index.js"],
      "env": {
        "HA_URL": "http://your-homeassistant-url:8123",
        "HA_TOKEN": "your-long-lived-access-token"
      }
    }
  }
}

Replace the URL and token with your Home Assistant instance and a valid long-lived access token.

Optional alternative: If you prefer running via Smithery, you can install automatically with:

npx -y @smithery/cli install @hekmon8/Homeassistant-server-mcp --client claude

Additional notes

Tips and common considerations:

  • Ensure HA_URL uses http(s):// and the correct host/port for your Home Assistant instance.
  • Use a long-lived access token for stable MCP connections; protect this token and rotate periodically.
  • If the MCP server cannot reach Home Assistant, double-check network access and token permissions.
  • The configuration sample path in the README is specific to a VSCode/Claude setup; adapt the path to your MCP runner configuration if needed.
  • When running behind a reverse proxy or in a container, ensure environment variables are correctly passed to the Node process.
  • For security, prefer HTTPS and limit token exposure; consider placing tokens in a secure secrets store when deploying.
  • The tools exposed by this server include: get_state (read entity state), toggle_entity (turn on/off), trigger_automation (start an automation), and list_entities (enumerate entities, with optional domain filtering).

Related MCP Servers

Sponsor this space

Reach thousands of developers