# J-Link MCP

> J-Link MCP is an MCP server for developer tools. MCP server that lets an AI debug ARM Cortex-M firmware on real hardware via J-Link probes. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, VS Code, macOS, Linux, Windows
- **Repository:** https://github.com/klievan/jlink-mcp
- **MCP Registry name:** io.github.Klievan/jlink-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-15

## About

When firmware crashes, one call to diagnose_crash reads the Cortex-M fault registers, decodes them, unwinds the exception stack frame, names the faulting instruction and pulls recent warnings from the device's RTT log. The README shows it on an nRF52840-DK, turning a forced HardFault into an unaligned-access UsageFault without anyone looking up what a CFSR bit means.

With a CMSIS-SVD file for the target, peripheral registers are decoded by field name instead of raw hex, so the model reads documented meanings rather than guessing bit layouts. The server has 48 tools covering session setup, snapshots, halt, step and resume, memory and register access, flashing .hex, .bin and .elf files, breakpoints, RTT log search and GDB servers. check_setup says what is missing, and search_devices looks through the 9,800 devices J-Link supports.

It drives the SEGGER J-Link software with a probe attached, and also supports OpenOCD (ST-Link, CMSIS-DAP, FTDI) and Black Magic Probe backends. It installs from npm, as a Claude Code plugin with an embedded-debugging skill, as a VS Code extension, or through a Nix flake. Environment variables set the target device, probe serial, SVD path and RTT address.

## Features

- **One-call crash diagnosis:** diagnose_crash decodes fault registers and the exception frame and correlates RTT logs.
- **SVD-aware registers:** Peripheral registers are decoded by name when an SVD file is set.
- **Setup check:** check_setup reports missing probe software, probe, device or SVD.
- **Flash and control:** Flash firmware, reset, halt, step, resume and set breakpoints.
- **RTT log search:** Streams RTT output and searches by level, module or regex.
- **Multiple backends:** Also works with OpenOCD and Black Magic Probe.

## Good for

- Find out why a Cortex-M board hard-faulted
- Flash new firmware and read the boot log
- Inspect a peripheral's registers with named bit fields
- Search RTT logs for errors from one module
- Start a GDB session for a deeper debugging run

## Install

### Claude Code (Terminal)

```sh
claude mcp add jlink-mcp --env JLINK_DEVICE='<JLINK_DEVICE>' -- npx -y jlink-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "jlink-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "jlink-mcp"
      ],
      "env": {
        "JLINK_DEVICE": "<JLINK_DEVICE>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "jlink-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "jlink-mcp"
      ],
      "env": {
        "JLINK_DEVICE": "<JLINK_DEVICE>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "jlink-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "jlink-mcp"
      ],
      "env": {
        "JLINK_DEVICE": "<JLINK_DEVICE>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "jlink-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "jlink-mcp"
      ],
      "env": {
        "JLINK_DEVICE": "<JLINK_DEVICE>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "jlink-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "jlink-mcp"
      ],
      "env": {
        "JLINK_DEVICE": "<JLINK_DEVICE>"
      }
    }
  }
}
```

## Tools

- `diagnose_crash`: Decode Cortex-M fault registers and the exception stack frame.
- `start_debug_session`: Start a GDB server, connect RTT and return the boot log.
- `snapshot`: Capture registers, fault status, stack and RTT output.
- `check_setup`: Report what is missing for debugging.
- `search_devices`: Search the J-Link device database.
- `list_devices`: Scan for connected probes.
- `set_device`: Change the target device at runtime.
- `read_peripheral`: Read a peripheral's registers with decoded bit fields.
- `decode_register`: Decode a single register.
- `read_memory`: Read memory at an address.
- `write_memory`: Write a 32-bit value to an address.
- `flash`: Flash a .hex, .bin or .elf file.
- `erase`: Erase flash.
- `halt`: Halt the CPU.
- `resume`: Resume the CPU.
- `step`: Single-step one instruction.
- `reset`: Reset the device.
- `set_breakpoint`: Set a hardware breakpoint.

## FAQ

### What hardware do I need?

A SEGGER J-Link probe connected to an ARM Cortex-M target, or a probe supported by the OpenOCD or Black Magic backends.

### How do I find my device name?

Use the search_devices tool, then set JLINK_DEVICE.

### Why are peripheral reads shown as hex?

No SVD file is set; point SVD_PATH at the target's CMSIS-SVD file.

### How do I install J-Link MCP?

Via npx, the Claude Code plugin marketplace, the VS Code extension or a Nix flake.

### How do I add J-Link MCP to Claude Code?

Run this command in your terminal: claude mcp add jlink-mcp --env JLINK_DEVICE='<JLINK_DEVICE>' -- npx -y jlink-mcp

### What are the best alternatives to J-Link MCP?

The closest alternatives to J-Link MCP are stlink-mcp, Smolmux Gdb MCP, jadx-ai-mcp, Windbg MCP and mcp-debugger.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [stlink-mcp](https://ai-powered.com/mcp/stlink-mcp): stlink-mcp is an open-source MCP server for developer tools.
- [Smolmux Gdb MCP](https://ai-powered.com/mcp/smolmux-gdb-mcp): Smolmux Gdb MCP is an open-source MCP server for developer tools.
- [jadx-ai-mcp](https://ai-powered.com/mcp/jadx-ai-mcp): jadx-ai-mcp is an open-source MCP server for developer tools.
- [Windbg MCP](https://ai-powered.com/mcp/windbg-mcp): Windbg MCP is an open-source MCP server for developer tools.
- [mcp-debugger](https://ai-powered.com/mcp/mcp-debugger-2): mcp-debugger is an MCP server for developer tools.
- [Reverse Engine Anything Plus](https://ai-powered.com/mcp/reverse-engine-anything-plus): Reverse Engine Anything Plus is an open-source MCP server for security.
- [Smolmux MCP](https://ai-powered.com/mcp/smolmux-mcp): Smolmux MCP is an open-source MCP server for developer tools.
- [droidprobe](https://ai-powered.com/mcp/droidprobe): droidprobe is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/j-link-mcp
