Home Assistant Automation MCP Server
Enables creation, editing, listing, and management of Home Assistant automations through the REST API, extending basic device control with full automation CRUD operations.
README
Home Assistant Automation MCP Server
This is a custom MCP (Model Context Protocol) server that extends Home Assistant capabilities to support creating, editing, and listing automations.
Overview
The existing Home Assistant MCP server provides device control but doesn't support automation management. This server wraps Home Assistant's REST API to provide automation CRUD operations.
Architecture
┌─────────────────┐
│ Cursor/IDE │
│ (MCP Client) │
└────────┬────────┘
│ MCP Protocol
│
┌────────▼─────────────────────────┐
│ Custom HA Automation MCP Server │
│ (Python - this project) │
└────────┬─────────────────────────┘
│ HTTP REST API
│
┌────────▼────────┐
│ Home Assistant │
│ REST API │
│ /api/automation │
└─────────────────┘
Home Assistant REST API Endpoints
Home Assistant provides these automation endpoints:
GET /api/automation- List all automationsGET /api/automation/{automation_id}- Get specific automationPOST /api/automation- Create new automationPUT /api/automation/{automation_id}- Update automationDELETE /api/automation/{automation_id}- Delete automationPOST /api/automation/{automation_id}/trigger- Trigger automation manually
Implementation Options
Option 1: Extend Existing MCP Server (Recommended)
If you have access to the Home Assistant MCP server source code, add new tools directly.
Option 2: Create Standalone MCP Server (This Implementation)
Create a separate MCP server that only handles automations, running alongside the existing HA MCP server.
Option 3: Fork and Extend
Fork the existing Home Assistant MCP server and add automation tools.
Prerequisites
- Python 3.10+
- Home Assistant instance with REST API enabled
- Long-lived access token from Home Assistant
- MCP SDK (for Python)
Setup Instructions
- Install dependencies:
pip install mcp aiohttp python-dotenv
- Configure environment variables:
export HA_URL="http://homeassistant.local:8123"
export HA_TOKEN="your_long_lived_access_token"
- Run the MCP server:
python mcp_ha_automations/server.py
- Configure Cursor to use this MCP server (add to Cursor settings)
MCP Tools Provided
- list_automations - List all automations
- get_automation - Get details of a specific automation
- create_automation - Create a new automation from YAML
- update_automation - Update an existing automation
- delete_automation - Delete an automation
- trigger_automation - Manually trigger an automation
- enable_automation - Enable an automation
- disable_automation - Disable an automation
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.