Home Assistant

by allenporter

44 3.7k downloads Not rated yet Apache-2.0

About

Interact with Home Assistant for querying and controlling smart home devices.

Details

Repository
allenporter/mcp-server-home-assistant
License
Apache-2.0

Explore

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Home Assistant
    Command (node, npx, python, etc.) uv
    Arguments
    • Argument 1 --directory
    • Argument 2 /Users/allen/Development/mcp-server-home-assistant
    • Argument 3 run
    • Argument 4 mcp-server-home-assistant
    • Argument 5 -v
    • Argument 6 -v
    Environment
    • HOME_ASSISTANT_API_TOKEN byJhbVci0iJIUzI1ii1sInR5cCI6IkpXVCJ9.....
    • HOME_ASSISTANT_WEB_SOCKET_URL http://localhost:8123/api/websocket

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

1. Install the home-assistant-model-context-protocol custom component in your Home Assistant instance
1. Create a Long Lived Access Token
1. Clone this git repo to a path like /Users/allen/Development/mcp-server-home-assistant
1. Edit your claude_desktop_config.json with something like this and include your home assistant url and api token:

    {
        "mcpServers": {
            "Home-assistant": {
                "command": "uv",
                "args": [
                    "--directory",
                    "/Users/allen/Development/mcp-server-home-assistant",
                    "run",
                    "mcp-server-home-assistant",
                    "-v",
                    "-v"
                ],
                "env": {
                    "HOME_ASSISTANT_WEB_SOCKET_URL": "http://localhost:8123/api/websocket",
                    "HOME_ASSISTANT_API_TOKEN": "byJhbVci0iJIUzI1ii1sInR5cCI6IkpXVCJ9.....
                }
            }
        }
    }
    
1. You can view the logs e.g. ~Library/Logs/Claude/mcp-server-Home-assistant.log to understand what is happening

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "home assistant": {
            "env": {
                "HOME_ASSISTANT_API_TOKEN": "byJhbVci0iJIUzI1ii1sInR5cCI6IkpXVCJ9.....",
                "HOME_ASSISTANT_WEB_SOCKET_URL": "http://localhost:8123/api/websocket"
            },
            "args": [
                "--directory",
                "/Users/allen/Development/mcp-server-home-assistant",
                "run",
                "mcp-server-home-assistant",
                "-v",
                "-v"
            ],
            "command": "uv"
        }
    }
}

Linux

{
    "env": {
        "HOME_ASSISTANT_API_TOKEN": "byJhbVci0iJIUzI1sInR5cCI6IkpXVCJ9.....",
        "HOME_ASSISTANT_WEB_SOCKET_URL": "http://localhost:8123/api/websocket"
    },
    "args": [
        "--directory",
        "/Users/allen/Development/mcp-server-home-assistant",
        "run",
        "mcp-server-home-assistant",
        "-v",
        "-v"
    ],
    "command": "uv"
}

Macos

{
    "env": {
        "HOME_ASSISTANT_API_TOKEN": "byJhbVci0iJIUzI1ii1sInR5cCI6IkpXVCJ9.....",
        "HOME_ASSISTANT_WEB_SOCKET_URL": "http://localhost:8123/api/websocket"
    },
    "args": [
        "--directory",
        "/Users/allen/Development/mcp-server-home-assistant",
        "run",
        "mcp-server-home-assistant",
        "-v",
        "-v"
    ],
    "command": "uv"
}

Windows

{
    "env": {
        "HOME_ASSISTANT_API_TOKEN": "byJhbVci0iJIUzI1ii1sInR5cCI6IkpXVCJ9.....",
        "HOME_ASSISTANT_WEB_SOCKET_URL": "http://localhost:8123/api/websocket"
    },
    "args": [
        "--directory",
        "/Users/allen/Development/mcp-server-home-assistant",
        "run",
        "mcp-server-home-assistant",
        "-v",
        "-v"
    ],
    "command": "uv"
}

mcp-server-home-assistant

A Model Context Protocol Server for Home Assistant. See Model Context Protocol
for context.

The custom component required by this integration is moving to Home Assistant Core in https://github.com/home-assistant/core/pull/134122

Usage in Claude Desktop

1. Install the home-assistant-model-context-protocol custom component in your Home Assistant instance
1. Create a Long Lived Access Token
1. Clone this git repo to a path like /Users/allen/Development/mcp-server-home-assistant
1. Edit your claude_desktop_config.json with something like this and include your home assistant url and api token:

    {
        "mcpServers": {
            "Home-assistant": {
                "command": "uv",
                "args": [
                    "--directory",
                    "/Users/allen/Development/mcp-server-home-assistant",
                    "run",
                    "mcp-server-home-assistant",
                    "-v",
                    "-v"
                ],
                "env": {
                    "HOME_ASSISTANT_WEB_SOCKET_URL": "http://localhost:8123/api/websocket",
                    "HOME_ASSISTANT_API_TOKEN": "byJhbVci0iJIUzI1ii1sInR5cCI6IkpXVCJ9.....
                }
            }
        }
    }
    
1. You can view the logs e.g. ~Library/Logs/Claude/mcp-server-Home-assistant.log to understand what is happening
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.

Videos about Home Assistant

Relevant YouTube tutorials, setups, and demos