
ESP32 Simulator
io.github.stramanu由 GitHub 账号 stramanu 发布v0.2.6更新于 Oct 26, 2026
Boot and test ESP32 firmware in a local emulator: UART asserts, buttons, virtual WiFi, screenshots.
概览
在本地模拟器中启动并测试 ESP32 固件,把串口日志、崩溃信息、断言结果和屏幕截图返回给助手。
- 可以做什么
- 启动固件并返回控制台日志、停止原因、模拟时间与崩溃信息
- 断言指定字符串或正则按顺序出现在控制台,给出通过/失败及缺失的行
- 按模拟时间戳驱动硬件:按键按下与松开、GPIO 电平、旋钮转动、UART 输入、触摸
- 在指定模拟时间截取开发板显示屏的 PNG 截图
- 列出支持的芯片、开发板、显示屏与输入方式,并检查模拟器与 ROM 是否就绪
- 适用场景
- 适合助手编写 ESP-IDF 固件后需要验证行为的场景:没有实体开发板时启动构建产物、检查启动日志、脚本化输入与显示输出,或在 CI 中运行同样的检查。
- 运行要求
- 通过 npx 以 stdio 在本地运行;需要 Node.js 22+,以及 ESP-IDF 或 Docker 来构建固件,并需执行一次安装步骤获取模拟器与 mask ROM。预编译模拟器支持 macOS arm64 与 Linux x64/arm64,其他平台需用 Cargo 自行构建。可选环境变量 ESP32SIM_PATH 与 ESP32SIM_ROM_DIR 用于指定模拟器与 ROM 目录。
安装
在 SourceWeft 中
- 打开 控制台中的 ESP32 Simulator,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
esp32sim-mcp
Your agent writes ESP32 firmware, boots it and tests it. No board, no account.
[npm] [CI] [License: MIT] [MCP]
[Claude Code adds a counter to an ESP-IDF project, builds it and verifies it in the emulator]A real Claude Code session, recorded live (only the idle tail is trimmed): it edits ESP-IDF's hello_world, builds it in Docker because ESP-IDF isn't installed, and checks the console in the emulator.
Coding agents are good at writing embedded C. They are blind when it comes to running it: without a board on the desk, "it compiles" is where the feedback loop ends.
esp32sim-mcp closes that loop. It gives Claude Code, Codex, Cursor or any MCP client a set of tools that boot the firmware the agent just built inside esp32sim, a local instruction-level ESP32 emulator, and hand back what the chip printed, whether it crashed, and what was on the display. The agent reads the result, fixes the code and tries again, the way you would with a board on the bench.
- 🔌 No hardware, no cloud. Everything runs on your machine. No account, no token, no board.
- 🧬 Real boot chain. Espressif's mask ROM, the ESP-IDF bootloader and your unmodified app, on ESP32-S3, C3, C6 and the classic ESP32.
- 📡 More than a console. Virtual WiFi access point with DHCP, DNS and NAT, buttons, rotary encoder, GPIO, UART input, touch, and display screenshots.
- 🧪 Assertions, not vibes.
sim_expectreturns pass/fail and the exact line that is missing, so the agent knows what to fix. - ⚡ Fast. Emulation usually runs ahead of real time: on Apple silicon, 8 emulated seconds of a WiFi station joining a network take about 0.6 s.
- 🤖 Comes with a skill.
initinstalls an agent skill that teaches the write → build → simulate → fix loop, including building in Docker when ESP-IDF is not installed.
Quickstart
Then ask your agent for something you can see on the serial console:
Add a counter that prints once a second, build it, and check in the simulator that it reaches 5.
Requirements: Node.js 22+, and ESP-IDF or Docker to build firmware. Prebuilt emulator binaries cover macOS (Apple silicon) and Linux (x64, arm64); see other platforms.
What the agent sees
From a real session, the agent calls:
and gets back:
When something goes wrong, it gets the panic instead (Guru Meditation Error, stack overflow, failed assert, heap corruption) with the log leading up to it, and the missing pattern spelled out.
Tools
All tools take a projectDir (the ESP-IDF build is found through build/flasher_args.json) or explicit appBin/bootloaderBin/ptableBin paths, plus chip, board and wifi (e.g. ssid=demo,psk=secret). Both UART0 and the USB-Serial/JTAG console are captured, so output shows up whichever one the project logs to.
How it works
esp32sim-mcp is a thin, tested layer: it finds the build, translates tool calls into esp32sim's command line, separates and de-duplicates the two consoles, detects panics, and shapes the result for an agent. The emulation itself is esp32sim's work.
Use it in CI
The same checks run without an agent, with exit code 0 on pass and 1 on fail. A GitHub Actions job that builds your firmware and asserts its boot log:
This is what this repository's own CI does with examples/hello-esp32, including a scripted button press.
All CLI commands
Supported chips and boards
Use none for stock ESP-IDF projects. The virtual WiFi access point works on all four chips.
Agent setup
init detects the agents you have and configures each one. It runs in your firmware project by default; --global writes user-level settings instead.
Existing entries are kept, reruns are no-ops, and a config file that does not parse is left untouched.
Claude Code plugin. Instead of init, install the server and skill together as a plugin, for every project:
MCP registry. The server is published to the official MCP registry as io.github.stramanu/esp32sim-mcp. For any other MCP client:
Other platforms
setup installs prebuilt binaries on macOS arm64 and Linux x64/arm64. They are built from source by this repository's emulator workflow with signed build provenance (gh attestation verify <archive> -R stramanu/esp32sim-mcp). Elsewhere, build esp32sim with Cargo (rustup), pinned to the commit this release is tested against:
ESP32SIM_PATH points at an emulator binary elsewhere and ESP32SIM_ROM_DIR at another ROM directory; ROMs inside an ESP-IDF install are found automatically.
How it compares
esparagus is the natural next step: simulate first with esp32sim-mcp, then confirm on a real board.
Limitations
- An emulator is not silicon. Peripherals esp32sim does not model, RF timing and Bluetooth are out of reach here; confirm on hardware before you ship.
- The agent builds the firmware itself (
idf.py, locally or in Docker); the MCP server does not compile. - Windows is untested.
Contributing
Issues and pull requests are welcome. See CONTRIBUTING.md for the development setup and how the end-to-end tests run against the real emulator, and CHANGELOG.md for what changed.
Credits
- esp32sim by Joakim Eriksson, Alice and Mattia Fiumara: the emulator that does the real work (MIT).
- Espressif: ESP-IDF and the mask ROM ELFs (Apache-2.0).
- Model Context Protocol.
License
MIT © Emanuele Strazzullo
来源:README.md,提交 46f0fe2
工具
0版本历史
1- v0.2.6最新Oct 19, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分