The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Embedded Debugger MCP listing page.
Embedded Debugger MCP is a Rust server for embedded debugging through either probe-rs (native) or OpenOCD (via the GDB Remote Serial Protocol). It exposes a single MCP tool set for AI assistants — probe discovery, target control, memory, breakpoints, flash, RTT, and AI-facing crash diagnosis — plus a small CLI and bundled skill for a command-driven workflow without setting up an MCP client first.
Language versions: English | 中文
diagnose_fault, unwind_exception).skills/embedded-debugger.openocd exposing its GDB port (e.g. openocd-esp32 for ESP32) to use the
openocd backend.rust-src for the bundled STM32 demo firmware check.The binary is target/release/embedded-debugger-mcp.
Run the server explicitly:
For compatibility, running embedded-debugger-mcp without a subcommand also
serves MCP over stdio.
Example MCP client configuration:
On Windows, use the .exe path and Windows path separators.
CLI mode is useful for setup checks, automation, and agent workflows before an MCP client is configured.
The bundled skill lives in:
It is written as a plain Codex skill and is also packaged for Claude Code with
.claude-plugin/plugin.json. The skill starts with CLI checks and uses MCP
tools only when an MCP client is available.
Install the skill for Codex and Claude Code:
Preview or automate the install with JSON:
--target accepts codex, claude, or both. The command installs the Codex
skill under ~/.codex/skills/embedded-debugger, the Claude Code skill under
~/.claude/skills/embedded-debugger, and a local Claude plugin-dir package under
~/.claude/plugins/local/embedded-debugger-mcp. Existing directories are not
replaced unless --force is passed.
Trigger the Codex skill with a prompt such as:
Load the installed Claude Code plugin package:
For skill-only environments, the same skills/embedded-debugger directory can
also be copied to a local skills directory.
Validate the skill package:
The first command validates the repository skill metadata, the second validates
the standard SKILL.md layout when the Codex skill creator validator is
installed, and the third validates the Claude Code plugin manifest.
The tools run over one of two interchangeable engines, selected at connect:
backend: "probe-rs" (default) — native probe-rs; full flash and RTT support.backend: "openocd" (experimental) — connects to an already-running openocd
over its GDB port (openocd_address, default 127.0.0.1:3333) using the GDB
Remote Serial Protocol. Intended for targets probe-rs does not cover (e.g.
Xtensa ESP32 via openocd-esp32). Memory access and halt/run/step/reset are
validated on real ESP32-S3; flash and RTT are probe-rs only. Register reads
currently use ARM gdb register numbers, so PC/SP are wrong on Xtensa (known
limitation); diagnose_fault and unwind_exception are Cortex-M specific.
Start openocd with gdb_memory_map disable, otherwise it probes flash on the
GDB connect, fails, and rejects the connection — e.g.
openocd -f board/esp32s3-builtin.cfg -c "gdb_memory_map disable".The AI sees the same tool set for both; only connect arguments change.
Probe management:
| Tool | Purpose |
|---|---|
list_probes | Discover connected debug probes. |
connect | Open a probe session for a target chip. |
probe_info | Show active session information. |
Target control:
| Tool | Purpose |
|---|---|
halt | Halt core execution. |
run | Resume execution. |
reset | Reset the core. Only the implemented hardware-style reset path is accepted. |
step | Single-step one instruction. |
get_status | Read core/session status. |
disconnect | Drop the session and clean up resources. |
Memory and breakpoints:
| Tool | Purpose |
|---|---|
read_memory | Read target memory with configured size/range limits. |
write_memory | Write target memory when enabled by configuration. |
set_breakpoint | Set a hardware breakpoint. |
clear_breakpoint | Clear a hardware breakpoint. |
Diagnostics:
| Tool | Purpose |
|---|---|
diagnose_fault | Read the Cortex-M SCB fault registers (CFSR/HFSR/MMFAR/BFAR/SHCSR/CPUID) plus PC/SP/LR in one call and return a compact structured evidence bundle with the set fault bits. Reports raw evidence; it does not assert a root cause. Halt the target first. |
unwind_exception | Unwind the stack after a crash and map each frame to a source line. On the probe-rs backend, returns a full DWARF backtrace (function + file:line per frame) via probe-rs's own unwinder; on the OpenOCD backend, reads the Cortex-M exception stack frame and maps the faulting PC / caller LR to source lines. Needs elf_path to firmware built with debug info (.debug_line). |
Flash:
| Tool | Purpose |
|---|---|
flash_erase | Erase flash when erase permissions are enabled. |
flash_program | Program ELF, HEX, or BIN files through probe-rs flash algorithms. |
flash_verify | Compare raw expected data with target flash contents. |
run_firmware | Erase, program, reset/run, and optionally attach RTT. |
RTT:
| Tool | Purpose |
|---|---|
rtt_attach | Attach to a SEGGER RTT control block. |
rtt_detach | Detach RTT. |
rtt_channels | List discovered RTT channels. |
rtt_read | Read from an up channel with max byte and timeout limits. |
rtt_write | Write to a down channel. |
After a crash, halt the core and let the model reason over the evidence:
halt, then diagnose_fault — reads the Cortex-M SCB fault registers
(CFSR/HFSR/MMFAR/BFAR/SHCSR/CPUID) plus PC/SP/LR in one call and returns a
compact structured bundle with the set fault bits. It reports evidence; it
does not assert a root cause.unwind_exception with elf_path — maps the crash to source lines. On the
probe-rs backend this is a full DWARF backtrace (function + file:line per
frame); on the OpenOCD backend it reads the exception stack frame and maps
the faulting PC / caller LR.Both are Cortex-M specific (SCB registers, ARM exception frame) and do not apply
to Xtensa (ESP32) targets. The firmware must be built with debug info
(.debug_line) for source mapping.
security.allow_flash_erase or
flash.allow_erase is enabled.security.allow_memory_write.security.allowed_file_paths when configured, and checked against size
limits.flash_verify supports raw data comparison. Use raw BIN files or hex data for
file-based verification.Generate a starting configuration:
The STM32 RTT demo is in examples/STM32_demo.
The demo firmware shows multi-channel RTT communication and is intended as a hardware validation aid. See examples/STM32_demo/README.md.
Run these before cutting a release:
This project is licensed under the MIT License. See LICENSE.