Quickstart
npm (recommended)
Install nothing — let your MCP client launch the server with npx:
codex mcp add cmsis-dap -- npx -y cmsis-dap-mcp
The npm package cmsis-dap-mcp downloads the correct platform binary
automatically on first launch and caches it afterwards.
To pin a version:
codex mcp add cmsis-dap -- npx -y cmsis-dap-mcp@0.5.0
Native binary
Download the binary for your platform from the GitHub Releases page, then point the client at it:
codex mcp add cmsis-dap -- /path/to/cmsis-dap-mcp --log-level warn
This is the standard way to run an unpublished or locally built server, or when you need an exact, offline-pinned binary.
Configuration styles
MCP clients can start a stdio server in three equivalent ways. The
npx form is the standard for published packages; the local-binary form is
equivalent and used for local builds.
| Style | Example | Best for |
|---|---|---|
npx package | command = "npx", args = ["-y", "cmsis-dap-mcp"] | Published releases; updates with npm |
| Local binary | command = "/path/to/cmsis-dap-mcp" | Local builds, offline, exact version |
| Remote URL | url = "https://..." | Streamable-HTTP servers (not supported by this project) |
All three clients covered on the AI client configuration
page accept both the npx form and a local binary path; the server behaves
identically either way.
First session
The server can be started with zero arguments — it enters a to-be-configured state where all read/write tools work and destructive tools stay gated until enabled (see step 7).
list_probesto find your probe id.connectwith{"protocol": "swd", "speed_khz": 1000}.read_memory/write_memoryfor raw access.halt, thenread_core_register(e.g.pc,sp,lr,r0).resumewhen done.load_svdwith your own SVD path for named peripheral access.program_flash/erase_flashrequire destructive mode: start the server with--allow-destructive, or callupdate_config {"allow_destructive": true}at runtime (no restart needed).- For a chip not built into probe-rs, call
define_chipwith a Keil FLM file beforeconnect(see Tools).
Example (verified output on a CMSIS-DAP probe + Cortex-M0+ board):
list_probes -> {"probes": [{"id": "0123456789AB", "product": "CMSIS-DAP", ...}]}
connect {protocol: swd, speed_khz: 1000}
-> {"target": {"core_type": "Armv6m", "core_count": 1, "ap_count": 1, "cpu_id": ..., "dp_id": ...}}
read_memory {address: 0x20000000, width: u32, count: 4}
-> {"values": [64000000, 1, 3, 0]}
halt -> {"halted": true}
read_core_register {name: pc} -> {"value": 134228884}
resume -> {"running": true}
CLI quick start
The standalone cmsis-dap-cli shares the same engine and auto-connects with
the global options (--probe-id, --target, --target-yaml, …):
cmsis-dap-cli --probe-id 0123456789AB --target STM32F030C8 connect
cmsis-dap-cli --probe-id 0123456789AB --target STM32F030C8 read --address 0x20000000 --width u32 --count 4
cmsis-dap-cli --probe-id 0123456789AB --target STM32F030C8 --elf fw.axf watch counter --interval-ms 200 --count 0
cmsis-dap-cli --probe-id 0123456789AB --target STM32F030C8 --elf fw.axf rtt monitor --count 0
cmsis-dap-cli --probe-id 0123456789AB --target STM32F030C8 --elf fw.axf evr monitor --count 0
Use repl to keep one session open (halt/read/resume across lines, or run the
watch/RTT/Event Recorder monitors after reset run). See the
CLI reference for the full command set.
Logs go to stderr only; the MCP protocol runs over stdout.