pymcuprog-mcp
Enables AI tools to program Microchip AVR microcontrollers via natural language by wrapping pymcuprog, supporting USB HID debuggers and serial UART UPDI adapters.
README
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。