# OpenOCD Debugger [Health: Active]

**Category:** 📟 Embedded System  
**Repository:** https://github.com/microhenrio/openocd-mcp  
**GitHub Stars:** 4  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/openocd-debugger

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

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "openocd-debugger": {
    "command": "uvx",
    "args": ["openocd-mcp"]
  }
}
```

## Documentation

## What OpenOCD Debugger MCP server does

The OpenOCD Debugger MCP server exposes microcontroller debugging operations through MCP. It works with targets supported by OpenOCD and uses a connected debug probe such as ST-Link, J-Link, or CMSIS-DAP. The server is chip-agnostic at the MCP layer; the target is selected through OpenOCD configuration.

Firmware images in ELF, BIN, or HEX formats can be programmed and verified. An AI client can also halt, resume, single-step, and reset the CPU, inspect or modify memory, and read or write CPU registers. Hardware and software breakpoints are supported, including conditional and hit-count variants. Hardware watchpoints can stop execution when an address is read, written, or accessed.

An ELF file adds symbol-aware variable access, so variables can be read or written by name. A CMSIS-SVD file adds named peripheral-register access with decoded bitfields, such as `RCC.CR` or `GPIOA.MODER`. Live variable watching samples values over time without halting the CPU and can expand structs and arrays using DWARF type information.

## How it works

The server communicates with OpenOCD, either by starting it when a session needs it or by using an existing executable. OpenOCD then connects to the target through the configured probe and transport. The project configuration identifies the target configuration and can optionally identify the interface, transport, ELF, and SVD files.

A typical session starts with connecting to and halting the target, followed by status inspection or a debugging action selected by the AI client. The active settings can be checked with `show_config`. SWD and JTAG transports are supported; the README specifically describes J-Link on Cortex-M with a J-Link interface configuration and SWD transport.

The OpenOCD Debugger MCP server includes permission controls intended to limit unexpected target changes. These include read-only mode, gated flash erase, and flash path and size limits.

## Setup and configuration

Use Python 3.10 or newer and connect a debug probe to the target. The repository can be installed in a virtual environment, producing the `openocd-mcp` executable. A Windows `setup.bat` shortcut creates the environment, installs the package, and registers it with Claude Code.

OpenOCD is downloaded for the local platform and cached on first connection with checksum verification. It can also be installed in advance with `openocd-mcp install-openocd`. To use an existing OpenOCD installation, set `OPENOCD_BIN` to its executable.

Create `openocd-mcp.json` in the firmware project. Set `target_cfg` to the chip configuration, and optionally set `interface_cfg`, `transport`, `svd_file`, and `elf_file`. Paths and configuration names must match the OpenOCD installation and the project layout. A J-Link on Windows requires its debug interface to be bound to libusbK or WinUSB for OpenOCD access.

Register the executable as a local stdio MCP server in the chosen client, then restart that client. The README provides registration examples for Claude Code, Claude Desktop, Cursor, Windsurf, Cline, Continue, and VS Code with GitHub Copilot.

## Tools and capabilities

The documented operations cover:

- Programming and verifying ELF, BIN, and HEX firmware.
- Halting, resuming, stepping, and resetting execution.
- Reading and writing memory and CPU registers.
- Creating hardware or software breakpoints, including conditional and hit-count breakpoints.
- Creating hardware watchpoints for read, write, or access events.
- Reading and writing ELF-backed variables by symbol name.
- Sampling variables without stopping the CPU, with typed struct and array expansion.
- Reading CMSIS-SVD peripheral registers and named bitfields.
- Reporting the active debugging configuration.

The OpenOCD Debugger MCP server does not expose an MCP self-update tool. Updating requires a terminal command such as a package upgrade, a refreshed `uvx` invocation, or a Git pull followed by installation when dependencies change. Restart the AI client after updating.

_Full upstream README: https://allmcps.com/mcp/openocd-debugger/readme_

