MCP server wrapping pymcuprog for AVR/Microchip programming
Project description
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 .
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: ping → flash or ping → build_and_flash
All programming tools accept optional device, tool, serialport, etc. parameters to override the environment variables on a per-call basis.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymcuprog_mcp-0.1.5.tar.gz.
File metadata
- Download URL: pymcuprog_mcp-0.1.5.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a22de981e7679b932afa85de143e993a14dec82725eed71c08e96fbf5df7b5e4
|
|
| MD5 |
9a43e2b8f7f463c90bb82c7db36a0d2d
|
|
| BLAKE2b-256 |
a2e0fab90e2fec430203a075fee322338907b3590b95d8c83b5234449c696e45
|
Provenance
The following attestation bundles were made for pymcuprog_mcp-0.1.5.tar.gz:
Publisher:
release.yml on lucasgerads/pymcuprog-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymcuprog_mcp-0.1.5.tar.gz -
Subject digest:
a22de981e7679b932afa85de143e993a14dec82725eed71c08e96fbf5df7b5e4 - Sigstore transparency entry: 1247195304
- Sigstore integration time:
-
Permalink:
lucasgerads/pymcuprog-mcp@2b2e9c44bcc2efa831ce409532e3e471bc2068f7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucasgerads
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b2e9c44bcc2efa831ce409532e3e471bc2068f7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pymcuprog_mcp-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pymcuprog_mcp-0.1.5-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
389c17fce1da2f847f9a45613313a1c1817eb0b6fe25cb64a48d647224e73abb
|
|
| MD5 |
5b2225678be8f83dc2b02ae1b1843871
|
|
| BLAKE2b-256 |
30d09227bb2cddc5ddd719b715adf56ec468ca6752802d6d2911fbb55fbabc2c
|
Provenance
The following attestation bundles were made for pymcuprog_mcp-0.1.5-py3-none-any.whl:
Publisher:
release.yml on lucasgerads/pymcuprog-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymcuprog_mcp-0.1.5-py3-none-any.whl -
Subject digest:
389c17fce1da2f847f9a45613313a1c1817eb0b6fe25cb64a48d647224e73abb - Sigstore transparency entry: 1247195309
- Sigstore integration time:
-
Permalink:
lucasgerads/pymcuprog-mcp@2b2e9c44bcc2efa831ce409532e3e471bc2068f7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lucasgerads
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b2e9c44bcc2efa831ce409532e3e471bc2068f7 -
Trigger Event:
push
-
Statement type: