agent-mcu MCP server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-mcu MCP server verify my STM32F407 is running at 168 MHz over J-Link"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-mcu-flow
AI-native end-to-end MCU development & Hardware-in-the-Loop (HIL) workflow engine for STM32 & ESP32 — zero runtime pip dependencies, unified CLI + stdio MCP server, declarative STM32CubeMX CLI automation, CMSIS-SVD register/clock/HardFault verification, and a 3-layer C architecture gate.
Part of the agent-* cross-surface automation suite:
agent-browser-bridge— Browser CDP automationagent-desktop— Windows UIA/vision desktop automationagent-mobile-auto— Android/iOS mobile automationagent-mcu-flow— Embedded MCU firmware & J-Link/SVD hardware closed-loop automation
Why agent-mcu-flow?
Human-readable GUI drawings + AI-driven CLI execution: Complex STM32 PLL clock trees live in verified golden
.iocbases (templates/base-ioc/), while AI drives peripheral/pin assignment declaratively viahardware_spec.json-> ST UM1718 CubeMX CLI script ->ioc-auditverification. Humans can always double-click.iocin CubeMX GUI at any time.Dual-Track Bottom-Up Entry:
Track A (
stm32-cubemx-cmake/esp32-idf): Production-grade HAL/LL/IDF with strict zero-conflict isolation (cmake/user_app.cmake+ minimalApp_Init()/App_Poll()facade inCore/Src/main.c).Track B (
stm32-baremetal-reg): Clean RM0090 register-level C11 bare-metal projects backed by offline SVD bitfield lookup and live J-Link register readback.
Hardware Truth Over Guesswork (Zero-Dependency SVD Engine):
agent-mcu svd-query: Look up exact peripheral/register/bitfield offsets from official.svdbefore writing register code.agent-mcu clock-check: Read realRCC&FLASH_ACRover J-Link to verifySYSCLK / HCLK / PCLK1 / PCLK2MHz and Flash wait-state safety (STM32 F4/F1/G4/L4/H7/F0).agent-mcu svd-read --expect: Assert real hardware register bitfields as automated pass/fail gates.agent-mcu fault-decode: Automatically decode ARM Cortex-MCFSR/HFSR/MMFAR/BFAR, detectMSP/PSPstacked exception frames, and resolve faultingPC/LRviaarm-none-eabi-addr2line.
Native CLI + Zero-Dependency Stdio MCP Server: Works seamlessly with Claude Code, Cursor, Codex, and Antigravity (
agent-mcu mcp, 9 tools).
Related MCP server: mcu-debug-mcp
Quick Start
# Install with uv (zero runtime dependencies)
uv sync --extra dev
# 1. Detect local toolchains (CubeMX, CubeCLT, ARM-GCC/GDB, Keil, J-Link, ESP-IDF, SVD)
uv run agent-mcu detect .
# 2. Scaffold a new standardized project (3 tracks)
uv run agent-mcu scaffold --track stm32-cubemx-cmake --out ./my_fw --name lift_ctrl --mcu STM32F407ZET6 --hse-mhz 8 --sysclk-mhz 168
# 3. Compile declarative CubeMX UM1718 CLI script from hardware_spec.json (add --execute with CubeMX installed)
uv run agent-mcu cubemx-apply examples/stm32f407-dual-track/hardware_spec.json \
--out-dir examples/stm32f407-dual-track/track_a_cubemx_cmake
# 4. Audit .ioc against schematic hardware_spec.json & export read-only Markdown snapshot
uv run agent-mcu ioc-audit examples/stm32f407-dual-track/track_a_cubemx_cmake/stm32f407_pilot.ioc \
--hardware-spec examples/stm32f407-dual-track/hardware_spec.json --require-cmake
# 5. Enforce 3-layer C architecture gate (config -> driver -> application -> task)
uv run agent-mcu arch-check examples/stm32f407-dual-track/track_b_baremetal_reg --strict
# 6. On hardware with J-Link: verify real 168 MHz SYSCLK + Flash Wait States
uv run agent-mcu clock-check --device STM32F407ZE --usb-serial <SERIAL> --hse-mhz 8 --expect-sysclk-mhz 168 --strict-warnings
# 7. Start stdio MCP server for AI coding agents
uv run agent-mcu mcpSTM32F407ZET6 Dual-Track Pilot
See examples/stm32f407-dual-track/:
track_a_cubemx_cmake/: Declarative CubeMX + CMake + isolated 3-layer app (App_Init/App_Polltop facade + domain-namedHeartbeat_Step).track_b_baremetal_reg/: Self-contained RM0090 pure-register firmware (HSE 8MHz -> PLL 168MHz,PG2 LED_RUN,USART1 115200 8N1), continuously cross-compiled by realarm-none-eabi-gccin GitHub Actions CI.
MCP Server Tools (agent-mcu mcp)
Tool | Purpose |
| Probe installed CubeMX, CubeCLT, CMake, ARM-GCC/GDB, Keil, J-Link, ESP-IDF, SVD files |
| Offline CMSIS-SVD peripheral/register/bitfield lookup |
| Live J-Link/GDB/mock register readback + bitfield assertions |
| Real STM32 RCC + FLASH_ACR frequency & wait-state audit |
| Cortex-M HardFault/BusFault/UsageFault + PSP/MSP stack frame + ELF line resolution |
| Parse |
| Compile/execute UM1718 CubeMX CLI script from golden |
| 3-layer C architecture boundary linter |
| Generate 3-track MCU project skeletons |
Available Tools
9 toolsmcu_arch_checkC
Verify 3-layer embedded C architecture boundaries (config/driver/application/task).
Inputs: root.
mcu_clock_checkC
Read STM32 RCC & FLASH_ACR registers to verify real SYSCLK/HCLK/PCLK1/PCLK2 MHz and Flash wait states.
Inputs: family (required), device, backend, hse_mhz, +3 more.
mcu_cubemx_applyB
Compile declarative hardware_spec.json + golden base .ioc into an ST UM1718 CubeMX CLI script and optionally execute headlessly.
Inputs: out_dir (required), spec_path (required), execute, base_ioc, +1 more.
mcu_detect_envB
Detect installed MCU toolchains (STM32CubeMX, CubeCLT, CMake, ARM-GCC/GDB, Keil, J-Link, ESP-IDF, probe-rs) and project files.
Inputs: project_path.
mcu_fault_decodeC
Decode ARM Cortex-M HardFault/BusFault/MemManage/UsageFault registers, PSP/MSP stacked frame, and optional ELF line symbols.
Inputs: elf, device, backend, mock_json, +1 more.
mcu_ioc_auditC
Parse STM32CubeMX .ioc into a read-only hardware snapshot and cross-check against hardware_spec.json.
Inputs: ioc_path (required), out_md, hardware_spec, require_cmake.
mcu_scaffoldC
Scaffold a standardized STM32 CubeMX+CMake, STM32 Bare-Metal Register, or ESP-IDF project.
Inputs: track (required), out_dir (required), mcu, name, +3 more.
mcu_svd_queryB
Query official CMSIS-SVD peripheral/register/bitfield definitions offline before writing register code.
Inputs: svd, device, register, peripheral.
mcu_svd_readC
Read peripheral registers from target hardware (J-Link/GDB) or mock snapshot, decode SVD bitfields, and evaluate assertions.
Inputs: registers (required), svd, halt, device, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct action (read registers, check clocks, decode faults, audit .ioc, apply CubeMX config, check arch, scaffold, detect env, query SVD). The closest pair is mcu_svd_read vs mcu_svd_query and mcu_ioc_audit vs mcu_cubemx_apply, but descriptions clearly distinguish hardware-read vs offline-query and read-only-audit vs generate/apply.
All tools use a uniform mcu_<verb>_<noun> snake_case pattern (svd_read, clock_check, fault_decode, ioc_audit, cubemx_apply, arch_check, detect_env, svd_query). No mixing of conventions or casing.
Nine tools is well within the ideal 3-15 range and each maps to a concrete stage of an embedded workflow (detect, scaffold, configure, verify, decode). No obviously redundant or filler tools.
Coverage spans environment detection, scaffolding, SVD introspection, clock/fault verification, config audit and CubeMX application, which is a coherent lifecycle. The main gap is the absence of an explicit build/flash/serial-monitor tool, which agents would have to handle via shell.
Maintenance
Related MCP Connectors
Design circuits, simulate and verify embedded firmware, and lay out PCBs with AI agents.
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
30+ deterministic dev and delivery tools: linting, metrics, diagrams, model advice, AI-text checks.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI coding assistants to perform complete headless STM32 embedded firmware development, including project creation, pin configuration, code generation, building, and flashing, by driving the official STM32 command-line toolchain.49MIT
- AlicenseAqualityBmaintenanceEnables AI agents to directly inspect and debug embedded hardware: reading/writing serial ports and bus devices, auto-detecting baud rates, parsing Modbus/NMEA/custom binary frames, plus diagnosing failures through a 45-rule fault-pattern library, error-code tables, and compile/flash error translation. Also provides pin-conflict checking, register and Cortex-M fault decoding, pre-validated driver and component selection libraries, board knowledge, and guarded flashing with post-flash byte-level verification.59MIT
- AlicenseAqualityBmaintenanceEnables AI agents to debug STM32 firmware on real hardware by driving GDB with OpenOCD/ST-Link/J-Link to flash, set breakpoints, inspect memory, registers and RTOS state, triage HardFaults, and profile. Returns decoded, structured evidence and suggested next actions instead of raw GDB text, with composite tools that collapse multi-step debug loops into single calls.864MIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to build, flash, debug, and communicate with STM32 microcontrollers over ST-Link entirely within the conversation. Provides headless CubeIDE builds, OpenOCD flashing, hardware breakpoints, live SWD variable monitoring resolved by C symbol names, fault triage, and pooled serial VCP I/O with deterministic sequencing for hardware-in-the-loop tests.35MIT