Skip to main content
R

mcu-docs-mcp (dsh-plugin)

rar-zip/mcu-docs-mcp/dsh-plugin

Registers 10 embedded MCU/STM32 tools: PDF manual line-level search, CMSIS-SVD register and Cortex-M HardFault decoding, timing calculators, and CubeMX .ioc / Keil .uvprojx auditing.

Install

dsh plugin --profile web add github:rar-zip/mcu-docs-mcp

This plugin lives in the dsh-plugin subdirectory of the repository.

README

mcu-docs-mcp

Stop letting AI guess STM32 registers or miscalculate dead-time and fry MOSFETs.
Install once, chat with your AI normally—get deterministic register math, hardware audits, and the original PDF manual highlighted to exact Chapter, Page & Line right inside your AI client or VS Code.

CI License: MIT Python 3.10+ MCP Apps SEP-1865 VS Code Extension DeepSeek Harness Codex CLI

中文用户: 原生支持 简体中文版(含中文 PDF 原生全文检索引擎、中文硬件审计/Diff 报告、阅读器 中/EN 实时切换、DeepSeek Harness (dsh) 桌面端、VS Code 原生扩展与 mcu-docs-mcp-zh 一键启动)👉 查看完整简体中文文档

简体中文文档 · VS Code Extension · Changelog · Contributing


mcu-docs-mcp live demo: AI calculates exact TIM1_BDTR dead-time and audits hardware configs while opening RM0090 highlighted at the exact page and line

How You Actually Use It (No CLI Commands to Memorize!)

mcu-docs-mcp is an MCP hardware brain + interactive PDF manual viewer that plugs into your AI agent or VS Code. Set it up once, then just talk to your AI normally—it calls the deterministic tools automatically behind the scenes:

What you ask your AIWhat mcu-docs-mcp executes automaticallyWhat you get back
"Compute TIM1_BDTR.DTG[7:0] for 200 ns dead-time at 168 MHz and show me the RM0090 formula."Runs the exact 4-range dead-time solver + line-bbox PDF locator (zero mental math!)Exact DTG=0x22 (202.38 ns) + RM0090 Page 3 opens automatically with the formula line highlighted in yellow
"Audit my updated motor_ctrl.ioc and Keil .uvprojx before I flash the board."Cross-checks clocks, Pin XML, SVD, CAN/FDCAN timing, Keil files & Errata PDFsCatches zero-deadtime shoot-through, APB1 CAN bitrate drift, dropped Keil .c files & HSE_VALUE mismatch with exact Errata citations
"My MCU hit HardFault: CFSR=0x00008200, BFAR=0x40010044. What crashed?"Decodes Cortex-M fault bits + reverse-resolves 0x40010044 against CMSIS-SVDPinpoints PRECISERR hitting TIM1_BDTR and tells you to verify RCC peripheral clock enable

Need another chip or sensor datasheet? Simply drag and drop any PDF (STM32H7, GD32, CH32V, ESP32, MPU6050, W25Q128, TMC2209...) directly onto the viewer—or paste a folder path—to index your whole library with cross-doc search, Ctrl + Scroll auto-HD zoom (up to 225 DPI), diagram box-select, and 1-click OS clipboard citation copy.


Works With Your Favorite AI Client & IDE

EnvironmentIntegrationWhat You Get
Antigravity / Claude / CursorNative MCP + SEP-1865 MCP AppsEmbedded side-pane PDF viewer auto-jumping to highlighted lines during chat
DeepSeek Harness (dsh) Desktopmcu-docs install dsh (@deepseek-ai/dsh-mcp-client)Auto-mounts all 10 hardware tools (mcp__mcu_docs_mcp__*) + installs 4 SKILL.md skills into ~/.dsh/skills/
VS CodeNative Extension (vscode-extension/) + mcu-docs install vscodeWorks with OR without AI: right-click TIM1->BDTR in C code to jump straight to the PDF, right-click .ioc for native Problems Panel diagnostics, plus Copilot/Cline MCP
OpenAI Codex CLImcu-docs install codexSafely merges ~/.codex/config.toml + installs 4 SKILL.md workflows + AGENTS.md
Standalone Browser Viewermcu-docs viewerLocal 127.0.0.1 companion PDF viewer alongside Keil, CubeIDE, or any terminal

1-Minute Setup (Easiest Way: Let Your AI Install It!)

Universal Zero-Effort Setup (Works for Every AI Client)

Don't want to hand-edit JSON, TOML, or YAML? Just paste this single sentence into your AI client (Antigravity, Claude, Cursor, Codex, VS Code Copilot, or DeepSeek Harness) and let your AI download, install, and wire it up automatically:

Please install https://github.com/rar-zip/mcu-docs-mcp and configure it in your current AI client (as an MCP server or native plugin), then verify that its tools respond cleanly.


1. DeepSeek Harness (dsh) Desktop (Native dsh-plugin/ Package)

Ships a native Cordis bundle dsh-plugin/ packaged per awesome-dsh-plugin with all 10 hardware tools and automatic Python / uvx backend discovery:

# 1. Install the Python backend (or skip if uv/uvx is already on PATH)
pip install git+https://github.com/rar-zip/mcu-docs-mcp.git

# 2. Install the native DSH plugin directly (or search rar-zip/mcu-docs-mcp#dsh-plugin once listed in dsh-market)
dsh plugin add https://github.com/rar-zip/mcu-docs-mcp/releases/download/v0.5.0/dsh-mcu-docs-0.5.0.tgz
Or attach via MCP config after pip install
mcu-docs install dsh --workspace /path/to/your/firmware-repo
# Restart DeepSeek Harness so the mounted MCP tools appear in the tool list

