Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/h666zhang/vscode-cube-mcp/agents-mdgit clone --depth 1 https://github.com/h666zhang/vscode-cube-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/h666zhang/vscode-cube-mcp/agents-md)<a href="https://agentmods.dev/instructions/h666zhang/vscode-cube-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/h666zhang/vscode-cube-mcp/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01141 | $0.01141 |
| Opus 5 | $0.00571 | $0.00571 |
| Sonnet 5 | $0.00228 | $0.00228 |
| Haiku 4.5 | $0.00114 | $0.00114 |
Grade A, and why
vscode-cube-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Vscode_cube_mcp — AGENTS.md(项目约定,agent 必读)
本目录是 Vscode_cube_mcp:一个封装 STM32CubeMX 命令行(-q) 的 MCP server。 任何 agent 接入本目录后,先读本文件,再动手。
能力边界(最高优先)
- 本工具只做配置层:.ioc 工程配置 + HAL 骨架生成(引脚 / 外设 / 时钟 / 工具链),不做应用层。
- 不生成、不修改、不负责应用业务代码(LED 闪烁、OLED 显示内容、传感器驱动、中断处理逻辑等)——这些由用户自己编写。
- 你(agent)在对话中若需要业务代码,应在生成后的工程文件里直接编写;但这不是本工具的能力,也不要要求工具"生成完整功能"。
- 以后给本工具提需求 / 加功能,同样遵循同一原则:配置到骨架为止,不替用户写业务逻辑。
第一优先:接入后先调 cubemx_help
- 本 server 的核心内置帮助工具是
cubemx_help:调用它获取完整工具清单、可用芯片模板、各外设配置方法与已知坑。 - 动手建工程 / 改配置前,必须先调用
cubemx_help,不要凭经验猜 set 命令语法(实测有多个坑,见下)。
项目结构
cubemx_mcp.py— MCP server 源码(9 个工具)templates/— 最小模板基底模板(6.18 原生 .ioc,按芯片命名;仅芯片标识+基础时钟 72MHz/SWD/SysTick,无外设,外设全部由cubemx_new_project的commandsset 现配;新增芯片用 CubeMX GUI 新建后存为templates/{mcu}.ioc)test_cubemx_mcp.py— 单元测试(不依赖 CubeMX)README.md— 面向用户的手册(安装/配置/FAQ)README.dev-notes.md— 开发笔记(配置补丁原理、外设实测、发布流程)
工具一览(9 个)
cubemx_help / cubemx_script / cubemx_load / cubemx_configure / cubemx_generate
/ cubemx_export_pinout / cubemx_new_project / cubemx_remove_peripheral / cubemx_add_source
已知坑(实测结论,勿重踩)
- TIM 内部时钟:
set mode TIMx一律 KO;set ip parameters TIMx ClockSource TIM_CLOCKSOURCE_INTERNAL只改参数不改 SH/VP 表达(GUI 仍显示 ETR)。可靠做法(0.4.0 配置补丁):cubemx_new_project的 commands 里含set ip parameters TIMx ClockSource TIM_CLOCKSOURCE_INTERNAL时,server 自动注入 6.18 验证过的标准表达,任意 TIM/芯片适用,可附Prescaler/Period自定义;详见cubemx_help(topic="tim")。 - RCC 时钟:对 RCC 执行 set 命令(如 PLLMUL)会把
RCC.PLLSourceVirtual=HSE弄丢,时钟静默降级 HSI(64MHz 而非 72MHz)。改时钟优先用cubemx_new_project的clock_source/pll_mul参数。 - generate 覆盖 CMakeLists:
cmake/stm32cubemx/CMakeLists.txt会被重新 generate 覆盖,自定义 源文件需重新调cubemx_add_source加入(幂等)。 - 模板必须 6.18 原生生成:手写/非原生 .ioc 会被 6.18 拒绝。请求的芯片无模板时,报错会给出 可用模板清单与生成方法。
开发 / 验证
- 单元测试:
python -m unittest test_cubemx_mcp(72 个,不依赖 CubeMX) - 语法检查:
python -m py_compile cubemx_mcp.py test_cubemx_mcp.py - MCP 协议级冒烟:用官方
mcp.client.stdio.ClientSession连接;手写 JSON-RPC 直连本 2.0 server 会挂起无响应。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 54 lines · 1,141 tokens per session scan A 34bd1c1b3ba8
vscode-cube-mcp AGENTS.md is an instructions file published in the GitHub repository h666zhang/vscode-cube-mcp (2 stars, last pushed 4d ago), licensed MIT. It adds 1,141 tokens to every session, about $0.0057 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
cml-mcp AGENTS.md
AGENTS.md instructions for xorrkaz/cml-mcp, covering agents.md — cml mcp server, project overview, compatibility goal, repository layout and tool modules (src/cmlmcp/tools/).
brilliant_sdk AGENTS.md
Instructions for brilliantlabsAR/brilliant_sdk, covering brilliant sdk — agent guide, how an app works (the pattern behind everything), minimal reading paths, verify without hardware and testing.
NeoMind CLAUDE.md
Claude Code instructions for camthink-ai/NeoMind, covering neomind — edge ai platform for iot, development commands, ecosystem repositories, extension package contract (.nep) and device type template contract (json).
cad-cae-copilot copilot-instructions.md
Copilot instructions for armpro24-blip/cad-cae-copilot, covering github copilot — aieng workspace and essentials.
phone-mcp CLAUDE.md
Claude Code instructions for premex-ab/phone-mcp, covering claude.md, project overview, build commands, architecture and module layout.
zmk-config AGENTS.md
AGENTS.md instructions for urob/zmk-config, covering customization guide, ground rules, how the multi-board layout works, adding a new board and where to change what.