← Back to search

OpenOCD Debugger

microhenrio Scanned 1d ago

Debug microcontrollers from Claude via OpenOCD: flash, breakpoints, memory and registers by name.

D
57.3 / 100

Versions

0.1.0latest
first seen Jun 30, 2026
PermissionsTool SafetyAuthAnnotationsCode QualityStabilitySpecVuln HistoryAuthorTransparencyCommunity

Tools 39

resume
annotations: none low

Resume CPU execution. Optionally resume from a specific address. If conditional breakpoints are set, this skips past those whose condition is false and stops at the first one whose condition is true (or on any other halt).

address str
configure
annotations: none low

Set the chip/project settings for this session. Only non-empty arguments are applied; the rest keep their current values. interface_cfg : debug-probe OpenOCD config, e.g. 'interface/stlink.cfg' or 'interface/jlink.cfg' target_cfg : chip OpenOCD config, e.g. 'target/stm32g0x.cfg' transport : 'swd' or 'jtag' — set 'swd' for J-Link on Cortex-M (else it picks JTAG) svd_file : path to the chip's CMSIS-SVD file (peripheral registers) elf_file : path to the firmware .elf (variables by name) Alternatively, put these in an 'openocd-mcp.json' file in your project so they load automatically. Loading a new SVD/ELF takes effect on next use.

elf_file str svd_file str transport str target_cfg str interface_cfg str
show_config
annotations: none low

Show the current effective project settings and where they came from.

set_permissions
annotations: none low

Adjust safety permissions for this session (only provided args change). read_only : master switch — blocks all writes/flash/erase/raw allow_memory_write : write_memory / write_variable / write_register / write_peripheral_register allow_flash : flash_write (program) allow_flash_erase : flash_erase_sector (destructive; off by default) allow_raw_command : run_command escape hatch flash_max_bytes : reject flashing files larger than this (0 = no limit) For persistent settings, put a "permissions" object in openocd-mcp.json. (flash_allowed_paths is set there, not here.)

read_only string allow_flash string flash_max_bytes string allow_flash_erase string allow_raw_command string allow_memory_write string
install_openocd
annotations: none low

Download and cache OpenOCD for this OS/architecture (if not already present), so the server can run without a separate OpenOCD install. Verifies a pinned SHA-256. Needed only when OpenOCD isn't bundled or on PATH (e.g. a pip install).

start_openocd
annotations: none low

