ESP32 Control

com.pixharvestv0.1.0更新於 Oct 8, 2026

Control ESP32 IoT devices from AI agents: status, GPIO, ADC, reboot.

概覽

AI 產生的概覽

讓助理透過 REST API 檢視與控制 ESP32 物聯網裝置:狀態、GPIO 讀寫、ADC 取樣、原始指令與重新開機。

功能
為執行輕量 MicroPython REST 韌體的 ESP32 提供六個工具:esp32.status 回報上線狀態、晶片、可用堆積記憶體與運作時間;esp32.gpio_set 將某個 GPIO 設為高或低;esp32.gpio_read 讀取數位腳位;esp32.adc_read 回傳類比電壓(毫伏);esp32.send_command 送出原始 AT 或應用指令;esp32.reboot 重新啟動裝置。此伺服器在本機執行,透過 HTTP 與裝置通訊,區網與遠端皆可使用。
適用情境
當你希望 Claude Desktop、Cursor 等 AI 用戶端直接檢視或操作實體 ESP32 開發板時使用,例如切換腳位電位、取樣類比輸入、檢查裝置健康狀態或重新開機,而不必開啟序列埠終端機或自行撰寫指令碼。
執行需求
本機 Python 執行環境並安裝 esp32-mcp 套件,以及一台已刷入本專案 MicroPython 韌體、提供 REST API 的 ESP32。裝置位址以環境變數 ESP32_HOST 設定(預設 ESP32_TIMEOUT 設定。裝置本身的 WiFi 熱點使用預設密碼,應予變更。
安裝前請注意
此伺服器會改變硬體狀態:esp32.gpio_set 會驅動實際腳位,esp32.send_command 會把原始指令傳給裝置,esp32.reboot 會重新啟動裝置,操作失誤會影響真實硬體。預設僅允許寫入腳位 2、4、5、18、19。韌體預設熱點密碼較弱,README 提醒在將裝置暴露到網際網路前先變更。專案提供付費 Pro 版本,但免費版已包含六個核心工具。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 ESP32 Control,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ESP32 MCP Server

Control and read ESP32 IoT devices directly from AI agents (Claude, Cursor, any MCP client).

  • esp32.status — online / chip / free heap / uptime
  • esp32.gpio_set — set a GPIO high/low
  • esp32.gpio_read — read a digital pin
  • esp32.adc_read — read analog voltage (mV)
  • esp32.send_command — raw AT/application command
  • esp32.reboot — reboot the device

Architecture

AI agent (Claude/Cursor)  →  this MCP server (Python)  →  ESP32 REST API  →  device

The ESP32 runs a tiny MicroPython firmware (esp32_firmware/main.py) exposing a lightweight REST API on port 80. The MCP server talks to it over HTTP — works locally and remotely.

Quick start

1. Flash the ESP32 firmware

  1. Install MicroPython on your ESP32.
  2. Upload esp32_firmware/main.py as main.py (Thonny or mpremote).
  3. Power on — the device opens a WiFi AP named ESP32-MCP (password 12345678) or you can set STA mode inside the firmware to join your network.

2. Run the MCP server

bash
pip install esp32-mcpexport ESP32_HOST=http://192.168.4.1     # device address (AP default)esp32-mcp                                  # stdio transport (local MCP client)

For remote agents, run with HTTP transport:

bash
uv run esp32-mcp --transport http --port 8000

3. Add to your AI client

Claude Desktop (claude_desktop_config.json):

json
{  "mcpServers": {    "esp32": {      "command": "esp32-mcp",      "env": { "ESP32_HOST": "http://192.168.4.1" }    }  }}

Cursor: Settings → MCP → Add server → esp32-mcp with env ESP32_HOST.

Then just ask: "turn GPIO 2 on", "what's the ADC reading on pin 34?", "reboot the device".

Configuration

Env varDefaultMeaning
ESP32_HOSThttp://192.168.4.1ESP32 REST endpoint
ESP32_TIMEOUT8request timeout (s)

Safety

  • GPIO outputs are limited to pins 2, 4, 5, 18, 19 by default (edit GPIO_OUT in the firmware to change).
  • The firmware only listens on its own network; change the AP password before exposing to the internet.

Pricing

PlanPriceWhat you get
Free$0All 6 core tools, single device
Pro$9/mo or $90/yrMulti-device, history, batch control, OTA, webhooks

Free is not a trial — core tools work forever. Upgrade when you need scale.

License

MIT

來源:README.md,提交 2e603b9

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v0.1.0最新Oct 8, 2026