sbl-debugger
OfficialClick on "Install 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., "@sbl-debuggerattach to daisy and set breakpoint at main"
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.
sbl-debugger
Embedded debug MCP server for ARM Cortex-M targets. Gives AI coding assistants direct control of GDB and OpenOCD — attach to hardware, set breakpoints, step through code, inspect registers and memory, all within a conversation.
Part of the Sound Byte Labs embedded tooling suite, alongside sbl-probe for serial I/O.
Installation
Create a virtual environment and install the package:
python3 -m venv .venv
source .venv/bin/activate
# Install
pip install -e .
# Or with test dependencies
pip install -e ".[dev]"System Requirements
gdb-multiarch(GDB with ARM target support)openocd(0.12.0+ recommended)SWD debug probe (ST-LINK, CMSIS-DAP, etc.)
On Debian/Ubuntu/Raspberry Pi OS:
sudo apt install gdb-multiarch openocdRelated MCP server: jlink-mcp
MCP Configuration
Register the server in your MCP client's config. For most clients, add to .mcp.json in your project root:
{
"mcpServers": {
"sbl-debugger": {
"type": "stdio",
"command": "/absolute/path/to/.venv/bin/python",
"args": ["-m", "sbl_debugger"]
}
}
}Important: Use the absolute path to the Python binary inside your virtual environment. For example:
/home/you/sbl-debugger-mcp/.venv/bin/python
Restart your MCP client and the tools are available immediately.
Tools
Session Management
Tool | Description |
| Attach to a target — launches OpenOCD + GDB, connects via SWD |
| Cleanly shut down a debug session |
| List all active debug sessions |
| Get current target state (halted/running, stop reason, current frame) |
| List available predefined target profiles |
Execution Control
Tool | Description |
| Halt a running target |
| Resume execution |
| Block until target stops (breakpoint hit, etc.) |
| Step source lines (into functions) |
| Step source lines (over function calls) |
| Step out of current function |
| Step machine instructions |
| Run to a location (sets temporary breakpoint + continues) |
| Reset the target (halt or run after reset) |
Inspection
Tool | Description |
| Read CPU registers (all core regs or specific subset) |
| Write a CPU register |
| Read memory (hex, u8, u16, u32 formats) |
| Write to memory |
| Get the call stack |
| List local variables in current frame |
| Evaluate a C/C++ expression in target context |
| Disassemble at an address or current PC |
Breakpoints
Tool | Description |
| Set breakpoint by function name, file:line, or address |
| Delete a breakpoint |
| List all breakpoints and watchpoints |
| Set a hardware data watchpoint (write/read/access) |
Peripheral Registers (SVD)
Tool | Description |
| List SVD peripherals with base addresses and register counts |
| Show all registers and bitfield definitions for a peripheral |
| Read a register from hardware and decode all bitfields |
| Read all registers of a peripheral with decoded bitfields |
Requires
cecrops(optional dependency) andSBL_HW_PATHenvironment variable pointing to sbl-hardware. Install with:pip install -e ".[svd]"
Snapshot & Advanced
Tool | Description |
| Full target state in one call (frame, registers, backtrace, locals, source) |
| Flash firmware to the target |
| Send raw OpenOCD monitor commands |
Target Profiles
Predefined profiles eliminate the need to remember OpenOCD configs:
Profile | Hardware | Debug Probe |
| Electrosmith Daisy Seed (STM32H750, Cortex-M7) | ST-LINK |
| Raspberry Pi Pico (RP2040, Cortex-M0+) | CMSIS-DAP Debug Probe |
| Raspberry Pi Pico 2 (RP2350, Cortex-M33) | CMSIS-DAP Debug Probe |
| Any target | Provide |
Custom targets work with any OpenOCD-supported hardware:
debug_attach(target="custom", interface="jlink.cfg", target_cfg="stm32f4x.cfg", elf="firmware.elf")Architecture
sbl_debugger/
├── server.py # FastMCP server, tool wiring
├── targets.py # Target profiles (daisy, pico, pico2)
├── session/
│ ├── manager.py # Thread-safe session registry
│ └── session.py # DebugSession (owns OpenOCD + GDB)
├── process/
│ ├── openocd.py # OpenOCD subprocess lifecycle
│ └── ports.py # GDB server port allocation
├── bridge/
│ ├── mi.py # GDB/MI wrapper (pygdbmi + lock)
│ └── types.py # FrameInfo, StopEvent, MiResult
├── svd/
│ ├── peripheral_db.py # SVD lookup/decode (wraps cecrops Device)
│ └── loader.py # SBL_HW_PATH resolution, cecrops import guard
└── tools/
├── session.py # attach, detach, sessions, status, targets
├── execution.py # halt, continue, step, reset
├── inspection.py # registers, memory, backtrace, locals
├── breakpoints.py # breakpoint/watchpoint management
├── snapshot.py # combined state dump
├── advanced.py # load (flash), monitor (raw OpenOCD)
└── peripheral.py # SVD peripheral register decodingKey design decisions:
Managed subprocesses — OpenOCD and GDB are launched, monitored, and cleaned up by the server. One
debug_attachcall does everything.GDB/MI via pygdbmi — structured command/response interface, no string parsing of GDB CLI output
Single command lock — one MI command at a time prevents response interleaving
Explicit polling —
wait_for_haltanddebug_statuscheck target state on demand, matching MCP's request/response modelError dicts, not exceptions — tools return
{"error": "..."}instead of crashing the server
Running Tests
pytest # 275 tests (all mocked, no hardware needed)
pytest -v # verbose
pytest tests/test_tools.py # just tool testsDependencies
mcp— Official Python MCP SDK (FastMCP)pygdbmi— GDB Machine Interface protocolcecrops— SVD register definitions (optional, for peripheral tools)Python >= 3.11
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/soundbytelabs/sbl-debugger-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server