Dbgprobe Mcp Server

io.github.es617由 GitHub 账号 es617 发布v0.1.4更新于 Oct 24, 2026

Let AI agents interact with debug probes — connect, flash, read/write memory, and reset.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

一个本地 MCP 服务器,让 AI 助手驱动 SEGGER J-Link 调试探针,对嵌入式目标进行烧录、内存查看、断点设置和复位。

可以做什么
列出探针并管理会话:连接、断开、查看状态、复位、暂停、继续、单步、擦除以及向目标设备烧录固件,可同时连接多个探针,各自独立会话。读写目标内存,设置、清除和列出断点。挂载 ELF 文件以解析符号、按函数名设置断点,并获得带符号信息的运行状态。挂载 SVD 文件以按名称读写外设寄存器和字段,支持枚举值解码和批量字段更新。启动、停止、读取和写入 SEGGER RTT 通道,以流式获取目标日志输出。加载暴露自定义工具的 Python 插件,并查看每次工具调用的追踪记录。
适用场景
适合嵌入式工程师、创客、测试人员和研究人员,希望助手通过 J-Link 探针烧录固件、检查寄存器和 RAM,并执行烧录-复位-读取的测试循环,而不必手动输入 J-Link Commander 命令。
运行要求
以 PyPI 包 dbgprobe-mcp-server(Python)通过 stdio 在本地运行。需要安装 SEGGER J-Link 软件包,JLinkExe 可自动检测或通过 DBGPROBE_JLINK_PATH 指定,并需连接 J-Link 探针和目标板。可选环境变量用于设置后端、接口、设备型号、速度、日志级别、插件策略和工具名分隔符。OpenOCD 和 pyOCD 后端仅为计划中。
安装前请注意
助手会操作真实硬件:错误的内存写入或烧录可能使设备变砖或清除校准数据,烧录还会清除断点。插件会以服务器完整权限执行任意 Python 代码,加载助手生成的插件前应先审查。工具调用追踪默认开启并写入本地追踪文件;载荷追踪默认关闭,需手动启用。请谨慎使用工具审批,并考虑助手能触及的范围。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Dbgprobe Mcp Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Debug Probe MCP Server

[MCP] [License: MIT] [Python] [Debug Probe]

A stateful debug probe Model Context Protocol (MCP) server for developer tooling and AI agents. Works out of the box with Claude Code, VS Code with Copilot, and any MCP-compatible runtime. Communicates over stdio and drives on-chip debug probes (J-Link first, OpenOCD and pyOCD planned) to flash, debug, and inspect embedded targets.

Example: Let Claude Code list attached J-Link probes, connect to your nRF52840, flash a new firmware, read memory, and reset the target — all conversationally.

Demo

Video walkthrough — connecting to a J-Link probe, flashing firmware, loading ELF and SVD for symbol-aware debugging, RTT logging, and breakpoints.


Why this exists

If you've ever typed J-Link Commander commands by hand, copy-pasted memory addresses between a datasheet and a terminal, re-flashed the same firmware 20 times during a debug session, and juggled multiple tool windows — this is for you.

You have a microcontroller on a debug probe. You want an AI agent to interact with it — connect, flash firmware, read/write memory, reset, halt, resume. This server makes that possible.

It gives any MCP-compatible agent a full set of debug probe tools. The agent calls these tools, gets structured JSON back, and reasons about what to do next — without you manually driving JLinkExe for every operation.

What agents can do with it:

  • Flash and iterate — build firmware, flash it, reset, check behavior — all in one conversation
  • Inspect memory — read peripheral registers, check RAM contents, verify flash writes
  • Debug interactively — halt, step, set breakpoints, inspect state, resume
  • Automate test flows — flash → reset → read output → validate
  • Multi-probe setups — connect to multiple probes simultaneously, each with its own session

Who is this for?

  • Embedded engineers — faster iteration: flash, debug, inspect memory conversationally
  • Hobbyists and makers — interact with microcontrollers without learning JLinkExe command syntax
  • QA and test engineers — automated flash-and-test sequences across multiple boards
  • Researchers — systematic exploration of embedded systems, register inspection

Quickstart (Claude Code)

bash
pip install dbgprobe-mcp-server
# Register the MCP server with Claude Codeclaude mcp add dbgprobe -- dbgprobe_mcp
# Or with explicit J-Link pathclaude mcp add dbgprobe \  -e DBGPROBE_JLINK_PATH=/Applications/SEGGER/JLink/JLinkExe \  -- dbgprobe_mcp

Then in Claude Code, try:

"List attached debug probes, connect to the J-Link, and read 16 bytes from address 0x20000000."

[Listing probes and connecting]

[Erasing and flashing firmware]


Supported backends

BackendStatusProbe hardware
J-LinkWorking (v0)SEGGER J-Link (EDU, EDU Mini, PLUS, PRO, etc.)
OpenOCDPlannedST-Link, CMSIS-DAP, and many others
pyOCDPlannedCMSIS-DAP, ST-Link, J-Link (via pyOCD)

The server is backend-agnostic — tool names (dbgprobe.*) stay the same regardless of which probe you use.

