ESPHome MCP Server
Manages ESPHome devices via the ESPHome Device Builder WebSocket & REST API, providing tools to list devices, retrieve and update YAML configurations, validate configurations, compile firmware, and flash OTA updates.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ESPHome MCP ServerList all my ESPHome devices and show which ones are online"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
A custom Model Context Protocol (MCP) server for managing ESPHome devices via the ESPHome Device Builder WebSocket & REST API.
It allows AI assistants (like Claude, Gemini, or custom agents) to inspect, edit, validate, compile, and flash ESPHome firmware Over-The-Air (OTA) directly from conversation context.
Features
esphome_list_devices: Lists all registered ESPHome devices, IP addresses, online statuses, board architectures, and YAML filenames.esphome_get_config: Retrieves full YAML configuration for any device (e.g.esp32-shelf.yaml).esphome_update_config: Saves updated YAML configurations directly to the ESPHome instance.esphome_validate: Validates YAML syntax & component configurations before compilation.esphome_compile: Triggers C++ compilation of device firmware.esphome_flash_ota: Flashes compiled firmware Over-The-Air (OTA) over Wi-Fi.
Related MCP server: Home Assistant MCP Server (HA-mcp)
How It Works
The server connects directly over local WebSockets to the standard ESPHome Device Builder dashboard (port 6052) running on your network.
No Home Assistant Add-ons Required: It bypasses third-party container layers and talks directly to ESPHome.
No SSH / Samba Mounts Needed: Configs are read, updated, validated, and flashed over the native ESPHome WebSocket API.
Quick Start (Automated Setup)
Run the automated installer script to create the virtual environment, install dependencies, verify your ESPHome connection, and automatically register the server with your MCP client:
git clone https://github.com/saihgupr/esphome-mcp.git
cd esphome-mcp
python3 install.pyThe script will prompt for your ESPHome IP/Host & Port, test the connection, create the .venv, and automatically add esphome to your mcp_config.json (Antigravity IDE, Claude Desktop, Cursor, etc.).
Note: After running
install.py, fully restart your IDE or AI Client application (Quit & Relaunch) to load the new MCP server.
Manual Configuration (Alternative)
If you prefer to configure manually, create .venv and update your MCP client configuration file (e.g. ~/.gemini/config/mcp_config.json or claude_desktop_config.json) using absolute paths:
{
"mcpServers": {
"esphome": {
"command": "/Users/your-username/path/to/esphome-mcp/.venv/bin/python",
"args": [
"/Users/your-username/path/to/esphome-mcp/server.py"
],
"env": {
"ESPHOME_HOST": "192.168.1.4",
"ESPHOME_PORT": "6052"
},
"disabled": false
}
}
}Local AI Models & Self-Hosted Clients
Because ESPHome MCP Server runs as a standard stdio MCP process, it works with open-source local LLMs (e.g., Qwen2.5-Coder, Llama 3) via MCP-compatible clients:
Compatible Local Clients & Setup
Continue (VS Code / JetBrains): Add the server to your
.continue/config.jsonunderexperimental.mcpServers:{ "name": "esphome", "command": "/path/to/esphome-mcp/.venv/bin/python", "args": ["/path/to/esphome-mcp/server.py"], "env": { "ESPHOME_HOST": "192.168.1.4", "ESPHOME_PORT": "6052" } }Open WebUI / Ollama / LM Studio: Connect
esphome-mcpusing any MCP stdio bridge tool or client extension (such as Open WebUI MCP Actions or MCPO). Point your client at your local model server (e.g. Ollamaqwen2.5-coderorllama3.3).Cursor / LibreChat: Add
esphome-mcpas a stdio server in settings and connect your preferred local provider endpoint (Ollama/v1, LM Studio/v1, or vLLM).
Tip for Local Models: Tool calling requires reliable function call formatting. We recommend function-calling capable local models such as Qwen2.5-Coder (14B/32B) or Llama 3.1/3.3 for optimal YAML editing and tool execution.
Environment Variables
Environment Variable | Default Value | Description |
|
| IP address or hostname of your ESPHome Device Builder / Home Assistant instance. |
|
| Port for the ESPHome web dashboard / WebSocket API. |
Usage & Examples
Once configured in your MCP client, you can manage your ESPHome devices using natural conversation.
Example Prompts:
Check Device Status:
"List all my ESPHome devices and show which ones are currently online."
Inspect Configuration:
"Show me the configuration file for
esp32-shelf.yaml."Edit, Validate & OTA Update:
"Update
esp32-shelf.yamlso pressing the door button triggers a 180-degree LED hue shift for half a second. Validate the config, and if valid, flash the update OTA over Wi-Fi."Compile Test:
"Check
nodemcu-2.yamlfor syntax errors and compile the binary to verify the build."
Contributing
Contributions are welcome! Please submit all Pull Requests to the develop branch.
Fork the repository
Create a feature branch (
git checkout -b feature/awesome-feature)Commit your changes and push to your fork
Open a Pull Request to develop
Support & Feedback
If you encounter any issues, bugs, or have feature requests, please open an issue on GitHub.
ESPHome MCP Server is open-source and free. If you find it useful, consider giving it a star ⭐ or making a donation to support development!
This server cannot be deployed
Maintenance
Related MCP Connectors
- mytesla.ioOAuthio.mytesla
Control your Tesla from your AI assistant - climate, charging, access, and security.
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Build, validate, deploy — HTTP APIs, cron jobs, webhooks and MCP tools — from your AI client.
Create, test, publish, and manage Dreamlit notification workflows from AI clients.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides tools for AI assistants to interact with smart home devices through Home Assistant, allowing operations like checking entity states and calling services.346 npm3MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with Home Assistant to control smart home devices, query entity states, and manage automations using natural language. It provides over 90 tools for comprehensive system management, including dashboard configuration, service execution, and automation debugging.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Arduino boards for compiling, uploading sketches, and serial communication.6MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP clients to manage ESPHome devices via the 2026.6+ dashboard WebSocket protocol, including listing, configuring, validating, and flashing firmware.26MIT