Skip to main content
Glama

FirmForge

英文 · 中文(README_CN.md)

FirmForge 是一个基于 MCP 的固件验证工具链,用于配合 AI 编码代理进行 MCU 开发。它提供五阶段硬件流水线——检测(Detect)、审查(Review)、构建(Build)、烧录(Flash)、验证(Verify)——并将这些阶段以 MCP 工具的形式暴露给代理(ff_detectff_contextff_buildff_runff_flashff_monitor)。

该工具链使用真实编译器(avr-gcc / ArduinoCore-avr)编译固件,使用 avrdude 对目标设备进行编程,并通过串口回读验证结果。代码生成不在其范围内。

流水线

阶段

描述

失败处理

S1 检测

通过 avrdude 芯片签名探测进行板卡识别;USB VID/PID 和工作区推断作为后备方案

阻塞

S2 审查

静态分析:cppcheck、针对芯片知识库的寄存器/位域验证、置信度评分

非阻塞

S3 构建

编译为 firmware.hex:裸寄存器 C(avr-gcc,-std=c11)或 Arduino API(ArduinoCore-avr);SHA256 指纹缓存

阻塞

S4 烧录

avrdude 编程(ATmega2560 使用 -D 跳过芯片擦除)并带引导加载程序复位

阻塞

S5 验证

串口回读与模式匹配;实时浏览器面板

非阻塞

Related MCP server: Chiplab

支持的芯片目标

芯片目标

MCU

备注

arduino_mega

ATmega2560

知识库中 202 个寄存器(含 GCC 别名)

arduino_328p

ATmega328P (UNO/Nano)

知识库中 91 个寄存器

通过 --boards-dir 支持自定义板卡。

安装

要求:Python ≥ 3.10。仅在烧录和验证阶段需要硬件。

pip install git+https://github.com/NotchStone/firmforge.git
ff setup

ff 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.hex

MCP 服务器

向你的代理注册该服务器(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 贡献者

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (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
    C
    quality
    D
    maintenance
    A comprehensive Model Context Protocol (MCP) server for Arduino CLI interactions, built with FastMCP. This server enables AI agents to seamlessly interact with Arduino CLI for development, debugging, code verification, and more.
    16
    2
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP 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.
    16
    MIT
  • A
    license
    C
    quality
    A
    maintenance
    MCP 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.
    43
    4
    MIT

View all related MCP servers

Related MCP Connectors

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/NotchStone/Firmforge'

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