J-Link requirements

Install the SEGGER J-Link Software Pack. The server auto-detects JLinkExe on PATH or in common install locations:

  • macOS: /Applications/SEGGER/JLink/
  • Linux: /opt/SEGGER/JLink/, /usr/bin/
  • Windows: C:\Program Files\SEGGER\JLink\

Or set DBGPROBE_JLINK_PATH to point to the executable directly.

This project is not affiliated with or sponsored by SEGGER. J-Link is used because it's widely available and well-supported.


Tools

CategoryTools
Probedbgprobe.probes.list, dbgprobe.connect, dbgprobe.erase, dbgprobe.disconnect, dbgprobe.reset, dbgprobe.halt, dbgprobe.go, dbgprobe.step, dbgprobe.status, dbgprobe.flash, dbgprobe.mem.read, dbgprobe.mem.write, dbgprobe.breakpoint.set, dbgprobe.breakpoint.clear, dbgprobe.breakpoint.list
Introspectiondbgprobe.connections.list
ELFdbgprobe.elf.attach, dbgprobe.elf.info, dbgprobe.elf.lookup, dbgprobe.elf.symbols
SVDdbgprobe.svd.attach, dbgprobe.svd.info, dbgprobe.svd.read, dbgprobe.svd.write, dbgprobe.svd.set_field, dbgprobe.svd.update_fields, dbgprobe.svd.list_peripherals, dbgprobe.svd.list_registers, dbgprobe.svd.list_fields, dbgprobe.svd.describe
RTTdbgprobe.rtt.start, dbgprobe.rtt.stop, dbgprobe.rtt.read, dbgprobe.rtt.write, dbgprobe.rtt.status
Pluginsdbgprobe.plugin.list, dbgprobe.plugin.template, dbgprobe.plugin.load, dbgprobe.plugin.reload
Tracingdbgprobe.trace.status, dbgprobe.trace.tail

See docs/tools.md for full schemas and examples.


Install (development)

bash
# Editable install from repo rootpip install -e ".[test]"
# Or with uvuv pip install -e ".[test]"

MCP is a protocol — this server works with any MCP-compatible client. Below are setup instructions for the most common ones.

Add to Claude Code

bash
# Standard setupclaude mcp add dbgprobe -- dbgprobe_mcp
# With default target deviceclaude mcp add dbgprobe \  -e DBGPROBE_JLINK_DEVICE=nRF52840_xxAA \  -- dbgprobe_mcp
# Debug loggingclaude mcp add dbgprobe -e DBGPROBE_MCP_LOG_LEVEL=DEBUG -- dbgprobe_mcp

Add to VS Code / Copilot

Add to your project's .vscode/mcp.json (or create it):

json
{  "servers": {    "dbgprobe": {      "type": "stdio",      "command": "dbgprobe_mcp",      "args": [],      "env": {        "DBGPROBE_JLINK_DEVICE": "nRF52840_xxAA"      }    }  }}

Adjust env to match your target — set DBGPROBE_JLINK_DEVICE to your chip, or remove it to specify the device at connect time.

Add to Cursor

Add to your project's .cursor/mcp.json (or create it). Cursor does not support dots in tool names, so DBGPROBE_MCP_TOOL_SEPARATOR must be set to _:

json
{  "mcpServers": {    "dbgprobe": {      "command": "dbgprobe_mcp",      "args": [],      "env": {        "DBGPROBE_JLINK_DEVICE": "nRF52840_xxAA",        "DBGPROBE_MCP_TOOL_SEPARATOR": "_"      }    }  }}

Environment variables

Server

VariableDefaultDescription
DBGPROBE_BACKENDjlinkDebug probe backend. Future: openocd, pyocd.
DBGPROBE_MCP_LOG_LEVELWARNINGPython log level (DEBUG, INFO, WARNING, ERROR). Logs go to stderr.
DBGPROBE_MCP_TRACEenabledJSONL tracing of every tool call. Set to 0, false, or no to disable.
DBGPROBE_MCP_TRACE_PAYLOADSdisabledInclude memory data payloads in traced args (stripped by default).
DBGPROBE_MCP_TRACE_MAX_BYTES16384Max payload chars before truncation (only when TRACE_PAYLOADS is on).
DBGPROBE_MCP_TOOL_SEPARATOR.Character used to separate tool name segments. Set to _ for MCP clients that reject dots in tool names (e.g. Cursor).
DBGPROBE_MCP_PLUGINSdisabledPlugin policy: all or comma-separated plugin names (e.g. nrf52,stm32).

J-Link backend

VariableDefaultDescription
DBGPROBE_JLINK_PATHauto-detectExplicit path to JLinkExe (or JLink.exe on Windows).
DBGPROBE_JLINK_GDBSERVER_PATHauto-detectExplicit path to JLinkGDBServerCLExe.
DBGPROBE_JLINK_DEVICE(none)Default target device string (e.g. nRF52840_xxAA). Can be overridden per-session.
DBGPROBE_INTERFACESWDDebug interface: SWD or JTAG.
DBGPROBE_SPEED_KHZ4000Interface clock speed in kHz.
DBGPROBE_GDB_TRACEdisabledLog all GDB RSP packets to file. Set to 1, true, or yes to enable.
DBGPROBE_GDB_TRACE_FILE/tmp/gdb_trace.logPath for GDB RSP trace log (only when GDB_TRACE is on).

