stm32-mcp
stm32-mcp is a headless MCP server that drives the official STM32 toolchain from the command line, letting AI coding agents create, configure, build, and flash STM32 firmware without any GUI.
Check the environment (
stm32_doctor): reports resolved tool paths, versions, installed HAL firmware packages, ST-LINK probe connectivity, and any problems (missing packages, non-ASCII home path, missing driver).Create projects (
stm32_create_project): generates a full STM32 project from name, MCU (e.g. STM32F103C8Tx), path, optional pins, clock settings/preset, and debug interface (SWD/JTAG/none).Inspect projects (
stm32_read_project): summarizes an existing.ioc— MCU, clock tree, configured pins, enabled peripherals, and FreeRTOS status.Configure pins (
stm32_configure_pins): idempotently applies/updates pin assignments, modes, and labels in the.iocand regenerates code.Generate HAL code (
stm32_generate_code): runs STM32CubeMX headlessly (config load + project generate) on an existing.ioc.Safely edit user code (
stm32_patch_user_code): inserts content only inside matching/* USER CODE BEGIN/END */blocks (replace or append), failing loudly on missing/unbalanced markers so regeneration never wipes logic.Build firmware (
stm32_build): headless CubeIDE compilation returning structured GCC diagnostics (severity, file, line, column, message), a short summary, and Flash/RAM usage instead of raw logs.Clean artifacts (
stm32_clean): deletes build output folders; requires explicitconfirm: true.Flash hardware (
stm32_flash): programs the target MCU via STM32_Programmer_CLI over SWD/JTAG with optional reset; requires explicitconfirm: true.
Backed by pre-flight ASCII path validation, shell-free spawn execution, safety confirmation gates, and zero credential scraping.
Provides integration with the STMicroelectronics STM32 toolchain, enabling headless creation, configuration, code generation, building, cleaning, and flashing of STM32 firmware projects via CubeMX, CubeIDE, and STM32 Programmer CLI.
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., "@stm32-mcp@stm32-mcp build the firmware in my project directory"
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.
stm32-mcp
Headless Model Context Protocol (MCP) server driving the official STMicroelectronics STM32 toolchain from the command line.
Automates project creation, pin configuration, HAL code generation, compilation, diagnostics parsing, and hardware flashing for AI coding assistants—including Claude Code and Google Antigravity—without launching a GUI.
Quick Start
1. Install & Build
This package is currently built from source:
git clone https://github.com/irrumi/stm32-mcp.git
cd stm32-mcp
npm install
npm run build
npm test2. Configure Your AI Client
Claude Code
Add to your project or user configuration:
{
"mcpServers": {
"stm32": {
"command": "node",
"args": ["<ABSOLUTE_PATH_TO_STM32_MCP>/dist/index.js"]
}
}
}Or install the packaged manifest:
claude plugin add <ABSOLUTE_PATH_TO_STM32_MCP>Google Antigravity
Add to ~/.gemini/antigravity/mcp_config.json (or workspace MCP settings):
{
"mcpServers": {
"stm32": {
"command": "node",
"args": ["C:/path/to/stm32-mcp/dist/index.js"]
}
}
}Install the firmware development skill:
# Windows PowerShell
Copy-Item -Recurse -Path ".\skills\stm32-firmware" -Destination "$HOME\.gemini\antigravity\skills\"Generic MCP Clients (Cursor, Claude Desktop)
Add to your MCP client config (claude_desktop_config.json):
{
"mcpServers": {
"stm32": {
"command": "node",
"args": ["/path/to/stm32-mcp/dist/index.js"]
}
}
}Related MCP server: stm32-mcp
What Happens When You Run It
In your AI chat, ask your assistant:
"Run stm32_doctor to check my STM32 toolchain health."
The assistant calls stm32_doctor and receives structured JSON:
{
"status": "ok",
"discovery": {
"cubeIdePath": "C:\\ST\\STM32CubeIDE_1.19.0\\STM32CubeIDE\\stm32cubeidec.exe",
"cubeMxJarPath": "C:\\ST\\STM32CubeIDE_1.19.0\\STM32CubeIDE\\plugins\\...\\STM32CubeMX.jar",
"programmerCliPath": "C:\\Program Files\\STMicroelectronics\\STM32Cube\\STM32CubeProgrammer\\bin\\STM32_Programmer_CLI.exe",
"gccPath": "C:\\ST\\STM32CubeIDE_1.19.0\\STM32CubeIDE\\plugins\\...\\arm-none-eabi-gcc.exe",
"installedFamilies": [
{ "family": "F1", "version": "1.8.6", "path": "C:\\Users\\user\\STM32Cube\\Repository\\STM32Cube_FW_F1_V1.8.6" }
],
"stlinkDetected": true
},
"problems": [],
"recommendations": []
}When building a project (stm32_build), instead of dumping thousands of raw log lines, the server parses GCC output and returns structured diagnostics with Flash and RAM usage:
{
"success": true,
"summary": "Build completed successfully for blinky-f103/Debug. (0 errors, 0 warnings)\nMemory usage: Flash: 4548 bytes, RAM: 1592 bytes.",
"diagnostics": [],
"memory": {
"text": 4528,
"data": 20,
"bss": 1572,
"total": 6120,
"flashBytes": 4548,
"ramBytes": 1592
}
}Why stm32-mcp?
Developing embedded firmware on STM32 has traditionally relied on desktop graphical interfaces: the Eclipse-based STM32CubeIDE and the Java-based STM32CubeMX.
AI coding assistants cannot interact with desktop GUIs, and driving the ST command-line utilities directly presents severe practical obstacles:
Path-Encoding Crashes: ST's legacy CLI tools fail or produce corrupted builds when file paths contain non-ASCII characters (e.g. Cyrillic or accented Latin) on Windows.
Headless Build Complexity: The Eclipse CDT headless builder requires specific console binaries (
stm32cubeidec.exe), isolated workspace arguments (-data), and explicit target MCU metadata in.cproject.Destructive Regeneration: Running STM32CubeMX code generation permanently wipes application logic unless code is strictly isolated inside matching
/* USER CODE BEGIN */and/* USER CODE END */comments.Context Window Exhaustion: Compiler stdout often exceeds 10,000 lines of build chatter, wasting tokens and degrading agent reasoning.
stm32-mcp wraps the entire ST toolchain in a clean, typed Model Context Protocol interface with pre-flight path validation, safe code-block patching, structured diagnostics, and safety confirmation gates.
Architecture & Workflow
flowchart LR
Agent["AI Coding Agent<br/>(Claude Code / Antigravity / Cursor)"] <-->|"MCP (JSON-RPC stdio)"| Server["stm32-mcp Server"]
Server --> Doctor["Toolchain Discovery<br/>(Auto-detects IDE, MX, CLI, GCC)"]
Server --> CubeMX["STM32CubeMX (-q)<br/>Headless Code Generation"]
Server --> CubeIDE["Eclipse CDT Builder<br/>Headless Compilation"]
Server --> Programmer["STM32_Programmer_CLI<br/>Target Flashing (SWD/JTAG)"]
CubeIDE --> Parser["Diagnostics & Memory Parser<br/>Flash / RAM Metrics"]
Programmer --> Hardware["Target STM32 Hardware<br/>(Blue Pill, Nucleo, Discovery)"]Key Features
100% Headless Operation: Never launches a GUI. Executes STM32CubeMX in quiet script mode (
-q), Eclipse CDT via the console runner (stm32cubeidec.exe), and flashing viaSTM32_Programmer_CLI.exe.Structured Compiler Diagnostics: Parses GCC warnings, errors, and notes into typed
{ severity, file, line, column, message }records. Reports Flash and RAM memory metrics fromarm-none-eabi-size.Pre-Flight ASCII Path Guard: Intercepts and rejects non-ASCII paths immediately with diagnostic guidance before invoking external ST tools.
Safe User Code Injection:
stm32_patch_user_codevalidates marker pairing and balance before modifying files, guaranteeing that CubeMX regeneration never destroys application logic.Safety Confirmation Gates: Destructive operations (
stm32_cleanandstm32_flash) require explicitconfirm: trueto prevent unintended file deletion or unwanted hardware programming.Zero Credential Scraping: Never requests, stores, or scrapes ST account logins. If an MCU firmware package is missing, the tool returns a direct link and folder location for manual download.
Tool Reference
The server exposes 9 dedicated MCP tools:
Tool | Parameters | Description |
| (none) | Reports paths, tool versions, installed MCU HAL firmware packages, and ST-LINK probe connectivity. |
|
| Generates a complete STM32 project: |
|
| Reads and parses |
|
| Idempotently updates pin assignments, modes, and labels in |
|
| Runs STM32CubeMX in headless script mode to generate HAL initialization and peripheral code. |
|
| Safely inserts code inside matching |
|
| Headless compilation via CubeIDE builder; returns structured diagnostics and Flash/RAM usage. |
|
| Deletes build output folders ( |
|
| Programs target MCU via ST-LINK ( |
End-to-End Walkthrough: Blinky on STM32F103
A verified reference project is included at examples/blinky-f103. Here is the typical workflow:
1. Verify Environment
// Tool: stm32_doctor
{}2. Create Project
// Tool: stm32_create_project
{
"name": "blinky-f103",
"mcu": "STM32F103C8Tx",
"path": "C:/projects/stm32/blinky-f103",
"debug": "swd"
}3. Configure Status LED Pin
// Tool: stm32_configure_pins
{
"projectPath": "C:/projects/stm32/blinky-f103",
"pins": [
{ "pin": "PC13", "mode": "GPIO_Output", "label": "LED_STATUS" }
]
}4. Generate HAL Initialization Code
// Tool: stm32_generate_code
{
"projectPath": "C:/projects/stm32/blinky-f103"
}5. Add Non-Blocking Superloop Logic
// Tool: stm32_patch_user_code
{
"file": "C:/projects/stm32/blinky-f103/Core/Src/main.c",
"section": "WHILE",
"mode": "replace",
"content": " static uint32_t last_tick = 0;\n if (HAL_GetTick() - last_tick >= 500) {\n last_tick = HAL_GetTick();\n HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13);\n }"
}6. Build Firmware
// Tool: stm32_build
{
"projectPath": "C:/projects/stm32/blinky-f103",
"configuration": "Debug"
}7. Flash Target Microcontroller
// Tool: stm32_flash
{
"elfPath": "C:/projects/stm32/blinky-f103/Debug/blinky-f103.elf",
"port": "SWD",
"reset": true,
"confirm": true
}Supported Environments & Prerequisites
System Requirements
Node.js: >= 20.0.0
Operating Systems: Windows 10/11 (primary target), Linux, macOS
STM32CubeIDE: 1.15.0 through 1.19.0 (installed at default path
C:\ST\STM32CubeIDE_*or/opt/st/stm32cubeide)STM32Cube MCU Packages: Download target packages (e.g.
STM32Cube_FW_F1_V1.8.6) from st.com and extract into~/STM32Cube/Repository.
Environment Variable Overrides
If tools are installed in custom locations, set the corresponding environment variables:
Variable | Target Executable / Directory |
| Directory containing |
| Path to |
| Path to |
| Path to |
Safety & Process Security
Process Execution: All external commands are executed using
child_process.spawnwith discrete argument arrays andshell: false. Shell interpolation is strictly prevented.Safety Gates: Deleting build artifacts (
stm32_clean) or programming hardware flash (stm32_flash) requires an explicitconfirm: trueparameter.Path Sanitization: All file paths are validated against ASCII characters prior to filesystem or process execution.
Repository Structure
stm32-mcp/
├── .claude-plugin/ # Claude Code plugin manifest
├── antigravity/ # Google Antigravity MCP configuration & docs
├── examples/
│ └── blinky-f103/ # Reference STM32F103 Blue Pill project
├── skills/
│ └── stm32-firmware/ # Agent skill definitions and firmware lifecycle guide
├── src/
│ ├── discovery.ts # ST toolchain auto-discovery
│ ├── index.ts # CLI entry point (stdio transport)
│ ├── server.ts # MCP server setup & tool registration
│ ├── ioc/ # .ioc parser, writer, and CDT project generator
│ ├── parsers/ # GCC diagnostic & size output parsers
│ ├── patcher/ # Safe USER CODE block extraction and patching
│ ├── tools/ # 9 MCP tool implementations
│ └── utils/ # ASCII path validator & safe process spawn
├── test/ # 45 Vitest unit and integration tests
├── CONTRIBUTING.md # Contribution guide & architecture rules
└── package.jsonDevelopment & Testing
# Run unit and integration tests
npm test
# Build TypeScript to dist/
npm run build
# Run in watch mode during development
npm run watchSee CONTRIBUTING.md for architecture rules, coding standards, and guidelines for adding MCU presets.
License
Available Tools
9 toolsstm32_buildA
Headless build. Returns structured diagnostics: {severity, file, line, column, message} parsed out of the GCC output, plus a short summary and the flash/RAM usage from the size output. Do not dump raw logs into the model context.
| Name | Required | Description | Default |
|---|---|---|---|
| clean | No | Whether to perform clean build | |
| projectPath | Yes | Path to STM32 project directory | |
| configuration | No | Build configuration name (default: Debug) | Debug |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It clearly states the tool is headless, parses GCC output into structured diagnostics, returns a summary and flash/RAM usage from size output, and warns against raw log dumping. This gives the agent accurate expectations for execution and output.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no wasted words. 'Headless build' is front-loaded, followed by the return contract and a direct handling instruction. Every sentence contributes meaningful information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The schema fully documents all three parameters, and the description supplies the return format, including diagnostics structure, summary, and size usage. Since there is no output schema, the explicit return details are especially valuable. Nothing critical for correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so projectPath, clean, and configuration are already fully documented in the input schema. The description adds no parameter-specific meaning beyond the overall build behavior, so it meets the baseline but does not enhance parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description starts with 'Headless build', identifying a clear action and the STM32 project context, then explains what the tool returns: structured diagnostics, summary, and flash/RAM usage. It doesn't explicitly distinguish itself from sibling tools like stm32_clean or stm32_flash, but the core purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it: for headless builds where structured diagnostics are desired, and it explicitly tells the agent not to dump raw logs into model context. However, it doesn't contrast this tool with siblings such as stm32_clean or stm32_flash, so alternative selection is left to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_cleanA
Clean build artifacts. Flashing hardware and deleting files require an explicit confirm: true argument. Default is refuse.
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Must pass true to confirm deletion of build folders | |
| projectPath | Yes | Path to STM32 project directory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral disclosure burden. It clearly reveals that deleting files requires confirm:true and that the default is refusal, which is essential for a destructive operation. The mention of 'flashing hardware' is slightly out of scope for a clean tool, but the core deletion behavior is transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short and front-loaded with the primary purpose. The second sentence is slightly muddied by referencing 'flashing hardware' in a clean tool, but overall it is compact and readable with no significant redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter tool with full schema coverage, the description plus schema is sufficient to invoke it correctly. It does not describe output or side effects beyond deletion, but the lack of an output schema makes that less critical. The main missing piece is explicit usage context, which is already scored separately.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so projectPath and confirm are already documented. The description adds that the default is 'refuse,' which merely mirrors the schema's default:false. It does not meaningfully extend parameter understanding beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states the action and target clearly: 'Clean build artifacts.' It is specific enough to distinguish from siblings like stm32_build and stm32_flash, though it does not explicitly name alternatives. It stops short of a 5 because the differentiation is implicit rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied: this tool is for removing build artifacts, and the confirm warning signals that deletion requires explicit consent. However, there is no explicit when-to-use guidance or comparison with alternatives, leaving the agent to infer the appropriate context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_configure_pinsA
Patches pin config in an existing .ioc and regenerates. Idempotent.
| Name | Required | Description | Default |
|---|---|---|---|
| pins | Yes | List of pin configurations to apply or update | |
| projectPath | Yes | Path to project folder or .ioc file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and discloses the two most important behaviors: it mutates a file ('patches') and triggers a regeneration side effect. 'Idempotent' adds material safety context—re-running with the same inputs yields consistent results. It doesn't specify overwrite behavior or prerequisites, but it goes well beyond a bare 'configure pins' statement.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences front-load the action ('Patches pin config in an existing .ioc') and place the idempotency note second. There is zero filler—'Patches,' 'existing .ioc,' 'regenerates,' and 'Idempotent' each carry distinct, necessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The core invocation contract is present—what it patches, where, and that it regenerates—sufficient for a 2-parameter call. However, with no output schema and no annotations, gaps remain: return behavior, whether regeneration implies a build, and conflict/error handling for pin modes are all undisclosed. Adequate for basic invocation, but thin for a mutating tool with side effects.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both projectPath and pins described in the schema, so the baseline is 3. The description confirms projectPath points to an existing .ioc but adds no detail on pin naming conventions, mode values, or label usage for the nested objects, which remain undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'patches' with a precise resource ('pin config in an existing .ioc') and discloses the regeneration side effect. This clearly distinguishes it from siblings like stm32_create_project (which would not target an existing .ioc) and stm32_patch_user_code (which targets user code, not pin config).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'existing .ioc' implies this tool is for modifying already-created projects rather than initial setup, pointing away from stm32_create_project and stm32_generate_code. However, it never explicitly states when to prefer this tool over alternatives or what conditions exclude it, leaving routing mostly to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_create_projectA
Args: name, mcu (e.g. STM32F103C8Tx), path, pins[] ({pin, mode, label}), clock ({hse_hz, sysclk_hz} or a named preset), debug (swd/jtag/none). Writes a valid .ioc and generates the CubeIDE project.
| Name | Required | Description | Default |
|---|---|---|---|
| mcu | Yes | MCU part number (e.g. STM32F103C8Tx) | |
| name | Yes | Project name (e.g. blinky) | |
| path | Yes | Destination directory path for the project | |
| pins | No | Pin configurations | |
| clock | No | Clock settings | |
| debug | No | Debug interface | swd |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions that it 'writes' and 'generates' files, but does not disclose potential side effects such as overwriting existing projects, whether it is destructive, or any other state changes. This is insufficient for a tool that creates project files.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, fitting in two sentences, and is well-structured with the argument list first followed by the action. No unnecessary words or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (6 parameters, nested objects, enum), the description provides a sufficient high-level overview of inputs and outputs. It lacks details about presets (e.g., what clock presets are available) and does not mention return values or error cases, but these are not critical for a creation tool and are not specified in the schema either.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides full coverage (100%) with descriptions for each parameter. The description adds minor structural detail (e.g., pins[] format and clock object fields) but does not significantly enhance understanding beyond the schema. Baseline of 3 applies due to high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool's function: 'Writes a valid .ioc and generates the CubeIDE project.' It lists all arguments in a structured way and distinguishes itself from sibling tools like stm32_configure_pins or stm32_generate_code by focusing on project creation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when creating a new project but does not explicitly state when to use it versus alternatives (e.g., when to use stm32_configure_pins instead). It lacks explicit guidance on context or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_doctorA
Reports resolved paths, versions, installed FW packages, and every problem found (missing package, non-ASCII home path, missing ST-LINK driver). Run this first; every other tool should suggest it on failure.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It presents the operation as a reporting/diagnostic action and enumerates concrete output categories, including problem types such as missing packages and non-ASCII home paths. It does not explicitly state 'does not modify anything,' but 'Reports' strongly implies a non-mutating health check, which is sufficient for a zero-parameter tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences with no filler. The first sentence front-loads exactly what the tool reports, and the second sentence gives crisp operational guidance. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameterless diagnostic tool with no output schema, the description is nearly complete: it lists the categories of information returned and when to run it. It leaves minor gaps such as the exact return format or how problems are represented, but an agent can reliably invoke and interpret this tool with the given information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so there are no parameter semantics to clarify. Per the baseline for 0-parameter tools, a score of 4 is appropriate; the description does not need to compensate for undocumented arguments because none exist.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Reports' and clearly identifies the resource: the STM32 development environment's resolved paths, versions, installed firmware packages, and detected problems. It is unmistakably distinct from the sibling tools, which create, configure, generate, patch, build, clean, flash, or read projects.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit usage guidance: 'Run this first' and 'every other tool should suggest it on failure.' This tells the agent exactly when to invoke this tool relative to all alternatives, which is strong usage guidance for a diagnostic entry point.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_flashC
STM32_Programmer_CLI -c port=SWD -w -rst. Requires confirm: true. Default is refuse.
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Programmer interface port (default: SWD) | SWD |
| reset | No | Whether to reset target device after flashing | |
| confirm | No | Must pass true to confirm flashing to target hardware | |
| elfPath | Yes | Path to .elf binary or project folder containing Debug/*.elf |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does disclose a safety behavior: 'Default is refuse' and confirm must be true, and it exposes a reset flag (-rst). However, it does not mention that flashing overwrites target memory or other potentially destructive side effects, which is a notable gap for a hardware-programming tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely compact, conveying the operation and a key safety requirement in two short sentences. However, the command-line snippet is not front-loaded with a plain-language purpose statement, making it less accessible. Still, there is no wasted content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's destructive potential and the presence of many sibling tools, the description is incomplete. It omits prerequisites, side effects, when to invoke it in the workflow, and what happens on success or failure. The confirmation gate is helpful but does not compensate for the missing context around a hardware write operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of parameters with descriptions and defaults, so the baseline is 3. The description adds minimal semantic value: it maps port/elf/reset to command-line flags but does not explain parameters beyond what the schema already states. No extra meaning is provided for 'confirm' beyond repeating its importance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description gives a command-line invocation ('STM32_Programmer_CLI -c port=SWD -w <elf> -rst') which implies writing an ELF to a target, but it does not explicitly state 'flash' or 'program' in natural language. It is specific to STM32 but may be opaque to an agent unfamiliar with STM32_Programmer_CLI flags, so it is more vague than clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions 'Requires confirm: true' as a necessary condition, but gives no guidance on when to use this tool versus siblings like stm32_build or stm32_generate_code. There is no mention of prerequisites (e.g., a built ELF) or use cases where flashing is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_generate_codeA
Runs CubeMX config load + project generate on an existing .ioc.
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to project directory or .ioc file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states 'generate' which implies file writing, but does not disclose potential overwriting or other side effects. It is neither fully transparent nor misleading.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence with no redundancy or irrelevant content. It is well-structured and front-loads the core action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description is complete enough. It specifies the prerequisite (existing .ioc) and the action, though it does not explain post-generation behavior. This is acceptable given the simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides a description for the sole parameter, projectPath, indicating it can be a directory or .ioc file. Since schema coverage is 100%, the baseline is 3; the tool description adds no extra semantic beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: loading CubeMX config and generating the project. It specifies the target (an existing .ioc file) and distinguishes it from siblings like creating a new project or configuring pins.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool (when an existing .ioc file is present) and differentiates from creation tools. It does not explicitly mention alternatives, but the context of sibling tools and the direct wording make the usage clear enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_patch_user_codeA
Args: file, section (e.g. PD, 2, WHILE, 4), content, mode (replace/append). Writes only between /* USER CODE BEGIN x / and / USER CODE END x */. Must fail loudly if the markers are missing or unbalanced, and must never touch generated init functions.
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Relative or absolute path to C/C++ source file | |
| mode | No | Mode: replace or append | replace |
| content | Yes | Code content to insert between markers | |
| section | Yes | Section tag identifier (e.g. 0, 1, 2, WHILE, PV, PD, Includes) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description goes well beyond the schema by disclosing that writes are strictly confined to marked regions, that it must fail loudly on missing/unbalanced markers, and that generated init functions must never be touched. Since no annotations are provided, this behavioral disclosure is especially valuable for an agent deciding whether the operation is safe.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and information-dense: it lists the arguments, states the exact write boundary, and specifies failure and safety constraints in only two sentences. Every sentence earns its place with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the essential invocation details, marker behavior, and failure constraints for a moderately complex patching tool. It does not describe return values or handling of non-existent files, but for a write-oriented tool with no output schema these are minor gaps given the strong behavioral guarantees provided.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds value by giving concrete section examples (PD, 2, WHILE, 4), clarifying the mode options, and tying the content parameter to insertion between markers, which enriches the otherwise minimal schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool writes content only between USER CODE BEGIN/END markers, giving a specific verb and resource. This distinguishes it from sibling tools like stm32_generate_code and stm32_flash, which perform broader generation or flashing operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage context is implied: use this tool to safely modify user-editable sections in STM32-generated files. However, it does not explicitly name alternatives or state when not to use it, such as when regenerating code or modifying generated initialization logic.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stm32_read_projectA
Summarises an existing project: MCU, clock tree, configured pins, enabled peripherals, whether FreeRTOS is on. Reads the .ioc, not the generated code.
| Name | Required | Description | Default |
|---|---|---|---|
| projectPath | Yes | Path to STM32 project directory or .ioc file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral burden, and it does so well: 'summarises' and 'reads' convey a non-mutating, read-only operation, and the source-of-truth scope (.ioc vs generated code) is explicit. It does not disclose failure behavior for invalid paths or missing .ioc files, but for a simple inspection tool these omissions are minor.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences of roughly 25 words total, with the action and output list front-loaded and the scope clarification second. Every clause earns its place; there is no filler, repetition, or redundant restating of the tool name.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a low-complexity tool with one parameter, no enums, and no output schema, the description is nearly complete: it states the action, the input, the data source, and the content of the summary, which partially compensates for the missing output schema. It omits edge-case behavior (missing .ioc, invalid project) and exact return format, but nothing essential to a correct first invocation is absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the parameter is fully documented structurally. The description adds only marginal nuance — 'existing project' implies a precondition that the path must already point to a real project, and 'Reads the .ioc' reinforces the schema's .ioc-file option. This is a small addition over the baseline set by complete schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Summarises') against a specific resource ('an existing project') and enumerates the exact deliverables: MCU, clock tree, configured pins, enabled peripherals, FreeRTOS status. It further distinguishes itself from siblings by scoping the input source to the .ioc file, making it clearly the inspection tool among create/configure/generate/build/flash peers.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The clause 'Reads the .ioc, not the generated code' gives a clear when-not boundary and implies this is the inspect-before-modifying step in the STM32 workflow. It does not explicitly name alternative tools for inspecting generated code, so it falls short of full sibling routing, but the context is strong enough for an agent to place it correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
9 tool updates
v1.0.0- First observed
stm32_build - First observed
stm32_clean - First observed
stm32_configure_pins - First observed
stm32_create_project - First observed
stm32_doctor - First observed
stm32_flash - First observed
stm32_generate_code - First observed
stm32_patch_user_code - First observed
stm32_read_project
TDQS
Scored across 9 tools
Each tool maps to a distinct lifecycle phase: diagnose, create, configure pins, generate, patch user code, build, clean, flash, and read project state. Even create_project and generate_code are clearly separated by whether an .ioc already exists, so an agent can select appropriately.
All tools share a consistent stm32_ prefix and use snake_case, with the majority following verb_noun pattern (create_project, configure_pins, generate_code, patch_user_code, read_project). The stm32_doctor name is the main deviation, since it is noun-like rather than verb_object, but it remains recognizable and consistent with the set's style.
The set has 9 tools, which is well within the ideal range and matches the server's stated purpose of covering an STM32 project workflow from diagnostics through flashing. Each tool has a clear role and none feel redundant or superficial.
The tool surface covers the main project lifecycle well: create, configure, generate, patch, build, clean, flash, and read state. A minor gap is that clock or peripheral configuration cannot be changed after project creation except through existing pin configuration, and there is no explicit erase/reset tool, but these are workable limitations.
Maintenance
Related MCP Connectors
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
AI electronics blueprint generator — BOM, wiring, firmware, renders for Arduino/ESP32/RPi.
Build, validate, deploy — HTTP APIs, cron jobs, webhooks and MCP tools — from your AI client.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with STM32 development boards via J-Link debugger using RTT communication, supporting connection, logging, memory operations, and firmware flashing through natural language.121MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to build, flash, and communicate with STM32 hardware over SWD and serial, including multi-board management, live memory monitoring, and hardware sequences.25MIT
- FlicenseAqualityCmaintenanceEnables AI assistants to flash firmware, program memory, modify option bytes, erase chips, reset boards, and capture SWO printf traces for STM32 microcontrollers via STM32CubeCLT.12-
- AlicenseNot gradedqualityCmaintenanceAn MCP server that lets AI coding agents drive the full STM32 development loop—code generation, build, flash, debug, serial monitoring, and fault diagnosis—end to end via CubeIDE, CubeMX, CubeProgrammer, OpenOCD, and GDB.1MIT