stm32c0-mcp
This MCP server manages bare-metal STM32C011 firmware projects with four tools:
scaffold_project: Generates a minimal project skeleton (linker script, startup code, blinky main.c) for a specified target part (default STM32C011F6Ux), with project name and force overwrite options.
build: Configures and compiles the project using CMake, Ninja, and arm-none-eabi-gcc; returns build status, compiler output, paths to ELF/BIN/HEX files, and flash/RAM usage. Supports clean builds and custom build directory.
flash: Programs firmware (.elf/.bin/.hex) to the device over SWD via ST-LINK using STM32_Programmer_CLI; options for target part, erase mode, verify, reset mode, SWD frequency, and probe serial number for multi-probe setups.
list_probes: Lists serial numbers of connected ST-LINK probes to identify targets.
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., "@stm32c0-mcp scaffold a new blinky project in ./my-project"
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.
stm32c0-mcp
MCP server + CLI for scaffolding, building, and flashing bare-metal STM32C011
firmware, driving the STM32CubeCLT command-line toolchain
(/opt/ST/STM32CubeCLT_1.22.0 by default — override with STM32CUBECLT_ROOT).
Targets the STM32C011 family (default part: STM32C011F6Ux, matching the
STM32C0116-DK Discovery kit). No HAL/CMSIS pack dependency — scaffolded
projects are genuinely bare-metal (hand-written vector table, linker script,
and a GPIO-register blinky).
Setup
pyenv local 3.10.0
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"Related MCP server: Embedded xLink MCP
CLI usage
.venv/bin/stm32c0 scaffold /path/to/project [--project-name NAME] [--part STM32C011F6Ux] [--force]
.venv/bin/stm32c0 build /path/to/project [--clean]
.venv/bin/stm32c0 flash /path/to/project/build/firmware.elf [--serial-number SN] [--shared]
.venv/bin/stm32c0 list-probes [--shared]Multiple probes
STM32_Programmer_CLI's direct USB path only ever sees a single ST-LINK: with
two connected it finds one and rejects the other with Error: Serial number not found, which looks like a hardware fault but isn't. Pass --shared to
route through ST-LINK server, which sees them all:
.venv/bin/stm32c0 list-probes --shared # every probe's serial
.venv/bin/stm32c0 flash fw.elf --serial-number SN --shared # target one of themST-LINK server is started automatically when --shared is used. It ships with
STM32CubeIDE rather than STM32CubeCLT (expected at /usr/local/bin/stlink-server,
override with STLINK_SERVER), so --shared is opt-in: shared connections fail
outright where that server isn't installed. --shared listings report serial
numbers only, without firmware versions.
MCP server
.venv/bin/stm32c0-mcpExposes scaffold_project, build, flash, and list_probes as MCP tools.
See docs/registration.md for wiring it into Claude Code.
Tests
.venv/bin/pytest -vtests/test_build_smoke.py requires no hardware. tests/test_flash_hardware.py
is skipped automatically unless an ST-LINK probe is connected.
Layout
src/stm32c0_mcp/— package:parts.py(device memory-map table),config.py(toolchain discovery),stlink_server.py(ST-LINK server discovery/startup for multi-probe access),scaffold.py/build.py/flash.py/probes.py(drivers),mcp_server.py/cli.py(thin wrappers),templates/bare_metal/(project skeleton templates).examples/blinky/— a committed, buildable instance of the scaffolded project; doubles as the smoke-test fixture.
Available Tools
4 toolsbuildA
Configure (if needed) and build an STM32C011 project with CMake+Ninja+arm-none-eabi-gcc. Returns success, compiler stdout/stderr, and the built .elf/.bin/.hex paths plus arm-none-eabi-size flash/RAM usage.
Inputs: project_dir (required), clean, build_dir.
flashA
Flash a .elf/.bin/.hex to an STM32C011 over SWD via ST-LINK using STM32_Programmer_CLI. Set serial_number to target one probe among several.
Inputs: file_path (required), part, erase, verify, +3 more.
list_probesA
List connected ST-LINK probes (serial numbers) for multi-probe setups.
Inputs: no named parameters.
scaffold_projectA
Create a minimal bare-metal CMake/Ninja STM32C011 project skeleton (linker script, startup code, one blinky main.c) at project_dir. Does not overwrite an existing non-empty directory unless force=True.
Inputs: project_dir (required), part, force, project_name.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct step in the development workflow: scaffold, build, flash, and discover probes. There is no overlap in purpose; even list_probes clearly supports the flash tool.
All tool names follow a consistent verb_noun pattern: scaffold_project, build, flash, list_probes. The pattern is clear and predictable.
Four tools is well-scoped for the server's purpose of creating, building, and flashing STM32C011 projects. Each tool is necessary and there are no redundant additions.
The set covers the full lifecycle from project scaffolding through building and flashing. Probe listing addresses multi-probe setups, leaving no obvious dead ends for the stated workflow.
Maintenance
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Related MCP Servers
- AlicenseAqualityDmaintenanceStateful MCP server for driving debug probes (J-Link) to flash, debug, and inspect embedded targets. Enables AI agents to perform flash, memory, breakpoint, and ELF/SVD-aware operations conversationally.4149 PyPI10MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for embedded debugging based on probe-rs, providing 22 tools for ARM Cortex-M and RISC-V microcontrollers, including connection, memory operations, breakpoints, flash programming, and RTT communication.2MIT
- AlicenseNot gradedqualityDmaintenanceA local stdio MCP server for embedded firmware automation that exposes tools to build, flash, reset devices, and capture serial logs through a device configuration file.1MIT
- AlicenseAqualityBmaintenanceMCP server that wraps STM32CubeMX CLI to let AI load .ioc projects, modify pin/peripheral configurations, generate HAL code, and export pinout tables.531 PyPI2MIT