2. VS Code (Native Extension + Copilot / Agent Mode)

pip install git+https://github.com/rar-zip/mcu-docs-mcp.git
mcu-docs install vscode --workspace /path/to/your/firmware-repo

Also includes the bundled standalone VS Code Extension (vscode-extension/) with C/C++ right-click register lookup, .ioc Problems Panel diagnostics, and built-in interactive PDF Manual Viewer.

3. OpenAI Codex CLI

pip install git+https://github.com/rar-zip/mcu-docs-mcp.git
mcu-docs install codex --workspace /path/to/your/firmware-repo

4. Antigravity / Claude Code / Claude Desktop / Cursor

# Claude Code zero-install one-liner:
claude mcp add mcu-docs --scope user -- uvx --from git+https://github.com/rar-zip/mcu-docs-mcp mcu-docs-mcp --workspace .
Antigravity / Claude Desktop / Cursor (mcp_config.json)
{
  "mcpServers": {
    "mcu_docs_mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/rar-zip/mcu-docs-mcp",
        "mcu-docs-mcp",
        "--workspace",
        "/path/to/your/firmware-repo"
      ]
    }
  }
}

Architecture

flowchart LR
    A["Firmware Repo<br/>.ioc · .uvprojx · .svd · PDFs"] --> B["mcu-docs-mcp Server<br/>(Python · PyMuPDF · SQLite FTS5)"]
    B --> C["Deterministic Hardware Engines<br/>SVD (&lt;dim&gt;/&lt;cluster&gt;) · Pin AF · 5x Timing Calcs<br/>HardFault Decoder · F0..H7/U5 Profiles"]
    B --> D["Line-BBox Manual Index<br/>(section, page, line_no, x0..y1)<br/>LRU Cache + EN/CJK Full-Text"]
    D --> E["Unified SEP-1865 Viewer (viewer.html)<br/>Ctrl+Scroll HD Zoom · Drag-Drop PDF Import<br/>Cross-Doc Search · Region Box-Select"]
    E --> F["Antigravity · Claude · VS Code Extension<br/>DeepSeek Harness (dsh) · Codex CLI"]
    A --> G["GitHub PR Diff Bot &amp; git textconv<br/>mcu-docs diff / git-install"]

MCP Tools Reference (10 Model Tools + Interactive Viewer)

ToolPurposeInteractive Viewer?
open_manual_viewerOpens the SEP-1865 PDF viewer (Ctrl+Scroll auto-HD zoom, drag-drop PDF import, All Docs/This Doc search, Region box-select, reliable OS clipboard copy)✅
search_manualFTS5 hardware-token + CJK search returning [DocID §Sec, P.x, L.y] citations + multi-line span highlight✅
index_pdf_manualIndexes any local PDF manual or entire folder of PDFs (STM32, GD32, CH32V, ESP32, TI, sensors)—
lookup_registerCMSIS-SVD lookup (multi-hop derivedFrom, <dim>, <cluster>, reverse hex 0x40010044) + 32-bit hex bitfield decoder✅
lookup_pin_afQueries STM32_open_pin_data XML for valid alternate functions (PA9 ↔ USART1_TX AF7, CubeMX suffix-safe)—
calc_peripheral_timingDeterministic solver for TIMx_BDTR.DTG[7:0], PWM PSC/ARR/CCR, USART_BRR, bxCAN, and FDCAN NBTP/DBTP—
decode_fault_registersDecodes Cortex-M CFSR/HFSR/MMFAR/BFAR and resolves faulting peripheral addresses via SVD—
diff_project_configsSemantic .ioc & .uvprojx diff with derived CAN/FDCAN/UART drift and dropped-file alerts—
audit_projectFull hardware audit against silicon bus limits (F0..H7/U5), shoot-through, CAN1..3/FDCAN1..3 SJW<=TS2 & family-gated Errata✅
fetch_stm32_dataDownloads & caches official STM32_open_pin_data XML and cmsis-svd-data .svd via Git Trees API—

Optional Power Tools: GitHub PR Bot & Local git diff

GitHub PR semantic diff comment preview

  • GitHub PR Bot: Copy .github/workflows/mcu-config-diff.yml into your firmware repo to post sticky semantic diff warnings on every .ioc / .uvprojx PR.
  • Local git diff Driver: Run mcu-docs git-install once in any firmware repo to turn noisy .ioc diffs into clean sorted hardware summaries.
  • Try the Included STM32F407 Motor Drive Demo:
    git clone https://github.com/rar-zip/mcu-docs-mcp.git && cd mcu-docs-mcp
    pip install -e ".[dev]"
    mcu-docs audit examples/stm32f407_motor_drive/motor_ctrl_v2.ioc --uvprojx examples/stm32f407_motor_drive/motor_ctrl_v2.uvprojx
    mcu-docs viewer
    

Supported Silicon & Vendor Manuals

  • Built-in STM32 Bus Profiles (silicon_profiles.py): STM32F0, F1, F3, F401/411/405/407/429/446, F7, G0, G4, L4, H7, U5.
  • Vendor-Agnostic PDF Viewer: Works with any vector PDF manual — STM32, GD32, WCH CH32V, ESP32, NXP, TI, Nordic, plus external ICs & sensors (MPU6050, ADS1256, W25Q128, TMC2209).

If mcu-docs-mcp saved you from a fried MOSFET, a stuck I2C bus, or an hour of Ctrl+F in a 2,000-page PDF, please consider giving it a Star ⭐!

MIT License

Related plugins