Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CMSIS-DAP MCP

An open-source debug tool suite for CMSIS-DAP probes and Cortex-M chips, providing an MCP server (for AI assistants) and a standalone CLI, both built on the same engine over SWD or JTAG.

New here? Start with the Getting Started guide for a step-by-step walkthrough from environment setup to your first connection.

Two tools

  • cmsis-dap-mcp — an MCP (Model Context Protocol) server that lets AI assistants (Codex, Claude Code, opencode, etc.) drive your probe and target chip directly.
  • cmsis-dap-cli — a standalone command-line tool for humans, scripts and automation, no AI client needed.

Core features

Probe and session

ToolWhat it does
list_probesEnumerate all connected CMSIS-DAP probes
get_probe_infoView probe details (product, serial, protocols, speeds)
connectConnect to a target via SWD or JTAG; supports under-reset connect
disconnectEnd the current session
get_target_infoView target info (core type, CPUID, memory regions)

Memory access

ToolWhat it does
read_memoryRead memory (u8/u16/u32/u64); export a range as bin/hex file
write_memoryWrite memory
verify_memoryRead back and compare against expected data; report mismatches

Core control

ToolWhat it does
read_core_register / write_core_registerRead/write core registers (pc, sp, lr, r0-r15, …)
list_core_registersList all registers available on the target
get_core_statusQuery core state (running/halted/sleeping/locked up)
halt / resume / stepPause / resume / single-step execution
resetReset the target; continue or halt after reset

Breakpoints and watchpoints

ToolWhat it does
set_breakpoint / clear_breakpoints / list_breakpointsHardware breakpoint management
set_watchpoint / clear_watchpoints / list_watchpointsDWT data watchpoints (read/write/rw trigger)

DAP raw access

ToolWhat it does
read_dap / write_dapDirect DP/AP register read/write (advanced debugging)

SVD named peripherals

ToolWhat it does
load_svdLoad any CMSIS-SVD file at runtime
list_peripheralsList all loaded peripherals
read_peripheral / write_peripheralRead/write peripheral registers and bitfields by name (read-modify-write)

Flash programming

ToolWhat it does
erase_flashErase flash by sector (only sectors overlapping the requested range)
program_flashProgram firmware from elf/axf/bin/hex files; optional read-back verify

Chip definition

ToolWhat it does
define_chip (MCP)Register an unknown chip at runtime from a Keil FLM file
chip generate (CLI)Generate a probe-rs target YAML from an FLM file
chip list / chip searchList or search the built-in chip library

Script engine

ToolWhat it does
run_script (MCP) / script (CLI)Execute J-Link Commander / OpenOCD style debug scripts

Non-invasive debugging

ToolWhat it does
dump_cpu_state (MCP) / dump (CLI)Take a CPU snapshot without resetting: registers, fault status, stacks, memory

Remote access

FeatureDescription
TCP JSON-RPC server--tcp PORT (MCP) or tcp-server (CLI): line-delimited remote protocol
GDB server--gdb-port PORT (MCP) or gdb-server (CLI): GDB Remote Serial Protocol stub

Runtime configuration

ToolWhat it does
get_configView current runtime configuration
update_configUpdate config at runtime (destructive gate, TCP/GDB ports) without restart
reload_configRe-apply the config file given at startup

Security

Three-tier security: read-only tools are always available; write tools are governed by the MCP client approval policy; destructive tools (flash erase/program) are disabled by default and must be explicitly enabled.

CLI live debugging (CLI-only)

FeatureDescription
watchPoll variables by address or ELF symbol with configurable refresh; timestamped log export
rtt monitorRead SEGGER RTT up-channel logs over SWD/JTAG — no UART needed
evr monitorDecode CMSIS-View Event Recorder events — no trace hardware needed
replInteractive shell that keeps one session open

Highlights

  • Generic Cortex-M support: standard cores work without chip-specific adaptation
  • Runtime chip definition: register unknown chips from FLM files; no pre-built YAML needed
  • Zero-argument startup: server starts with no flags and is fully configurable at runtime
  • Zero dependencies for end users: npx -y cmsis-dap-mcp or a single native binary
  • Cross-platform: Windows / Linux / macOS

Documentation

Chinese documentation: https://guohj2021.github.io/CMSIS-DAP-MCP/zh/