# McuBuddy

MCP server linking AI assistants to physical microcontrollers for hardware debugging, FreeRTOS checks, and Keil firmware builds.

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

## What it does

McuBuddy connects coding assistants to embedded targets over a local `stdio` channel. It communicates with development boards using ST-Link, J-Link, or CMSIS-DAP hardware probes through pyOCD and probe-rs backends. The core profile exposes 19 tools immediately at launch. Additional feature sets like `build_flash`, `rtos`, or `logs` require explicit activation via the `MCUBUDDY_TOOLSETS` environment variable.

During diagnosis, the model maps register bits using CMSIS-SVD files and resolves crash addresses to source lines with ELF and DWARF debug data. Automated compilation and flashing of `.uvprojx` projects depend on `UV4.exe`, meaning Keil MDK workflows only function on Windows. Halting the target to capture registers stops the CPU, so non-intrusive checks must be requested explicitly if execution cannot pause.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcubuddy -- uvx McuBuddy
```
uvx runs the command named after the package; if the README names another one, use uvx --from McuBuddy <command>

### Codex

**Platform CLI**
```bash
codex mcp add mcubuddy -- uvx McuBuddy
```
uvx runs the command named after the package; if the README names another one, use uvx --from McuBuddy <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcubuddy": {
            "command": "uvx",
            "args": [
                "McuBuddy"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from McuBuddy <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcubuddy": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "McuBuddy"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from McuBuddy <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcubuddy uvx McuBuddy
```
uvx runs the command named after the package; if the README names another one, use uvx --from McuBuddy <command>

## When to use it
- diagnose HardFault events and stack corruption with ELF symbols
- decode hardware registers using CMSIS-SVD definitions
- inspect FreeRTOS task stacks and runtime context on real hardware
- trigger project builds and downloads via Keil MDK `UV4.exe`

## Example prompts
- Find connected debug probes and inspect the state of target py32f030x8 with McuBuddy.
- Analyze the firmware ELF symbols to pinpoint the function causing this HardFault.
- Check the FreeRTOS task list and retrieve runtime output from RTT.

## Similar
- [embedded-systems](https://affpapa.org/en/nevibecode/skills/embedded-systems.md) — skill · 6800 installs
- [datasheet-and-refmanual-reading](https://affpapa.org/en/nevibecode/skills/datasheet-and-refmanual-reading.md) — skill · 314 installs
- [esp32-firmware-engineer](https://affpapa.org/en/nevibecode/skills/esp32-firmware-engineer.md) — skill · 1300 installs
- [openocd-jtag](https://affpapa.org/en/nevibecode/skills/openocd-jtag.md) — skill · 536 installs
- [Chiplab](https://affpapa.org/en/nevibecode/mcp/chiplab.md) — MCP server · ★ 18
- [Agentic HIL](https://affpapa.org/en/nevibecode/mcp/agentic-hil.md) — MCP server · ★ 21

---
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
