
ESP32 Control
com.pixharvestv0.1.0更新于 Oct 8, 2026
Control ESP32 IoT devices from AI agents: status, GPIO, ADC, reboot.
概览
让助手通过 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 热点使用默认密码,应当修改。
安装
在 SourceWeft 中
- 打开 控制台中的 ESP32 Control,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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 / uptimeesp32.gpio_set— set a GPIO high/lowesp32.gpio_read— read a digital pinesp32.adc_read— read analog voltage (mV)esp32.send_command— raw AT/application commandesp32.reboot— reboot the device
Architecture
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
- Install MicroPython on your ESP32.
- Upload
esp32_firmware/main.pyasmain.py(Thonny ormpremote). - Power on — the device opens a WiFi AP named
ESP32-MCP(password12345678) or you can set STA mode inside the firmware to join your network.
2. Run the MCP server
For remote agents, run with HTTP transport:
3. Add to your AI client
Claude Desktop (claude_desktop_config.json):
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
Safety
- GPIO outputs are limited to pins
2, 4, 5, 18, 19by default (editGPIO_OUTin the firmware to change). - The firmware only listens on its own network; change the AP password before exposing to the internet.
Pricing
Free is not a trial — core tools work forever. Upgrade when you need scale.
License
MIT
来源:README.md,提交 2e603b9
工具
0版本历史
1- v0.1.0最新Oct 8, 2026


