J-Link MCP — Claude Code MCP server for firmware debugging
Hooks an AI assistant up to real hardware through SEGGER J-Link probes: register reads, flashing, RTT logs and Cortex-M crash decoding.
claude mcp add --env JLINK_DEVICE=<JLINK_DEVICE> --env JLINK_SERIAL=<JLINK_SERIAL> --env SVD_PATH=<SVD_PATH> --env JLINK_RTT_ADDR=<JLINK_RTT_ADDR> --transport stdio j-link-mcp -- npx -y jlink-mcpWhat J-Link MCP does
The server exposes debugging tools to your assistant: read registers and memory, flash and reset a board, stream RTT logs with filtering by level, module or regex, halt, step and resume execution, set breakpoints, start a GDB server. The diagnose_crash call does the tedious part — it decodes ARM Cortex-M fault registers, unwinds the exception stack frame and points at the instruction that faulted.
Give it your target's CMSIS-SVD file and peripheral registers come back with field names and enumeration values taken from the vendor description instead of raw hex. OpenOCD (ST-Link, CMSIS-DAP, FTDI) and Black Magic Probe backends are supported too.
Before you start you need the SEGGER J-Link software package, Node 18+ and a probe wired to an ARM Cortex-M target. The other backends want OpenOCD or arm-none-eabi-gdb in place of J-Link. Registering the server without JLINK_DEVICE leaves it with no idea which chip to talk to, so set that variable up front.
What it helps with
- decode a HardFault and locate the faulting instruction
- flash and reset a board without typing J-Link commands
- filter RTT output by module or severity
- read a peripheral register by its SVD field name
- spin up a GDB session for a full debug run
Example prompts for the agent
- Run
diagnose_crashand tell me where the firmware faulted - Flash my nRF52840 and reset the board
- Show recent warnings from the RTT log for the sensor_drv module
How to install J-Link MCP
Platform CLI
claude mcp add --env JLINK_DEVICE=<JLINK_DEVICE> --env JLINK_SERIAL=<JLINK_SERIAL> --env SVD_PATH=<SVD_PATH> --env JLINK_RTT_ADDR=<JLINK_RTT_ADDR> --transport stdio j-link-mcp -- npx -y jlink-mcpReplace <…> with your own values
Platform CLI
codex mcp add j-link-mcp --env JLINK_DEVICE=<JLINK_DEVICE> --env JLINK_SERIAL=<JLINK_SERIAL> --env SVD_PATH=<SVD_PATH> --env JLINK_RTT_ADDR=<JLINK_RTT_ADDR> -- npx -y jlink-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"j-link-mcp": {
"command": "npx",
"args": [
"-y",
"jlink-mcp"
],
"env": {
"JLINK_DEVICE": "<JLINK_DEVICE>",
"JLINK_SERIAL": "<JLINK_SERIAL>",
"SVD_PATH": "<SVD_PATH>",
"JLINK_RTT_ADDR": "<JLINK_RTT_ADDR>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"j-link-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"jlink-mcp"
],
"env": {
"JLINK_DEVICE": "<JLINK_DEVICE>",
"JLINK_SERIAL": "<JLINK_SERIAL>",
"SVD_PATH": "<SVD_PATH>",
"JLINK_RTT_ADDR": "<JLINK_RTT_ADDR>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e JLINK_DEVICE=<JLINK_DEVICE> -e JLINK_SERIAL=<JLINK_SERIAL> -e SVD_PATH=<SVD_PATH> -e JLINK_RTT_ADDR=<JLINK_RTT_ADDR> j-link-mcp npx -y jlink-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about J-Link MCP
How do I install J-Link MCP in Claude Code?
From the plugin marketplace: claude mcp add jlink-mcp -e JLINK_DEVICE=<JLINK_DEVICE> -- npx -y jlink-mcp. A fuller form passes the extra variables: `claude mcp add --env JLINK_DEVICE=<JLINK_DEVICE> --env JLINK_SERIAL=<JLINK_SERIAL> --env SVD_PATH=<SVD_PATH> --env JLINK_RTT_ADDR=<JLINK_RTT_ADDR> --transport stdio j-link-mcp -- npx -y jlink-mcp`.
What does J-Link MCP do?
It connects an AI assistant to a SEGGER J-Link debug probe: register and memory reads, firmware flashing, RTT logs, execution control, a GDB server and automatic Cortex-M fault decoding.
Which backends work besides J-Link?
OpenOCD with ST-Link, CMSIS-DAP or FTDI probes, plus Black Magic Probe. Those need OpenOCD or arm-none-eabi-gdb.