โ๏ธ This MCP server works together with the
Home Assistant Vibecode Agent,
installed as a Home Assistant add-on.
The agent runs on your Home Assistant instance and provides โeyes and handsโ for AI IDEs like Cursor, VS Code, Claude Code, or any other MCP-enabled IDE.
Let AI build your Home Assistant automations โ or act as your DevOps for the ones you write by hand. Just describe what you need in natural language. ๐ ๐ค
You describe your goal โ AI inspects your Home Assistant โ designs a custom solution โ and deploys it on-board automatically. ๐
And if you prefer to handcraft your automations and scripts yourself, the agent can simply act as your DevOps and extra pair of hands: quickly uploading your changes, running tests, and analyzing logs on demand. You stay in control and decide how much you delegate to AI and how deep it should go.
Transform the way you manage your smart home. This add-on enables Cursor, Visual Studio Code (VS Code), or any MCP-enabled IDE to:
- ๐ Analyze your Home Assistant configuration, entities, and devices
- ๐๏ธ Create intelligent automations, scripts, and complete systems โ including Home Assistant helpers that can be fully managed programmatically
- ๐จ Design and customize Lovelace dashboards with full control over cards, layouts, and styling
- ๐๏ธ Create and tweak themes for a personalized UI
- ๐ Safely deploy changes with automatic Git-based versioning
- ๐ Monitor and troubleshoot your setup through log analysis
- ๐ฆ Install and manage HACS integrations and custom repositories
No more manual YAML editing or searching through documentation - just describe what you want in natural language!
Example: "Install smart climate control for my radiators" โ AI creates 10+ automations, helpers, sensors, and scripts optimized for YOUR TRVs.
Built on Model Context Protocol and powered by HA Vibecode Agent.
โ
Read your full configuration โ entities, automations, scripts, helpers
โ
Understand your devices โ capabilities, relations, and usage patterns
โ
Learn existing logic โ analyze how your current automations and scripts behave
โ
Create complete systems โ multiple interconnected automations in seconds
โ
Generate helpers and sensors โ tailored to your actual setup and needs
โ
Write optimized scripts โ based on real entities, areas, and devices
โ
Refactor existing logic โ improve or merge automations instead of starting from scratch
โ
Create and update Lovelace dashboards โ fully programmatically
โ
Add, remove, or rearrange cards โ stat, graphs, history, custom cards, and more
โ
Control layouts and views โ organize rooms, areas, and scenarios
โ
Design and tweak themes โ colors, typography, and styles for a personalized UI
โ
Git-based versioning โ every change is tracked with meaningful commit messages
โ
Human-readable commits โ AI explains what changed and why
โ
Configuration validation โ test before apply to reduce breaking changes
โ
One-click rollback โ revert to a previous state if something goes wrong
โ
Activity log โ full audit trail of what the agent did and when
โ
Install and configure HACS โ unlock 1000+ community integrations
โ
Search repositories โ themes, plugins, custom components, dashboards
โ
Install integrations โ one-command setup for new HACS components
โ
Keep things fresh โ update all HACS repositories from a single place
Result:
You describe your goal โ AI inspects your Home Assistant โ designs a custom solution โ and deploys it on-board automatically. ๐
Most MCP integrations Iโve seen for Cursor, VS Code or Claude work only on your local machine and talk to Home Assistant over SSH and sometimes the REST API.
For serious Home Assistant work, thatโs not really enough:
Home Assistant is not just a bunch of YAML files. It exposes multiple internal APIs, and some of the most important ones are only available from inside HA itself over the WebSocket API.
When you access HA only via SSH, the AI usually has to generate and upload a helper script on every request, then execute it blindly on the host. Since that script can be different every time, each request is a bit of a black box โ more like playing Russian roulette than doing reliable automation.
Because of that, I chose a different architecture.
This project is split into two modules:
Home Assistant Agent (this module) โ runs inside Home Assistant (as an add-on), has native access to all relevant APIs, files and services, and exposes a safe, well-defined interface for external tools.
Home Assistant MCP server โ runs on your computer alongside your AI IDE (Cursor, VS Code, etc.) and talks to the Agent over a controlled API instead of SSH hacks (installation steps below)
This design makes working with Home Assistant faster, more predictable, safer and repeatable. Your AI IDE gets exactly the actions and data it needs โ through a stable API โ instead of constantly inventing ad-hoc scripts and hoping they behave correctly.
Before installing, you need:
- Home Assistant running (any version)
- HA Vibecode Agent v2.2.0+ installed as add-on
- Agent Key from HA Vibecode Agent (auto-generated on first start)
- AI-enabled editor installed (Cursor, VS Code + GitHub Copilot, Claude Code etc)
The MCP server requires Node.js to run on your computer (where your AI editor is installed):
- Check if Node.js is already installed: open terminal and run
node --version - If not installed or version is below v18.0.0, download and install from nodejs.org
- After installation, verify:
node --versionshould show v18.0.0 or higher - Important: Install Node.js on the computer where your AI editor runs, not on the Home Assistant server
Install the agent in your Home Assistant from :
- Go to Settings โ Add-ons โ Add-on Store
- Click โฎ โ Repositories
- Add:
https://github.com/Coolver/home-assistant-vibecode-agent - Install HA Vibecode Agent (v2.0.0+)
- Start the agent
Get configuration from Home Assistant:
- Open your Home Assistant (usually http://homeassistant.local:8123)
- Go to Settings โ Add-ons โ HA Vibecode Agent
- Click "Open Web UI" button
- Click the Cursor or VS Code tab (depending on which IDE you want to use with Home Assistant) and follow the setup instructions. Youโll need to install and configure Cursor or VS Code so they can connect to the HA Agent via the MCP protocol.
- Thatโs it โ youโre ready to start working with your Home Assistant scripts, automations and dashboards using AI. If you find this project useful and want to support its development, please consider giving it a GitHub Star โญ
Verify everything works:
Open your AI editor (Cursor, VS Code, etc) and send this message to AI:
Connect to my Home Assistant and show me:
1. List of all my climate entities
2. Current status of the HA Vibecode Agent
This will verify the MCP connection is working.
If AI successfully returns your entities and agent status, you're all set! โ
Troubleshooting: If connection fails:
- Check that HA Vibecode Agent is running
- Ensure your AI editor was fully restarted
- Verify configuration was pasted correctly
Just describe what you want in natural language - AI will handle the rest!
| Variable | Description | Required | Default |
|---|---|---|---|
HA_AGENT_URL |
URL of HA Vibecode Agent | Yes | http://homeassistant.local:8099 |
HA_AGENT_KEY |
Agent Key for authentication | Yes | - |
If your agent runs on a different URL:
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "@coolver/home-assistant-mcp@latest"],
"env": {
"HA_AGENT_URL": "http://<home-assistant-host>:8099",
"HA_AGENT_KEY": "your_api_key_here"
}
}
}
}- Check your Agent Key is correct in
mcp.json(underHA_AGENT_KEY) - Regenerate key if needed: Settings โ Add-ons โ HA Vibecode Agent โ Open Web UI
- Make sure HA Vibecode Agent is running
- Verify agent is accessible:
curl http://homeassistant.local:8099/api/health
- Check HA Vibecode Agent is started in Home Assistant
- Verify the URL in
HA_AGENT_URL - Make sure port 8099 is not blocked by firewall
This error means Node.js is not installed or not found in your system PATH.
Solution: Install Node.js (v18.0.0 or higher) on the computer where Cursor is running:
- Download and install Node.js from https://nodejs.org
- Restart Cursor completely after installation
- Verify installation by running
node --versionin a terminal
Important: Node.js must be installed on your computer (where Cursor, VS Code, Claude or other IDE runs), not on the Home Assistant server.
- โ All communication goes through HA Vibecode Agent (port 8099)
- โ Agent Key authentication for MCP clients
- โ Agent validates Agent Key for all requests
- โ Agent uses internal SUPERVISOR_TOKEN for Home Assistant API operations
- โ Your Agent Key is stored only in local IDE config file
โ ๏ธ Never commitmcp.jsonwith your Agent Key to git!
- HA Vibecode Agent - Home Assistant add-on (required)
- Model Context Protocol - Protocol specification
MIT ยฉ Vladimir Eremeev
home-assistant-mcp/
โโโ package.json # NPM package config
โโโ tsconfig.json # TypeScript config
โโโ src/
โ โโโ index.ts # MCP server entry point
โ โโโ ha-client.ts # HA Agent API client
โ โโโ handlers.ts # Tool request handlers
โ โโโ tools.ts # Legacy tool definitions
โ โโโ tools/ # Modular tool definitions
โ โโโ index.ts # Tool exports
โ โโโ files.ts # File operation tools
โ โโโ system.ts # System operation tools
โ โโโ dashboard.ts # Dashboard tools
โโโ build/ # Compiled JavaScript output
โโโ README.md
โโโ CHANGELOG.md
โโโ QUICK_START.md
MCP Server (index.ts) โ Communication Protocol
โ
Tool Handlers (handlers.ts) โ Business Logic
โ
HA Client (ha-client.ts) โ HTTP API Wrapper
โ
HA Vibecode Agent (https://github.com/Coolver/home-assistant-vibecode-agent) (REST API) โ Home Assistant Integration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- ๐ Issues: GitHub Issues
- ๐ก Discussions: GitHub Discussions
Give a โญ๏ธ if this project helped you control your smart home with AI!