embedded-debugger-mcp

作者 Adancurusul已验证

MCP server + CLI + Codex/Claude skill for embedded debugging via probe-rs or OpenOCD — ARM Cortex-M, RISC-V, and Xtensa (ESP32), with AI crash diagnosis

152
Stars
26
Forks
Rust
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/Adancurusul/embedded-debugger-mcp

快速入门

使用 embedded-debugger-mcp 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

Embedded Debugger MCP Server

Rust RMCP License

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 | 中文

What It Provides

  • One MCP tool set over two interchangeable backends (probe-rs native, or OpenOCD via GDB RSP), chosen at connect. Validated on real ESP32-S3.
  • MCP tools for probe discovery, target connection, core control, memory access, breakpoints, flash programming, RTT communication, and crash diagnosis (diagnose_fault, unwind_exception).
  • CLI commands for environment checks, configuration inspection, probe listing, MCP serving, and skill prompt handoff.
  • A Codex/Claude Code compatible skill at skills/embedded-debugger.
  • Release checks covering rustfmt, clippy, tests, docs, packaging, and the STM32 demo build.

Architecture

MCP client or CLI
        |
        v
embedded-debugger-mcp  (one MCP tool set)
        |
        v
DebugBackend:  probe-rs (native)  |  OpenOCD (GDB RSP)
        |
        v
debug probe / openocd  ->  target MCU

Requirements

  • Rust stable toolchain.
  • A probe-rs compatible debug probe such as ST-Link, J-Link, DAPLink, Black Magic Probe, or a supported FTDI-based probe. Alternatively, a running openocd exposing its GDB port (e.g. openocd-esp32 for ESP32) to use the openocd backend.
  • A supported target chip and working SWD/JTAG wiring for hardware operations.
  • Nightly Rust plus rust-src for the bundled STM32 demo firmware check.

Build

git clone https://github.com/adancurusul/embedded-debugger-mcp.git
cd embedded-debugger-mcp
cargo build --release

The binary is target/release/embedded-debugger-mcp.

MCP Mode

Run the server explicitly:

embedded-debugger-mcp serve

For compatibility, running embedded-debugger-mcp without a subcommand also serves MCP over stdio.

Example MCP client configuration:

{
  "mcpServers": {
    "embedded-debugger": {
      "command": "/path/to/embedded-debugger-mcp/target/release/embedded-debugger-mcp",
      "args": ["serve"],
      "env": {
        "RUST_LOG": "info"
      }
    }
  }
}

On Windows, use the .exe path and Windows path separators.

CLI And Skill Mode

CLI mode is useful for setup checks, automation, and agent workflows before an MCP client is configured.

embedded-debugger-mcp doctor
embedded-debugger-mcp doctor --json
embedded-debugger-mcp probes list
embedded-debugger-mcp probes list --json
embedded-debugger-mcp config generate
embedded-debugger-mcp config validate
embedded-debugger-mcp config show
embedded-debugger-mcp skill print-prompt
embedded-debugger-mcp skill install --target both

The bundled skill lives in:

skills/embedded-debugger/

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:

embedded-debugger-mcp skill install --target both

Preview or automate the install with JSON:

embedded-debugger-mcp skill install --target both --dry-run --json
embedded-debugger-mcp skill install --target both --force --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:

Use $embedded-debugger to inspect my embedded target setup.

Load the installed Claude Code plugin package:

claude --plugin-dir ~/.claude/plugins/local/embedded-debugger-mcp --print '/embedded-debugger inspect my embedded target setup'

For skill-only environments, the same skills/embedded-debugger directory can also be copied to a local skills directory.

Validate the skill package:

python3 .github/scripts/validate_skill.py skills/embedded-debugger
python3 ~/.codex/skills/.system/skill-creator/scripts/quick_validate.py skills/embedded-debugger
claude plugin validate .
embedded-debugger-mcp skill install --target both --home /tmp/embedded-debugger-skill-home --force --json

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.

Backends

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.

MCP Tool Set

