Home Assistant

Home Assistant

oleander

Connects Large Language Models to Home Assistant, enabling natural language control and querying of smart home devices and automations.

Enables natural language control of Home Assistant smart home systems with tools for querying entity states, executing service calls, and retrieving system information through secure WebSocket or stdio communication.

3341 views3Local (stdio)

What it does

  • Query smart device states and properties
  • Execute Home Assistant service calls
  • Control lights, switches, and other entities
  • Retrieve system information and history
  • Manage automations and scenes
  • Access entity attributes and metadata

Best for

Smart home owners wanting voice/chat controlHome automation enthusiasts building AI assistantsDevelopers creating natural language home interfaces
Works with any MCP-compatible clientSecure token-based authenticationDemo mode with mock data

About Home Assistant

Home Assistant is a community-built MCP server published by oleander that provides AI assistants with tools and capabilities via the Model Context Protocol. Transform your smarter home with Home Assistant: advanced home automation smart home control and secure device managemen It is categorized under developer tools.

How to install

You can install Home Assistant in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Home Assistant is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Home Assistant MCP Server

A Model Context Protocol (MCP) server for integrating with Home Assistant, allowing LLMs to control and query your smart home.

Features

  • Query and control Home Assistant entities via natural language
  • Works with any MCP-compatible client (like Claude Desktop)
  • Provides tools for state management, service calls, history, and more
  • Secure authentication using Home Assistant long-lived access tokens
  • Multiple transport options (stdio for local processes, SSE for remote clients)
  • Demo mode with mock data for testing and demonstration when Home Assistant is not available

Installation

# Install globally using bun
bun install -g home-assistant-mcp-server

# Or install from source
git clone https://github.com/oleander/home-assistant-mcp-server.git
cd home-assistant-mcp-server
bun install
bun run build
bun link

Configuration

Create a .env file in your current directory with the following variables:

# Required configurations
HASS_URL=http://your-home-assistant:8123  # URL to your Home Assistant instance
HASS_TOKEN=your_long_lived_access_token   # Long-lived access token for authentication

# Optional configurations
PORT=3000                # Port for the HTTP server (default: 3000)
HASS_MOCK=false          # Enable mock data mode when Home Assistant is unavailable (default: false)

Environment Variables

VariableRequiredDefaultDescription
HASS_URLYes-URL to your Home Assistant instance (e.g., http://homeassistant.local:8123)
HASS_TOKENYes-Long-lived access token for authenticating with Home Assistant
PORTNo3000Port number for the HTTP server when using HTTP/SSE transport
HASS_MOCKNofalseWhen set to "true", enables mock data mode for testing without a Home Assistant connection

To get a long-lived access token:

  1. Log in to your Home Assistant instance
  2. Click on your profile (bottom left)
  3. Scroll down to "Long-Lived Access Tokens"
  4. Create a new token with a descriptive name
  5. Copy the token value (you won't see it again)

Usage

Running as a standalone server

# Standard mode (requires a running Home Assistant instance)
home-assistant-mcp-server                # Start with HTTP/SSE transport
home-assistant-mcp-server --stdio        # Start with stdio transport for direct process communication

# Demo mode (with mock data when Home Assistant is unavailable)
home-assistant-mcp-server --mock         # Start with HTTP/SSE transport and mock data
home-assistant-mcp-server --stdio --mock # Start with stdio transport and mock data

Integration with Claude Desktop

To use with Claude Desktop:

  1. Edit your Claude Desktop config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the server configuration:

{
  "mcpServers": {
    "homeassistant": {
      "command": "home-assistant-mcp-server"
      "env": {
        "HASS_URL": "http://your-home-assistant:8123",
        "HASS_TOKEN": "your_token_here",
        "HASS_MOCK": "true"
      }
    }
  }
}

If you have Home Assistant running, simply remove the --mock flag and set HASS_MOCK to false.

  1. Restart Claude Desktop

Available Tools

The server exposes several tools for interacting with Home Assistant:

  • states - Query entity states
  • lights - List lights
  • light - Control a light
  • service - Call Home Assistant services
  • history - Retrieve historical entity data
  • services - List available services
  • config - Get Home Assistant configuration
  • domains - List available domains
  • error_log - Get Home Assistant error log
  • devices - Get all devices in Home Assistant

For detailed usage examples, see docs/hass-mcp.md.

Security

This server requires a Home Assistant access token with full access. Consider these security recommendations:

  • Only run the server on trusted networks
  • Use HTTPS if exposing the server remotely
  • Keep your .env file secure and don't commit it to source control
  • Consider using a token with limited permissions when possible

License

This project is licensed under the MIT License - see the LICENSE file for details.

Alternatives

Related Skills

Browse all skills
ui-design-system

UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.

18
home-assistant-manager

Expert-level Home Assistant configuration management with efficient deployment workflows (git and rapid scp iteration), remote CLI access via SSH and hass-cli, automation verification protocols, log analysis, reload vs restart optimization, and comprehensive Lovelace dashboard management for tablet-optimized UIs. Includes template patterns, card types, debugging strategies, and real-world examples.

7
home-assistant-integration-knowledge

Everything you need to know to build, test and review Home Assistant Integrations. If you're looking at an integration, you must use this as your primary reference.

7
ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

6
homeassistant

Control Home Assistant - smart plugs, lights, scenes, automations.

5
ai-assisted-development

Leveraging AI coding assistants and tools to boost development productivity, while maintaining oversight to ensure quality results.

4