esp-runtime-mcp
Provides runtime-side tools for ESP-IDF/Espressif development, enabling capture and analysis of device console logs, automatic crash parsing and symbolization, address decoding, coredump reading, device reset, and serial port discovery after firmware flashing.
Click on "Deploy 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-runtime-mcpreset the board and capture the boot log, tell me if it crashes"
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-runtime-mcp
MCP server for the runtime side of ESP-IDF development: what happens on the chip after flashing.
ESP-IDF 6.0 ships an official MCP server (idf.py mcp-server) with set_target, build_project, flash_project and clean_project. Other community servers cover the same build/flash ground. None of them let the agent read the console, so the agent can flash firmware but cannot see that it crashed. This server closes the loop:
edit -> build -> flash (idf.py mcp-server)
-> capture_log(reset, expect) (this server: did it boot and reach the expected state?)
-> crash? decoded backtrace (this server: file:line, inlining, fault address)
-> fix -> ...Tools
Tool | What it does |
| Reads the console until all |
| Parses a log the user pasted, or the last capture, without hardware. |
| Runs addr2line on any text containing addresses, such as a |
| Runs |
| Sends an RTS→EN reset pulse, holding IO0 high so the chip boots the app. |
| Lists serial ports and flags the likely ESP bridges: Espressif USB, CP210x, CH340/CH9102 and FTDI. |
Crash parser coverage
Guru Meditation on Xtensa (PC / EXCVADDR /
PC:SPbacktrace) and RISC-V (MEPC / RA / MTVAL). Includes IWDT and stack-canary debug exceptions.abort(),assert failed(both the IDF ≥5 and newlib formats), andESP_ERROR_CHECKwith file, line, function and expression. A trailingabort()is merged into the same event.FreeRTOS stack overflow hook, heap corruption and brownout.
Task WDT, keeping a separate backtrace for each CPU.
ROM reset reasons (
rst:0xc (SW_CPU_RESET)) and reboot loops; each crash in a loop becomes its own event.RISC-V without EH-frame backtraces: words from the stack dump that fall in code address ranges are offered as candidates and labelled as a heuristic.
Related MCP server: silotek-serial-mcp
Design notes
Port I/O. pyserial is blocking, so the read loop runs in a worker thread behind an async API. Each port has its own lock, so two tools never read the same UART at once. Ports are opened with
serial_for_url, which meansrfc2217://host:portworks for boards connected to another machine.Line handling. Reads use a ring buffer, and the result reports how many lines were dropped. Chunked reads are split into lines correctly, and ANSI colour codes are stripped.
Stopping after a crash. The panic message is only the start of the crash output: the register dump and backtrace come after it. Capture therefore continues until
Rebooting...or a 1.5 s grace period (for builds configured to halt on panic).Symbolisation. The architecture comes from
e_machinein the ELF header. The tool is then looked up in this order:xtensa-esp-elf-addr2line/riscv32-esp-elf-addr2line, then$IDF_TOOLS_PATH, thenllvm-addr2line. Results are cached per ELF modification time, so a reboot loop costs a single addr2line call.ESP-IDF conventions. The defaults follow
$ESPPORTand$ESPBAUD. The ELF path is taken frombuild/project_description.json.
Install
pip install -e ".[coredump]"Claude Code / Cursor config (run with ESP-IDF activated so the toolchain is on PATH):
{
"mcpServers": {
"esp-idf": { "command": "eim", "args": ["run", "idf.py mcp-server"] },
"esp-runtime": {
"command": "esp-runtime-mcp",
"env": { "ESPPORT": "/dev/ttyUSB0", "ESP_RUNTIME_PROJECT_DIR": "/path/to/project" }
}
}
}Tests
pip install -e ".[dev]" && pytestThe tests need no hardware and no Espressif toolchain:
The parser is tested against recorded crash logs in
tests/fixtures.The capture loop is tested through pyserial's
loop://device, with data fed in chunks the way a real UART delivers it.The addr2line path is tested end to end on a host-compiled ELF.
The MCP tools are tested through an in-memory MCP client.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
- SuperlogOAuthsh.superlog
Open-source agent that observes and fixes your application. Query logs, traces, metrics, incidents.
AI agent observability for production traces, natural-language insights, and improvement loops.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Ingest and search LogsLoom logs from coding agents.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceProvides serial debugging for embedded Linux targets, enabling boot log capture, automatic login, crash detection, U-Boot interrupt, and hardware reset via MCP protocol.-
- FlicenseAqualityDmaintenanceA headless MCP server that enables AI tools (like Claude Code) to read and analyze serial logs from embedded boards (ESP32, STM32) for firmware debugging, with read-only tools for log retrieval and a built-in web viewer.61-
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to build, flash, and monitor ESP-IDF projects on real hardware, including serial sessions and pytest-embedded hardware tests.1MIT
- AlicenseAqualityAmaintenanceEnables AI assistants to spawn and control persistent local shells, SSH sessions, REPLs, debuggers, and serial/UART devices with zero-loss output capture, timestamped history, and atomic expect matching for command execution and prompt synchronization.1218 PyPIMIT