JLink Insight MCP
Provides build integration for CMake-based STM32 projects, including toolchain detection, reading CMake presets and compile commands, configuring/building firmware, and reporting compiler output, warnings/errors, and ELF hash.
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., "@JLink Insight MCP flash build/Debug/demo.elf, run it, and report runtime issues for 60 seconds"
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.
JLink Insight MCP
让 Claude / Codex 根据 STM32 工程的实际能力,自动烧录已编译固件、启动运行,并通过 J-Link、RTT、SystemView 获取运行证据与诊断反馈。
当前版本 0.3.0,提供完整可安装源码与测试。
安全边界 / Security boundary
本服务的工具面面向 LLM 客户端,因此破坏性操作默认关闭,需要显式确认。 Destructive operations are gated because the tool surface is driven by a language model:
操作 | 闸门 |
|
|
|
|
|
|
| 白名单:只放行调试类命令 |
gdb_batch 具体限制:
命令走白名单,
shell/compile/eval/interpreter-exec/pipe/call/python/source/!cmd等一律拒绝;强制
set may-call-functions off,并拒绝print ... func()形式的表达式调用;强制
-nx -nh,不会读取工作目录或用户目录下的.gdbinit。
两个可选环境变量:
变量 | 作用 | 默认 |
|
|
|
| 设为 | 未设置(不转发) |
jlink-project.json 是可提交到版本库的文件,因此 build.env_allow 与
build.env 都无法单独解锁凭据类变量——只有操作者设置
JLINK_MCP_ALLOW_SECRET_ENV=1 才生效。
program_flash / write_memory / write_register 是底层调试原语,不做内容级
校验(它们按设计可写任意地址),只应在确知目标时使用。
Related MCP server: J-Link RTT Viewer MCP
新机器 6 步检查清单
换一台电脑时按顺序走一遍。每步都有期望输出;不对就按「失败怎么办」排查。
# | 做什么 | 验证命令 | 期望 | 失败怎么办 |
1 | 装 SEGGER J-Link Software |
| 打印一个路径 | 从 segger.com 下载安装;装完重开终端 |
2 | 装编译工具链 |
| 各自打印版本 | 装 STM32CubeCLT 或 Arm GNU Toolchain + CMake;确保在 |
3 | 克隆仓库 |
| 目录里有 | 检查网络 / 代理 |
4 | 一键装 Python 环境 |
| 约 66s, | 先 |
5 | 配 MCP 客户端 | 粘贴脚本打印的 JSON/YAML,确认 | 重载后 | 路径必须绝对;Windows 用正斜杠或转义反斜杠 |
6 | 在固件工程放 manifest | 工程根目录建 |
| 不建也能用,但每次要手传 |
装完后的三条验证(在 Agent 里直接调工具):
toolchain_detect() → build_ready 与 debug_ready 都应为 true
build_status("D:/your/project") → presets、工具链文件、ELF SHA256、Flash/RAM 占用
list_jlink_devices() → 插着 J-Link 时至少返回一个探针缺哪个前置依赖,就少哪类能力(服务永远能启动,缺的能力调用时报错):
已安装 | 可用 | 不可用 |
仅 Python 环境 | 服务启动、64 个工具全部注册 | 全部硬件工具、全部编译工具 |
+编译工具链 |
| 烧录、RTT、寄存器、 |
+J-Link |
| SVD 按字段解析(需 SVD 文件) |
+SVD 目录(可选) |
| — |
运行流程
CubeMX / VS Code 工程编译完成,生成 ELF、HEX 或 BIN。
inspect_project读取.ioc、FreeRTOS 版本头文件、编译数据库及 ELF 符号。deploy_project选择明确的 MCU 与探针,烧录到 STM32 内部 Flash,逐字节独立回读校验。校验成功后复位、运行;在后台发现实际 RTT / SysView 通道,按能力选择监控模式。
客户端通过
get_runtime_report轮询任务运行占比、ISR 耗时、日志和故障证据,生成反馈。
工程 / 固件能力 | 可用功能 |
裸机,无 RTT | 烧录、运行、断点、单步、内存、CPU 寄存器、SVD;可选故障采样 |
已集成 RTT | 额外采集 RTT 日志,标记 assert / panic 等日志线索 |
FreeRTOS,无 SystemView | 常规调试及已有 RTT;不会凭空生成任务调度历史 |
FreeRTOS + SystemView + trace hooks | 额外采集任务 / ISR 事件、独占运行占比、Ready 到 Running 延迟及质量信息 |
文件存在、参与编译、最终链接、运行时输出是不同层次的证据。主机服务不自动修改用户固件,也不自动植入 RTOS 或 SystemView。
快速安装(一键,跨平台)
需要 Python 3.10+。解压/克隆后进入源码根目录,运行:
python setup_mcp.py脚本会:创建 .venv → 以 editable 模式安装依赖 → 自检工具链 → 打印可直接粘贴的 MCP 客户端配置。
重复运行是安全的(复用已有 venv);--force 重建,--check 只自检不安装,--dev 附带测试依赖。
外部前置条件(脚本无法代装):
依赖 | 用途 | 缺失后果 |
SEGGER J-Link Software | J-Link 驱动 / | 所有硬件工具不可用 |
| 编译( | 仅编译不可用,烧录调试照常 |
芯片厂商 SVD 目录(可选) | 寄存器按字段解析 | 仅 SVD 工具不可用,可用 |
工具链路径不需要手写:服务按 manifest → EMBEDDED_* 环境变量 → PATH → gcc 兄弟目录 → 常见安装目录 自动发现。
换机器只需设 EMBEDDED_CMAKE / EMBEDDED_ARM_GCC 等环境变量,源码不动。
注意:环境变量名不要包含
KEY/PASSWORD/SECRET/TOKEN,也不要使用DSH_*前缀 —— 部分 MCP 客户端(如 dsh-mcp-client)会清洗这些变量。
安装卡住怎么办:
脚本不会执行
pip install --upgrade pip。venv 自带 pip 已够用,而自升级在部分网络/代理环境 会挂起数分钟(实测 >180s 无输出、CPU≈0)。这是首次安装最常见的卡点。国内网络慢可指定镜像:
set PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple(Windows) 或export PIP_INDEX_URL=...(Linux/macOS)。需要代理时设
HTTPS_PROXY/HTTP_PROXY后再运行脚本。离线环境:先在联网机器
pip download出依赖,再用--find-links安装。
手工安装(Windows / PowerShell)
py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --no-cache-dir .
.\.venv\Scripts\python.exe -m jlink_mcpLinux / macOS:
python3 -m venv .venv
.venv/bin/python -m pip install --no-cache-dir .
.venv/bin/python -m jlink_mcp最后一条命令启动 stdio MCP 服务,等待客户端请求,不能把它当交互式命令行输入 Python 函数。通常由客户端直接启动,无需手动运行。
安装后的新命令为 jlink-insight-mcp,兼容命令 jlink-mcp 也保留。Python 包路径仍为 jlink_mcp。
手工安装的两条纪律:必须带
--no-cache-dir(pip 缓存写入在部分环境下会挂起), 不要加-e(editable 元数据生成在部分 hatchling/pip 组合下会卡住)。 只有在需要「改源码即时生效」时才用python setup_mcp.py --editable。
⚠️ 依赖里的
mcp必须<2:本包使用mcp.server.fastmcp,mcp2.x 已将其改名为MCPServer, 装上 2.x 会在启动时抛ModuleNotFoundError: No module named 'mcp.server.fastmcp'。
客户端配置
把示例中的 Python 路径替换为本机解压目录下虚拟环境的绝对路径。
Codex CLI / IDE:参考 examples/codex-config.toml,合并到
~/.codex/config.toml。Claude Code / Claude Desktop:参考 examples/claude-mcp.json。
VS Code 原生 MCP 客户端:参考 examples/vscode-mcp.json,合并到工作区
.vscode/mcp.json。Claude / Codex 扩展使用各自的配置方式。
MCP 服务必须运行在能访问工程文件、J-Link USB 和 J-Link 软件的那台电脑上。云端执行环境不能自动访问本地开发板。SVD 文件从 JLINK_SVD_DIR 加载;未配置有效的型号对应文件时不会虚构寄存器定义。基本硬件工具不需要 OpenAI API Key;继承的可选语义检索功能除外。
Codex 配置字段依据 OpenAI 官方 MCP 文档。
给 Claude / Codex 的使用指令
检查当前工程 C:/projects/demo,固件已经编译完成。识别 MCU、FreeRTOS 和 SystemView 能力,使用 JLink Insight MCP 烧录、校验并运行固件,监控 60 秒。定期查询报告,区分已确认故障、调度风险和数据不足,并说明观测证据。
有多个 ELF、多个 .ioc 或多个探针时,需要指定对应文件或探针序列号;服务不会直接选择第一个。
以下是 MCP 工具调用参数示例,不是终端命令:
inspect_project(project_path="C:/projects/demo")
plan_project_debug(project_path="C:/projects/demo", firmware_path="build/Debug/demo.elf")
deploy_project(project_path="C:/projects/demo", firmware_path="build/Debug/demo.elf", duration_s=60)
get_runtime_report()
# 传入上次返回的 last_sequence,只获取新的消息。
get_runtime_report(after_sequence=1)
stop_runtime_monitor()BIN 需要明确 flash_address,ELF / HEX 使用固件自带地址。推荐保留 ELF 符号供能力识别。可将 examples/jlink-project.json 复制到 STM32 工程根目录,固定固件路径、MCU 和 BIN 地址。
编译完成后自动部署
显式启动编译产物监听:
start_firmware_watch(
project_path="C:/projects/demo",
firmware_path="build/Debug/demo.elf",
duration_s=3600,
deploy_initial=False
)
get_firmware_watch_status()
stop_firmware_watch()监听选定文件的 SHA256 变化,连续稳定一秒后部署。deploy_initial=False 会跳过启动时已有的文件,等待下次编译变化;设置 True 则部署当前稳定文件。每个哈希只尝试一次;失败后查看 last_result,修复问题并重新启动监听,或编译出新版本。不会执行构建命令。
监听器只自动停止自己上次部署产生的监控会话,遇到其他会话占用时报告错误。stop_firmware_watch 停止后续部署,当前固件与已启动监控仍继续;停止监控另调 stop_runtime_monitor。正在烧录时无法中断底层 DLL 调用,停止请求可能返回 stop_pending=true。
实时监控和诊断边界
后台监控与 MCP 会话同时运行,客户端需要轮询报告;本服务不承诺客户端会主动弹窗。
默认不暂停 CPU,避免干扰调度。此时通过 RTT / SystemView 观测运行行为;普通运行中的 CPU 故障寄存器检查标为 unknown。
sample_cpu=True会周期性短暂停机采样并恢复运行,影响时序。与 SystemView 同用时,报告会降低调度判断的可信度。停止后台监控后,可用
runtime_snapshot(halt_if_running=True)单次检查活动异常、CFSR / HFSR 等证据。M0 / M0+ 等不支持的扩展故障寄存器不会读取。捕获到活动 fault 异常与故障状态位残留分别报告。日志模式匹配和阈值超限属于线索 / 风险,不能单独证明 HardFault、死锁或优先级反转。
没有异常记录只表示当前窗口未发现异常,不能证明系统永远正确。丢包、缺少时钟或 trace hooks 时明确提示数据不足。
监控窗口保留最近 20000 个解码事件、最近 100 行日志,原始轨迹最多 4 MiB;到达 4 MiB 或持续时间上限会停止并保留结果。单次监控 1–3600 秒,可显式重新启动。
当前面向单核 STM32 / Cortex-M / FreeRTOS。多核合并、RT-Thread 专项适配、完整 FreeRTOS API 锁关系分析以及
.SVDat容器尚不支持。
监控期间其他硬件写入、断点、内存与 SVD 工具会报告设备占用。先停止监控,再调试:
stop_runtime_monitor()
halt_cpu()
read_registers(register_names=["PC", "LR", "SP", "XPSR"])
# 用实际 SVD 名称、外设和寄存器替换参数。
read_register_with_fields(device_name="STM32F407", peripheral_name="GPIOA", register_name="MODER")
run_cpu()SVD 外设读取可能有硬件副作用,应只请求需要的寄存器,不做自动全量扫描。CPU 是否运行、断点位置及程序错误之间也需要结合上下文解释。
新增 MCP 工具
工具 | 用途 |
| 工程、固件和集成能力识别 |
| 只读部署计划及 SVD 候选 |
| 自动连接、烧录、校验、运行、启动监控 |
| 已连接目标的后台监控 |
| 查询反馈 / 停止监控 |
| 可选暂停采样及 Cortex-M 故障检查 |
| 原始 SystemView RTT 文件 + JSON 报告 |
| 编译产物变化后自动部署 |
| 查询 / 停止编译监听 |
| 限时前台采集 / 原始二进制离线解码 |
| 自动发现 cmake / ninja / arm-none-eabi-* / JLinkGDBServer 及版本 |
| 盘点 manifest、presets、工具链文件、compile_commands、ELF SHA256 与 Flash/RAM 占用 |
| configure + build,返回完整编译器输出、warning/error 计数、ELF hash |
| 用宿主编译器编译并运行工程自带单元测试(双档 -O0/-O3),失败时逐用例定位 |
| 一次串起 build → host 测试门禁 →(可选)flash/校验/运行 →(可选)短时取证 |
| 拉起 JLinkGDBServer + |
基础连接、调试、RTT、SVD 等原工具继续保留;可用客户端工具列表查看完整接口。reset_target 支持 normal / halt;core-only reset 和范围擦除没有伪造的 pylink 调用。推荐使用 deploy_project 完成固件下载,避免手动整片擦除。
无 VSCode 的编译 / 烧录 / 调试工作流
新增的 5 个工具让这个服务可以独立承担「编译 → 烧录 → 取证 → 符号级调试」, 不依赖 VSCode / CubeIDE,可直接在任意支持 MCP 的 Agent 里驱动。
在工程根目录放 jlink-project.json(参考 examples/jlink-project.json),
工具链路径留空即自动发现:
{
"ioc": "Application.ioc",
"chip_name": "STM32U575RG",
"firmware": "build/Debug/Application_FACTORY.elf",
"flash_address": "0x08000000",
"build": { "preset": "Debug", "firmware": "build/Debug/Application_FACTORY.elf" }
}典型调用顺序:
build_status(project_path) # 只读:工具链 / presets / ELF / 占用
build_project(project_path, preset="Debug") # 编译,拿 ELF SHA256
host_test(project_path, opt="both") # 宿主编译器跑单元测试,不碰硬件
deploy_project(firmware_path=…, chip_name=…) # 烧录 + 逐字节校验 + 运行
get_runtime_report() / rtt_read() # 取证
stop_runtime_monitor() # 释放硬件
gdb_batch(project_path, commands=["bt"]) # 需要符号级回溯时或者一条 workflow_pipeline(project_path, flash=True, confirm=True, observe_s=30) 走完中间三步。
Host 单元测试门禁(烧录前拦截)
workflow_pipeline 在 build 之后、flash 之前插了一个 host_test 阶段:
build → host_test(-O0, -O3) → flash → observe
│
└─ 失败 → 直接返回 ok=false,message 写明 "firmware NOT flashed; failing: <用例名>"需要工程里有 host 测试驱动(自动找
Tests/run_host_tests.py,可用 manifestbuild.host_test_script指定)。需要宿主编译器(
gcc/clang/cc,可用build.host_cc或EMBEDDED_HOST_CC指定)。两者缺任一 → 该阶段标记 skipped,不阻塞流水线(不当成失败)。
host_test_opt="both"(默认)跑-O0和-O3,能抓出只在某个优化等级暴露的 UB / 缺volatile。失败时自动逐个
--only <name>重跑,直接告诉你哪个用例挂了。
这套设计的意义:逻辑回归永远到不了板子。host 测试是秒级的,而烧录 + 上台架验证是分钟级且有硬件损耗。
CI/CD:jlink-ci 命令行入口
CI 里没有 LLM 也没有 MCP 客户端,所以提供了确定性命令行入口,用退出码表达结果:
jlink-ci status --project . # 工具链 / ELF / host 测试就绪情况
jlink-ci verify --project . # build + host tests(无硬件,CI 门禁)
jlink-ci flash --project . --chip STM32U575RG --confirm # 真实写 Flash
jlink-ci pipeline --project . --flash --confirm --observe 30 # 全链路
jlink-ci debug --project . --cmd bt # 一次性符号级调试退出码 | 含义 |
| 成功 |
| 执行失败(编译 / 测试 / 烧录) |
| 用法或配置错误(缺参数、未带 |
--json 输出结构化证据(含 schema_version、ELF SHA256、failing_tests),可直接存成 CI 工件。
无硬件 job 只需要 cmake/ninja/arm-none-eabi-gcc + 宿主编译器;烧录 job 放 self-hosted runner。 完整示例(GitHub Actions / self-hosted / 并发串行化)见 docs/CI_INTEGRATION.md。
可移植性:工具链按 manifest → EMBEDDED_* 环境变量 → PATH → arm-none-eabi-gcc 兄弟目录 → 常见安装目录
五级解析,代码中没有任何机器专属路径。换机器只设环境变量:
EMBEDDED_CMAKE · EMBEDDED_NINJA · EMBEDDED_ARM_GCC · EMBEDDED_ARM_GDB ·
EMBEDDED_ARM_SIZE · EMBEDDED_ARM_OBJCOPY · EMBEDDED_JLINK_GDBSERVER
安全默认:workflow_pipeline 的 flash 默认 false;打开时必须 confirm=True(真实写 Flash)。
全部子进程用 argv 列表 + stdin=DEVNULL + capture_output,不经过 shell,stdout 只留给 MCP 协议。
实现细节与已知坑(含
stdin管道阻塞、mcp<2约束)见 docs/BUILD_WORKFLOW.md。
测试与开发
python -m pip install --no-cache-dir ".[dev]"
python -m pytest需要边改源码边跑测试时改用 editable:
python setup_mcp.py --dev --editable(editable 元数据生成在部分环境会挂起,见上文说明)。
默认排除真实硬件集成及性能测试。显式运行全部单元与 Mock 测试(包括测试目录中的微基准)可用:
python -m pytest tests/unit tests/mock -o addopts="" -q测试包括真实 ELF32 文件结构、镜像加载地址、回读失败中断、pylink 接口约定、SystemView 编码、嵌套 IRQ、丢包、资源互斥、后台监控、编译监听和真实 stdio MCP 客户端握手。硬件验收步骤见 docs/HARDWARE_VALIDATION.md,架构见 docs/ARCHITECTURE.md。
SystemView 固件接入详见 docs/SYSTEMVIEW.md。源码归属与许可见 NOTICE.md 和 LICENSE。
Available Tools
65 toolsbuild_projectA
Configure + build a CMake/Ninja/arm-none-eabi project / 编译工程并产出证据.
Uses CMakePresets.json when the preset exists, else explicit Ninja configure. Returns raw compiler output, ELF SHA256, size output, warning/error counts. Never touches hardware and does not modify source files.
Inputs: project_path (required), clean, preset, target, +3 more. Returns: object
build_statusB
Report manifest, toolchain, firmware SHA256 and size / 盘点工程与编译产物状态.
Read-only. Recommended as the first tool call in a headless session.
Inputs: project_path (required), preset. Returns: object
clear_breakpointC
Clear breakpoint / 清除断点.
Args: address: Breakpoint address / 断点地址
Returns: Clear result / 清除结果
Inputs: address (required). Returns: object
connect_deviceA
Connect to JLink device / 连接到 JLink 设备.
Connects to the specified JLink debugger. If no serial number is specified, connects to the first available device. 连接到指定的 JLink 调试器。如果不指定序列号,则连接第一个可用设备。
Args: serial_number: Device serial number (optional) / 设备序列号(可选) interface: Target interface type (SWD/JTAG, optional, defaults to runtime config) / 目标接口类型(SWD/JTAG,可选,默认取运行时配置) chip_name: Target chip name (e.g., STM32F407VG, optional) / 目标芯片名称(如 STM32F407VG,可选)
Returns: Connection result / 连接结果
Inputs: chip_name, interface, serial_number. Returns: object
deploy_projectA
Flash compiled STM32 ELF/HEX/BIN, verify all bytes, run, auto-select monitoring / 自动烧录运行并监控.
Requires exact chip and unique probe/artifact or explicit selection. Programs internal flash. sample_cpu briefly halts CPU during monitoring; default false preserves timing.
Inputs: project_path (required), monitor, chip_name, duration_s, +4 more. Returns: object
diagnose_environmentC
Diagnose environment and resource availability / 诊断环境与资源可用性.
Returns: Environment diagnosis report / 环境诊断报告
Inputs: no named parameters. Returns: object
disconnect_deviceA
Disconnect JLink device / 断开 JLink 设备连接.
Disconnects the current active JLink connection and releases device resources. 断开当前活动的 JLink 连接,释放设备资源。
Returns: Disconnection result / 断开结果
Inputs: no named parameters. Returns: object
erase_flashB
Erase Flash / 擦除 Flash.
Args: start_address: Start address (optional) / 起始地址(可选) end_address: End address (optional) / 结束地址(可选) chip_erase: Whether to perform chip erase (wipes the bootloader too) / 是否整片擦除(会连 Bootloader 一起抹掉) confirm: Required: erasing is irreversible / 必填:擦除不可逆
Returns: Erase result / 擦除结果
Inputs: confirm, chip_erase, end_address, start_address. Returns: object
export_runtime_traceC
Export captured raw SystemView binary and JSON report to local files / 导出采集数据及报告.
Inputs: output_path (required). Returns: object
gdb_batchA
One-shot symbol-level debug via J-Link GDB Server / 无 VSCode 的符号级调试.
Spawns JLinkGDBServer if the port is free, runs arm-none-eabi-gdb -batch with -ex commands (bt / info registers / x / disassemble), then stops the server. Stop runtime monitor first (hardware is exclusive).
Inputs: project_path (required), port, commands, elf_path, +3 more. Returns: object
get_best_practicesA
Get best practices for specified task type / 获取指定任务类型的最佳实践.
Args: task_type: Task type, supports: / 任务类型,支持: - read_registers: Read registers / 读取寄存器 - connect_device: Connect device / 连接设备 - memory_operations: Memory operations / 内存操作 - flash_operations: Flash operations / Flash 操作 - debug: Debug control / 调试控制
Returns: Best practices, including recommended workflows, forbidden operations, and common errors / 最佳实践,包含推荐流程、禁止操作和常见错误
Inputs: task_type (required). Returns: object
get_connection_statusB
Get current connection status / 获取当前连接状态.
Queries JLink connection status, target chip connection status, voltage, and other information. 查询 JLink 连接状态、目标芯片连接状态、电压等信息。
Returns: Connection status information / 连接状态信息
Inputs: no named parameters. Returns: object
get_cpu_stateC
Get CPU state / 获取 CPU 状态.
Returns: CPU state information / CPU 状态信息
Inputs: no named parameters. Returns: object
get_firmware_watch_statusB
Get compiled firmware watcher status and last deployment result / 查询编译监听及部署结果.
Inputs: no named parameters. Returns: object
get_forbidden_operationsB
Get list of forbidden operations / 获取禁止的操作列表.
Returns: List of forbidden operations and their reasons / 禁止操作列表和原因说明
Inputs: no named parameters. Returns: object
get_gdb_server_statusC
Get GDB Server status / 获取 GDB Server 状态.
Returns: GDB Server status information / GDB Server 状态信息
Inputs: no named parameters. Returns: object
get_runtime_reportB
Get runtime evidence and scheduling feedback / 获取运行状态、故障及调度反馈.
Pass previous last_sequence to retrieve only new messages. Absence of findings is not a proof of correctness.
Inputs: after_sequence. Returns: object
get_semantic_statsB
Get Semantic Search Statistics / 获取语义搜索统计信息.
Returns statistics about the semantic search system including: 返回语义搜索系统的统计信息,包括:
Total number of tools / 工具总数
Number of categories / 分类数量
Initialization status / 初始化状态
Embedding cache statistics / 嵌入缓存统计
Returns: Statistics about the semantic search system / 语义搜索系统的统计信息
Inputs: no named parameters. Returns: object
get_server_capabilitiesB
Get current server capabilities / 获取当前服务器能力状态.
Returns: Server capability summary / 服务器能力摘要
Inputs: no named parameters. Returns: object
get_server_configB
Get current server configuration / 获取当前服务器配置.
Returns: Server configuration snapshot / 服务器配置快照
Inputs: no named parameters. Returns: object
get_svd_peripheralsC
Get all peripherals of specified device / 获取指定设备的所有外设.
Args: device_name: Device name (e.g., FC4150F1MBSxXxxxT1A) / 设备名称(如 FC4150F1MBSxXxxxT1A)
Returns: Peripheral list / 外设列表
Inputs: device_name (required). Returns: object
get_svd_registersC
Get all registers of specified peripheral / 获取指定外设的所有寄存器.
Args: device_name: Device name / 设备名称 peripheral_name: Peripheral name / 外设名称
Returns: Register list / 寄存器列表
Inputs: device_name (required), peripheral_name (required). Returns: object
get_system_promptB
Get system prompt or custom prompt / 获取系统提示词或自定义提示词.
Args: prompt_name: Prompt name (optional), None returns system prompt / 提示词名称(可选),None 则返回系统提示词
Returns: Prompt content / 提示词内容
Inputs: prompt_name. Returns: object
get_target_infoB
Get target device (MCU) information / 获取目标设备(MCU)信息.
Reads detailed information about the connected target chip, including device name, core type, Flash/RAM size, etc. 读取连接的目标芯片的详细信息,包括设备名称、内核类型、Flash/RAM 大小等。
Returns: Target device information / 目标设备信息
Inputs: no named parameters. Returns: object
get_target_voltageB
Get target voltage / 获取目标电压.
Reads the supply voltage of the target chip. 读取目标芯片的供电电压。
Returns: Voltage information / 电压信息
Inputs: no named parameters. Returns: object
get_usage_guidanceA
Get JLink MCP tool usage guidance / 获取 JLink MCP 工具使用指南.
Provides categories, descriptions, and usage examples for all available tools. 提供所有可用工具的分类、描述和使用示例。
Args: category: Tool category (optional), supports: / 工具分类(可选),支持: - connection: Connection management / 连接管理 - device_info: Device information / 设备信息 - memory: Memory operations / 内存操作 - flash: Flash operations / Flash 操作 - debug: Debug control / 调试控制 - rtt: RTT logging / RTT 日志 - svd: SVD register parsing / SVD 寄存器解析 None means return all categories / None 表示返回所有分类 include_examples: Whether to include usage examples / 是否包含使用示例
Returns: Usage guide, including tool categories, descriptions, and common scenarios / 使用指南,包含工具分类、描述和常见场景
Inputs: category, include_examples. Returns: object
halt_cpuC
Halt CPU / 暂停 CPU.
Returns: Halt result / 暂停结果
Inputs: no named parameters. Returns: object
host_testA
Compile and run host (native) unit tests, no hardware needed / 主机单元测试.
Runs the project's driver (auto-detected Tests/run_host_tests.py) with a host C compiler. opt="both" runs -O0 and -O3 to catch optimization-sensitive bugs. On failure it re-runs per test with --only to name the failing cases. Use it standalone, or via workflow_pipeline as a pre-flash gate.
Inputs: project_path (required), cc, opt, only, +3 more. Returns: object
inspect_projectC
Inspect CubeMX MCU, FreeRTOS version, ELF and RTT/SystemView evidence / 检测工程能力.
Inputs: project_path (required), ioc_path, firmware_path. Returns: object
list_device_patchesB
List all loaded device patches and their supported devices / 列出所有已加载的设备补丁及其支持的设备.
Lists all available device patches (e.g., Flagchip) and their supported device lists. 列出所有可用的设备补丁(如 Flagchip 等)及其支持的设备列表。
Returns: Device patch list / 设备补丁列表
Inputs: no named parameters. Returns: object
list_jlink_devicesB
List all connected JLink devices / 列出所有连接的 JLink 设备.
Returns a list of all connected JLink debuggers in the system. 返回系统中所有已连接的 JLink 调试器列表。 Each device contains serial number, product name, and connection type. 每个设备包含序列号、产品名称和连接类型。
Returns: Device information list / 设备信息列表
Inputs: no named parameters. Returns: result
list_scenariosB
List all available usage scenarios / 列出所有可用的使用场景.
Returns: Scenario list, including descriptions and expected times / 场景列表,包含描述和预期时间
Inputs: no named parameters. Returns: object
list_svd_devicesB
List all devices that support SVD / 列出所有支持 SVD 的设备.
Returns a list of all devices with SVD files loaded in the system. 返回系统中所有已加载 SVD 文件的设备列表。
Returns: Device list / 设备列表
Inputs: no named parameters. Returns: object
match_chip_nameA
Intelligently match chip name / 智能匹配芯片名称.
Matches simplified chip names (e.g., FC7300F4MDD) to complete chip names (e.g., FC7300F4MDDxXxxxT1C). Supports prefix matching, contains matching, and fuzzy matching. 将简化的芯片名称(如 FC7300F4MDD)匹配到完整的芯片名称 (如 FC7300F4MDDxXxxxT1C)。支持前缀匹配、包含匹配和模糊匹配。
Args: chip_name: Chip name (can be simplified or complete) / 芯片名称(可以是简化名称或完整名称)
Returns: Match result, including matched (matched complete name) and all_matches (all matches) / 匹配结果,包含 matched(匹配到的完整名称)和 all_matches(所有匹配项)
Inputs: chip_name (required). Returns: object
parse_register_valueB
Parse register value (parse only, no hardware read) / 解析寄存器值(仅解析,不读取硬件).
Args: device_name: Device name / 设备名称 peripheral_name: Peripheral name / 外设名称 register_name: Register name / 寄存器名称 value: Register value / 寄存器值
Returns: Register value and field parsing result / 寄存器值和字段解析结果
Inputs: value (required), device_name (required), register_name (required), peripheral_name (required). Returns: object
plan_project_debugC
Plan project-aware flash/debug without hardware writes / 只读生成烧录调试计划.
Inputs: project_path (required), chip_name, firmware_path. Returns: object
program_flashC
Program firmware to Flash / 烧录固件到 Flash.
Args: address: Start address / 起始地址 data: Data to program / 要烧录的数据 verify: Whether to verify after programming / 烧录后是否校验
Returns: Programming result / 烧录结果
Inputs: data (required), address (required), verify. Returns: object
read_memoryB
Read memory at specified address / 读取指定地址的内存.
Args: address: Start address / 起始地址 size: Read size (bytes, max 64KB) / 读取大小(字节,最大 64KB) width: Access width (8/16/32 bits, default 32) / 访问宽度(8/16/32位,默认 32)
Returns: Memory read result / 内存读取结果
Inputs: size (required), address (required), width. Returns: object
read_registersB
Read CPU registers / 读取 CPU 寄存器.
Args: register_names: Register name list (optional, None reads all general-purpose registers) / 寄存器名称列表(可选,None 则读取所有通用寄存器)
Returns: Register values / 寄存器值
Inputs: register_names. Returns: object
read_register_with_fieldsB
Read register and parse fields (combining SVD and actual read) / 读取寄存器并解析字段(结合 SVD 和实际读取).
Args: device_name: Device name / 设备名称 peripheral_name: Peripheral name / 外设名称 register_name: Register name / 寄存器名称
Returns: Register value and field parsing result / 寄存器值和字段解析结果
Inputs: device_name (required), register_name (required), peripheral_name (required). Returns: object
reset_targetC
Reset target chip / 复位目标芯片.
Args: reset_type: Reset type (normal/halt/core) / 复位类型(normal/halt/core)
Returns: Reset result / 复位结果
Inputs: reset_type. Returns: object
rtt_get_statusC
Get RTT status / 获取 RTT 状态.
Returns: RTT status information / RTT 状态信息
Inputs: no named parameters. Returns: object
rtt_readC
Read RTT log / 读取 RTT 日志.
Args: buffer_index: RTT buffer index / RTT 缓冲区索引 size: Read size (bytes) / 读取大小(字节) timeout_ms: Timeout (milliseconds) / 超时时间(毫秒)
Returns: Read result / 读取结果
Inputs: size, timeout_ms, buffer_index. Returns: object
rtt_startC
Start RTT / 启动 RTT.
Args: buffer_index: RTT buffer index / RTT 缓冲区索引 read_mode: Read mode / 读取模式 timeout_ms: Timeout (milliseconds) / 超时时间(毫秒)
Returns: Start result / 启动结果
Inputs: read_mode, timeout_ms, buffer_index. Returns: object
rtt_stopC
Stop RTT / 停止 RTT.
Returns: Stop result / 停止结果
Inputs: no named parameters. Returns: object
rtt_writeC
Write data to RTT / 向 RTT 写入数据.
Args: data: Data to write / 要写入的数据 buffer_index: RTT buffer index / RTT 缓冲区索引
Returns: Write result / 写入结果
Inputs: data (required), buffer_index. Returns: object
run_cpuC
Run CPU / 运行 CPU.
Returns: Run result / 运行结果
Inputs: no named parameters. Returns: object
runtime_snapshotA
Read Cortex-M fault evidence; optionally halt and restore running state / 可选短暂停机检查故障.
Stop background monitor first. Sticky fault status describes history, not necessarily an active fault.
Inputs: halt_if_running. Returns: object
scan_target_devicesB
Scan devices on target bus / 扫描目标总线上的设备.
Scans all devices on the JTAG chain or SWD bus. 扫描 JTAG 链或 SWD 总线上的所有设备。
Returns: Scan results / 扫描结果
Inputs: no named parameters. Returns: object
semantic_search_toolsA
Semantic Search Tools - Recommend relevant tools based on natural language query / 语义搜索工具 - 根据自然语言查询推荐相关工具.
Uses vector embedding technology to intelligently match user queries with available tools. 使用向量嵌入技术,智能匹配用户查询与可用工具。
This can significantly reduce AI model token consumption (expected 95-99% savings). 可以大幅减少 AI 模型的 Token 消耗(预期节省 95-99%)。
Examples / 示例: - "如何读取寄存器?" (How to read registers?) → Returns read_registers, read_register_with_fields - "如何烧录固件?" (How to flash firmware?) → Returns erase_flash, program_flash, verify_flash - "如何查看实时日志?" (How to view real-time logs?) → Returns rtt_start, rtt_read - "read memory" → Returns read_memory, read_registers - "connect to device" → Returns connect_device, list_jlink_devices
Args: query: User query in natural language (Chinese or English) / 用户自然语言查询(中文或英文) top_k: Number of tools to return (default: 3, range: 1-10) / 返回工具数量(默认:3,范围:1-10) threshold: Similarity threshold (default: 0.5, range: 0-1) / 相似度阈值(默认:0.5,范围:0-1)
Returns: Search results containing relevant tools with scores / 包含相关工具及分数的搜索结果
Notes: - This tool requires OpenAI API key to be configured / 此工具需要配置 OpenAI API Key - First search will generate embeddings for all tools (may take 1-2 seconds) / 首次搜索将为所有工具生成嵌入(可能需要 1-2 秒) - Subsequent searches will be fast (<50ms) due to caching / 后续搜索将很快(<50ms),因为缓存 - Supports both Chinese and English queries / 支持中文和英文查询
Inputs: query (required), top_k, threshold. Returns: object
set_breakpointC
Set breakpoint / 设置断点.
Args: address: Breakpoint address / 断点地址
Returns: Set result / 设置结果
Inputs: address (required). Returns: object
start_firmware_watchA
Watch a compiled artifact, auto flash stable changes, run and monitor / 监听编译产物并自动烧录监控.
Explicitly enables repeated hardware writes for this selected artifact. Waits for 1 second stability. One deployment attempt per SHA256. Does not execute builds or modify the firmware source. Requires confirm=True: this tool writes Flash repeatedly without further prompts.
Inputs: project_path (required), firmware_path (required), confirm, chip_name, +3 more. Returns: object
start_gdb_serverB
Start GDB Server / 启动 GDB Server.
Args: host: Listen address / 监听地址 port: Listen port / 监听端口 device: Device name / 设备名称 interface: Interface type (SWD/JTAG, default JTAG) / 接口类型(SWD/JTAG,默认 JTAG) speed: Interface speed (kHz) / 接口速度(kHz)
Returns: Start result / 启动结果
Inputs: host, port, speed, device, +1 more. Returns: object
start_runtime_monitorA
Start background J-Link/RTT/SystemView monitor / 启动后台运行状态监控.
Reserves hardware until stop/duration/trace byte limit. Poll get_runtime_report for updates. Other hardware tools are unavailable during monitoring. No CPU halts unless sample_cpu=true.
Inputs: mode, poll_ms, duration_s, sample_cpu, +4 more. Returns: object
step_instructionB
Step one instruction / 单步执行一条指令.
Returns: Step result / 单步执行结果
Inputs: no named parameters. Returns: object
stop_firmware_watchA
Stop future automatic deployments; firmware keeps running / 停止后续自动部署,固件继续运行.
Inputs: no named parameters. Returns: object
stop_gdb_serverC
Stop GDB Server / 停止 GDB Server.
Returns: Stop result / 停止结果
Inputs: no named parameters. Returns: object
stop_runtime_monitorA
Stop monitoring and release hardware for breakpoint/SVD/debug operations / 停止监控并释放硬件.
Inputs: no named parameters. Returns: object
systemview_captureA
Capture SystemView binary events and RTOS runtime summary / 采集 SystemView 并分析 RTOS.
Target must run instrumented firmware. Exclusive RTT; stop other recorders. Foreground call: up to 2 seconds discovery plus 10 seconds capture. Single core only. channel selects the SysView UP buffer, not RTT control block.
Inputs: channel, max_bytes, duration_ms, event_limit, +1 more. Returns: object
systemview_decodeB
Decode raw SystemView RTT bytes and summarize runtime / 离线解码 SystemView 二进制流.
Input is Base64 of raw RTT bytes, not a .SVDat file. Maximum 4 MiB. timestamp_hz overrides INIT timestamp clock, not necessarily CPU clock.
Inputs: data_base64 (required), event_limit, timestamp_hz. Returns: object
toolchain_detectA
Discover CMake/Ninja/arm-none-eabi/J-Link toolchain / 探测本机嵌入式工具链.
Resolution order: jlink-project.json build.toolchain → EMBEDDED_* env vars → PATH → sibling of arm-none-eabi-gcc → common install locations. Returns paths, versions and build_ready/debug_ready flags. Read-only.
Inputs: project_path. Returns: object
verify_flashC
Verify Flash content / 校验 Flash 内容.
Args: address: Start address / 起始地址 data: Expected data / 期望的数据
Returns: Verification result / 校验结果
Inputs: data (required), address (required). Returns: object
workflow_pipelineA
One-call build → host tests → optional flash/run → optional evidence / 一体化流水线.
Safe by default: flash=False. flash=True requires confirm=True (real Flash write). host_test_enabled=True runs native unit tests BEFORE any Flash write; the stage is skipped when no driver/compiler exists. host_test_opt="both" runs -O0 and -O3. observe_s>0 starts a short monitor, captures one report, then releases hardware.
Inputs: project_path (required), flash, preset, confirm, +8 more. Returns: object
write_memoryC
Write to memory / 写入内存.
Args: address: Start address / 起始地址 data: Data to write / 要写入的数据 width: Access width (8/16/32 bits, default 32) / 访问宽度(8/16/32位,默认 32)
Returns: Write result / 写入结果
Inputs: data (required), address (required), width. Returns: object
write_registerC
Write single register / 写入单个寄存器.
Args: register_name: Register name / 寄存器名称 value: Register value / 寄存器值
Returns: Write result / 写入结果
Inputs: value (required), register_name (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 65 tools
Core hardware operations are mostly distinguishable, but several clusters overlap: runtime monitoring vs SystemView vs RTT capture, deploy_project vs program_flash vs workflow_pipeline vs firmware watch, and multiple meta/guidance tools. Detailed descriptions help, but an agent must read carefully to choose the right entry point.
Most names are readable snake_case, but conventions are mixed: verb_noun (get_runtime_report, read_memory), noun_verb (rtt_start, systemview_capture, toolchain_detect), and noun_noun (runtime_snapshot, workflow_pipeline, host_test). The pattern is not fully predictable, though it remains understandable.
With 65 tools, the surface is far beyond what an agent can manage efficiently, including many meta-guidance, status, and overlapping workflow tools. Even for a broad embedded debug/build/monitor server, this is an extreme count that makes tool selection costly.
Coverage is very broad: connection, device info, memory/register access, flash, debug control, RTT, SystemView, build/test/deploy, and runtime monitoring are all present. Minor gaps remain, such as breakpoint listing/watchpoints and some higher-level project lifecycle operations, but core workflows are covered.
Maintenance
Related MCP Connectors
AI code governance and code review for Claude Code, Copilot and Cursor. Checks rules and security.
Let ChatGPT and Claude read and edit files, search and run commands on your own computer.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Every employee asks your codebase from Claude, without access to it. Statistics on each developer.
Related MCP Servers
- 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
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with STM32 development boards via J-Link debugger using RTT communication, supporting connection, logging, memory operations, and firmware flashing through natural language.121MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to build, flash, and communicate with STM32 hardware over SWD and serial, including multi-board management, live memory monitoring, and hardware sequences.26MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to debug embedded devices via SEGGER J-Link probes, including reading memory, flashing firmware, streaming RTT logs, and diagnosing crashes.48114 npm48MIT