{"id":51620847,"url":"https://github.com/jeeftor/esphome-mcp","last_synced_at":"2026-07-12T19:01:50.880Z","repository":{"id":369765878,"uuid":"1291454104","full_name":"jeeftor/esphome-mcp","owner":"jeeftor","description":"MCP server for managing ESPHome devices (config, compile, OTA install, logs, entity states)","archived":false,"fork":false,"pushed_at":"2026-07-06T21:22:22.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-06T22:14:19.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeeftor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-07-06T20:20:41.000Z","updated_at":"2026-07-06T21:22:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jeeftor/esphome-mcp","commit_stats":null,"previous_names":["jeeftor/esphome-mcp"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jeeftor/esphome-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fesphome-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fesphome-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fesphome-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fesphome-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeeftor","download_url":"https://codeload.github.com/jeeftor/esphome-mcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fesphome-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35400291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-12T19:01:50.272Z","updated_at":"2026-07-12T19:01:50.872Z","avatar_url":"https://github.com/jeeftor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esphome-mcp\n\nAn [MCP](https://modelcontextprotocol.io) server that lets LLM clients like\nClaude manage ESPHome devices: read/write YAML configs, compile, install\nfirmware OTA, pull logs, and read live entity states.\n\nIt talks to two ESPHome transports:\n\n1. **ESPHome Device Builder WebSocket API** (port 6052, `/ws`) — config CRUD,\n   validate, compile, install, and logs. This targets the modern ESPHome\n   2026.6+ dashboard protocol used by ESPHome 2026.7.\n2. **ESPHome Native TCP API** (port 6053, Noise-encrypted) — live entity\n   states via `esphome_list_entities`.\n\n## Tools\n\n| Tool                     | Transport  | Description                                            |\n| ------------------------ | ---------- | ----------------------------------------------------- |\n| `esphome_list_devices`   | Dashboard  | List configured devices + online status + versions   |\n| `esphome_get_config`     | Dashboard  | Get raw YAML for a device                             |\n| `esphome_save_config`    | Dashboard  | Overwrite a device's YAML                             |\n| `esphome_validate_config`| Dashboard  | Validate config without compiling                     |\n| `esphome_compile`        | Dashboard  | Compile firmware (summarized output)                  |\n| `esphome_install`        | Dashboard  | Compile + OTA install                                 |\n| `esphome_get_logs`       | Dashboard  | Fetch the last N log lines                            |\n| `esphome_list_entities`  | Native API | List entities + current states (auto-discovers PSK)  |\n\nThe server also registers compatibility aliases matching\n`loryanstrant/ESPHome-MCP`, including `list_devices`, `list_device_names`,\n`get_device_configuration`, `edit_device_configuration`,\n`validate_device_configuration`, `install_device_configuration`, `update_device`,\nand related status/version/log tools.\n\n`esphome_list_entities` can auto-discover the device's host and encryption PSK\nfrom the dashboard — just pass `device` instead of `host`/`psk`. The host is\nfetched from `devices/list` and the PSK is fetched from the Device Builder API\nwhen available, with YAML parsing as a fallback.\n\n## Install\n\n### From source\n\n```bash\nmake install   # installs `esphome-mcp` to $GOBIN\n```\n\n### Docker\n\n```bash\ndocker pull ghcr.io/jeeftor/esphome-mcp:latest\ndocker run --rm -p 3333:3333 \\\n  -e ESPHOME_URL=http://homeassistant.local:6052 \\\n  ghcr.io/jeeftor/esphome-mcp:latest\n```\n\nThe MCP endpoint is at `http://localhost:3333/mcp` (Streamable HTTP transport).\n\n### Docker Compose\n\n```bash\n# Edit compose.yaml to set your ESPHOME_URL, then:\ndocker compose up -d\n```\n\n## Run\n\n### Stdio mode (default — for Claude Code, etc.)\n\n```bash\nesphome-mcp\n```\n\nReads config from `~/.config/esphome-mcp/config.yaml` or `ESPHOME_*` env vars.\n\n### HTTP serve mode (for Docker / remote MCP clients)\n\n```bash\nesphome-mcp serve --http-addr 0.0.0.0:3333\n```\n\nExposes the MCP Streamable HTTP endpoint at `/mcp`.\n\n### Version\n\n```bash\nesphome-mcp version\n```\n\n## Configure\n\nConfig is read from `~/.config/esphome-mcp/config.yaml` (see\n`config.example.yaml`) or environment variables prefixed with `ESPHOME_`:\n\n| Env var             | Config key     | Default                       |\n| ------------------- | -------------- | ----------------------------- |\n| `ESPHOME_URL`       | `url`          | `http://localhost:6052`       |\n| `ESPHOME_USERNAME`  | `username`     | `\"\"`                          |\n| `ESPHOME_PASSWORD`  | `password`     | `\"\"`                          |\n| `ESPHOME_HA_ADDON`  | `ha_addon`     | `false`                       |\n| `ESPHOME_PSK`       | `psk`          | `\"\"` (native API encryption)  |\n\n`esphome_list_entities` can auto-discover the device's host and encryption PSK\nfrom the dashboard — just pass `device` instead of `host`/`psk`. You can also\nset `ESPHOME_PSK` as a fallback or provide `psk` per call.\n\n## Auth modes\n\n### Standalone ESPHome (password)\n\nSet `ESPHOME_PASSWORD` (and `ESPHOME_USERNAME` if your dashboard requires it).\nThe client sends Basic auth during the WebSocket handshake and also performs\nDevice Builder `auth/login` when the server reports `requires_auth`.\n\n### Home Assistant ESPHome addon\n\nThe HA addon uses **HA Supervisor auth** by default, which does **not** support\nBasic auth. The `/login` endpoint requires `SUPERVISOR_TOKEN` (only available\ninside the addon container), so external clients **cannot** use cookie-based\nlogin. You have two options:\n\n**Option A — Disable addon auth (simplest):**\nIn the ESPHome addon config, set \"Disable external authentication\"\n(`DISABLE_HA_AUTHENTICATION=true`, aka `leave_front_door_open`) and map port\n6052 in the addon's Network section. Then no credentials are needed — just set\n`ESPHOME_URL` and go.\n\n**Option B — Ingress bypass (port 6052 mapped, auth still enabled):**\nMap port 6052 in the addon config and set `ESPHOME_HA_ADDON=true`. This sends\n`X-HA-Ingress: YES` on all requests, which the addon treats as authenticated\n(the same way HA's ingress proxy does).\n\n## Use with Claude Code / MCP\n\n### Stdio (local)\n\n**Standalone ESPHome:**\n\n```json\n{\n  \"mcpServers\": {\n    \"esphome\": {\n      \"command\": \"esphome-mcp\",\n      \"env\": {\n        \"ESPHOME_URL\": \"http://homeassistant.local:6052\",\n        \"ESPHOME_PASSWORD\": \"your-dashboard-password\"\n      }\n    }\n  }\n}\n```\n\n**Home Assistant ESPHome addon (ingress bypass):**\n\n```json\n{\n  \"mcpServers\": {\n    \"esphome\": {\n      \"command\": \"esphome-mcp\",\n      \"env\": {\n        \"ESPHOME_URL\": \"http://homeassistant.local:6052\",\n        \"ESPHOME_HA_ADDON\": \"true\"\n      }\n    }\n  }\n}\n```\n\nNote: with auto-discovery, you usually do not need to set `ESPHOME_PSK`;\n`esphome_list_entities` asks Device Builder for the API key when you pass the\n`device` parameter. If your dashboard cannot expose the key, pass `psk`.\n\n### HTTP (Docker / remote)\n\nIf you run `esphome-mcp serve` in a container or on a remote host, point your\nMCP client at the HTTP endpoint:\n\n```json\n{\n  \"mcpServers\": {\n    \"esphome\": {\n      \"url\": \"http://localhost:3333/mcp\"\n    }\n  }\n}\n```\n\n## Docker\n\nTagged releases publish multi-architecture images (`linux/amd64`,\n`linux/arm64`) to GitHub Container Registry:\n\n```bash\ndocker pull ghcr.io/jeeftor/esphome-mcp:latest\ndocker run --rm -p 3333:3333 \\\n  -e ESPHOME_URL=http://homeassistant.local:6052 \\\n  -e ESPHOME_HA_ADDON=true \\\n  ghcr.io/jeeftor/esphome-mcp:latest\n```\n\nThe image is built from a static Go binary into a minimal `scratch` runtime\n(~15 MB). It includes CA certificates for outbound HTTPS to the ESPHome\ndashboard. It runs as non-root user 65532.\n\nBuild locally:\n\n```bash\nmake docker\ndocker run --rm -p 3333:3333 \\\n  -e ESPHOME_URL=http://host.docker.internal:6052 \\\n  esphome-mcp:local\n```\n\nOr with Docker Compose:\n\n```bash\ndocker compose up -d\n```\n\n## Releases\n\nGitHub Actions runs tests, `go vet`, and a GoReleaser config check before\npublishing any tag release. Tags matching `v*` build binaries for\nLinux/macOS/Windows (amd64/arm64), publish multi-arch Docker images to GHCR,\nand update the GitHub Release notes from `CHANGELOG.md`.\n\n```bash\nmake test\nmake lint\nmake release-check\ngit tag -a vX.Y.Z -m \"Release vX.Y.Z\"\ngit push origin vX.Y.Z\n```\n\n## Develop\n\n```bash\nmake build     # build the binary\nmake serve     # run as HTTP server on :3333\nmake test      # run tests (includes a full Noise handshake round-trip)\nmake lint      # go vet\nmake help      # list all targets\n```\n\n## Notes\n\n- The native API client implements the `Noise_NNpsk0_25519_ChaChaPoly_SHA256`\n  handshake required by modern ESPHome firmware. Plaintext (unencrypted) native\n  connections are no longer supported by ESPHome as of 2026.1.\n- Dashboard auth supports: Basic auth (standalone ESPHome with password), HA\n  addon ingress bypass (`X-HA-Ingress` header), or no auth (addon with\n  `DISABLE_HA_AUTHENTICATION`). See [Auth modes](#auth-modes) above.\n- Dashboard operations use the modern Device Builder `/ws` command bus\n  (`devices/list`, `devices/get_config`, `editor/validate_yaml`,\n  `firmware/compile`, `firmware/install`, and `devices/logs`).\n- `esphome_compile` / `esphome_install` return a summarized build log (errors\n  + last N lines) to keep token usage low.\n- The HTTP serve mode uses the MCP Streamable HTTP transport, which supports\n  session management and is compatible with MCP clients that accept HTTP URLs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeeftor%2Fesphome-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeeftor%2Fesphome-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeeftor%2Fesphome-mcp/lists"}