Getting Started
This guide walks you through installing mcesptool, adding it to Claude Code, and verifying connectivity with an ESP device. The whole process takes about five minutes.
Prerequisites
Section titled “Prerequisites”- Python 3.10 or later — mcesptool uses modern type annotations and async features
- esptool installed and available on your
PATH(ships with ESP-IDF, or install standalone viapip install esptool) - An ESP32 or ESP8266 device connected over USB, or willingness to use QEMU emulation instead
Installation
Section titled “Installation”-
Install mcesptool
The fastest way to run the server is with
uvx, which downloads and runs the package in an isolated environment:Terminal window uvx mcesptoolTo add it as a project dependency instead:
Terminal window uv add mcesptool -
Add to Claude Code
Register mcesptool as an MCP server so Claude Code can invoke its tools:
Terminal window claude mcp add mcesptool -- uvx mcesptoolTerminal window claude mcp add mcesptool -- uv run --directory /path/to/mcp-esptool mcesptool -
Verify esptool is available
mcesptool shells out to
esptoolfor all chip communication. Confirm it is installed:Terminal window which esptool.py && esptool.py versionTerminal window which esptool.py && esptool.py versionTerminal window where esptool.pyesptool.py version -
Connect your device
Plug in your ESP board over USB. On Linux, the device typically appears at
/dev/ttyUSB0or/dev/ttyACM0. On macOS, look for/dev/cu.usbserial-*or/dev/cu.SLAB_USBtoUART.Terminal window ls /dev/ttyUSB* /dev/ttyACM* 2>/dev/nullIf the port exists but is not accessible, add yourself to the
dialoutgroup:Terminal window sudo usermod -aG dialout $USERLog out and back in for the group change to take effect.
Terminal window ls /dev/cu.usb*macOS generally does not require extra permissions for USB serial devices. If you see no devices, install the appropriate USB-to-UART driver for your board (CP210x or CH340).
Open Device Manager and look under Ports (COM & LPT) for a COM port. Note the port number (e.g.,
COM3). You may need to install the CP210x or CH340 driver from your board manufacturer. -
Detect your chip
Use
esp_detect_chipto confirm mcesptool can communicate with the device:# MCP tool invocationesp_detect_chip(port="/dev/ttyUSB0")A successful response looks like:
{"success": true,"port": "/dev/ttyUSB0","baud_rate": 115200,"connection_time_seconds": 0.84,"chip_info": {"chip_type": "ESP32-S3","mac_address": "dc:da:0c:xx:xx:xx"}}For more detail, pass
detailed=Trueto include flash size, crystal frequency, and feature flags:esp_detect_chip(port="/dev/ttyUSB0", detailed=True)
Troubleshooting
Section titled “Troubleshooting”If esp_detect_chip fails:
- “No ESP devices found” — check your USB cable. Some cables are charge-only and do not carry data.
- Permission denied — on Linux, ensure your user is in the
dialoutgroup (see step 4 above). - Timeout — hold the BOOT button on your board while the tool connects, then release. Some boards require manual bootloader entry.
Run esp_scan_ports() to see all detected serial ports and their status.
Next steps
Section titled “Next steps”- First Flash — flash firmware to a device end-to-end
- First QEMU Session — create a virtual ESP32 without any hardware