tedostrem
MCP Servertedostrempublic

home assistant mcp color

A Model Context Protocol (MCP) integration that enables AI assistants to search for and control Home Assistant devices through natural language commands in Cursor.

Repository Info

0
Stars
1
Forks
0
Watchers
0
Issues
Python
Language
MIT License
License

About This Server

A Model Context Protocol (MCP) integration that enables AI assistants to search for and control Home Assistant devices through natural language commands in Cursor.

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Home Assistant MCP

A Model Context Protocol (MCP) integration for controlling Home Assistant devices using AI assistants.

Overview

This MCP allows AI assistants to control your Home Assistant devices. It provides tools to:

  1. Search for entities in your Home Assistant instance
  2. Control devices (turn them on/off)

Prerequisites

  • Python 3.11 or higher
  • Home Assistant instance running and accessible via API
  • Home Assistant Long-Lived Access Token

Installation

  1. Clone this repository
  2. Set up a Python environment:
cd home-assistant
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -U pip
pip install uv
uv pip install -e .

Configuration

Get a Home Assistant Long-Lived Access Token

  1. Go to your Home Assistant instance
  2. Navigate to your profile (click on your username in the sidebar)
  3. Scroll down to "Long-Lived Access Tokens"
  4. Create a new token with a descriptive name like "MCP Integration"
  5. Copy the token (you'll only see it once)

Set up in Cursor AI

Add the following configuration to your MCP configuration in Cursor:

{
  "mcpServers": {
    "home_assistant": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/home-assistant-mcp",
        "run",
        "main.py"
      ],
      "env": {
        "HOME_ASSISTANT_TOKEN": "your_home_assistant_token_here"
      },
      "inheritEnv": true
    }
  }
}

Replace:

  • /path/to/your/home-assistant with the actual path to this directory
  • your_home_assistant_token_here with your Home Assistant Long-Lived Access Token

Home Assistant URL Configuration

By default, the MCP tries to connect to Home Assistant at http://homeassistant.local:8123.

If your Home Assistant is at a different URL, you can modify the HA_URL variable in app/config.py.

Usage

Once configured, you can use Cursor AI to control your Home Assistant devices:

  • Search for devices: "Find my living room lights"
  • Control devices: "Turn on the kitchen light"

Troubleshooting

  • If you get authentication errors, verify your token is correct and has not expired
  • Check that your Home Assistant instance is reachable at the configured URL

Future Capabilities

Dynamic Entity Exposure

The current implementation requires a two-step process to control devices:

  1. Search for entities using natural language
  2. Control the entity using its specific entity_id

A planned enhancement is to create a more dynamic way to expose entities to the control devices tool, allowing the AI to:

  • Directly control devices through more natural commands (e.g., "turn off the kitchen lights")
  • Cache frequently used entities for faster access
  • Support more complex operations like adjusting brightness, temperature, or other attributes
  • Handle entity groups and scenes more intuitively

This would significantly reduce the time to action and create a more seamless user experience when controlling Home Assistant devices through an AI assistant.

Quick Start

1

Clone the repository

git clone https://github.com/tedostrem/home-assistant-mcp-color
2

Install dependencies

cd home-assistant-mcp-color
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownertedostrem
Repohome-assistant-mcp-color
LanguagePython
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation