ESPHome设备管理MCP服务器

ESPHome MCP Server 是一个通过 Model Context Protocol 向 AI 编程助手提供 ESPHome 设备管理能力的 Home Assistant 插件,支持设备列表查看、配置验证、固件编译、OTA 刷写、日志获取以及 YAML 配置和字体文件同步,适用于在 Claude Code 中高效开发与管理 ESPHome 设备。

  • by ggrochowski
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 ggrochowski/ha-addon-esphome-mcp

使用说明

ESPHome MCP Server — Home Assistant Add-on

MCP (Model Context Protocol) server that exposes ESPHome operations as tools for Claude Code. Runs as a Home Assistant add-on with direct filesystem access — no SSH required.

Quick Start

  1. Add this repository as a custom add-on repository in Home Assistant:

    Settings > Add-ons > Add-on Store > ... (menu) > Repositories

    https://github.com/bberrevoets/ha-addon-esphome-mcp
    
  2. Install and start the ESPHome MCP Server add-on.

  3. Check the add-on logs for the auto-generated auth token.

  4. Set ESPHOME_MCP_TOKEN in your shell environment.

  5. Add to .mcp.json in your ESPHome project:

    {
      "mcpServers": {
        "esphome": {
          "type": "http",
          "url": "http://<your-ha-host>:8099/mcp",
          "headers": {
            "Authorization": "Bearer ${ESPHOME_MCP_TOKEN}"
          }
        }
      }
    }
    
  6. Restart Claude Code and verify with /mcp.

Tools

Tool Description
esphome_list_devices List device configs with names
esphome_validate Validate a device YAML config
esphome_compile Compile firmware for a device
esphome_flash OTA flash a device
esphome_logs Get recent device logs
esphome_push_files Write YAML configs to HA
esphome_pull_files Read YAML configs from HA
esphome_push_fonts Write font files (base64) to HA
esphome_pull_fonts Read font files (base64) from HA

Architecture

Claude Code (desktop)  --HTTP-->  HA Add-on (MCP Server)  --local-->  ESPHome CLI
                                       |
                                  /config/esphome/  (direct filesystem access)

See esphome-mcp/DOCS.md for full documentation.

License

MIT — Berrevoets Systems