esp-idf-mcp
Enables AI agents to build, flash, and monitor ESP-IDF projects on Espressif hardware, manage device targets and dependencies, interact with serial sessions, and run hardware-in-the-loop tests.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@esp-idf-mcpBuild the current project, flash it to my ESP32-S3, and monitor the boot logs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
esp-idf-mcp
A Model Context Protocol (MCP) server that lets AI agents build, flash, and monitor ESP-IDF projects on real hardware — end to end, from source code to boot logs.
Instead of an agent only being able to write firmware code, this server closes the loop: compile → flash over serial → capture boot logs → run pytest-embedded hardware tests — all without leaving the agent's tool set.
Features
Build without idf.py boilerplate — configures with CMake and builds with Ninja directly; only reconfigures when
CMakeCache.txtis missing.Flash + auto-monitor in one call — flashes with
esptool(readsbuild/flash_args), waits out the hard-reset boot, then optionally opens the serial port, resets the board, and collects logs. Closes monitor sessions holding the port first, so flashing never deadlocks on a busy COM port.Session-based serial monitor —
monitor_open/monitor_read/monitor_send/monitor_close: a persistent, non-blocking session you poll for new lines only, with regex-basedwait_forearly return.One-shot log capture —
serial_start: open, reset, collect a boot window (or wait for a regex likeerror|panic|Guru Meditation), return, auto-close.Agent-friendly output — strips ANSI color escapes, collapses repeated lines (
(xN)) to save tokens, keeps only the relevant tail of long build logs.Survives USB re-enumeration — after a reset the port can disappear and come back (ESP32-S2/USB-OTG); the read loop reconnects for up to 10 s and clears stale buffered logs.
Hardware-in-the-loop tests — runs
pytest-embeddedsuites against the real board.
Includes a Windows usbser.sys workaround (RTS-only control transfers need a DTR re-assert) so reset works on USB-CDC ports as well as CH340-style adapters.
Related MCP server: esp-mcp
Tools
Tool | Purpose |
| CMake configure (if needed) + Ninja build |
| esptool flash, optional auto serial monitor with |
|
|
| Manage ESP component manager dependencies in |
| Incremental clean or fullclean |
| Persistent interactive serial session |
| One-shot capture: open → reset → collect → close |
| Run |
| List connected serial ports |
Requirements
ESP-IDF (developed against v6.0.2 on Windows; other versions/OSes should work if the env vars below point at your install)
Python ≥ 3.9 with
mcpandpyserialAn MCP client (ZCode, Claude Desktop, Cursor, …)
Setup
Option A — install as a package
pip install .Option B — run the single file directly
Just point your MCP client at esp_idf_mcp.py with any Python that has mcp + pyserial installed (the ESP-IDF venv works well).
Register with your MCP client
{
"mcpServers": {
"esp-idf": {
"command": "python",
"args": ["C:\\path\\to\\esp_idf_mcp.py"]
}
}
}(or "command": "esp-idf-mcp" with no args if installed via pip)
Configuration
All paths are read from environment variables at startup and fall back to defaults for a standard Windows ESP-IDF install:
Env var | Default | Meaning |
|
| ESP-IDF framework root |
|
| ESP-IDF Python virtualenv |
|
| Version label |
|
| Enables the component manager ( |
Toolchain directories (xtensa/riscv GCC, CMake, Ninja, idf-exe) under C:\Espressif\tools are prepended to PATH when present and skipped when missing.
Typical agent workflow
set_target(esp32c2) → build_project → flash_project(monitor_baud=74880,
wait_for="ip_ready") → iterate on code → run_pytestLicense
MIT ——————反方向的K
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
Production-readiness for your AI coding agents.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables ESP-IDF firmware development through MCP by providing tools to manage ESP32 targets, serial ports, and project compilation/building operations.-
- FlicenseNot gradedqualityFmaintenanceAn MCP server for managing ESP-IDF workflows, enabling LLMs to build, flash, and test firmware for ESP32 and related microcontrollers. It provides tools for project creation, target configuration, and serial port management to simplify embedded development.156-
- AlicenseNot gradedqualityDmaintenanceEnables AI tools like Claude Code and Codex CLI to read and write serial port data, facilitating embedded development workflows such as coding, flashing, and debugging.25MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Arduino boards for compiling, uploading sketches, and serial communication.6MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Maty403/esp-idf-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server