firmforge
MCP server for firmware verification in MCU development, exposing a five-stage pipeline (Detect, Review, Build, Flash, Verify) as tools for AI agents to compile, flash, and verify firmware on Arduino boards.
README
FirmForge
English · 中文(README_CN.md)
FirmForge is an MCP-based firmware verification toolchain for MCU development with AI coding agents. It provides a five-stage hardware pipeline — Detect, Review, Build, Flash, Verify — and exposes the stages to agents as MCP tools (ff_detect, ff_context, ff_build, ff_run, ff_flash, ff_monitor).
The toolchain compiles firmware with a real compiler (avr-gcc / ArduinoCore-avr), programs the target with avrdude, and verifies the result via serial readback. Code generation is out of scope.
Pipeline
| Stage | Description | Failure handling |
|---|---|---|
| S1 Detect | Board identification via avrdude chip-signature probe; USB VID/PID and workspace inference as fallbacks | Blocking |
| S2 Review | Static analysis: cppcheck, register/bitfield validation against the chip knowledge base, confidence scoring | Non-blocking |
| S3 Build | Compile to firmware.hex: bare-register C (avr-gcc, -std=c11) or Arduino API (ArduinoCore-avr); SHA256-fingerprint caching |
Blocking |
| S4 Flash | avrdude programming (ATmega2560 uses -D skip-chip-erase) with bootloader reset |
Blocking |
| S5 Verify | Serial readback with pattern matching; live browser panel | Non-blocking |
Supported Targets
| Board | MCU | Notes |
|---|---|---|
arduino_mega |
ATmega2560 | 202 registers in knowledge base (incl. GCC aliases) |
arduino_328p |
ATmega328P (UNO/Nano) | 91 registers in knowledge base |
Custom boards are supported via --boards-dir.
Installation
Requirements: Python ≥ 3.10. Hardware is required only for the Flash and Verify stages.
pip install git+https://github.com/NotchStone/firmforge.git
ff setup
ff setup downloads and installs avr-gcc, avrdude, cppcheck, and ArduinoCore-avr to ~/.firmforge/. Re-running is idempotent.
For MCP support (agent integration):
pip install "firmforge[mcp] @ git+https://github.com/NotchStone/firmforge.git"
Stable wheels are attached to GitHub Releases.
A China mirror is available on Gitee: see README_CN.md (中文).
Usage
# Detect connected board
ff detect
# Review + compile only (no hardware required)
ff build arduino_mega --app path/to/source
# Full pipeline on hardware
ff run arduino_mega --app path/to/source --expected "Hello World"
# Flash a pre-built hex
ff flash arduino_mega --firmware firmware.hex
MCP Server
Register the server with your agent (CodeBuddy, Cursor, Claude Desktop, ...):
{
"mcpServers": {
"firmforge": {
"command": "python",
"args": ["-m", "firmforge.adapters.mcp_server"],
"cwd": "/path/to/your/firmware/project"
}
}
}
Agent workflow: query ff_context for register/pin references before writing firmware, then ff_run to compile, flash, and verify. Bundled data (board definitions, chip knowledge, toolchain manifests) is resolved from inside the package; the server runs from any working directory.
Development
pip install -e .[test,mcp]
pytest
License
MIT © FirmForge Contributors
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.