# stlink-mcp

> stlink-mcp is an open-source MCP server for developer tools. MCP server that lets coding agents flash, run and inspect STM32 boards over ST-LINK. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux, self-hosted
- **Repository:** https://github.com/dii/stlink-mcp
- **MCP Registry name:** io.github.dii/stlink-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Most debugging tools report what they were told, not what happened. This server is built on the opposite rule: a tool says it succeeded only after checking that the requested thing really occurred. Every result carries a status of verified, unverified or failed, plus the observation that backs it, such as console output from the board's own serial port or the program counter seen inside the new image.

It runs locally next to the board and drives the STM32CubeCLT command line tools already installed. Variables and peripheral registers are read by name from your ELF and ST's SVD files without halting the program, and every result states whether the call halted or reset the target. Single-stepping, memory writes and RTT are deliberately left out, with other projects suggested for those.

The README marks it alpha. Three device IDs were measured on hardware (STM32F407, H743 and N657) and others are seeded at run time from ST's own device databases, labelled as such.

## Features

- **Verified results:** Each result is verified, unverified or failed, with the evidence named.
- **Run and flash firmware:** Loads an image and confirms it by console output or program counter.
- **Non-halting reads:** Reads variables and peripheral registers by name without stopping the program.
- **Halt and reset reporting:** Every call says whether it halted or reset the target.
- **Board state check:** Reports the board's state and refuses to guess ambiguous SRAM layouts.
- **Sixteen agent-shaped tools:** Run-to-point style calls return call stack, registers and stop reason in one result.

## Good for

- Let an agent run the edit, build, load and observe loop on an STM32 board
- Check that a new firmware image really started after flashing
- Read peripheral registers by name while the program runs
- Catch cases where ST's tools report success without effect

## Install

### Claude Code (Terminal)

```sh
claude mcp add stlink-mcp -- uvx stlink-mcp
```

### Claude Desktop (claude_desktop_config.json)

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

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

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

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

```json
{
  "servers": {
    "stlink-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "stlink-mcp"
      ]
    }
  }
}
```

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

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

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

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

## Tools

- `run_firmware`: Loads an image and reports success only when its console output or program counter confirms it ran.
- `flash_firmware`: Programs the target; on devices not yet measured it needs a .bin and an address.
- `board_state`: Reports board state, including SRAM addresses it declines to choose between.
- `sample_values`: Watches values while the program runs.

## FAQ

### What does it need installed?

STM32CubeCLT, or STM32CubeIDE for the same three tools, found automatically in standard locations or via STLINK_MCP_CLT_ROOT.

### Does it support single-stepping?

No. The README says an agent gets more from one call that runs to a chosen point, and points to other projects for stepping or RTT.

### Which boards are measured?

Device IDs 0x413 (STM32F407), 0x450 (STM32H743) and 0x486 (STM32N657) are measured on hardware; others are seeded from ST's databases.

### What is its maturity?

Alpha, version 0.9.0, and any of the API may change before 1.0.

### Is stlink-mcp free?

Yes. stlink-mcp is open source, so you can use and self-host it for free.

### How do I add stlink-mcp to Claude Code?

Run this command in your terminal: claude mcp add stlink-mcp -- uvx stlink-mcp

### What are the best alternatives to stlink-mcp?

The closest alternatives to stlink-mcp are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

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

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/stlink-mcp
