mxmcp
Integrates with STMicroelectronics STM32CubeMX to create and configure STM32 microcontroller projects, including pinout, peripheral modes, clock trees, RTOS/middleware settings, validation, and C code generation. It can drive the official CubeMX engine when installed or run standalone using bundled STM32 device data.
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., "@mxmcp Create an STM32F103C8T6 project named blink and set PC13 as GPIO output"
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.
mxmcp — STM32CubeMX 的 MCP 服务器(也可完全独立运行)
交付物:
mxmcp/(服务器源码 + 自带数据包)、tests/(6 个测试脚本)、docs/(逆向记录、架构、数据模型、功能矩阵、独立模式、验收)、analysis/(机器可读逆向产物)、tools/(可复现的取证脚本)。
两种模式,同一个 MCP 接口:
hybrid:装了 CubeMX 时驱动官方引擎(引脚/时钟/生成都是 ST 原版行为)。
standalone:不需要任何 CubeMX 安装 —— 自带 9.1 MB 数据包 (2 019 颗 MCU / 245 083 引脚 / 274 套 IP 模式 / HAL Init 参数树), 自带校验引擎与 C 代码生成器。见 docs/STANDALONE.md。
项目状态 (.ioc) ←→ mxmcp (Python MCP server) ←→ CubeMX CLI (常驻 JVM,可选)
↑
自带数据包 cubemx-db.zip(离线选型/校验/生成)1. 为什么这样做
CubeMX 6.15.0 是 PE32 装载器 + 内嵌 ZIP 的 Java 应用(不是 native-image, 不需要脱壳):
java -jar STM32CubeMX.exe -q script.txt就是官方 headless 入口; 内嵌归档 54 774 条目、起始0x13000、中央目录0xD2F0A03(tools/rebuild_full_jar.py全量重建,0 失败)。引擎内部有 267 条 CLI 注册(旧记录只有 89 条,因为旧提取漏了
com/st/components)、217 个插件 opcode;export script能把任意工程序列化成 可重放命令。因此 MCP 不做“重新实现 CubeMX”,而是受控前端:写操作走官方解释器, 读操作读
.ioc/自带数据包;两者可交叉校验(verify/standalone_validate)。
完整逆向记录:ARCHITECTURE.md(总览)· REVERSE_ENGINEERING.md(过程)· DATA_MODEL.md(数据结构)· CLI_REGISTRY.md(267 条命令)· FEATURES.md(功能覆盖矩阵)· SECURITY_NETWORK.md(信任链与端点)· STANDALONE.md(独立模式)
Related MCP server: stm32cubemx-mcp
2. 运行要求
Python 3.9+(零第三方依赖,只用标准库)
STM32CubeMX 可选:
装了 → hybrid 模式,用官方引擎(默认路径
C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX)没装 → standalone 模式,先建一次数据包
python -m mxmcp.bundle build --cubemx-root <安装目录>(需要一台装了 CubeMX 的机器)
注意:仓库不附带数据包(ST 派生内容,见 LICENSE)。
环境变量(可选):
变量 | 作用 | 默认 |
| CubeMX 安装目录 |
|
| 工程状态目录 |
|
| 同时驻留的 JVM 数(每个打开工程一个) |
|
3. 接入 MCP 客户端
stdio 传输、JSON-RPC 2.0(换行分隔,也接受 Content-Length 帧)。
{
"mcpServers": {
"stm32cubemx": {
"command": "python",
"args": ["-m", "mxmcp.server"],
"cwd": "C:\\path\\to\\mxmcp",
"env": { "MXMCP_WORKSPACE": "C:\\Users\\me\\.mxmcp" }
}
}
}自检:
python -m mxmcp.server --list-tools
python -m mxmcp.server --selftest
python -m mxmcp.server --call catalog_index --args {}4. 五分钟上手
project_create {name: "blink", mcu: "STM32F103C8T6", toolchain: "Makefile"}
-> project_id = blink
mcu_pin_functions {project_id: "blink", pin: "PA9"} # 看可选信号
pin_set {project_id: "blink", pin: "PC13", signal: "GPIO_Output"}
pin_set {project_id: "blink", pin: "PA9", signal: "USART1_TX"}
pin_set {project_id: "blink", pin: "PA10", signal: "USART1_RX"}
mode_set {project_id: "blink", peripheral: "USART1", mode: "Asynchronous"}
ip_param_set {project_id: "blink", ip: "USART1", param: "BaudRate", value: "115200"}
gpio_set {project_id: "blink", pin: "PC13", param: "GPIO_Label", value: "LED"}
clock_set {project_id: "blink", sysclk_hz: 72000000, pll_mul: "RCC_PLL_MUL9",
pll_source: "RCC_PLLSOURCE_HSE", sysclk_source: "RCC_SYSCLKSOURCE_PLLCLK",
apb1_div: "RCC_HCLK_DIV2"}
project_save {project_id: "blink"}
verify {project_id: "blink"}
project_generate {project_id: "blink", output_dir: "D:/work/blink", toolchain: "Makefile"}project_generate 返回文件清单与警告;典型结果:913 个文件、Src/main.c、Drivers/、
Makefile、.ioc,耗时约 5–10 秒(引擎已热)。
5. 工具一览(113 个)
工程生命周期:project_create project_list project_get project_open
project_close project_save project_save_as project_delete project_diff
project_load_mcu project_load_board project_import_config project_export_script
project_options project_set_option project_report project_csv project_files
选型/资料(离线):catalog_index mcu_search mcu_info mcu_pin_functions
family_list family_mcus board_search board_list ip_library template_list
firmware_packages mode_catalog command_catalog product_db middleware_list
引脚 / 外设:pinout_get pin_functions pin_set pin_reset pin_clear_all
pin_lock pin_reserve gpio_params gpio_set peripheral_list mode_list
mode_set mode_reset mode_check sub_modes submode_state mode_pattern
ip_param_get ip_param_set ip_params_set ip_params_dump ip_user_name
value_check
中断 / DMA / 内存映射:nvic_read nvic_write dma_query dma_mutate
mdma_query mdma_mutate gic_query gic_mutate mmt lpbam
RTOS / 中间件:rtos_schema rtos_status rtos_objects rtos_object_write
rtos_config middleware_add
时钟:clock_get clock_set clock_resolve clock_param_possible_values
生成 / 校验:project_generate generate_code verify compliance
移植 / 比较 / 选择器:porting ioc_compare selectors
软件包:pack_status pack_enable pack_disable pack_validate swmgr
xcubedl login logout
独立模式(无安装):standalone_info standalone_create standalone_open
standalone_pin standalone_signals standalone_mode standalone_param
standalone_nvic standalone_view standalone_validate standalone_generate
standalone_mcu
.ioc 直写 / 兜底 / 运行时:ioc_get ioc_set ioc_delete ioc_import
ioc_export cli cli_batch cli_help runtime_props ide_bridge
cli / cli_batch 能执行 CLI_REGISTRY 里的任何命令
(267 条),所以 MCP 接口是 CubeMX CLI 的超集:即使某个能力没有专门工具,也不会丢。
完整的功能→命令→工具对照见 docs/FEATURES.md。
6. 关键行为与坑位(已在代码里处理)
load只认 db RefName:STM32F103C8T6会让解释器永久挂起;project_create会先用本地库把料号解析成STM32F103C(8-B)Tx。参数不登记不落盘:
ip_param_set/clock_set自动把参数名并入<IP>.IPParameters。config save在无路径时挂起:只用saveas/saveext,并在保存后回读校验。引擎卡死会污染后续调用:会话引擎超时即杀进程,下次调用自动
config load恢复; 返回值里hung: true会明确告知。固件包版本必须匹配:
.ioc里的FirmwarePackage与实际安装目录不一致时,project generate会尝试联网(无 UI 下可能挂起)。生成前会预检;缺包时自动 改用project setCustomFWPath指向已安装的同族包并重新固定版本,再生成。首次生成可能只拷贝驱动:CubeMX 偶尔第一遍只做驱动拷贝;工具会检测 “有 Drivers 无 main.c”并自动再生成一次。
GPIO 参数要完整引脚名:
PC13→PC13-TAMPER-RTC,工具会自动解析。HSE 时钟树:只设
PLLSourceVirtual=HSE而不复用 OSC 引脚时时钟树仍按 HSI 求解;clock_set会自动把OSC_IN/OSC_OUT复用成RCC_OSC_IN/OUT,并在结果里给出 warning。派生时钟值要存两次:CubeMX 在 save 时才计算
PLLCLKFreq_Value等派生量。 可靠节奏是 写入 → save → reload → save(实测 8 MHz → 72 MHz),已固化在clock_set的多轮收敛里;手工用cli复现时务必照此顺序。没有
.ioc时别依赖已启动的引擎:引擎被回收再启动是空工程,config saveas会抛Mcu.getDie()NPE。先project_save一次再继续。中间件 IP 的
set mode不带引号:set mode FREERTOS CMSIS_V2;get modes对中间件返回 KO,mode_list会自动回退到db/mcu/IP/*_Modes.xml。RTOS 对象只在扩展保存里:
project_ext.ioc才有FREERTOS.Tasks01等; 读状态要合并视图,写完必须让引擎重新加载一次。
7. 目录
mxmcp/
├── mxmcp/ 服务器源码(零第三方依赖)
│ ├── server.py MCP 入口(stdio;--selftest/--list-tools/--call)
│ ├── rpc.py JSON-RPC 2.0 / MCP 协议
│ ├── engine.py CubeMX 会话引擎(-i 常驻 + 三种成帧)
│ ├── store.py 工程池、保存/加载、料号解析
│ ├── ioc.py .ioc 读写(含 project_ext.ioc 合并视图)
│ ├── catalog.py 安装目录索引(无安装时自动走数据包)
│ ├── bundle.py 数据包 build/info/verify + Pack 读取
│ ├── standalone.py 独立引擎(引脚/模式/参数/NVIC,真实校验)
│ ├── ipmodes.py IP 模式与参数 schema
│ ├── codegen.py 独立 C 代码生成
│ ├── firmware.py 固件包完整性扫描
│ └── tools_*.py 113 个 MCP 工具
├── tests/ 6 个测试脚本
│ ├── test_units.py 解析/参数/固件预检(含真实生成)
│ ├── test_e2e.py MCP 全流程(F1/F4/板卡)
│ ├── test_advanced.py dma/nvic/gic/mmt/porting/selectors/catalog
│ ├── test_rtos.py RTOS 对象读写与校验
│ ├── test_middleware.py 中间件集成
│ └── test_standalone.py 把安装路径指到不存在,验证独立模式
├── tools/ 取证与构建脚本(不是运行时依赖)
├── docs/ 逆向与使用文档
├── analysis/ 机器可读逆向产物(本地生成,不发布)
├── LICENSE CONTRIBUTING.md CHANGELOG.md pyproject.toml
└── .github/workflows/ci.yml lint + 测试 + 合规 + 打包8. 测试
python -m pytest tests -q :: 单元测试(无需 CubeMX)
python tests\test_standalone.py :: 独立模式:把 MXMCP_CUBEMX_ROOT 指到不存在的目录
python tests\test_e2e.py :: ~70 s,MCP 全流程(需 CubeMX)
python tests\test_advanced.py :: 60+ 断言,覆盖新增命令族
python tests\test_rtos.py :: RTOS 对象增删改与唯一名约束
python tests\test_middleware.py :: 中间件启用与 active IP 报告
python tools\check_compliance.py :: 确认没有 ST 派生文件进入仓库实测(2026-10-29,Windows + CubeMX 6.15.0):
脚本 | 结果 |
| 通过(含 913 文件真实生成) |
| 通过(F1 全流程、板卡工程、F4 时钟、CLI 桥) |
| ALL OK(93 工具时代) |
| 通过(任务/队列/信号量 + 重复名拒绝) |
| 通过(FREERTOS 集成 + verify) |
| 通过(无安装:建工程→引脚→生成 6 文件) |
9. 许可
MIT(见 LICENSE)。注意:仓库不含任何 ST 派生数据——
数据包与反编译产物由使用者从自己的安装件本地生成(python -m mxmcp.bundle build),
不随仓库或发行物分发。详见 docs/OPEN_SOURCE.md。
STM32 / STM32CubeMX 是 STMicroelectronics 的商标,本项目与其无隶属关系。
Available Tools
113 toolsboard_listA
List every board known to the board manager (name, mcu, vendor, source pdsc).
Inputs: no named parameters.
board_searchB
Search ST boards (NUCLEO/DISCO/EVAL) by name fragment.
Inputs: query (required), limit.
catalog_indexA
Counts for the local CubeMX database: MCUs per family, boards, IP mode files, config files and FreeMarker templates. Use before searching.
Inputs: no named parameters.
cliC
Run any CubeMX CLI command verbatim in the project engine and return its output (OK/KO plus payload). Covers the entire command language: get/set/reset/lock/check/csv/generate/project/config/pinout/switch/unset/export/import/NVIC/dma/pack/swmgr/clock/... Optionally save afterwards.
Inputs: command (required), project_id (required), save, timeout, +1 more.
cli_batchB
Run several CLI commands in order (stops at the first KO unless continue_on_error). Ideal for replaying project_export_script output.
Inputs: commands (required), project_id (required), save, timeout, +2 more.
cli_helpB
Per-family usage tables straight from the engine (running the bare command prints its sub-command list).
Inputs: project_id (required), commands.
clock_getB
Clock tree state: derived frequencies (HCLK/SYSCLK/PCLK/...) and the RCC settings that produce them, read from the saved .ioc plus live reads.
Inputs: project_id (required), params.
clock_param_possible_valuesB
Query the allowed values of one RCC parameter (get mode_param_possvalue).
Inputs: param (required), project_id (required).
clock_resolveC
Run CubeMX's clock issue resolver (clock resolution) and re-save.
Inputs: project_id (required), save.
clock_setB
Program the clock tree. Accepts explicit RCC parameters or the friendly keys: sysclk_hz, pll_mul, pll_source, sysclk_source, ahb_div, apb1_div, apb2_div, hse_mhz, hsi_mhz, lse_khz, lsi_khz. Runs clock resolution so CubeMX re-solves the tree, then saves and returns the derived frequencies.
Inputs: project_id (required), save, params, ahb_div, +12 more.
command_catalogA
The extracted CLI registry: every command string CubeMX registers, which jar/class registers it, its arity and its help text. Use it to discover what cli can run; command=<name> returns the exact usage.
Inputs: jar, command.
complianceB
Run CubeMX's own consistency checks: xts/xtest suites, check mcu modes (mode availability for the current pin map), the all-MCU mode and XML audits, a single mode check, and the pinout keep-placement check.
Inputs: action (required), project_id (required), ip, mode, +1 more.
dma_mutateB
Change DMA assignment: add/delete a request, set its flow, or set one DMA parameter (Priority/Mode/... exactly as CubeMX names them).
Inputs: kind (required), request (required), project_id (required), flow, +3 more.
dma_queryC
Inspect the DMA request/stream map of the project (CubeMX dma ... service): list_all, list, list_briefly, list_periph, list_controller, available_streams, available_periph_requests, available_controller_requests, used_flows, delete_all.
Inputs: action (required), project_id (required), target.
family_listA
List STM32 families present in the database with MCU counts.
Inputs: no named parameters.
family_mcusA
List the MCUs of one family (e.g. STM32H7) with memory/package metadata.
Inputs: family (required), limit.
firmware_packagesA
List installed STM32Cube firmware packages in the local repository (these are what project generate copies Drivers from).
Inputs: repository.
generate_codeA
Generate only the CubeMX application code into a directory (generate code <dir>, no drivers/IDE files). mode may force the all-in-main or one-file-per-IP layout first.
Inputs: project_id (required), mode, output_dir.
gic_mutateC
Change GIC interrupt routing (enable/disable, enable state, triggering mode, priority, security).
Inputs: kind (required), target (required), project_id (required), save, +1 more.
gic_queryB
Read the GIC interrupt controller (STM32MP1/MP2) through CubeMX: interrupt list, per-IP interrupts, enable state and triggering mode.
Inputs: action (required), project_id (required), target.
gpio_paramsA
GPIO parameters for one pin or all pins, read from the saved .ioc (GPIOParameters list, label, mode, lock state).
Inputs: project_id (required), pin.
gpio_setB
Set a GPIO parameter (GPIO_Label, GPIO_Mode, GPIO_PuPd, GPIO_Speed, GPIO_OutputLevel...). Uses the engine when the CLI branch accepts it and otherwise edits the .ioc and reloads it, which produces the same file the GUI writes.
Inputs: pin (required), param (required), value (required), project_id (required), +1 more.
ide_bridgeB
Service hooks around the main window: simulate the CubeIDE open action, query a plugin's error state, refresh an IP's UI, toggle the tooltip log, toggle user analytics, and read the code-generator mode / IP dependencies / BSP status / MCU peripherals.
Inputs: action (required), project_id (required), ip, value, +1 more.
ioc_compareB
Compare two .ioc files with CubeMX's own differ (cpload project1/2 + cpexport) and return the report text.
Inputs: ioc_1 (required), project_id (required), ioc_2, output, +3 more.
ioc_deleteB
Delete one key from the saved .ioc and reload it.
Inputs: key (required), project_id (required), reload.
ioc_exportB
Copy the project .ioc to an arbitrary path (shareable artifact).
Inputs: path (required), project_id (required).
ioc_getA
Read raw keys from the saved .ioc: one key, or all keys with an optional prefix (e.g. 'RCC.' or 'PA9.').
Inputs: project_id (required), key, prefix.
ioc_importA
Import an external .ioc as a new project (loads it and normalises it through a save).
Inputs: path (required), name.
ioc_setA
Write raw keys into the saved .ioc and reload it into the engine. Used for values the CLI cannot address (GPIO parameters, custom constants).
Inputs: project_id (required), key, value, reload, +1 more.
ip_libraryA
List the IP mode-definition files under db/mcu/IP (e.g. ADC-STM32F4xx_Cube_Modes.xml). Filter by family or name fragment.
Inputs: limit, query, family.
ip_param_getB
Read one IP parameter (get ip parameters <ip> <param>).
Inputs: ip (required), param (required), project_id (required).
ip_params_dumpA
Dump every persisted parameter of the selected IPs from the saved .ioc (the authoritative view after project_save).
Inputs: project_id (required), ips.
ip_param_setA
Set an IP parameter (set ip parameters <ip> <param> <value>). Also registers the name in <IP>.IPParameters so the value is persisted by project_save (CubeMX only writes listed parameters).
Inputs: ip (required), param (required), value (required), project_id (required), +1 more.
ip_params_setC
Set several IP parameters at once and register them all in IPParameters.
Inputs: ip (required), params (required), project_id (required).
ip_user_nameA
Rename an IP instance (set username <ip> <name>), which changes the MX_/HAL_ symbol prefix in generated code.
Inputs: ip (required), name (required), project_id (required).
loginA
Log in to my.st.com for firmware/pack downloads (login <email> <password> <remember y|n>).
Inputs: email (required), password (required), project_id (required), remember.
logoutB
End the my.st.com session (logout).
Inputs: project_id (required).
lpbamC
Manage LPBAM / multi-context projects (the GUI's Low Power Banana workflow): list, add, delete, rename, select a configuration or the active MX project.
Inputs: action (required), project_id (required), name, save, +2 more.
mcu_infoA
Full record for one MCU from db/mcu/.xml: attributes, memory, and every IP instance with its CubeMX IP version and config file.
Inputs: ref_name (required).
mcu_pin_functionsB
Alternate-function table for an MCU read straight from the MCU XML (no engine). Optional pin substring filter. Use get functions/ set pin via the engine for live availability.
Inputs: mcu (required), pin.
mcu_searchA
Search MCUs by part number or RefName (STM32F103C8T6, STM32F103C(8-B)Tx) or by prefix (STM32G4). Returns flash/RAM/core/package and the exact RefName to pass to load.
Inputs: query (required), limit.
mdma_mutateC
Change MDMA assignments/parameters (add_request, add_channel_request, delete_request, delete_channel, set_param).
Inputs: kind (required), project_id (required), save, param, +3 more.
mdma_queryC
Inspect MDMA (dual-port DMA, H7/U5/N6...) requests and channels via the CubeMX mdma ... service.
Inputs: action (required), project_id (required), index, target.
middleware_addB
Integrate a middleware instance (set mode <name> <mode>) or register a custom X-CUBE middleware (add mw with root/mode/config/template paths).
Inputs: name (required), project_id (required), mode, custom, +5 more.
middleware_listB
Every middleware instance CubeMX can integrate (from MiddleWareConstants), the template hooks each one generates, which are active in the project, and how to enable or register a custom one.
Inputs: name, project_id.
mmtB
Drive the Memory Mapping Tool (H7RS/U5/N6 TrustZone-style memory map): dump free/AppReg/HRange/HRegion, reserve SW/HW regions, reset reserved, load/save pre-config files, enable ThreadX layout.
Inputs: action (required), project_id (required), kind, scope, +3 more.
mode_catalogA
Offline catalogue of every IP mode in the shipped database (274 IPs: peripheral/service/middleware/LPBAM), with per-version mode lists, parameter counts and the IP type. Works without starting the engine.
Inputs: ip, kind.
mode_checkB
Ask CubeMX whether a mode is currently enabled (check mode enabled).
Inputs: mode (required), peripheral (required), project_id (required).
mode_listB
Peripheral modes: available (what the MCU can do), all (every leaf mode) or mapped (what is currently enabled).
Inputs: project_id (required), which, peripheral.
mode_patternC
Get the value pattern CubeMX expects for a mode parameter (get mode_param_pattern <ip> <mode> <parameter>).
Inputs: ip (required), mode (required), parameter (required), project_id (required).
mode_resetC
Disable one mode of a peripheral (reset mode).
Inputs: mode (required), peripheral (required), project_id (required).
mode_setB
Enable a peripheral mode (set mode <IP> <mode>), e.g. USART1 Asynchronous, RCC Crystal/Ceramic Resonator, TIM3 PWM Generation CH1.
Inputs: mode (required), peripheral (required), project_id (required).
nvic_readB
Read NVIC state: enabled interrupts, an IP's interrupts, the priority group, and per-IRQ priority / subpriority / handler-generated / enable state / group / preempt source.
Inputs: action (required), project_id (required), irq.
nvic_writeC
Change NVIC: enable/disable an interrupt, set priority/subpriority/group/preempt source/handler-generated flag, or the priority group.
Inputs: action (required), project_id (required), irq, save, +1 more.
pack_disableC
Disable a CMSIS-Pack component and validate the selection.
Inputs: pack (required), class (required), group (required), vendor (required), +3 more.
pack_enableB
Enable a CMSIS-Pack component (pack enable <vendor> <pack> <version> <class> <group> [variant] [-resolve]) and run pack validate.
Inputs: pack (required), class (required), group (required), vendor (required), +5 more.
pack_statusA
Enumerate every software pack/component visible to the project as structured JSON (pack status <file>): pack ids, component ids, selected flags and dependency status. Filter with query.
Inputs: project_id (required), limit, query, output, +1 more.
pack_validateB
Apply every component enabled since the last validate (pack validate) and persist the .ioc.
Inputs: project_id (required), save.
peripheral_listB
Every IP instance the loaded MCU provides, with its CubeMX IP version (get mcu peripherals).
Inputs: project_id (required).
pin_clear_allA
Remove every pin mapping (clearpinout), then optionally re-save the .ioc.
Inputs: project_id (required), save.
pin_functionsB
List every selectable function of a pin (get functions <pin>), e.g. PA9 -> TIM1_CH2, USART1_TX, GPIO_Output ...
Inputs: pin (required), project_id (required).
pin_lockA
Lock or unlock a pin so generation keeps (or may change) its mapping (lock pin <pin> <locked>).
Inputs: pin (required), project_id (required), locked.
pinout_getA
Read the live pinout (get pinout): every pin with its current signal. Filter with only_configured to drop Reset_State/Power pins.
Inputs: project_id (required), sync_ioc, only_configured.
pin_reserveA
Reserve a pin (marks it used without assigning a peripheral) via set pinreservation.
Inputs: pin (required), project_id (required).
pin_resetA
Free one pin (exact name) or every pin matching a regex (reset pin). Use after pin_set to undo a misassignment.
Inputs: project_id (required), pin.
pin_setA
Assign a peripheral signal to a pin (set pin <pin> <signal>). Signals must exist in pin_functions; GPIO_Input/GPIO_Output/GPIO_Analog/GPIO_EXTIn are always valid for GPIO pins.
Inputs: pin (required), project_id (required), signal, signals.
portingC
Port a configuration onto another MCU / manage the import engine: try_auto (import another .ioc into the current MCU), try/try_and_log, report, compatibility rules, import options and logs, and the MCUs-DB hack mode used to patch database entries.
Inputs: action (required), project_id (required), dma, ioc, +13 more.
product_dbB
Query the parametric MCU-finder database (the data behind the product selector: attributes, CPN/RPN commercial names, resources, features) read-only. CubeMX downloads it to ~/.stmcufinder; use swmgr / the GUI database refresh to obtain it.
Inputs: limit, table, search, database.
project_closeA
Close the warm engine of a project (frees a JVM; saved .ioc is untouched).
Inputs: project_id (required).
project_createA
Create a CubeMX project. Give exactly one of mcu (part number or db RefName, e.g. STM32F103C8T6), board (e.g. NUCLEO-F030R8) or ioc (existing .ioc to clone). Optionally set toolchain and output_dir. The project is immediately saved as /projects//project.ioc.
Inputs: name (required), ioc, mcu, board, +3 more.
project_csvA
Export the current pin configuration to CSV (csv pinout <file>), the same file the GUI passes to board layout tools.
Inputs: project_id (required), path.
project_deleteC
Forget a project; optionally delete its workspace files.
Inputs: project_id (required), remove_files.
project_diffB
Structural diff between a project's .ioc and another project or .ioc file (added/removed/changed keys).
Inputs: project_id (required), other_ioc, other_project_id.
project_export_scriptB
Serialize the current configuration into a replayable CubeMX CLI script (export script). This is the exact command list that recreates the project.
Inputs: project_id (required), path.
project_filesC
List generated files under the project output directory (glob filter).
Inputs: project_id (required), glob, root, limit.
project_generateB
Generate the complete project (CubeMX code + firmware drivers + IDE project files) for a toolchain, exactly like project generate. CubeMX may need a my.st.com login to download a missing firmware package; this is reported in warnings with status KO.
Inputs: project_id (required), name, timeout, compiler, +9 more.
project_getA
Describe one project: MCU, toolchain, saved .ioc path and (optionally) the full IOC summary (active IPs, pin count, ProjectManager settings).
Inputs: project_id (required), summary.
project_import_configA
Import another .ioc into the live project (import config), then re-save.
Inputs: ioc (required), project_id (required).
project_listA
List CubeMX projects known to this server (id, MCU, toolchain, whether a warm engine is attached and whether a saved .ioc exists).
Inputs: no named parameters.
project_load_boardA
Load a board configuration into a project (default peripherals with allmodes, or bare pinout with nomode).
Inputs: board (required), project_id (required), mode.
project_load_mcuA
Re-target an existing project to another MCU (CubeMX keeps compatible pins/peripherals where possible, same as the GUI load <mcu>).
Inputs: mcu (required), project_id (required).
project_openA
Attach a warm CubeMX engine to a known project and reload its .ioc (or a different .ioc). Needed after a server restart; other tools open lazily too.
Inputs: project_id (required), ioc.
project_optionsC
Read the ProjectManager section of the saved .ioc (toolchain, FW package, heap/stack, file layout, user-code guards...).
Inputs: project_id (required).
project_reportA
Produce a human readable report of the configuration (MCU, active IPs, pin map, clock settings, project settings) from the saved .ioc.
Inputs: project_id (required), path.
project_saveB
Snapshot the live engine configuration into the project .ioc (config saveas + saveext, so default-valued parameters are persisted too).
Inputs: project_id (required), extended.
project_save_asA
Duplicate a project's saved .ioc into a new project id and open it.
Inputs: name (required), project_id (required).
project_set_optionC
Set project manager options: name, path, toolchain (STM32CubeIDE/EWARM/MDK-ARM/Makefile/CMake), compiler (GCC/Starm-Clang), toolchain_location, couple_files_by_ip, generate_under_root, custom_fw_path, stack_size, heap_size, structure (Advanced/Basic), copy_library (copy all/copy only/copy as reference).
Inputs: project_id (required), name, path, save, +10 more.
rtos_configB
Read or set FreeRTOS configuration scalars (configUSE_TIMERS, configTOTAL_HEAP_SIZE, configMAX_PRIORITIES…), registering each key in IPParameters exactly like the GUI does.
Inputs: values, project_id.
rtos_objectsB
List the RTOS objects stored in the project with their fields decoded according to the shipped schema (field order from rtos_apis.xml).
Inputs: api, project_id, object_type.
rtos_object_writeA
Add / update / delete an RTOS object (task, queue, timer, semaphore, mutex, event) with schema validation and the GUI's unique-name rule, then let CubeMX reload and re-save the project so the .ioc is canonical.
Inputs: op (required), object_type (required), api, index, +2 more.
rtos_schemaB
The RTOS user-object schema CubeMX ships (tasks/queues/timers/semaphores/mutexes/events per CMSIS RTOS v1 & v2), including every field, its default, allowed values, the JS enabled-condition, and how the objects are stored in the .ioc.
Inputs: no named parameters.
rtos_statusB
Read the project's RTOS state: active mode, the .ioc prefix, every stored object per type, the FreeRTOS config scalars, and whether the RTOS row is present.
Inputs: project_id.
runtime_propsB
Read or write the JVM system properties / environment of the running CubeMX engine and change its log level at runtime.
Inputs: action (required), name, value, project_id.
selectorsC
Use CubeMX's headless selector tables: enumerate/inspect the MCU finder columns and filters, the board-manager peripheral tables, and the example (X-CUBE) library selections.
Inputs: kind (required), action (required), project_id (required), value, +3 more.
standalone_createB
Create a project for an MCU using only the bundled database (marketing part numbers are resolved to the db reference name).
Inputs: mcu (required), name, toolchain.
standalone_generateB
Generate a C project (main.c/main.h/MSP/IRQ/Makefile) entirely offline from the bundled HAL config model — no CubeMX installation involved.
Inputs: name, toolchain, output_dir, project_id.
standalone_infoA
Report whether the standalone (no-installation) path is active, what the bundled data pack contains, and which capabilities are available offline.
Inputs: no named parameters.
standalone_mcuA
Search the bundled MCU database, or dump one device's pins and IPs (works with no CubeMX installation).
Inputs: exact, limit, query.
standalone_modeC
Enable a peripheral/middleware mode, validated against the IP's mode list from db/mcu/IP/*_Modes.xml.
Inputs: ip (required), mode (required), project_id.
standalone_nvicB
Configure an interrupt in the standalone project (priority, subpriority, enabled state) and persist it in the NVIC. line.
Inputs: irq (required), project_id (required), enabled, priority, +1 more.
standalone_openC
Load a .ioc into the standalone engine (no CubeMX needed).
Inputs: ioc (required).
standalone_paramB
Set an IP parameter and register it in .IPParameters (the same persistence rule CubeMX uses).
Inputs: ip (required), param (required), value (required), project_id.
standalone_pinA
Bind (or reset) a pin signal with real validation against the MCU pinout: only signals the pin advertises are accepted, GPIO_* variants are expanded from the db IOModes, and a signal can only be bound once.
Inputs: pin (required), signal, project_id.
standalone_signalsB
List the signals a pin can carry (offline, from the bundled MCU xml) and what it is bound to now.
Inputs: pin (required), signal, project_id.
standalone_validateA
Validate the standalone project: pin/signal legality, duplicate signal bindings, and IPs that do not exist on the MCU.
Inputs: project_id.
standalone_viewB
Full standalone project state (MCU, pins, IP parameters, NVIC, options, validation problems) plus the .ioc text.
Inputs: project_id.
sub_modesB
Raw sub-mode state dump for one peripheral (get sub-modes), useful for compound modes such as SYS/NVIC.
Inputs: peripheral (required), project_id (required).
submode_stateA
Inspect a mode-tree branch: sub-mode enable state and available sub-modes (get sub-mode-state / get sub-modes), the same data the peripheral diagram uses.
Inputs: ip (required), path (required), project_id (required).
swmgrB
Software manager: refresh the package catalogue, install/remove a STM32Cube firmware package or CMSIS-Pack, change the repository path or proxy, check connectivity.
Inputs: action (required), project_id (required), key, value, +3 more.
template_listB
List the FreeMarker code templates shipped in db/templates (used by the generator; also the source for user-template override).
Inputs: limit, query.
value_checkA
Ask CubeMX whether a parameter value is legal for an IP right now (possible_value ip parameters / not_a_possible_value ip parameters) — this evaluates the XML condition expressions (IP dependencies, semaphores, die variants) instead of guessing.
Inputs: ip (required), value (required), parameter (required), project_id (required).
verifyA
Cross-check live engine state against the saved .ioc: MCU, every pin signal, active IP modes, plus an optional generation run. Returns a problem list (empty = consistent).
Inputs: project_id (required), generate.
xcubedlC
Download an X-CUBE pack by name (xcubedl <packname>).
Inputs: pack (required), project_id (required), timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 113 tools
The set has many overlapping paths to the same outcome: `cli` can perform nearly every other operation, while `standalone_*` tools mirror the main project/pin/mode/parameter workflow. Additional overlaps exist between `project_diff` and `ioc_compare`, `verify` and `compliance`, `project_create` and `standalone_create`, and different search/list tools for MCUs, boards, and signals.
Most tools use lower snake_case and many share a clear domain prefix such as `project_`, `pin_`, `mode_`, `clock_`, and `standalone_`. However, action ordering and granularity vary between noun_verb, verb_noun, bare abbreviations, and noun-only names (`generate_code`, `project_generate`, `swmgr`, `login`, `rtos_status`, `middleware_add`).
113 tools is far beyond an appropriate MCP surface for a single server, even for a complex CubeMX automation domain. The duplicate standalone path, generic CLI escape hatches, and many specialized query/mutate pairs make the set unwieldy for agent tool selection.
The surface covers project lifecycle, MCU/board discovery, pinout, modes, IP parameters, clocks, generation, packs, software packages, authentication, DMA/MDMA/GIC/NVIC, RTOS, middleware, standalone operation, and verification. There are no obvious major lifecycle or CRUD gaps for CubeMX configuration and generation.
Maintenance
Related MCP Connectors
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server that wraps STM32CubeMX CLI to let AI load .ioc projects, modify pin/peripheral configurations, generate HAL code, and export pinout tables.546 PyPI3MIT
- 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.97MIT
- 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
- AlicenseAqualityCmaintenanceThis server enables AI agents to fully control STM32CubeIDE and STMicroelectronics hardware, including GUI automation, headless builds, flashing, GDB debugging, option bytes, serial telemetry, and CubeMX .ioc engineering.342Apache 2.0