# J-Link MCP

Hooks an AI assistant up to real hardware through SEGGER J-Link probes: register reads, flashing, RTT logs and Cortex-M crash decoding.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 38
- Author: Klievan
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Klievan/jlink-mcp
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/j-link-mcp

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `JLINK_DEVICE`, `JLINK_SERIAL`, `SVD_PATH`, `JLINK_RTT_ADDR` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
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-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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

### Gemini CLI

**Platform CLI**
```bash
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-mcp
```
Replace <…> with your own values

## When to use it
- 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
- Run `diagnose_crash` and 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

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
