stm32-gdb-mcp
MCP server that lets AI agents debug STM32 firmware on real hardware (GDB + OpenOCD/ST-Link/J-Link): HardFault triage, FreeRTOS, SWO/RTT, decoded structured results.
Install / Use
claude mcp add Zeraissh -- npx -y github:Zeraissh/stm32-gdb-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of stm32-gdb-mcp
stm32-gdb-mcp scores 83/100 on our quality scale, 2991st of 4,632 Development & Engineering skills we index.
Its MCP Server is 23 KB long, well organised into 16 sections with 12 code examples: a thorough specification that gives an agent plenty to work with.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 14 days ago, so stm32-gdb-mcp is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-11-07. Automated pattern scan on 2026-11-07. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
stm32-gdb-mcp compared with similar skills
All 4 of these similar skills score higher than stm32-gdb-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| stm32-gdb-mcp (this skill)by Zeraissh | 83 | 3 | 14d ago | MCP Server |
| taste-skillby Leonxlnx | 100 | 111.4k | 2d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 109.8k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.1k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 70.2k | 1d ago | CLAUDE.md |
Frequently asked questions
- How do I install stm32-gdb-mcp?
- Run
claude mcp add Zeraissh -- npx -y github:Zeraissh/stm32-gdb-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does stm32-gdb-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is stm32-gdb-mcp safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is stm32-gdb-mcp still maintained?
- The repository was last updated 14 days ago, so stm32-gdb-mcp is actively maintained.
Skill content
View source on GitHubSTM32 GDB MCP Server / STM32 GDB MCP 服务器
<!-- mcp-name: io.github.Zeraissh/stm32-gdb-mcp -->An MCP server that lets an AI agent debug STM32 firmware on real hardware — drive GDB + OpenOCD/ST-Link/J-Link to flash, breakpoint, inspect memory/registers/RTOS, triage HardFaults, and profile — and get back decoded, structured evidence instead of raw GDB text.
让 AI 智能体在真实硬件上调试 STM32:通过 GDB + OpenOCD/ST-Link/J-Link 烧录、打断点、查 内存/寄存器/RTOS、定位 HardFault、做性能采样,返回已解码的结构化证据而非原始 GDB 文本。
uvx stm32-gdb-mcp # any MCP client: command "uvx", args ["stm32-gdb-mcp"]
Needs arm-none-eabi-gdb (or gdb-multiarch) and a GDB server (OpenOCD / J-Link / st-util)
on PATH; stm32-gdb-mcp-check-env prints the install command for your OS. See
Install for one-command setup in Claude Code, Cursor, VSCode and others.
/ 需要 PATH 中有 arm-none-eabi-gdb(或 gdb-multiarch)和一种 GDB Server;
stm32-gdb-mcp-check-env 会给出本机系统的安装命令。各客户端的一键安装见下方 Install。
Why this server / 为什么选它
| | Generic GDB MCP servers / 通用 GDB MCP | probe-rs-based servers / 基于 probe-rs | stm32-gdb-mcp |
|---|---|---|---|
| Output / 返回内容 | Raw GDB text / 原始文本 | Structured / 结构化 | Decoded + suggested_next_actions / 解码结果 + 下一步建议 |
| HardFault → source line / 定位到源码 | — | ✓ | ✓ plus stack analysis / 附栈分析 |
| FreeRTOS tasks, stacks, queues / RTOS 感知 | — | — | ✓ |
| Peripheral registers decoded from SVD / SVD 外设解码 | — | — | ✓ |
| Logs / 日志 | — | RTT | RTT, SWO, UART |
| Symbolized PC sampling / 符号化采样 | — | — | ✓ |
| One-call bring-up (flash_and_run, debug_until) / 组合工具 | — | partial / 部分 | ✓ |
| Replay + debug report / 回放与报告 | — | — | ✓ |
| Multi-board rack, programmable USB hub / 多板与 USB Hub | — | — | ✓ |
| Probes / 调试器 | Any GDB remote | probe-rs probes | ST-Link, J-Link, CMSIS-DAP via OpenOCD / J-Link GDB Server / st-util |
| Targets / 目标芯片 | Any | Cortex-M, RISC-V, ESP32 | STM32 (Cortex-M) |
Pick a probe-rs-based server if you need RISC-V or ESP32; pick this one when you debug STM32 and want the agent to get from symptom to root cause with fewer calls. / 需要 RISC-V 或 ESP32 时选 probe-rs 系;调试 STM32、希望 agent 用更少调用从现象走到根因时选本项目。
What you get / 能力一览
| | |
|---|---|
| Bring-up & flash / 启动与烧录 | detect_probe, suggest_server_args, build_firmware, flash_and_run, self_check, reset_target |
| Execution / 执行控制 | run_and_wait(结构化停止事件), run_for_duration(运行/采样后暂停并采集), breakpoint, step, halt/continue, debug_until |
| Inspect / 状态检查(需暂停) | capture_state, read_memory/read_variable, read_registers, frame, read_peripheral_register |
| Fault triage / 故障诊断 | reconstruct_fault_context(故障 PC → 源码), diagnose_fault, analyze_stack |
| RTOS / 实时系统 | detect_rtos, read_freertos, snapshot(scope=rtos) |
| Observe / 可观测性 | logging(RTT/SWO/UART), setup_swo(无需额外解码器的 printf), sample_pc(符号化采样器) |
| Determinism / 可复现性 | run_scenario(回放), batch, get_session 日志/指标, export_debug_report |
| Multi-board / 多板卡 | 任意工具传 session="name";使用 list_sessions/close_session 管理 |
Two cross-cutting goals: low comprehension cost (decoded outputs, suggested_next_actions)
and minimal repro steps (composites like flash_and_run / debug_until collapse 5–15 calls
into one). Compact mode keeps the visible surface small; every tool remains reachable through
call(tool, args), and tool_help exposes hidden schemas.
两个贯穿目标是:通过解码结果和 suggested_next_actions 降低理解成本,并通过
flash_and_run、debug_until 等组合工具把多次调用压缩为一次,缩短复现路径。
compact 模式只展示核心工具;所有隐藏工具仍可由 call(tool, args) 调用,并可用
tool_help 查询完整说明与 schema。
Install / 安装
| Client | One command |
|---|---|
| Claude Code(工具 + skills + 常驻规则) | /plugin marketplace add Zeraissh/stm32-gdb-mcp,然后 /plugin install stm32-debug-kit@zeraissh-stm32 |
| Cursor / VSCode / Codex / Windsurf / Trae | python scripts/deploy.py --project "<firmware dir>" --ide vscode,cursor |
| Manual / 手动配置(任意 MCP 客户端) | pip install -e .,再将客户端指向 stm32-gdb-mcp |
deploy.py installs the server, writes the IDE's MCP config, and drops a project-aware rules
file into your firmware project. Per-client config snippets + the rules template are in
docs/install-ides.md. Compact mode is on by default.
PyPI/console installs also expose stm32-gdb-mcp-check-env, stm32-gdb-mcp-install,
and stm32-gdb-mcp-deploy.
deploy.py 会安装服务器、写入 IDE 的 MCP 配置,并在固件项目中生成带项目上下文的规则文件。
各客户端配置片段和规则模板见 docs/install-ides.md。默认启用 compact
模式;PyPI/console 安装还会提供上述三个辅助命令。
stm32-gdb-mcp-check-env --json also reports the imported module version/path, installed
distribution version, and all four console scripts. Use stm32-gdb-mcp-deploy --upgrade
when those installation fields drift. / stm32-gdb-mcp-check-env --json 还会报告当前导入
模块的版本/路径、已安装发行版本和四个 console script;这些安装字段发生漂移时,使用
stm32-gdb-mcp-deploy --upgrade 修复。
Requirements / 环境要求:PATH 中需要 arm-none-eabi-gdb(Debian/Ubuntu 上的
gdb-multiarch 也可以,或用 STM32_GDB_MCP_GDB 指定任意支持 ARM 的 GDB),以及至少一种 GDB
Server(openocd / JLinkGDBServerCL / st-util)。运行 stm32-gdb-mcp-check-env(或
python setup_env.py)检查;缺什么,它会打印本机系统(Windows scoop / macOS brew /
Linux apt、pacman)对应的一行安装命令。
Needs arm-none-eabi-gdb (or gdb-multiarch, or any ARM-capable GDB named by
STM32_GDB_MCP_GDB) plus one GDB server; stm32-gdb-mcp-check-env prints the install
command for whatever is missing on your OS.
What the plugin runs and connects to / 插件会运行和连接什么
The Claude Code plugin (stm32-debug-kit) runs everything locally on your machine:
- MCP server:
python scripts/run_mcp_server.py, which runs the server from this repository'ssrc/over stdio. The Python it runs under needs the dependencies inpyproject.toml(pip install -e .orpip install stm32-gdb-mcp). - SessionStart hook:
python hooks/session_start.pyprints a short banner into the session context. It reads nothing and sends nothing. - Processes it starts:
arm-none-eabi-gdb(or the GDB named above), a GDB server (openocd,JLinkGDBServerCLorst-util), and, when you ask it to build,cmake/make. They talk to the debug probe over USB and to each other over TCP onlocalhost. - Local ports: GDB server ports on
localhost; the optional USB hub daemon and dashboard serve on127.0.0.1only (default port 8765). Serial ports are opened only when a tool reads a UART log. - Files: it reads your firmware project (ELF, SVD, build files). It writes only where a
tool is told to (a debug report, a saved debug config), plus small lock and state files
under the system temp folder (
stm32-gdb-mcp/). - Network: nothing leaves your machine unless an agent calls
report_issue, which files a GitHub issue onZeraissh/stm32-gdb-mcpthrough your ownghCLI login. That issue contains the description the agent wrote, the MCP version and environment summary, and the session's tool journal and metrics. There is no telemetry.
Claude Code 插件(stm32-debug-kit)的所有内容都在本机运行:
- MCP 服务器:
python scripts/run_mcp_server.py,通过 stdio 运行本仓库src/中的服务器。 运行它的 Python 需要装好pyproject.toml中的依赖(pip install -e .或pip install stm32-gdb-mcp)。 - SessionStart hook:
python hooks/session_start.py只向会话上下文输出一段简短说明, 不读取也不发送任何数据。 - 启动的进程:
arm-none-eabi-gdb(或上文指定的 GDB)、GDB Server(openocd、JLinkGDBServerCL或st-util),以及按需构建时的cmake/make。它们通过 USB 连接调试器,彼此之间通过localhost上的 TCP 通信。 - 本地端口:GDB Server 端口只在
localhost;可选的 USB Hub 守护进程和看板只监听127.0.0.1(默认端口 8765)。只有在工具读取 UART 日志时才会打开串口。 - 文件:读取你的固件工程(ELF、SVD、构建文件)。只在工具指定的位置写文件(调试报告、
保存的调试配置),另外在系统临时目录的
stm32-gdb-mcp/下写少量锁文件和状态文件。 - 网络:除非 agent 调用
report_issue,否则不会有数据离开本机。report_issue会用你 本机ghCLI 的登录身份,在Zeraissh/stm32-gdb-mcp上提交一个 GitHub issue,内容包括 agent 写的描述、MCP 版本和环境摘要,以及本次会话的工具调用记录和指标。没有任何遥测。
30-second quickstart / 快速上手
detect_probe() # USB evidence; auto-select only one probe
debug_profile(action=set, mcu="STM32L431", probe="stlink", elf_path="build/app.elf", svd_path="STM32L4.svd")
suggest_server_args(mcu="STM32L431") # probe omitted -> use profile probe
start_debug_session(server_type="openocd") # server_args omitted -> infer from profile mcu/probe
self_check() # ALWAYS first: byte order, core, family
flash_and_run(file_path="build/app.elf", run_to="main")
breakpoint(action=set, location="my_func", condition="state == BAD")
run_and_wait() # structured stop event + next actions
run_for_duration(duration_sec=30, capture={"expressions": ["rx_count"]})
run_for_duration(duration_sec=60, sample={"interval_ms": 500, "expressions": ["rx_count", "state"]})
reconstruct_fault_context() # on a crash: faulting PC → file:line
detect_probe reads physical USB devices, keeps serials for identical probes, and never
chooses between multiple connected probes. / detect_probe 读取真实 USB 设备,同型号探针按
序列号分别保留;连接多个探针时绝不会擅自选择。
The full tool reference (lean families with action=/what=) is
skills/stm32-debug/reference/tool-map.md. The server
also ships always-on instructions, so any MCP client gets the debug loop without setup.
完整工具索引见 skills/stm32-debug/reference/tool-map.md,
其中按 action= / what= 归并工具族。服务器还会发送常驻 instructions,因此任意 MCP
客户端连接后都能获得同一套调试闭环。
Key rules (the target must cooperate) / 关键规则
- Reads need a HALTED core. If a read says
target_unresponsive,halt_executionfirst. / 读取要求内核已暂停。 若返回target_unresponsive,先执行halt_execution。 run_for_duration(sample=...)is best-effort low-rate debugger polling. It does not halt the target itself, but running-target expression reads may fail on some probes/MCUs; use SWO/ring-buffer firmware telemetry for higher-rate or guaranteed capture. /run_for_duration(sample=...)是尽力而为的低速调试器轮询;某些探针或 MCU 无法在运行中读取 表达式。需要更高采样率或可靠采集时,请使用 SWO 或固件环形缓冲。- A breakpoint TIMEOUT means the path was NOT reached — don't just retry. Halt,
capture_state,breakpoint(action=list)(hit_count=0 confirms), read the gating flag, set an earlier breakpoint or drive the precondition. / 断点超时表示路径没有到达。 不要原样重试;暂停后采集状态、确认 命中次数、读取门控条件,再前移断点或驱动前置条件。 - Writes are guarded (option bytes/IWDG/WWDG blocked) —
write_guard(action=policy)to allow. / 写操作受保护。 option bytes、IWDG、WWDG 默认禁止,需用write_guard(action=policy)显式放行。 - Never hard-kill OpenOCD (wedges the ST-Link USB) — use
recover_session. SWD is exclusive. / 不要强杀 OpenOCD。 使用recover_session;同一探针的 SWD 调试连接是独占的。 - A wedged probe needs a physical re-enumeration. With the optional
[hub]extra and a SmartUSBHub,hub(action=power)cuts VBUS andhub(action=data)drops the USB data lines, so that re-plug becomes a tool call. Without a hub it is still a hum
Truncated for display — read the full file on GitHub.
Related Skills
taste-skill
111.4kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
109.8kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
79.1kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
70.2kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
