firmforge
FirmForge
FirmForge 是一个基于 MCP 的固件验证工具链,用于配合 AI 编码代理进行 MCU 开发。它提供五阶段硬件流水线——检测(Detect)、审查(Review)、构建(Build)、烧录(Flash)、验证(Verify)——并将这些阶段以 MCP 工具的形式暴露给代理(ff_detect、ff_context、ff_build、ff_run、ff_flash、ff_monitor)。
该工具链使用真实编译器(avr-gcc / ArduinoCore-avr)编译固件,使用 avrdude 对目标设备进行编程,并通过串口回读验证结果。代码生成不在其范围内。
流水线
阶段 | 描述 | 失败处理 |
S1 检测 | 通过 avrdude 芯片签名探测进行板卡识别;USB VID/PID 和工作区推断作为后备方案 | 阻塞 |
S2 审查 | 静态分析:cppcheck、针对芯片知识库的寄存器/位域验证、置信度评分 | 非阻塞 |
S3 构建 | 编译为 firmware.hex:裸寄存器 C(avr-gcc, | 阻塞 |
S4 烧录 | avrdude 编程(ATmega2560 使用 | 阻塞 |
S5 验证 | 串口回读与模式匹配;实时浏览器面板 | 非阻塞 |
Related MCP server: agentic-hil
支持的芯片目标
芯片目标 | MCU | 备注 |
| ATmega2560 | 知识库中 202 个寄存器(含 GCC 别名) |
| ATmega328P (UNO/Nano) | 知识库中 91 个寄存器 |
通过 --boards-dir 支持自定义板卡。
安装
要求:Python ≥ 3.10。仅在烧录和验证阶段需要硬件。
pip install git+https://github.com/NotchStone/firmforge.git
ff setupff setup 会将 avr-gcc、avrdude、cppcheck 和 ArduinoCore-avr 下载并安装到 ~/.firmforge/。重复运行是幂等的。
如需 MCP 支持(代理集成):
pip install "firmforge[mcp] @ git+https://github.com/NotchStone/firmforge.git"稳定版 wheel 包附在 GitHub Releases 中。
中国镜像可在 Gitee 上获取:参见 README_CN.md(中文)。
使用方法
# 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.hexMCP 服务器
向你的代理注册该服务器(CodeBuddy、Cursor、Claude Desktop 等):
{
"mcpServers": {
"firmforge": {
"command": "python",
"args": ["-m", "firmforge.adapters.mcp_server"],
"cwd": "/path/to/your/firmware/project"
}
}
}代理工作流:在编写固件之前查询 ff_context 获取寄存器/引脚参考,然后运行 ff_run 进行编译、烧录和验证。捆绑数据(板卡定义、芯片知识、工具链清单)从包内部解析;服务器可在任意工作目录下运行。
开发
pip install -e .[test,mcp]
pytest许可证
MIT © FirmForge 贡献者
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server for simulating firmware on virtual microcontroller instances, allowing AI agents to upload, run, and read UART output from supported boards such as STM32 and Nordic.19MIT
- AlicenseAqualityBmaintenanceAgentic Hardware-in-the-Loop (Agentic HIL) lets coding agents develop firmware on real embedded boards: flash, reset, read UART and exchange CAN traffic, diagnose and fix. Local, policy-gated MCP tools support OpenOCD, pyOCD and STM32CubeProgrammer, with pytest for CI.44943 PyPI37Apache 2.0
- AlicenseCqualityCmaintenanceMCP server for AI-assisted MCU and embedded firmware debugging. It connects to real hardware via debug probes, inspects CPU/memory/peripherals, manages Keil builds, and provides structured evidence for fault diagnosis.1937 PyPI12MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables AI agents to inspect, plan, validate, and apply STM32CubeMX .ioc configuration changes, and generate STM32CubeIDE projects, ensuring safe and testable embedded-system workflows.98MIT