STM32 GDB MCP Server
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., "@STM32 GDB MCP Server build and flash my firmware, then pause at main"
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.
STM32 GDB MCP Server / 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 + |
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 ( | — | 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 用更少调用从现象走到根因时选本项目。
Related MCP server: jlink-mcp
What you get / 能力一览
Bring-up & flash / 启动与烧录 |
|
Execution / 执行控制 |
|
Inspect / 状态检查(需暂停) |
|
Fault triage / 故障诊断 |
|
RTOS / 实时系统 |
|
Observe / 可观测性 |
|
Determinism / 可复现性 |
|
Multi-board / 多板卡 | 任意工具传 |
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 + 常驻规则) |
|
Cursor / VSCode / Codex / Windsurf / Trae |
|
Manual / 手动配置(任意 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:linedetect_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 human with a cable. / 卡死的探针必须物理重新枚举。 装上可选的[hub]extra 并接可编程 USB Hub 后,hub(action=power)可断 VBUS、hub(action=data)可断数据线,那次插拔就变成一次工具调用; 没有 Hub 时仍然只能靠人手拔插。
Programmable USB hub (optional) / 可编程 USB Hub(可选)
pip install 'stm32-gdb-mcp[hub]'Then point a session at its port (1-based, matching the hub's silkscreen):
{"action": "set", "hub": {"channel": 2, "guard": "confirm"}}hub(action=describe) is read-only and also reports per-port voltage/current on models
with an ADC. hub(action=power/data/cycle) requires confirm=true while the guard is in
its default confirm mode, and — in every mode, guard: allow included — whenever the
calling session's own GDB server is live on that port: cutting power mid-flash is how a
board becomes a brick. Note the scope: in local mode the check sees only the session
making the call, so it will not notice that a different session is mid-flash on that
channel. With the shared hub daemon (the default; see below) it sees every registered
session on every server.
Three entry points confirm on their own behalf, deliberately, because naming them is the
confirmation — and their decisions land in the same audit trail hub(action=describe)
returns. reset_target(strategy="cold") and recover_session's escalation ladder stop the
GDB session before the cut instead of yanking VBUS out from under it.
hub(action=discover) refuses outright while a session is live — except with
force=true, which bypasses the interlock entirely, so that flag is the one place you
are genuinely on your own. Set guard: allow for scripted CI. /
hub(action=describe) 是只读的,带 ADC 的型号还会返回每端口电压/电流。默认 confirm
模式下,hub(action=power/data/cycle) 必须显式传 confirm=true;调用方自己的会话在该端口
上有活跃 GDB 服务时,任何模式(含 guard: allow)下都强制要求——烧录中途断电正是把板子变砖的
方式。注意这条检查的范围:local 模式下它只看发起调用的那个会话,不会发现另一个会话正在该
通道上烧录;使用共享 Hub 守护进程时(默认,见下文)则能看到所有服务器登记的全部会话。
有三处入口会自行确认,这是刻意设计的——点名调用它们本身就是确认,且其决定同样进入
hub(action=describe) 返回的审计日志。reset_target(strategy="cold") 与 recover_session
的恢复阶梯会先停掉 GDB 会话再断电,而不是从活跃会话脚下拔掉 VBUS;hub(action=discover)
在有活跃会话时直接拒绝运行——但 force=true 会完全绕过该联锁,那是唯一真正需要你自己
负责的地方。CI 脚本可设 guard: allow。
Selecting a channel on a multi-board rack / 多板机架下的通道选择
hub: {channel: N} above pins one session to one port. With several boards, map the
whole rack once instead and let each session pick its own channel: /
上面的 hub: {channel: N} 把一个会话钉在一个端口上。多块板时改为一次性描述整个机架,
让每个会话各自选中自己的通道:
# bench_hub.yaml
hub:
port: COM7 # omit to auto-scan / 省略则自动扫描
guard: confirm
map:
3: {label: TC}
4: {label: AGS}{"action": "load", "path": "bench_hub.yaml"}Three things about this that are easy to get wrong: / 其中有三点很容易搞错:
A
labelis matched against the debug session name, exactly. It is not a free-form nickname: the channel is selected only when the session was started assession="TC". This is the only way to select a channel for a serial-less probe —hub(action=discover, apply=true)keys those by USB port, which identifies a channel but cannot select one. /label是与调试会话名精确比对的,不是自由昵称:只有会话以session="TC"启动时才会 选中该通道。对于无序列号的探针这是唯一可行的选择方式——hub(action=discover, apply=true)只能按 USB 端口给它们建 key,那能认出通道,却无法选中通道。The debug profile is per-session. Loading the config into one session does not make the map visible to another; the hub call then fails with
hub_unavailable: hub channel unmapped. Load it into each session:debug_config(action=load, path="bench_hub.yaml", session="TC"). The profile is also in-memory only, so this is re-run after every server restart. / 调试 profile 是按会话隔离的。 在一个会话里加载配置,另一个会话看不到该映射,此时 hub 调用会以hub_unavailable: hub channel unmapped失败。需要给每个会话都加载一次:debug_config(action=load, path="bench_hub.yaml", session="TC")。profile 还是纯内存的, 因此服务器每次重启后都要重新加载。setreplaces a nested block; it does not merge into it.debug_profile(action=set, hub={...})keeps every OTHER profile field, but thehubblock you pass replaces the stored one whole — so writinghub={map: {3: {label: TC}}}afterhub(action=discover, apply=true)throws away the probe identity discovery had written there, and a serial-less probe has no other identity. Passmerge=trueto deep-merge into the stored block instead; leave it off when you mean to drop a stale channel, because replacing is the only way to remove one. /set对嵌套块是整块替换,不是合并。 顶层其他字段会保留,但传入的hub块会整块覆盖已 存的内容——在hub(action=discover, apply=true)之后再写hub={map: {3: {label: TC}}}, 会把 discovery 写入的探针身份一并丢掉(无序列号探针没有别的身份可用)。需要合并请加merge=true;要删除过期通道则保持默认的替换语义,因为那是唯一的删除方式。
When it works, the result carries channel_source: "map_label" — check that field rather
than assuming the right port was chosen. /
生效时结果会带 channel_source: "map_label"——请以该字段为准,不要想当然认为选对了端口。
Several MCP servers on one rack / 多个 MCP 服务器共用一个 Hub
The hub's control port opens in one process at a time, so by default the first hub call
spawns a small hub daemon that owns it, and every MCP server talks to that instead.
Nothing changes in how you call hub(...). /
Hub 控制口同一时间只能被一个进程打开。因此默认情况下,第一次调用 hub 会拉起一个Hub 守护进程
独占它,所有 MCP 服务器都改为与守护进程通信;hub(...) 的用法完全不变。
Reads are shared. Writes lock only the channels they touch: a power cycle on CH1 never interleaves with another switch on CH1, but a switch on CH4 runs alongside it. Exclusive isolation locks the whole rack, and
hub(action=discover)holds a rack-wide lease for its whole run, so no other server's switch can corrupt the map. Waiting is FIFO among conflicting requests, so a rack-wide request is never starved. / 读取共享;写操作只锁住 涉及的通道:CH1 的电源循环不会与 CH1 上的其他开关交错,但 CH4 的操作可以同时进行。exclusive 隔离锁住整个机架;hub(action=discover)在整个运行期间持有全机架租约,其他服务器的开关无法 插入。冲突请求按先来后到排队,整机架请求不会被饿死。Each server's guard mode stays its own (
guard: allowon a CI server does not relax anyone else), and the audit trail records which server did what. / 每个服务器的 guard 模式各自独立,审计日志记录是哪台服务器执行的操作。What a server switched off is restored when it exits — or when the daemon finds its PID gone. / 某服务器断开的电源/数据线,在它退出(或守护进程发现其进程已消失)时自动恢复。
Cross-server interlock. Every server registers its sessions that have a
hubblock (after each tool call, plus a 2 s heartbeat). Cutting power or data on a channel where any server has a live GDB server needsconfirm=true, whatever the guard mode, and the refusal names that session and server.hub(action=discover)refuses while any server on the rack is live. A session with nohubblock cannot be mapped to a channel and so is not protected. / 跨服务器互锁:每个服务器都会登记带hub配置的会话(每次工具调用后 同步登记,另有 2 秒心跳)。只要任一服务器在该通道上有活跃 GDB,断电/断数据就必须confirm=true(与 guard 模式无关),拒绝信息会指出是哪个服务器的哪个会话;任一服务器有活跃 会话时hub(action=discover)拒绝运行。没有hub配置的会话无法映射到通道,因此不受保护。A write waits at most 30 s behind another server's write, then is refused (not run late) with the name of what held the hub; one that did wait reports
queued_ms. Every switch also invalidates every server'sdetect_probecache. / 写操作最多排队 30 秒,超时则拒绝执行 (而不是延后执行)并指出占用者;排过队的结果带queued_ms。每次切换都会让所有服务器的detect_probe缓存失效。The daemon exits after 10 idle minutes unless it still owes a channel. / 空闲 10 分钟且无待恢复通道时,守护进程自动退出。
python -m mcp_server.hub_daemon status # URL, version, connected servers
python -m mcp_server.hub_daemon stop # restores what clients switched off
python -m mcp_server.hub_daemon serve --config bench_hub.yaml # run it yourself, foregroundSTM32_GDB_MCP_HUB_MODE=auto (default) uses the daemon and falls back to in-process when
the [hub] extra is absent or the daemon cannot start; daemon never falls back; local
is the old single-process behaviour. Everything binds to 127.0.0.1; writes need the token
in the per-user state file. /
STM32_GDB_MCP_HUB_MODE=auto(默认)使用守护进程,未安装 [hub] extra 或守护进程无法启动时
退回进程内模式;daemon 不回退;local 为原来的单进程行为。全部仅监听 127.0.0.1,写操作需
要用户私有状态文件中的 token。
Live dashboard / 实时看板
hub(action=dashboard) # -> data.url, e.g. http://127.0.0.1:8765/A read-only page: per-port power/data state, live V/I/P with a 1/5/15-minute history
(power-off spans shaded), and a timeline of hub actions. With the daemon it is the
daemon's page, showing every connected MCP server and what each still owes; in local
mode it runs inside this server (state=off stops it) and lists its debug sessions. /
只读页面:各端口电源/数据线状态、电压电流功率及 1/5/15 分钟历史(断电区间灰色)、hub 操作时间线。
使用守护进程时就是守护进程的页面,显示所有已连接的 MCP 服务器及其待恢复通道;local 模式下
在本服务器内运行(state=off 停止),并列出本服务器的调试会话。
Response shape / 响应结构
Every tool returns a stable JSON envelope inside the MCP TextContent transport:
{ "ok": true, "data": {}, "error": null, "raw_response": null, "suggested_next_actions": [] }Human-readable text lives in data.message / error.message; raw GDB output stays in
raw_response when it aids diagnosis. Errors carry a code (e.g. target_unresponsive).
可读消息位于 data.message / error.message;仅在有助于诊断时保留原始 GDB 输出到
raw_response。错误包含稳定的 code,例如 target_unresponsive。现代 MCP 客户端还会收到
内容相同的原生 structuredContent,错误结果设置 isError=true。
Agent guidance — three layers / 三层引导
Inline / 内联 — most results carry
suggested_next_actions(the next loop step) / 大多数结果直接给出下一步动作。Always-on / 常驻 — the server's
instructionsinject automatically / 服务器自动注入调试闭环与关键规则。On-demand — skills:
stm32-debug(bring-up, HardFault, hang, minimal repro, replayable scenarios) andstm32-instrument(write-time SWO/ITM trace). In other IDEs the same guidance travels as a rules file (AGENTS.md). / 按需加载两项 skill;其他 IDE 通过AGENTS.md等规则文件获得同样指导。
Repeatable config / 可复现配置
Load a YAML debug profile so sessions reproduce across clients:
debug_config(action=load, path="mcp/board.yaml").
加载 YAML 调试 profile 可让不同客户端复现同一会话:
debug_config(action=load, path="mcp/board.yaml")。
mcu: STM32L431CCUx
probe: stlink
server_type: openocd
server_args: ["-f", "interface/stlink.cfg", "-f", "target/stm32l4x.cfg"]
elf_path: build/app.elf
svd_path: STM32L4.svdRelative elf_path, svd_path, project_root, and swo.file values are resolved from the
YAML file's directory. Session start, logging, reset, and flash tools then use the loaded
profile when their corresponding arguments are omitted.
相对的 elf_path、svd_path、project_root 和 swo.file 均以 YAML 所在目录为基准解析。
随后启动会话、日志、复位和烧录工具会在省略对应参数时自动使用该 profile。
Load the profile, connect, and run the mandatory identity check in one MCP round trip:
batch(steps=[
{"tool": "debug_config", "args": {"action": "load", "path": "mcp/board.yaml"}},
{"tool": "start_debug_session", "args": {}},
{"tool": "self_check", "args": {}}
], stop_on_error=true)以上配方在一次 MCP 往返中完成“加载配置 -> 连接 -> 自检”,任一步失败即停止。
See examples/configs/ for J-Link, OpenOCD, and non-flashing L151/L431/U535 HIL profiles. /
J-Link、OpenOCD 及不烧录的 L151/L431/U535 HIL 配置见 examples/configs/。
Develop / 开发
pip install -e ".[dev]"
python -m ruff check . && python -m pytest && python -m compileall src tests
python -m build && python scripts/check_dist_contents.py dist/*docs/install-ides.md— per-IDE install + rules template / 各 IDE 安装与规则模板docs/TROUBLESHOOTING.md— common failures + recovery / 常见故障与恢复docs/hil-validation.md— HIL validation / 硬件在环验证(STM32_GDB_MCP_HIL=1)CONTRIBUTING.md,SECURITY.md,docs/release.md
Hardware validation runs on a self-hosted runner labeled stm32; normal CI is hardware-free
(lint, tests, compile, packaging).
硬件验证运行在带 stm32 标签的自托管 runner;普通 CI 不依赖硬件,只执行 lint、测试、
编译检查和发行包验证。
Available Tools
86 toolsacceptance_loop_statusARead-onlyIdempotent
Read the acceptance loop's trajectory (per-iteration pass/fail counts, status) and the current decision without running an iteration.
Inputs: session.
analyze_stackARead-onlyIdempotent
Reports stack used/free bytes and a clear overflow verdict for the halted core. stack_top defaults to the initial MSP (first word of the vector table at vector_table_addr). Give stack_size or stack_limit for the overflow check (else only usage is reported). The key tool for diagnosing stack overflows.
Inputs: session, stack_top, stack_size, stack_limit, +1 more.
batchADestructive
Runs several tool calls in ONE round trip and returns ALL their full results — the fastest way to do a sequence of operations (e.g. read registers + backtrace + several variables) without per-call latency. ok is false if ANY step failed; data.succeeded/data.failed count the outcomes (count/total only count steps run vs requested). Pass session to run every step against a named debug session.
Inputs: steps (required), session, stop_on_error.
breakpointB
Breakpoint / watchpoint management. action=set(location[,condition,temporary,ignore_count]) | delete(breakpoint_id) | list | watch(location,access_type). access_type=r|w|a.
Inputs: action (required), session, location, condition, +4 more.
build_firmwareADestructive
Builds firmware with Keil uVision (UV4), CMake, make, or a custom command, so the AI can rebuild after a fix. Keil emits a .axf (ELF/DWARF) that the debug tools load like any .elf. Returns the exit code, success flag, and build log tail.
Inputs: kind (required), cwd, config, target, +8 more.
callADestructive
Invoke ANY stm32-gdb-mcp tool by name — including one that is NOT in your current tool list (clients with tool-count limits may hide some). Use this to reach e.g. start_debug_session when it isn't directly listed: call(tool='start_debug_session', args={...}). Returns that tool's result.
Inputs: tool (required), args, session.
call_readARead-onlyIdempotent
Like call, but restricted to tools that only READ state — so it needs no approval prompt where call, which can reach anything, does. Prefer it for hidden read-only tools: call_read(tool='read_core_registers', args={}). The gate is per-ACTION, not per-tool: a family's reading action goes through even though the family also writes, so call_read(tool='debug_profile', args={'action':'get'}) works while action='set' does not. A refusal names the actions it would accept. Refuses anything that writes; use call for those.
Inputs: tool (required), args, session.
capture_stateARead-onlyIdempotent
One-call 'where am I': decoded core registers + a PC/LR/SP summary, the decoded backtrace, and the innermost-frame locals. The fastest way to get full halted context.
Inputs: session.
clear_session_journalB
Clears the session journal (keeps the run-id).
Inputs: session.
close_sessionB
Closes a named debug session, tearing down its GDB client and server.
Inputs: session_id (required), session.
configure_debug_freezeADestructive
Freezes peripherals (IWDG, WWDG, RTC, timers) while the core is halted via the DBGMCU freeze registers, so the watchdog cannot reset the target out from under the debugger. Family is taken from the debug profile MCU if omitted.
Inputs: peripherals (required), apply, family, session.
continue_executionA
Resumes execution of the target device until the next breakpoint. Safe to call when the target is already running (reports already_running instead of erroring), so 'make sure it is running' is expressible.
Inputs: session.
coredumpC
Core-dump capture / load. action=capture(path) | load(path).
Inputs: action (required), path, session.
debug_configB
Debug-config file (.json) management. action=load(path) | save(path,config) | validate(config).
Inputs: action (required), path, config, session.
debug_profileA
Active debug profile (mcu/elf/svd/probe). action=get | set([mcu,elf_path,svd_path,board,probe,server_type,server_args,project_root,hub,notes,merge]). set merges at the TOP LEVEL ONLY: omitted fields keep their value, but a nested block you pass REPLACES the stored one whole — hub={map:{3:{label:TC}}} drops the rest of hub, including what hub(action=discover) wrote. merge=true deep-merges nested blocks instead; leave it off to DROP a stale entry, since replace is the only way to remove one. Returns the full resulting profile, which is in-memory only: empty again after the MCP server restarts.
Inputs: action (required), hub, mcu, board, +9 more.
debug_untilA
One-call repro step: set an optional conditional/temporary breakpoint at a location, run, and return the stop event PLUS the decoded backtrace and innermost-frame locals. Collapses set_breakpoint + run + read frame/vars into a single round-trip.
Inputs: location (required), session, condition, temporary, +2 more.
decode_peripheral_registerBRead-onlyIdempotent
Reads and decodes a peripheral register with SVD bitfield names and enumerated values.
Inputs: register (required), peripheral (required), session.
describe_acceptanceARead-onlyIdempotent
Read the loaded AcceptanceSpec or the last verdict. what=summary (name + check counts), checks (full check list), or last_result (the most recent run_acceptance report).
Inputs: what, session.
describe_boardARead-onlyIdempotent
Read the BoardDescription imported by import_netlist. what=summary (MCU + peripherals + counts), pins (full MCU pin map), nets, power (power/ground nets), or peripherals (distinct peripherals in use).
Inputs: what, session.
describe_frameworkARead-onlyIdempotent
Read the synthesized FrameworkPlan. what=summary (mcu + clocks + peripherals), clocks, gpio (per-pin config), peripherals (init blocks), init_order, or unresolved (the TODO holes that need target data or a design decision). Run design_framework first.
Inputs: what, session.
design_frameworkA
Synthesize a deterministic FrameworkPlan (Pillar D) from the session's imported board: which clocks to enable, how each pin must be muxed, and which peripheral init blocks to emit, in dependency order. Supply per-peripheral HAL .Init parameters via design={'USART1': {'baud': 115200, ...}} and optional AF numbers via af_map. Mandatory .Init members are auto-filled with HAL-standard defaults (a complete, valid init struct, not a half-initialized one) and a few are derived from the netlist (UART flow control from RTS/CTS pins, SPI NSS from an NSS pin); each field is tagged explicit/derived/default. Alternate-function numbers are also auto-derived from a pin-capability DB (db_path or the STM32_GDB_MCP_PIN_DB env) when its entries carry an 'af' field; an explicit af_map overrides the DB per pin. Anything that needs a human decision (baud, timer period, I2C timing) is surfaced as unresolved, never guessed. Import a netlist first (import_netlist).
Inputs: af_map, design, db_path, session, +1 more.
detect_probeARead-onlyIdempotent
Lists physical ST-Link, J-Link, and CMSIS-DAP probes currently connected over USB. Preserves serial numbers so multiple identical probes are never silently collapsed.
Inputs: session.
detect_rtosARead-onlyIdempotent
Detects whether FreeRTOS symbols are available in the current GDB session.
Inputs: session.
diagnose_faultBRead-onlyIdempotent
Reads and decodes Cortex-M fault registers into likely fault causes.
Inputs: session.
disassembleCRead-onlyIdempotent
Disassembles N instructions at a location (default $pc).
Inputs: session, location, instructions.
export_debug_reportA
Writes a single self-contained JSON report (journal + metrics + profile, optionally a state snapshot and a coredump) tied to the run-id, so a bug session is fully reproducible and shareable from one artifact.
Inputs: path (required), session, coredump_path, include_snapshot.
expressionsA
Evaluate C/GDB expressions. action=assert(assertions) | capture([expressions,table]) | compare(expressions,action). assertions=[{expression,expected[,operator]}]; table={index_range,columns}; compare runs 'action' between the two captures.
Inputs: action (required), table, session, assertions, +1 more.
flash_and_runADestructive
One-call bring-up: flash an ELF (loads symbols), reset-halt, set a temporary breakpoint at an entry point (default 'main'), run to it, and return the decoded stop context. With hub_channel (or usb_location) and no session running, it starts one pinned to that probe first -- so 'flash the firmware on channel 4' is this single call, on a bench with several probes, without disconnecting any of the others.
Inputs: file_path (required), mcu, run_to, session, +3 more.
flash_eraseADestructive
Erases a flash range on the target (OpenOCD 'flash erase_address pad'), rounding out to the driver's erase-sector boundaries. The recovery tool for a board that will not boot: clearing a corrupt OTA journal, a stale boot descriptor, or a half-written image. Requires an explicit address AND length — there is deliberately no mass-erase default.
Inputs: length (required), address (required), verify, session, +1 more.
flash_firmwareADestructive
Flashes a compiled firmware binary to the target. Accepts GCC .elf or Keil .axf. By default it then resets and RUNS the firmware (Keil-style 'Load + Run'). Pass reset_run=false to flash only (e.g. to set breakpoints before the firmware starts). Refuses (elf_layout_unsupported) an image GDB would flash incompletely, such as a Keil ARMCC5 AXF whose RW initializer lies outside its segment; flash its fromelf BIN instead.
Inputs: file_path (required), session, reset_run.
frameARead-onlyIdempotent
Stack-frame navigation. action=select(level) | source([location,count]) | variables([level,include_raw]). level 0 is the innermost frame.
Inputs: action (required), count, level, session, +2 more.
get_sessionARead-onlyIdempotent
Returns this session's record by view: 'journal' (every tool call with args/ok/summary/duration; supports limit), 'timeline' (compact human-readable replay), or 'metrics' (per-tool call counts, success/failure, durations).
Inputs: view, limit, session.
halt_executionC
Interrupts/halts the target device execution.
Inputs: session.
hubADestructive
Programmable USB hub: per-port power, USB2 data lines, cold boot, and V/I sampling. action=describe | power(state[,channel,confirm]) | data(state[,channel,exclusive,confirm]) | cycle([channel,off_ms,settle_ms,confirm]) | measure([channel,duration_sec,interval_sec,all_channels]) | discover([apply,force,settle_sec]) | dashboard([state,port,interval_sec,open_browser]). dashboard serves a read-only live web page on 127.0.0.1 and returns its URL. state=on|off; channel is 1-based and defaults to the session's mapped hub channel. Removing port power cold-boots that board and un-enumerates its probe.
Inputs: action (required), port, apply, force, +12 more.
import_netlistA
Parse a schematic netlist (KiCad .net today) into a machine-readable BoardDescription: the MCU part/family/line, a per-pin map (package pin -> port pin -> net -> inferred peripheral function), and the power/ground nets. This is the input contract for automated framework design. Pass 'path' or 'text'. The result is stored on the session; read views with describe_board.
Inputs: path, text, format, db_path, +1 more.
import_specA
Translate a controlled-vocabulary product spec (human/product terms) into the per-peripheral design params design_framework consumes, and cross-check it against the imported netlist. This is the upstream guard the pipeline lacked: instead of hand-writing HAL macros, supply intent -- UART framing '8N1', direction 'txrx', flow_control 'rtscts'; SPI role 'master', spi_mode 0..3, data_size, bit_order; I2C speed 'fast', addressing '7bit'; ADC resolution 12, conversion 'continuous'; a timer update_hz; plus dma / interrupt / priority opt-ins -- and the machine expands it deterministically (8E1 -> UART_WORDLENGTH_9B + UART_PARITY_EVEN, honoring HAL's parity-bit-in-word-length rule). A peripheral named in the spec but absent from the netlist is a conflict; an intent key or value the machine does not model is surfaced as unresolved -- never guessed. Then design_framework(from_spec=true) builds the plan from the translated params. Import a netlist first so the spec is cross-checked.
Inputs: spec, session.
inspect_projectBRead-onlyIdempotent
Discovers firmware project artifacts such as ELF, map, linker script, SVD, and STM32CubeMX .ioc metadata.
Inputs: session, project_root.
inspect_symbolARead-onlyIdempotent
Symbol / type introspection. what=size(expr) | type(expr) | address(symbol) | resolve(expr) | functions([regex]) | variables([regex]). resolve maps an address back to source, returning {resolved,symbol,offset,section,file,line}; resolved=false means no symbol there.
Inputs: what (required), expr, regex, symbol, +2 more.
list_sessionsARead-onlyIdempotent
Lists all debug target sessions (the 'default' one plus any named) with their liveness and port. To debug MULTIPLE boards at once, pass a 'session' argument (any string) to any tool — e.g. start_debug_session(session='rackA', ...) — and each gets fully isolated state.
Inputs: session.
load_acceptanceA
Load a machine-checked AcceptanceSpec (product-spec → deterministic checks) from an inline 'spec' object or a JSON 'path'. Checks: memory_u32 (any memory-mapped register), variable (C global), core_register, no_fault, stopped_at (PC in a symbol). Stored on the session; evaluate with run_acceptance.
Inputs: path, spec, session.
load_device_packA
Register a verified device-fact pack (Pillar F) so the deterministic solvers cover a new STM32 family: its DMA request routing, irregular NVIC vectors, clock PLL profile, and timer bus/width. Facts are DATA, never guessed -- STM32F4/L4 ship built-in; add a family by supplying a validated pack (schema 'stm32-device-pack/v1') via path= (a JSON file) or inline pack=. Call with no arguments to report current coverage. Honest by design: a malformed pack is rejected with the list of problems and never half-loaded; shadowing a built-in family needs allow_override=true.
Inputs: pack, path, session, allow_override.
load_svdC
Loads an SVD file for peripheral parsing.
Inputs: filepath (required), session.
load_symbolsA
Loads symbols from an ELF/AXF into the current GDB session WITHOUT flashing. Symbols are per-session, so after a fresh connect or recover_session you need this (or flash_firmware) before symbol breakpoints resolve. Falls back to the debug profile's elf_path if elf_path is omitted.
Inputs: session, elf_path.
loggingA
Firmware log capture over a channel. action=start(channel[,port,baudrate,command,args,file,timeout]) | stop(channel) | get(channel[,limit,since_index,clear]) | clear(channel). channel=rtt|swo|uart; uart takes port/baudrate, rtt/swo take command/args or file.
Inputs: action (required), args, file, port, +8 more.
mcp_infoARead-onlyIdempotent
Identifies THIS running stm32-gdb-mcp server: release version, git commit, the package directory the code was imported from (plus the install root the git probe used), whether compact mode is hiding tools, and how many tools this build advertises versus how many exist. Needs NO debug session, NO probe and NO target — call it the moment a tool you expect is missing or behaves like an older build, instead of guessing which checkout the client actually launched.
Inputs: session.
read_call_stackARead-onlyIdempotent
Reads the call stack as a decoded list of frames {level, func, file, line, addr} plus a one-line summary. Set include_raw=true to also get the raw GDB output.
Inputs: session, include_raw.
read_freertosARead-onlyIdempotent
Reads FreeRTOS state by 'what': 'current_task' (pxCurrentTCB), 'tasks' (ready list: names/priorities/TCB/stack), 'task_lists' (ready/delayed/suspended/deleted), 'queue' or 'mutex' (needs handle = a Queue_t expression), or 'heap' (heap_4/5 usage).
Inputs: what (required), handle, session, max_tasks, +1 more.
read_memoryARead-onlyIdempotent
Reads a block of memory from the target. Returns the raw bytes in memory order, plus value_le -- the same bytes as one little-endian value -- for a 1/2/4/8-byte read. Use value_le for a peripheral register: the raw string arrives least-significant-byte first, so reversing it by hand is where bit positions get misread.
Inputs: length (required), address (required), session.
read_peripheral_registerARead-onlyIdempotent
Reads a peripheral register using its name from the loaded SVD.
Inputs: register (required), peripheral (required), session.
read_registersBRead-onlyIdempotent
Read CPU register groups. what=core([include_raw]) | fault | cycle([enable]). fault decodes CFSR/HFSR; cycle reads the DWT cycle counter.
Inputs: what (required), enable, session, include_raw.
read_variableARead-onlyIdempotent
Reads the value of a C variable currently in scope.
Inputs: name (required), session.
reconstruct_fault_contextA
Reconstructs the full crash site after a HardFault: decodes fault registers, unwinds the auto-stacked exception frame from MSP/PSP via EXC_RETURN to recover the true faulting PC, and resolves it to source file:line. Run this when halted in a fault handler.
Inputs: session.
recover_sessionA
Recovers a dropped or wedged session: cleanly tears down the GDB client and server, then restarts the server (with retry/backoff for a busy probe) using the last start_debug_session arguments and reconnects. Use after a probe_unavailable or connection_lost error. When a programmable USB hub is configured (debug_profile hub.channel), a retry that cannot fix the probe escalates to toggling its USB data lines and then power-cycling the port -- the only in-band cure for a wedged endpoint. Any hub action taken is reported in recovery_steps.
Inputs: deep, session, escalate.
render_frameworkA
Render the synthesized FrameworkPlan to a HAL C init skeleton (bsp_init.c + bsp_init.h). Every derived fact (clock enables, GPIO modes, mapped .Init fields) is concrete; every unresolved value is a clearly marked TODO — nothing is fabricated. Returns the files, their content, and a todo_count. Run design_framework first.
Inputs: style, session.
report_issueA
Files a GitHub issue about an MCP problem from THIS session — auto-bundling the session journal, metrics, and MCP version into a structured report (via the gh CLI). Call this when a tool misbehaves or confuses you. Deduplicated per session so retries don't spam. Defaults to the stm32-gdb-mcp repo.
Inputs: title (required), description (required), env, repo, +1 more.
reset_targetADestructive
Resets the target device. Can optionally halt immediately after reset. strategy="cold" removes target power through a configured programmable USB hub before resetting, which is the only strategy that produces a true power-on reset (RCC_CSR POR flag, cleared .noinit, drained RAM); it fails rather than silently doing a warm reset when no hub channel is mapped. It needs no confirm argument -- asking for a cold reset by name IS the confirmation the hub guard wants -- and it stops the GDB session before the cut, then re-establishes it.
Inputs: halt (required), command, session, strategy.
run_acceptanceA
Evaluate the loaded AcceptanceSpec against live silicon state and return a deterministic pass/fail/error verdict per check (the closed-loop judge). An unreadable target is reported as 'error', never a silent pass. A failing/errored check derived by synthesize_acceptance carries provenance.source — the init function + line that should satisfy it — so fixes are precision-guided. Run load_acceptance first; halt the target at the state you want to assert.
Inputs: session.
run_acceptance_iterationA
Run one bounded loop iteration: (optional build) → (optional flash+run-to) → evaluate the AcceptanceSpec against live silicon, then record the verdict and return a decision (converged / should_continue / exhausted / stalled) plus the checks to fix. A build or run-to failure is recorded as a phase_error, not a crash. Refuses to run a terminal loop unless force=true. start_acceptance_loop first.
Inputs: force, session.
run_and_waitA
Resumes the target and waits, returning a structured stop event (reason, symbolized frame, breakpoint id, signal) or a timeout. Use this instead of continue_execution + polling to close the debug loop.
Inputs: session, timeout_sec.
run_for_durationA
Runs the target freely for a wall-clock duration, halts it, and returns one structured report with final frame/context and optional expression captures. Useful for counters, telemetry buffers, polling loops, and timing-sensitive bus diagnostics without breakpoint perturbation.
Inputs: duration_sec (required), then, sample, capture, +2 more.
run_pipelineA
Spec-to-silicon capstone (Pillar G): run the whole deterministic DESIGN half in one call. Chains the existing, individually verified tools in dependency order -- import_netlist? -> import_spec? -> design_framework -> solve_clock_tree? -> solve_timer? -> render_framework -> synthesize_acceptance -- turning a netlist plus a product spec into a flashable HAL skeleton and a machine-checked acceptance spec, then hands off to the build/verify loop. Optional stages (marked ?) run only when their input is present. Honest by construction: it GUESSES NOTHING -- it sequences verified tools and aggregates every stage's own unresolved/conflict gaps into one 'human decisions / data still needed' list. A required-stage hard error (no board, invalid input) stops with pipeline_status=blocked at that stage; expected gaps (an AF needing a pin DB, an unmodelled clock) surface as complete_with_unresolved; a clean run is complete. Operates on the session's board unless netlist= is supplied.
Inputs: spec, style, af_map, design, +13 more.
run_scenarioADestructive
Replays a declarative scenario — a list of {tool, args} steps — deterministically and returns a per-step pass/fail report. Provide inline 'steps' or a 'path' to a JSON scenario file. The minimal-step way to re-run a complex bug repro.
Inputs: path, steps, session, stop_on_failure.
run_to_lineB
Runs until a given location is reached (function, 'file.c:42', or '*0xADDR').
Inputs: location (required), session.
sample_pcA
Statistical PC profiler: enables DWT and samples the program counter while the core RUNS (non-intrusive, over SWD — no SWO pin or firmware change). Returns a symbolized hot-spot histogram (top functions by %), not raw hex — the fast way to find where firmware spends time or what loop it is stuck in. A high 'unsampleable' count means the core is halted/asleep; a high 'zero_samples' count means nothing was profiled at all. Leave enable=true: GDB cannot write the enable bit while the core runs, so this halts briefly to set it and resumes, and only when it is not already set. Note some links cannot serve memory reads while the core runs at all (measured: OpenOCD + ST-Link + STM32L1) — there PC sampling is unavailable and the result says so rather than inventing a hot spot.
Inputs: count, enable, session.
self_checkA
Validates the link right after connecting: reads CPUID and DBGMCU IDCODE and checks byte order, that a real Cortex-M is present, and that the device matches the expected family (from the profile MCU or the 'expected_family' arg). Run this first to catch endianness/config faults before debugging. Halts the core first (identity reads are unreliable while running); pass halt=false to skip.
Inputs: halt, session, expected_family.
session_diagnosticsB
Session/transport diagnostics. what=health([reconnect]) | events | server_logs. events returns recent GDB/MI records; server_logs returns the GDB server's stderr.
Inputs: what (required), session, reconnect.
set_adapter_speedADestructive
Sets the SWD/JTAG adapter clock (kHz) at runtime. The default ST-Link speed is only ~480 kHz; raising it (e.g. 4000) speeds up flashing and memory reads ~8x. Lower it if reads/flash become unreliable.
Inputs: khz (required), session.
setup_swoADestructive
One-call SWO/ITM printf setup. Configures the target's TPIU+ITM from the debugger (no firmware ITM-init needed) for the given core clock (hclk_hz) and SWO baud, and returns the OpenOCD capture commands + the firmware printf retarget snippet. Then capture with logging(action=start, channel='swo', file=). Requires the SWO pin (e.g. PB3) wired to the probe.
Inputs: hclk_hz (required), port, output, swo_hz, +3 more.
snapshotBRead-onlyIdempotent
One-shot diagnostic snapshot. scope=full([include_project,include_rtos,include_logs,log_limit,project_root]) | rtos. full bundles registers+stack+faults; rtos captures task/queue state.
Inputs: scope (required), session, log_limit, include_logs, +3 more.
solve_clock_treeA
Synthesize a concrete SystemClock_Config() for the session's FrameworkPlan (Pillar D Tier 3) - the last hand-written gap in generated init code. Given a clock source (HSE + crystal Hz, or HSI) and a target SYSCLK, it computes the exact PLL dividers (M/N/P or R, Q for 48 MHz USB), AHB/APB bus prescalers, and flash wait-states via pure datasheet math, then stores the result so the next render_framework emits real clock code instead of a TODO stub. Deterministic and honest: an unmodelled device or an infeasible target is surfaced, never guessed. Built-in profiles: STM32F401/F407/F411 and mainstream L4 (<=80 MHz); pass an explicit profile for others. Run design_framework first.
Inputs: load, source, profile, session, +3 more.
solve_timerA
Solve a timer's Prescaler/Period (PSC/ARR) for a target update frequency (Pillar D Tier 3). Turns intent ('TIM3 at 1 kHz') into concrete register values using the timer input clock (TIMxCLK) derived from the solved clock tree. Record a target via design_framework(design={'TIM3': {'update_hz': 1000}}) then run solve_clock_tree first, or pass timer_clock_hz directly for a what-if. Deterministic and honest: an exact target yields zero-error PSC/ARR, an inexact one yields the closest pair plus the achieved frequency and ppm error, and an unrepresentable target or an unknown timer bus is surfaced, never guessed. Injects the result into the plan so render_framework emits concrete values instead of a TODO.
Inputs: bus, load, timer, session, +3 more.
start_acceptance_loopA
Start a bounded spec-to-silicon acceptance loop (Pillar C) for the loaded AcceptanceSpec. Each run_acceptance_iteration does one build → flash → run-to-state → run_acceptance pass; the loop stops on convergence, on max_iterations, or on a stall (same checks failing repeatedly). Omit build/flash to run evaluate-only iterations (you flash manually). Load a spec first.
Inputs: build, flash, session, max_iterations, +1 more.
start_debug_sessionA
Starts the specified GDB Server (openocd, stlink, jlink) and connects the GDB Client to it. openocd REQUIRES server_args naming the probe and target, e.g. ['-f','interface/stlink.cfg','-f','target/stm32l4x.cfg'] — without them OpenOCD cannot find a config or adapter. Omitted values come from the active debug profile.
Inputs: probe, serial, session, speed_khz, +4 more.
stepA
Single-steps the target: kind='over' (over the line), 'into' (into calls), 'out' (run until the function returns), or 'instruction' (one machine instruction; set over=true to step over a call).
Inputs: kind, over, session.
stop_debug_sessionB
Stops the GDB client/server, variable tracking, and all active RTT/SWO/UART readers.
Inputs: session.
suggest_server_argsARead-onlyIdempotent
Returns the correct OpenOCD server_args for an MCU family + probe (e.g. STM32L431 + stlink -> ['-f','interface/stlink.cfg','-f','target/stm32l4x.cfg']) and validates the config files exist in OpenOCD's bundled scripts dir. Call this to get start_debug_session args — do NOT search the disk for .cfg files.
Inputs: mcu (required), probe, session, speed_khz.
synthesize_acceptanceA
Auto-derive a machine-checked AcceptanceSpec from the synthesized FrameworkPlan (Pillar D Tier 3) and load it as the session's acceptance judge — welding design synthesis to the acceptance loop. Always emits a no_fault check (init must not HardFault); adds a memory_u32 bits_set check per clock the plan enables (RCC enable bit), a memory_u32 bits_set check per interrupt the plan enables (arch-standard NVIC ISER bit, from the resolved IRQ number), and a masked memory_u32 eq check per configured pin (GPIO MODER = AF/analog; F1's CRL/CRH is skipped). Register/IRQ/port placements come from the session's loaded SVD or explicit register_map/irq_map/gpio_map; anything unresolvable is surfaced, never guessed. Each derived check also carries source provenance (the init function + line that should satisfy it), so a later failure points straight at the fix site. Run design_framework first; load an SVD (start_debug_session/set svd) for clock/NVIC/GPIO checks.
Inputs: load, name, irq_map, session, +6 more.
timeoutsB
GDB operation timeouts. action=get | set(overrides). overrides={connect,reset,memory,...} in seconds.
Inputs: action (required), session, overrides.
tool_helpARead-onlyIdempotent
Returns descriptions and complete schemas for full-surface tools, including tools hidden in compact mode.
Inputs: name, query, session.
track_variableA
Background variable tracking: action='start' (needs variable + interval_ms), 'stop', or 'get' (returns the sampled data for trend/leak analysis).
Inputs: action (required), session, variable, interval_ms.
typed_memoryBDestructive
Typed (struct-aware) memory access. action=read(address,width_bits,count) | write(address,value,width_bits). width_bits=8|16|32|64.
Inputs: action (required), count, value, address, +2 more.
validate_boardARead-onlyIdempotent
Validate the imported BoardDescription: detect a package pin wired to multiple nets (short), a peripheral signal routed to multiple pins, a port pin driven by multiple nets, and missing power/ground/debug/reset nets. With a pin-capability DB (db_path or the STM32_GDB_MCP_PIN_DB env) it also checks alternate-function legality; unknown pins degrade to 'unverified', never a false conflict. Run import_netlist first.
Inputs: db_path, session.
verify_flashARead-onlyIdempotent
Verifies that target flash matches an ELF (GDB compare-sections). Compares read-only sections, which is what lives in flash; writable sections hold the ELF's initial RAM values and always differ once the firmware has run, so including them would fail every healthy target. Pass include_writable=true only right after a load, before the target has executed.
Inputs: file_path (required), session, include_writable.
wait_for_stopARead-onlyIdempotent
Waits for the next stop event WITHOUT resuming the target, returning a structured stop event or a timeout.
Inputs: session, timeout_sec.
write_guardC
Memory-write guardrail. action=policy([mode,add_allow,add_protected]) | audit([limit]). mode=enforce|dry_run.
Inputs: action (required), mode, limit, session, +2 more.
write_memoryCDestructive
Writes a value to a specific memory address.
Inputs: value (required), address (required), session.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 86 tools
Many tools overlap in the run/stop/context-capture space (run_and_wait, wait_for_stop, continue_execution, run_for_duration, run_to_line, capture_state) and multiple meta-call tools (call, call_read, batch, tool_help) create selection ambiguity. Descriptions are detailed enough to mostly disambiguate, but with 86 tools an agent can still easily misselect.
Most names follow a predictable snake_case verb_noun pattern (start_debug_session, read_memory, flash_firmware, solve_clock_tree). A minority are single-noun mega-tools (hub, breakpoint, expressions, logging, frame, snapshot), which is a minor deviation but still readable and internally consistent within that subset.
86 tools is far beyond the well-scoped 3-15 range and is too many even for this broad server. Although it spans debug, build, board design, acceptance loops, and USB hub control, the surface is unwieldy and likely to overwhelm clients and agents; consolidation into more action-parameter mega-tools is needed.
The tool surface covers the embedded debug lifecycle comprehensively: sessions, flashing, symbols, memory/registers, breakpoints, RTOS, SVD, fault/stack recovery, logging, profiling, coredump, acceptance loops, netlist-to-framework design, clock/timer solving, and hub power control. No obvious domain gap remains for the stated STM32 GDB/debug-and-build purpose.
Maintenance
Related MCP Connectors
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
Design circuits, simulate and verify embedded firmware, and lay out PCBs with AI agents.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Free MCP debugging tools for AI agents and developers. Diagnose failed API and MCP tool calls, identify HTTP errors, validate tool arguments against supported JSON Schema rules, and get actionable troubleshooting recommendations.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to debug embedded systems by providing a comprehensive interface for GDB operations across multiple architectures like ARM and x86. It supports remote debugging via gdbserver or QEMU, allowing for detailed inspection of memory, registers, stack frames, and variables.31-
- AlicenseAqualityDmaintenanceEnables AI assistants like Claude to directly debug microcontrollers via JLink, supporting breakpoints, single-step, memory/register access, variable inspection, RTT logging, and firmware flashing.257MIT
- AlicenseAqualityCmaintenanceEnables AI tools to perform full-featured embedded microcontroller debugging via pyOCD and CMSIS-DAP probes, including probe management, flashing, breakpoints, register/memory access, fault analysis, and RTT communication.582MIT

sbl-debuggerofficial
AlicenseNot gradedqualityDmaintenanceEnables AI assistants to debug ARM Cortex-M targets via GDB and OpenOCD, supporting attach, breakpoints, stepping, register/memory inspection, and SVD peripheral decoding.MIT