ELF Support

Attach an ELF file to a session to enable symbol-aware debugging:

  • Symbol lookup — resolve function names to addresses and vice versa
  • Breakpoints by name — breakpoint.set(symbol="main") instead of raw addresses
  • Auto-enriched responses — status, step, and halt include symbol + symbol_offset when an ELF is attached
  • Flash integration — flashing an .elf auto-attaches it; flashing .hex/.bin auto-reloads a previously attached ELF; sibling .elf files are suggested via hints
> "Attach the ELF, set a breakpoint on main, run, and show me where it halted."

The agent calls elf.attach, breakpoint.set(symbol="main"), go, then status — and gets back "halted at main+0" instead of a raw hex address.

[ELF symbol resolution — PC resolved to arch_cpu_idle+18]

[Breakpoint hit at main — symbol-aware debugging]


SVD Support

Attach an SVD (System View Description) file to a session to enable register-level peripheral access:

  • Named register reads — svd.read("GPIO.OUT") returns the raw value and all decoded fields with enum names
  • Field-level reads — svd.read("GPIO.PIN_CNF[3].PULL") returns the field value and enum name ("PullUp")
  • Safe field writes — svd.set_field("GPIO.PIN_CNF[3].PULL", "PullUp") does read-modify-write
  • Batch field updates — svd.update_fields("GPIO.PIN_CNF[3]", {"DIR": "Output", "PULL": "PullUp"}) — one read, one write
  • Raw register writes — svd.write("GPIO.OUT", 0x01) — full register, no RMW
  • Discovery — list peripherals, registers, fields; describe with enums
  • Auto-decode on mem.read — when an SVD is attached and mem.read hits a known register address, the response includes decoded fields
> "Attach the SVD, read GPIO.PIN_CNF[3], and set PULL to PullUp."

The agent calls svd.attach, svd.read("GPIO.PIN_CNF[3]"), then svd.set_field("GPIO.PIN_CNF[3].PULL", "PullUp") — and gets back decoded field values instead of raw hex.

[SVD attached — 84 peripherals, 2332 registers]


RTT (Real-Time Transfer)

Start, stop, read, and write to SEGGER RTT channels. The agent can stream target log output and send data to the device — useful for debugging firmware that prints over RTT instead of UART.

> "Start RTT and show me the output."

[RTT streaming Zephyr boot log from target]

For repetitive flows — read device ID, run a self-test sequence, validate calibration — you can package them as plugins: Python modules that expose custom tools the agent can call directly. Enable with DBGPROBE_MCP_PLUGINS=all. See the nrf52_info example.


Tracing

Every tool call is traced to .dbgprobe_mcp/traces/trace.jsonl and an in-memory ring buffer (last 2000 events). Tracing is on by default — set DBGPROBE_MCP_TRACE=0 to disable.

Use dbgprobe.trace.status and dbgprobe.trace.tail to inspect the trace without reading the file directly.


Try without an agent

You can test the server interactively using the MCP Inspector:

bash
npx @modelcontextprotocol/inspector python -m dbgprobe_mcp_server

Roadmap / TODO

  • OpenOCD backend — support ST-Link, CMSIS-DAP, and other probes via OpenOCD subprocess
  • pyOCD backend — native Python probe access via pyOCD library
  • Multi-core support — target specific cores on multi-core SoCs
  • Cortex-A/R support — ARM-mode breakpoints (kind=4); currently Thumb-only (Cortex-M)

Known limitations

  • Single-client only. The server handles one MCP session at a time (stdio transport).
  • RTT channel 0 only. RTT support is limited to channel 0 (terminal). Multi-channel RTT is a future enhancement.
  • Flash clears breakpoints. Flashing new firmware invalidates breakpoints (the code at those addresses may have changed). The session stays alive but breakpoints are cleared.
  • Cortex-M only. Breakpoints use Thumb-mode (kind=2). Cortex-A/R targets (ARM-mode, kind=4) are not yet supported.
  • Instruction-level step only. dbgprobe.step single-steps one CPU instruction. Source-level stepping (step into/over/out) is not supported.

Safety

This server connects an AI agent to real debug hardware. That's the point — and it means the stakes are higher than pure-software tools.

Plugins execute arbitrary code. When plugins are enabled, the agent can create and run Python code on your machine with full server privileges. Review agent-generated plugins before loading them.

Writes affect real hardware. A bad memory write or flash operation can brick a device, wipe calibration data, or trigger unintended behavior. Consider what the agent can reach.

Use tool approval deliberately. When your MCP client prompts you to approve a tool call, consider whether you want to allow it once or always.

This software is provided as-is under the MIT License. You are responsible for what the agent does with your hardware.


License

This project is licensed under the MIT License — see LICENSE for details.

来源:README.md,提交 738f888

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.4最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分