Start OpenOCD as a subprocess (so you don't have to launch it manually). Detects an already-running instance and won't start a duplicate. interface_cfg : debug-probe config (default: project setting, else ST-Link) target_cfg : chip config, e.g. 'target/stm32f4x.cfg' (default: project setting) Leave both empty to use the configured project settings (see configure / openocd-mcp.json). A target_cfg must be set somewhere or this errors.

target_cfg str interface_cfg str
stop_openocd
annotations: none low

Stop the OpenOCD process this server started.

status
annotations: none low

Report current debug state: whether OpenOCD is running, whether the target is halted or running, and the current program counter (PC) if halted. Does not disturb execution.

connect
annotations: none low

Connect to OpenOCD. Call this first. If nothing is listening and auto_start is True, the server launches OpenOCD itself using the configured project settings (probe + target) and connects. Set auto_start=False to require an already-running OpenOCD.

host str port int auto_start bool
halt
annotations: none low

Halt the target CPU so registers and memory can be inspected.

reset
annotations: none low

Reset the target. mode: 'halt' — reset and immediately halt (good for debugging) 'run' — reset and start running 'init' — reset and run init scripts With 'run' and conditional breakpoints set, this honors those conditions (skipping false ones) just like resume.

mode str
step
annotations: none low

Execute a single instruction and halt again.

read_registers
annotations: none low

Dump all CPU registers (r0-r15, pc, sp, lr, xpsr, etc.).

read_register
annotations: none low

Read a single CPU register by name. Examples: 'r0', 'pc', 'sp', 'lr', 'xpsr', 'msp', 'psp'

name str
write_register
annotations: none low

Write a value to a CPU register. value: hex string, e.g. '0x20001000'

name str value str
read_memory
annotations: none low

Read memory from the target. address : hex address, e.g. '0x20000000' count : number of units to read width : unit size in bits — 8, 16, or 32

count int width int address str
write_memory
annotations: none low

Write a value to a memory address. address : hex address, e.g. '0x20000000' value : hex value, e.g. '0xDEADBEEF' width : 8, 16, or 32

value str width int address str
read_peripheral
annotations: none low

Read memory-mapped peripheral registers. base_address : peripheral base, e.g. '0x40020000' for GPIOA on STM32 count : number of 32-bit registers to read (default 16)

count int base_address str
add_breakpoint
annotations: none low

Add a breakpoint. address : hex address, e.g. '0x08001234' hardware : True for hardware breakpoint (recommended for flash); False for software

address str hardware bool
remove_breakpoint
annotations: none low

Remove the breakpoint at the given address.

address str
add_watchpoint
annotations: none low

Add a data watchpoint. address : hex address to watch length : size in bytes (usually 1, 2, or 4) type : 'r' (read), 'w' (write), or 'a' (access/any) value : optional hex value to match (hardware dependent) mask : optional hex mask for the value match

mask str type str value str length int address str
remove_watchpoint
annotations: none low

Remove the watchpoint at the given address.

address str
list_breakpoints
annotations: none low

List all currently set breakpoints and watchpoints.

remove_all_breakpoints
annotations: none low

Remove every breakpoint and watchpoint that is currently set.

add_conditional_breakpoint
annotations: none low

Add a conditional breakpoint. The target halts at `address` only if `condition` evaluates true; otherwise resume/reset-run skips past it. address : hex address for the breakpoint condition : a TCL expression/block. Use get_reg <name> and get_mem <addr> ?width?. It is evaluated when the breakpoint is hit; non-zero = halt. Examples: 'expr {[get_reg r0] > 100}' 'expr {[get_mem 0x20000000] == 0xdeadbeef}' 'incr ::hit_count; expr {$::hit_count >= 5}'

address str condition str
remove_conditional_breakpoint
annotations: none low

Remove the conditional breakpoint at the given address.

address str
flash_write
annotations: none low

Program a firmware file onto the target flash. path : full path to .elf, .bin, or .hex file verify : read back and verify after programming (recommended) reset_after : reset and run the new firmware after flashing

path str verify bool reset_after bool
flash_info
annotations: none low

Display information about the flash bank (size, sectors, erase state).

bank int
flash_erase_sector
annotations: none low

Erase a range of flash sectors. bank : flash bank index (usually 0) first : first sector number to erase last : last sector number to erase (inclusive)

bank int last int first int
load_elf
annotations: none low

Load variable names and addresses from a firmware .elf file, so you can read and write variables by name. Build the firmware with debug symbols. path: full path to the .elf (defaults to the configured elf_file if set).

path str
read_variable
annotations: none low

Read a global/static variable by name (requires load_elf first). Scalars (1/2/4 bytes) are decoded to hex and decimal; larger objects (arrays, structs) are dumped as words.

name str
write_variable
annotations: none low

Write a scalar global/static variable by name (requires load_elf first). value: hex (e.g. '0x2A') or decimal. Use write_memory for arrays/structs.

name str value str
list_variables
annotations: none low

List known variable names, optionally filtered by a substring.

filter str
watch_variables
annotations: none low

Live-watch one or more variables WITHOUT halting the CPU: sample them repeatedly while the target runs and return a time-series table. names : comma- or space-separated variable names (requires load_elf). samples : number of snapshots, 1-200. interval_ms : delay between snapshots in milliseconds. Works for RAM globals/statics (read live via background memory access). CPU registers need a halt and aren't supported here. Multi-word values are read non-atomically, so a >4-byte value may be momentarily inconsistent. This tool is one-shot and returns a flat text table. For an open-ended, auto-refreshing GUI window with expandable structs/arrays, there is a separate standalone program called `openocd-watch`. It is NOT reachable through this MCP server as a tool call — but it is an ordinary console script, so an assistant with its own shell/process-launch capability (e.g. a coding agent with a terminal tool) MAY run it directly as a background process for the user, same as it would run any other CLI program. An assistant limited to this server's MCP tools cannot reach it and should tell the user to run it themselves instead. Invocation: openocd-watch <var1> <var2> --elf <path/to/firmware.elf> Add --autostart if OpenOCD isn't already running.

names str samples int interval_ms int
load_svd
annotations: none low

Load peripheral register definitions from a CMSIS-SVD file. Loaded automatically on first use from the configured svd_file; call this only to use a different SVD. path defaults to the configured svd_file.

path str
read_peripheral_register
annotations: none low

Read a peripheral register by name (e.g. 'RCC.CR', 'GPIOA.MODER') and decode its named bitfields. The target should be halted for a stable read.

name str
write_peripheral_register
annotations: none low

Write a 32-bit value to a peripheral register by name (e.g. 'GPIOA.ODR').

name str value str
list_peripheral_registers
annotations: none low

With no argument: list all peripheral names. With a peripheral name (e.g. 'RCC'): list that peripheral's registers.

peripheral str
run_command
annotations: none low

Run any raw OpenOCD TCL command and return its output. Use this for anything not covered by the other tools.

command str

Permissions 4

network medium
Server uses network capabilities via: socket, urllib
filesystem low
Server uses filesystem capabilities via: open(), os, shutil
shell high
Server uses shell capabilities via: subprocess
env_vars low
Server uses env_vars capabilities via: os.environ

Scan Findings 104

low
Tool 'write_memory' has no annotations annotation_checker · 100%
low
Tool 'configure' has no annotations annotation_checker · 100%
low
Tool 'show_config' has no annotations annotation_checker · 100%
low
Tool 'set_permissions' has no annotations annotation_checker · 100%
low
Tool 'install_openocd' has no annotations annotation_checker · 100%
low
Tool 'start_openocd' has no annotations annotation_checker · 100%
low
Tool 'stop_openocd' has no annotations annotation_checker · 100%
low
Tool 'status' has no annotations annotation_checker · 100%
low
Tool 'connect' has no annotations annotation_checker · 100%
low
Tool 'halt' has no annotations annotation_checker · 100%
low
Tool 'resume' has no annotations annotation_checker · 100%
low
Tool 'reset' has no annotations annotation_checker · 100%
low
Tool 'step' has no annotations annotation_checker · 100%
low
Tool 'read_registers' has no annotations annotation_checker · 100%
low
Tool 'read_register' has no annotations annotation_checker · 100%
low
Tool 'write_register' has no annotations annotation_checker · 100%
low
Tool 'read_memory' has no annotations annotation_checker · 100%
low
Tool 'read_peripheral' has no annotations annotation_checker · 100%
low
Tool 'add_breakpoint' has no annotations annotation_checker · 100%
low
Tool 'remove_breakpoint' has no annotations annotation_checker · 100%
low
Tool 'add_watchpoint' has no annotations annotation_checker · 100%
low
Tool 'remove_watchpoint' has no annotations annotation_checker · 100%
low
Tool 'list_breakpoints' has no annotations annotation_checker · 100%
low
Tool 'remove_all_breakpoints' has no annotations annotation_checker · 100%
low
Tool 'add_conditional_breakpoint' has no annotations annotation_checker · 100%
low
Tool 'remove_conditional_breakpoint' has no annotations annotation_checker · 100%
low
Tool 'flash_write' has no annotations annotation_checker · 100%
low
Tool 'flash_info' has no annotations annotation_checker · 100%
low
Tool 'flash_erase_sector' has no annotations annotation_checker · 100%
low
Tool 'load_elf' has no annotations annotation_checker · 100%
low
Tool 'read_variable' has no annotations annotation_checker · 100%
low
Tool 'write_variable' has no annotations annotation_checker · 100%
low
Tool 'list_variables' has no annotations annotation_checker · 100%
low
Tool 'watch_variables' has no annotations annotation_checker · 100%
low
Tool 'load_svd' has no annotations annotation_checker · 100%
low
Tool 'read_peripheral_register' has no annotations annotation_checker · 100%
low
Tool 'write_peripheral_register' has no annotations annotation_checker · 100%
low
Tool 'list_peripheral_registers' has no annotations annotation_checker · 100%
low
Tool 'run_command' has no annotations annotation_checker · 100%
info
Sandbox failed to start for behavioral verification behavioral_verifier · 100%
medium
Vulnerable dependency: mcp@1.9.0 (GHSA-3qhf-m339-9g5v) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (GHSA-9h52-p55h-vw2f) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (GHSA-j975-95f5-7wqh) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (GHSA-jpw9-pfvf-9f58) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (GHSA-vj7q-gjh5-988w) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (PYSEC-2026-1616) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (PYSEC-2026-1617) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (PYSEC-2026-1618) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (PYSEC-2026-3482) dependency_analyzer · 95%
medium
Vulnerable dependency: mcp@1.9.0 (PYSEC-2026-3483) dependency_analyzer · 95%
medium
Hex string literal (>50 chars) in microhenrio-openocd-mcp-2e3307f/openocd_mcp/provision.py:29 entropy_analyzer · 70%
medium
Hex string literal (>50 chars) in microhenrio-openocd-mcp-2e3307f/openocd_mcp/provision.py:33 entropy_analyzer · 70%
medium
Hex string literal (>50 chars) in microhenrio-openocd-mcp-2e3307f/openocd_mcp/provision.py:37 entropy_analyzer · 70%
medium
Hex string literal (>50 chars) in microhenrio-openocd-mcp-2e3307f/openocd_mcp/provision.py:41 entropy_analyzer · 70%
medium
Hex string literal (>50 chars) in microhenrio-openocd-mcp-2e3307f/openocd_mcp/provision.py:45 entropy_analyzer · 70%
info
pyproject.toml metadata manifest_parser · 100%
info
Tool: configure manifest_parser · 90%
info
Tool: show_config manifest_parser · 90%
info
Tool: set_permissions manifest_parser · 90%
info
Tool: install_openocd manifest_parser · 90%
info
Tool: start_openocd manifest_parser · 90%
info
Tool: stop_openocd manifest_parser · 90%
info
Tool: status manifest_parser · 90%
info
Tool: connect manifest_parser · 90%
info
Tool: halt manifest_parser · 90%
info
Tool: resume manifest_parser · 90%
info
Tool: read_peripheral_register manifest_parser · 90%
info
Tool: reset manifest_parser · 90%
info
Tool: step manifest_parser · 90%
info
Tool: read_registers manifest_parser · 90%
info
Tool: read_register manifest_parser · 90%
info
Tool: write_register manifest_parser · 90%
info
Tool: read_memory manifest_parser · 90%
info
Tool: write_memory manifest_parser · 90%
info
Tool: read_peripheral manifest_parser · 90%
info
Tool: add_breakpoint manifest_parser · 90%
info
Tool: remove_breakpoint manifest_parser · 90%
info
Tool: add_watchpoint manifest_parser · 90%
info
Tool: remove_watchpoint manifest_parser · 90%
info
Tool: list_breakpoints manifest_parser · 90%
info
Tool: remove_all_breakpoints manifest_parser · 90%
info
Tool: write_peripheral_register manifest_parser · 90%
info
Tool: add_conditional_breakpoint manifest_parser · 90%
info
Tool: remove_conditional_breakpoint manifest_parser · 90%
info
Tool: flash_write manifest_parser · 90%
info
Tool: flash_info manifest_parser · 90%
info
Tool: flash_erase_sector manifest_parser · 90%
info
Tool: load_elf manifest_parser · 90%
info
Tool: read_variable manifest_parser · 90%
info
Tool: write_variable manifest_parser · 90%
info
Tool: list_variables manifest_parser · 90%
info
Tool: watch_variables manifest_parser · 90%
info
Tool: load_svd manifest_parser · 90%
info
Tool: list_peripheral_registers manifest_parser · 90%
info
Tool: run_command manifest_parser · 90%
info
Required env vars (6) manifest_parser · 80%
info
Sandbox failed to start for output poisoning scan output_poisoning · 100%
medium
Permission: network access detected permission_analyzer · 90%
low
Permission: filesystem access detected permission_analyzer · 90%
high
Permission: shell access detected permission_analyzer · 95%
low
Permission: env_vars access detected permission_analyzer · 90%
critical
Tool poisoning in 'load_svd': Cross-tool prerequisite: 'first call/use' poisoning · 85%
info
SBOM generated: 3 components sbom_generator · 100%
medium
No build provenance detected (SLSA L0) slsa_assessor · 90%