ESPHome MCP Server

ESPHome MCP Server

Enables AI assistants to manage ESPHome devices by listing, inspecting, editing, validating, compiling, and flashing firmware over-the-air via the ESPHome WebSocket API.

Category
Visit Server

README

<h1> ESPHome MCP Server <img src="images/logo.png" width="80" align="right" /> </h1>

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.

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.py

The 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
    }
  }
}

Environment Variables

Environment Variable Default Value Description
ESPHOME_HOST 192.168.1.4 IP address or hostname of your ESPHome Device Builder / Home Assistant instance.
ESPHOME_PORT 6052 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.yaml so 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.yaml for syntax errors and compile the binary to verify the build."


Contributing

Contributions are welcome! Please submit all Pull Requests to the develop branch.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/awesome-feature)
  3. Commit your changes and push to your fork
  4. 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!

ko-fi

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured