te

tevonsb/homeassistant-mcp

๐Ÿ“‡ ๐Ÿ  Access Home Assistant data and control devices (lights, switches, thermostats, etc).

#home automation#smart home#IoT
Publishertevonsb/homeassistant-mcp
Submitted date4/19/2025

Overview: Model Context Protocol Server for Home Assistant

Title

Model Context Protocol Server for Home Assistant

How to Use

The server acts as a bridge between your Home Assistant instance and Language Learning Models (LLMs), enabling natural language control and monitoring of smart home devices via the Model Context Protocol (MCP).

Key Steps:

  1. Installation:
    • Clone the repository and install dependencies (npm install).
    • Use Docker Compose (recommended) for easy deployment.
  2. Configuration:
    • Set up environment variables (.env file) with Home Assistant credentials.
  3. API Integration:
    • Access device control, automation management, and real-time updates via RESTful API or SSE (Server-Sent Events).

Key Features

  • Device Control: Natural language commands for lights, climate, locks, and more.
  • Real-Time Updates: SSE for instant state changes and automation triggers.
  • Automation Management: Create, modify, and trigger automations programmatically.
  • System Administration: Manage add-ons, HACS packages, and Home Assistant configurations.
  • Security: Token-based authentication and rate limiting.

Use Cases

  1. Voice Assistants: Integrate with LLMs (e.g., ChatGPT) for voice-controlled smart homes.
  2. Automation Scripts: Dynamically adjust automations based on real-time data.
  3. Remote Monitoring: Track device states and alerts via API.
  4. Development: Build custom dashboards or mobile apps with Home Assistant backend.

Example:

// Subscribe to real-time light updates const eventSource = new EventSource('http://localhost:3000/subscribe_events?token=YOUR_TOKEN&domain=light'); eventSource.onmessage = (event) => console.log(JSON.parse(event.data));

For details, refer to the SSE API documentation.


License: MIT | Prerequisites: Node.js โ‰ฅ20.10, Docker Compose, Home Assistant token
Project Status: Active | Test Coverage: 95%

Visit More

View All