# Home Assistant

The MCP server for Claude Code reads Home Assistant data and runs its actions. An agent can inspect device states, check history, or change home settings.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5 repo stars
- Author: foreverworks
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/foreverworks/mcps/tree/HEAD/servers/home-assistant
- Updated: 2026-10-29
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/home-assistant

## What it does

The server gives an AI agent access to Home Assistant entities, areas, history, and logbook entries. It can also run actions, such as adjusting a light, changing a thermostat, or starting a script. Each action involving locks, alarm panels, covers, or valves requires approval before it runs.

The machine needs network access to a Home Assistant instance and a long-lived access token. The package `@foreverworks/mcp-home-assistant` runs on Node 22.19 or newer; set `HOME_ASSISTANT_URL` to the instance address and `HOME_ASSISTANT_TOKEN_FILE` to the token file path. A regular user's token supports every tool except `render_template`; an administrator token also enables admin-only actions.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `HOME_ASSISTANT_URL`, `HOME_ASSISTANT_TOKEN_FILE`, `HOME_ASSISTANT_CONFIRM_DOMAINS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: Home Assistant

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env HOME_ASSISTANT_URL=<HOME_ASSISTANT_URL> --env HOME_ASSISTANT_TOKEN_FILE=<HOME_ASSISTANT_TOKEN_FILE> --env HOME_ASSISTANT_CONFIRM_DOMAINS=<HOME_ASSISTANT_CONFIRM_DOMAINS> --transport stdio home-assistant -- npx -y @foreverworks/mcp-home-assistant
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add home-assistant --env HOME_ASSISTANT_URL=<HOME_ASSISTANT_URL> --env HOME_ASSISTANT_TOKEN_FILE=<HOME_ASSISTANT_TOKEN_FILE> --env HOME_ASSISTANT_CONFIRM_DOMAINS=<HOME_ASSISTANT_CONFIRM_DOMAINS> -- npx -y @foreverworks/mcp-home-assistant
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "home-assistant": {
            "command": "npx",
            "args": [
                "-y",
                "@foreverworks/mcp-home-assistant"
            ],
            "env": {
                "HOME_ASSISTANT_URL": "<HOME_ASSISTANT_URL>",
                "HOME_ASSISTANT_TOKEN_FILE": "<HOME_ASSISTANT_TOKEN_FILE>",
                "HOME_ASSISTANT_CONFIRM_DOMAINS": "<HOME_ASSISTANT_CONFIRM_DOMAINS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "home-assistant": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@foreverworks/mcp-home-assistant"
            ],
            "env": {
                "HOME_ASSISTANT_URL": "<HOME_ASSISTANT_URL>",
                "HOME_ASSISTANT_TOKEN_FILE": "<HOME_ASSISTANT_TOKEN_FILE>",
                "HOME_ASSISTANT_CONFIRM_DOMAINS": "<HOME_ASSISTANT_CONFIRM_DOMAINS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e HOME_ASSISTANT_URL=<HOME_ASSISTANT_URL> -e HOME_ASSISTANT_TOKEN_FILE=<HOME_ASSISTANT_TOKEN_FILE> -e HOME_ASSISTANT_CONFIRM_DOMAINS=<HOME_ASSISTANT_CONFIRM_DOMAINS> home-assistant npx -y @foreverworks/mcp-home-assistant
```
Replace <…> with your own values

## When to use it
- inspect device states and their areas
- check Home Assistant history and logbook entries
- adjust a light or thermostat setting
- run an action that requires approval

## Example prompts
- Which devices are active in the living room?
- How did the living room temperature shift overnight?
- Set the kitchen light to 30 percent brightness.

## Similar
- [home-assistant-best-practices](https://affpapa.org/en/nevibecode/skills/home-assistant-best-practices.md) — skill · 9500 installs
- [Home Assistant Automation](https://affpapa.org/en/nevibecode/skills/home-assistant-automation.md) — skill · 5100 installs
- [home-assistant-mcp](https://affpapa.org/en/nevibecode/mcp/home-assistant-mcp.md) — MCP server · ★ 58 repo stars
- [home-assistant-manager](https://affpapa.org/en/nevibecode/skills/home-assistant-manager.md) — skill · ★ 986 repo stars
- [home-assistant](https://affpapa.org/en/nevibecode/skills/home-assistant.md) — skill · ★ 173 repo stars
- [mcp-hass](https://affpapa.org/en/nevibecode/skills/mcp-hass.md) — skill · 3200 installs

From the same set: [foreverworks/mcps](https://affpapa.org/en/nevibecode/by/foreverworks/mcps.md) — 15 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
