Back to MCP Catalog

Home Assistant MCP Server

Smart HomePython
Control and query your Home Assistant smart home system through natural language
Available Tools

home_assistant

Interact with Home Assistant to control devices, check sensor states, and manage your smart home

The Home Assistant MCP server enables AI assistants to interact with your smart home devices and sensors through the Model Context Protocol. It connects to your Home Assistant instance via websocket API, allowing you to control lights, check sensor values, manage automations, and more using natural language commands. This integration brings the power of your smart home to conversational AI interfaces like Claude Desktop.

Overview

The Home Assistant MCP server provides a bridge between AI assistants and your Home Assistant smart home system. It allows you to control devices, check sensor states, manage automations, and more through natural language interactions.

Prerequisites

Before setting up the Home Assistant MCP server, you'll need:

  1. A running Home Assistant instance
  2. The home-assistant-model-context-protocol custom component installed in your Home Assistant instance (Note: This is being integrated into Home Assistant Core in PR #134122)
  3. A Long Lived Access Token from your Home Assistant instance

Installation

  1. Clone the repository:

    git clone https://github.com/allenporter/mcp-server-home-assistant
    cd mcp-server-home-assistant
    
  2. Install the package:

    pip install -e .
    

    Alternatively, you can use uv for installation:

    uv pip install -e .
    

Configuration

To use the Home Assistant MCP server with Claude Desktop or other compatible AI assistants, you'll need to:

  1. Create a Long Lived Access Token in Home Assistant:

    • Go to your profile in Home Assistant (click on your username in the sidebar)
    • Scroll down to the "Long-Lived Access Tokens" section
    • Create a new token and save it securely
  2. Configure your AI assistant to use the MCP server by adding it to your configuration file (e.g., claude_desktop_config.json).

  3. Set the following environment variables in your configuration:

    • HOME_ASSISTANT_WEB_SOCKET_URL: The websocket URL of your Home Assistant instance (e.g., "http://localhost:8123/api/websocket")
    • HOME_ASSISTANT_API_TOKEN: Your Long Lived Access Token

Troubleshooting

If you encounter issues with the MCP server:

  1. Check the logs for detailed error messages:

    • On macOS: ~/Library/Logs/Claude/mcp-server-Home-assistant.log
    • On other platforms: Check your AI assistant's documentation for log locations
  2. Verify your Home Assistant instance is accessible at the URL you provided

  3. Ensure your access token has the necessary permissions and hasn't expired

  4. Make sure the home-assistant-model-context-protocol custom component is properly installed in your Home Assistant instance

Related MCPs

Home Assistant Integration
Smart HomeTypeScript

Control and monitor your Home Assistant smart home devices through Claude

Home Assistant Integration
Smart HomePython

Control and query your Home Assistant smart home with AI assistants

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.