Skip to main content
Glama
lucasgerads

pymcuprog-mcp

by lucasgerads

pymcuprog-mcp

MCP server wrapping pymcuprog so AI tools (Claude Code, Claude Desktop, etc.) can program Microchip AVR microcontrollers via natural language.

Supports USB HID debuggers (nEDBG, PICkit 4, Atmel-ICE, MPLAB Snap, …) and serial UART UPDI adapters.

Installation

No installation needed if you use uvx — it runs the server directly from PyPI on demand (see .mcp.json examples below).

To install as a persistent tool:

uv tool install pymcuprog-mcp

Or with pip:

pip install pymcuprog-mcp

From source:

git clone https://github.com/lucasgerads/pymcuprog-mcp
cd pymcuprog-mcp
pip install -e .

Related MCP server: jlink-mcp

Configuration

The server is configured via environment variables. The two most important ones are PYMCUPROG_DEVICE (target MCU name, e.g. atmega4808) and PYMCUPROG_TOOL (debugger type, e.g. nedbg).

Variable

Description

Default

PYMCUPROG_DEVICE

Target device name (e.g. atmega4808, attiny416)

PYMCUPROG_TOOL

Debugger type (nedbg, pickit4, atmelice, snap, …)

any connected

PYMCUPROG_SERIALNUMBER

USB serial number substring (to pick a specific tool)

PYMCUPROG_SERIALPORT

Serial port for UART UPDI mode (e.g. /dev/ttyUSB0, COM3)

PYMCUPROG_BAUDRATE

Baud rate for serial UPDI mode

115200

PYMCUPROG_PROJECT_DIR

Default project directory for the build_and_flash tool

Setting PYMCUPROG_SERIALPORT switches the server into serial UPDI mode (uses a plain USB-serial adapter instead of a Microchip debugger).

.mcp.json examples

All examples use uvx, which downloads and runs the server directly from PyPI with no prior installation step.

USB HID debugger (nEDBG / Curiosity Nano)

{
  "mcpServers": {
    "pymcuprog": {
      "command": "uvx",
      "args": ["pymcuprog-mcp"],
      "env": {
        "PYMCUPROG_DEVICE": "atmega4808",
        "PYMCUPROG_TOOL": "nedbg"
      }
    }
  }
}

PICkit 4 or MPLAB Snap

{
  "mcpServers": {
    "pymcuprog": {
      "command": "uvx",
      "args": ["pymcuprog-mcp"],
      "env": {
        "PYMCUPROG_DEVICE": "attiny416",
        "PYMCUPROG_TOOL": "pickit4"
      }
    }
  }
}

Serial UART UPDI (cheap USB-serial adapter)

{
  "mcpServers": {
    "pymcuprog": {
      "command": "uvx",
      "args": ["pymcuprog-mcp"],
      "env": {
        "PYMCUPROG_DEVICE": "avr128da48",
        "PYMCUPROG_SERIALPORT": "/dev/ttyUSB0",
        "PYMCUPROG_BAUDRATE": "115200"
      }
    }
  }
}

Multiple tools on the same machine (select by serial number)

{
  "mcpServers": {
    "pymcuprog-board-a": {
      "command": "uvx",
      "args": ["pymcuprog-mcp"],
      "env": {
        "PYMCUPROG_DEVICE": "atmega4808",
        "PYMCUPROG_TOOL": "nedbg",
        "PYMCUPROG_SERIALNUMBER": "MCHP0001"
      }
    },
    "pymcuprog-board-b": {
      "command": "uvx",
      "args": ["pymcuprog-mcp"],
      "env": {
        "PYMCUPROG_DEVICE": "atmega4808",
        "PYMCUPROG_TOOL": "nedbg",
        "PYMCUPROG_SERIALNUMBER": "MCHP0002"
      }
    }
  }
}

Claude Code (via CLI)

claude mcp add pymcuprog -e PYMCUPROG_DEVICE=atmega4808 -e PYMCUPROG_TOOL=nedbg -- uvx pymcuprog-mcp

Available tools

Tool

Description

list_supported_devices

All device names pymcuprog knows (no hardware needed)

list_connected_tools

USB HID debuggers currently attached

ping

Read device ID bytes to verify connectivity

erase

Chip erase or erase a specific memory area

flash

Erase + write + verify + release in one call (recommended)

build_and_flash

Run make in a project directory, then flash the resulting .hex

write_hex

Program a .hex file with manual control over erase/verify steps

verify_hex

Compare target memory to a .hex file

read_memory

Read raw bytes from flash, EEPROM, fuses, etc.

write_memory

Write raw hex bytes to fuses, EEPROM, user_row, etc.

hold_in_reset

Hold target in reset

release_from_reset

Release target from reset

disconnect

Close the persistent debugger session

read_target_voltage

Measure target VCC

read_supply_voltage

Read debugger supply setpoint

set_supply_voltage

Set debugger supply voltage output

read_tool_info

Read debugger firmware/hardware info

Typical workflow: pingflash or pingbuild_and_flash

All programming tools accept optional device, tool, serialport, etc. parameters to override the environment variables on a per-call basis.

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
5Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    Enables AI tools like Claude Code and Codex CLI to read and write serial port data, facilitating embedded development workflows such as coding, flashing, and debugging.
    20
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI assistants like Claude to directly debug microcontrollers via JLink, supporting breakpoints, single-step, memory/register access, variable inspection, RTT logging, and firmware flashing.
    25
    4
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables AI assistants to interact with STM32 development boards via J-Link debugger using RTT communication, supporting connection, logging, memory operations, and firmware flashing through natural language.
    12
    MIT

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

  • CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lucasgerads/pymcuprog-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server