Probe management:

ToolPurpose
list_probesDiscover connected debug probes.
connectOpen a probe session for a target chip.
probe_infoShow active session information.

Target control:

ToolPurpose
haltHalt core execution.
runResume execution.
resetReset the core. Only the implemented hardware-style reset path is accepted.
stepSingle-step one instruction.
get_statusRead core/session status.
disconnectDrop the session and clean up resources.

Memory and breakpoints:

ToolPurpose
read_memoryRead target memory with configured size/range limits.
write_memoryWrite target memory when enabled by configuration.
set_breakpointSet a hardware breakpoint.
clear_breakpointClear a hardware breakpoint.

Diagnostics:

ToolPurpose
diagnose_faultRead 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_exceptionUnwind 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:

ToolPurpose
flash_eraseErase flash when erase permissions are enabled.
flash_programProgram ELF, HEX, or BIN files through probe-rs flash algorithms.
flash_verifyCompare raw expected data with target flash contents.
run_firmwareErase, program, reset/run, and optionally attach RTT.

RTT:

ToolPurpose
rtt_attachAttach to a SEGGER RTT control block.
rtt_detachDetach RTT.
rtt_channelsList discovered RTT channels.
rtt_readRead from an up channel with max byte and timeout limits.
rtt_writeWrite to a down channel.

Crash Diagnosis

After a crash, halt the core and let the model reason over the evidence:

  1. 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.
  2. 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.

Safety Notes

  • Flash erase is disabled unless security.allow_flash_erase or flash.allow_erase is enabled.
  • Memory writes are controlled by security.allow_memory_write.
  • Optional memory range restriction uses target memory regions in the configuration.
  • Firmware file paths are canonicalized, checked against security.allowed_file_paths when configured, and checked against size limits.
  • Sector erase by arbitrary address is rejected until target-specific sector mapping is implemented.
  • flash_verify supports raw data comparison. Use raw BIN files or hex data for file-based verification.

Generate a starting configuration:

embedded-debugger-mcp config generate > embedded-debugger.toml
embedded-debugger-mcp --config embedded-debugger.toml config validate

STM32 Demo

The STM32 RTT demo is in examples/STM32_demo.

cd examples/STM32_demo
CARGO_TARGET_DIR=/tmp/embedded-debugger-mcp-stm32-target cargo +nightly check --locked

The demo firmware shows multi-channel RTT communication and is intended as a hardware validation aid. See examples/STM32_demo/README.md.

Release Checks

Run these before cutting a release:

cargo fmt --all -- --check
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo test --locked --all-targets --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --locked --all-features --no-deps
cargo package --locked
python3 .github/scripts/validate_skill.py skills/embedded-debugger
claude plugin validate .
embedded-debugger-mcp skill install --target both --home /tmp/embedded-debugger-skill-home --force --json
(cd examples/STM32_demo && CARGO_TARGET_DIR=/tmp/embedded-debugger-mcp-stm32-target cargo +nightly check --locked)

Acknowledgments

  • probe-rs for embedded debug probe support.
  • rmcp for the Rust MCP SDK.
  • tokio for the async runtime.

License

This project is licensed under the MIT License. See LICENSE.

常见问题

What is embedded-debugger-mcp?

embedded-debugger-mcp is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Adancurusul. MCP server + CLI + Codex/Claude skill for embedded debugging via probe-rs or OpenOCD — ARM Cortex-M, RISC-V, and Xtensa (ESP32), with AI crash diagnosis. It has 152 GitHub stars.

Is embedded-debugger-mcp safe to use?

Yes. embedded-debugger-mcp passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install embedded-debugger-mcp?

Clone the repository with "git clone https://github.com/Adancurusul/embedded-debugger-mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is embedded-debugger-mcp written in?

embedded-debugger-mcp is primarily written in Rust. It is open-source under Adancurusul on GitHub, so you can review or fork the full source.

Are there alternatives to embedded-debugger-mcp?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh embedded-debugger-mcp against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情