McuBuddy MCP server
✓ 인증됨디버그 프로브와 Keil MDK를 사용하여 AI 어시스턴트가 실제 하드웨어 MCU 디버깅, 펌웨어 분석 및 자동 검증을 수행할 수 있도록 지원합니다.
다른 이름 cunjun/McuBuddy
- 스타
- 10
- Tools
- —
- 다운로드, 30일
- 89
- 최신 버전
- 0.5.1
- 마지막 커밋
- 2026년 8월 17일
- 라이선스
- MIT
McuBuddy MCP란?
McuBuddy은(는) MCP server입니다. 디버그 프로브와 Keil MDK를 사용하여 AI 어시스턴트가 실제 하드웨어 MCU 디버깅, 펌웨어 분석 및 자동 검증을 수행할 수 있도록 지원합니다.
프로젝트 README에서 생성된 요약
McuBuddy MCP server 정보
임베디드 펌웨어 엔지니어와 개발자는 AI 어시스턴트를 통해 실제 하드웨어 디버깅 및 자동 검증을 직접 수행할 수 있습니다. 이 서버는 ST-Link, J-Link 또는 CMSIS-DAP과 같은 디버그 프로브에 연결하여 AI가 CPU 및 메모리 상태, CMSIS-SVD를 통한 주변 장치 레지스터, FreeRTOS 태스크 컨텍스트를 검사할 수 있도록 합니다. 펌웨어 진단 및 런타임 관찰성을 위한 구조화된 도구를 제공함으로써 코드 분석과 물리적 하드웨어 사이의 간극을 메워줍니다.
로컬 머신에서 서버를 실행하는 사용자는 Claude Code 또는 Codex와 같은 클라이언트에 이를 통합할 수 있습니다. Windows 사용자의 경우, 서버가 UV4.exe를 통해 Keil MDK를 호출하여 프로젝트 빌드 및 펌웨어 다운로드를 처리할 수 있습니다. 이 시스템은 stdio 프로세스를 사용하는 로컬 전용 백엔드로 작동하며, 타겟 보드, 프로브 및 필요한 ELF 또는 AXF 파일이 호스트 머신에서 직접 접근 가능해야 합니다. 디버깅 워크플로우를 관리하기 위해 probe, diagnose, build_flash, rtos, logs와 같은 특정 도구 세트로 기능을 구성합니다.
활용 사례
- 1펌웨어 결함 조사AI가 ELF/DWARF 데이터를 사용하여 HardFault 발생 시 메모리 주소를 특정 소스 코드 라인 및 콜 스택으로 변환하여 확인할 수 있습니다.
- 2빌드 및 플래시 사이클 자동화개발자는 AI에게 코드를 수정하고, Keil MDK 빌드를 트리거하며, 새로운 펌웨어를 타겟 보드에 플래시하도록 지시할 수 있습니다.
- 3실시간 시스템 로그 모니터링어시스턴트가 UART, RTT 또는 J-Link SWO에서 런타임 데이터를 읽어 시스템 동작을 관찰할 수 있습니다.
- 4RTOS 내부 상태 검사AI가 FreeRTOS 태스크와 각 스택 사용량을 조사하여 리소스 문제를 식별할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
McuBuddy MCP 설치 방법
형식 확인: 2026년 11월 10일Cursor에 추가Goose에 추가Claude Code에 McuBuddy MCP 설치
$ claude mcp add mcubuddy -- uvx McuBuddyCursor에 McuBuddy MCP 설치
~/.cursor/mcp.json
{
"mcpServers": {
"mcubuddy": {
"command": "uvx",
"args": [
"McuBuddy"
]
}
}
}VS Code에 McuBuddy MCP 설치
.vscode/mcp.json
{
"servers": {
"mcubuddy": {
"type": "stdio",
"command": "uvx",
"args": [
"McuBuddy"
]
}
}
}VS Code CLI에 McuBuddy MCP 설치
$ code --add-mcp '{"name":"mcubuddy","type":"stdio","command":"uvx","args":["McuBuddy"]}'Claude Desktop에 McuBuddy MCP 설치
claude_desktop_config.json
{
"mcpServers": {
"mcubuddy": {
"command": "uvx",
"args": [
"McuBuddy"
]
}
}
}Codex에 McuBuddy MCP 설치
$ codex mcp add mcubuddy -- uvx McuBuddyCodex config.toml에 McuBuddy MCP 설치
~/.codex/config.toml
[mcp_servers.mcubuddy] command = "uvx" args = ["McuBuddy"]
Gemini CLI에 McuBuddy MCP 설치
$ gemini mcp add -s user mcubuddy uvx -- McuBuddyGemini settings.json에 McuBuddy MCP 설치
~/.gemini/settings.json
{
"mcpServers": {
"mcubuddy": {
"command": "uvx",
"args": [
"McuBuddy"
]
}
}
}자동 검사
2026년 11월 14일에 실행됨전체 보고서 →자동 검사를 통과했습니다. 이는 보안 감사가 아닙니다. 코드를 직접 읽고 서버에 필요한 최소한의 권한만 부여하십시오. 검사 방식
- 소스 저장소 연결 및 접근 가능cunjun/mcubuddy is public and reachablegithub.com/cunjun/mcubuddy ↗통과
- 패키지가 이 저장소를 소스로 명시McuBuddy names cunjun/mcubuddy as sourcepypi.org/project/McuBuddy/ ↗통과
- 빌드 출처(Sigstore 증명)No build attestation published for this release검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-08-17github.com/cunjun/mcubuddy ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음No popular package one edit away from McuBuddy통과
- 패키지 및 해당 종속성에 중요한 보안 권고 없음55 resolved dependencies checked; no critical advisoryosv.dev ↗통과
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기McuBuddy — AI-Powered MCU and Embedded Firmware Debugging MCP Server
Extend AI from firmware analysis to real MCUs, closing the loop across diagnosis, code changes, build, flashing, and validation in verified environments.
McuBuddy is a Model Context Protocol (MCP) server for
MCU board-level debugging. It exposes debug probes, Keil MDK projects, ELF/DWARF symbols,
CPU and memory state, SVD peripheral registers, UART/RTT logs, FreeRTOS state, Flash operations,
and GDB servers as structured tools that AI assistants can call.
It is designed for firmware development, board bring-up, fault isolation, debugging automation, and AI-assisted validation.
McuBuddy starts with 19 stable tools in the default toolset. Add only the domains a workflow
needs with MCUBUDDY_TOOLSETS=probe,diagnose (available domains: probe, diagnose,
build_flash, rtos, logs, and experimental). The core profile is the only profile;
startup toolset selection is explicit and immutable.
[!IMPORTANT] Automation does not replace engineering responsibility. Humans remain responsible for goals and acceptance criteria, wiring and power safety, high-risk operation approval, code review, and new environment validation. Motors, relays, and other safety-related devices also require recovery plans and independent protection.
Quick links: Quick Start · Project Guide · Tool Reference · Support Matrix
✨ Key Features
- Real-hardware debugging: Discover and connect to ST-Link, J-Link, CMSIS-DAP, and other probes; control target execution; and inspect registers, memory, breakpoints, and watchpoints.
- Keil project workflow: Discover
.uvprojx/.uvprojfiles, select a target, invoke Keil MDK throughUV4.exefor builds or downloads, and feed the generated AXF/ELF into debugging. - Source-level fault diagnosis: Use ELF/DWARF data to resolve addresses to functions, source lines, local variables, and call stacks when investigating HardFaults, startup failures, stack overflows, and memory corruption.
- Peripheral and RTOS inspection: Decode peripheral registers through CMSIS-SVD and inspect FreeRTOS tasks, task contexts, and stack usage.
- Logs and runtime observability: Read UART, RTT, and selected J-Link SWO logs, and manage pyOCD/J-Link GDB server lifecycles.
- Evidence-driven results: Return structured target, state, and validation evidence so AI can continue an investigation instead of guessing code changes from symptoms alone.
- Actionable hardware boundaries: Distinguish MCU limitations, firmware-inapplicable tools, configuration problems, tool failures, and insufficient evidence, including impact and the next safe check so unsupported paths are not debugged as firmware defects.
🏗️ How It Works
flowchart LR
AI["AI Client<br/>Codex / Claude Code"] --> MCP["McuBuddy<br/>MCP Server"]
MCP --> EB["Execution Boundary<br/>Serialized Session"]
EB --> TOOLS["Debugging Tools<br/>Diagnostics / Symbols / SVD / RTOS / Logs"]
TOOLS --> KEIL["Keil MDK / UV4.exe<br/>Build / Optional Download"]
TOOLS --> PROBE["Probe Backends<br/>pyOCD / J-Link / probe-rs"]
KEIL --> IMAGE["AXF / ELF / HEX / BIN"]
IMAGE --> TOOLS
PROBE --> BOARD["Real MCU Board"]
MCP is not a protocol for invoking Keil. The AI calls McuBuddy through MCP; McuBuddy then
uses Keil MDK through UV4.exe, pyOCD, J-Link, or another internal backend as required.
🚀 Quick Start
1. Prerequisites
Basic requirements:
- Python 3.10 or later;
- a powered MCU development board;
- a correctly connected ST-Link, J-Link, or CMSIS-DAP probe;
- the target chip name;
- preferably, an ELF/AXF image containing debug information.
Keil build and download features require Windows with Keil MDK installed. McuBuddy invokes
µVision through UV4.exe, including in Keil MDK v5 installations.
2. Installation
pip install "McuBuddy @ git+https://github.com/cunjun/McuBuddy.git"
This installs McuBuddy once for all local firmware projects. Do not clone or copy the McuBuddy
repository into each target project. McuBuddy is a local-only MCP backend: the client starts one
stdio process per connection, and McuBuddy does not expose HTTP, SSE, WebSocket, or another MCP
network listener.
The target project, Keil installation, ELF/SVD files, probe, and serial port must be directly
visible to the machine running McuBuddy. To update, reinstall from the official repository at
https://github.com/cunjun/McuBuddy; McuBuddy never checks for, downloads, or installs updates
automatically.
Install the optional dependency when using the J-Link Python backend:
pip install "McuBuddy[jlink]"
For development from source:
git clone https://github.com/cunjun/McuBuddy.git
cd McuBuddy
pip install -e ".[dev]"
3. Configure an MCP Client
{
"mcpServers": {
"McuBuddy": {
"command": "McuBuddy",
"args": []
}
}
}
For a Windows source checkout, explicitly configure the virtual-environment Python executable and working directory. See Installation and First Connection, then restart the AI client.
4. Run a First Read-Only Check
After connecting the probe and powering the board, tell the AI:
Use McuBuddy to inspect the current debugging environment, discover connected probes,
and perform a first read-only check of the board without writing Flash.
Before starting, tell me what information is still missing.
The recommended sequence is to check the environment and target first, then configure the probe and read the minimum target state:
doctor()
list_connected_probes()
match_chip_name("py32f030x8")
configure_probe(target="py32f030x8", backend="pyocd")
probe_connect(target="py32f030x8")
read_stopped_context()
probe_connect and read_stopped_context are available in the default core profile. Reading a
stable stopped context may halt the target, so it is still execution-changing. If the device must
not be halted, instruct the AI to perform only non-intrusive probe and environment checks.
💬 Automated Debugging Example
Use McuBuddy to debug <project path>. The MCU is <exact model>, and the probe is
<ST-Link/J-Link/CMSIS-DAP>. First collect board-level evidence and locate the problem. After
authorization, modify the code, build and flash it, then validate the result on the real board.
For the evidence-first decision order and common scenarios, see Common Debugging Workflows.
🧰 Backends and Hardware Validation
| Path | Current Role | Main Capabilities |
|---|---|---|
| pyOCD + ST-Link/CMSIS-DAP | Primary backend | Control, memory, Flash, source debugging, RTT, RTOS, and GDB server |
| J-Link | Primary backend | Control, memory, Flash, source debugging, native RTT, DWT, and GDB server |
| probe-rs sidecar | Extended preview | ARM/RISC-V/Xtensa discovery, configurable core control, registers, memory, hardware breakpoints, Flash, and RTT |
Keil MDK (Windows, via UV4.exe) |
Build/download backend | Project discovery, target configuration, build, logs, and optional download; supports MDK v5 installations |
Primary validation coverage includes:
- STM32L496VETx + ST-Link / pyOCD;
- STM32F103C8 + J-Link;
- built-in target preflight profiles for STM32F103ZE and PY32F030X8.
“Implemented in code” does not mean “validated on every board.” Use the
Support Matrix and list_validation_records() as the source of truth.
🛡️ Safety Model
McuBuddy provides machine-readable safety classifications through list_tool_safety().
| Category | Examples | Default Requirement |
|---|---|---|
| Read-only | Target matching, register/memory reads, symbol resolution, logs, diagnostics | No confirmation required |
| Execution-changing | halt, resume, reset, continue, stepping | Does not write Flash, but changes execution state |
| Runtime-state write | Memory/register writes, breakpoints, watchpoints, SVD field writes | Explicit confirmation |
| Persistent destructive operation | Flash erase/program, Keil firmware download | Explicit confirmation |
| Host process | Keil build, GDB server start/stop | Starts or stops a local process |
Safety principles:
- For an unknown target, match the chip and probe first; do not guess addresses.
- Read evidence before halting, resetting, or writing.
- Before a Flash operation, confirm the target, scope, image, and recovery method.
- For motors, relays, power switches, and other actuators, prefer breakpoints and low-energy tests.
- Send actuator commands with
uart_send_with_cleanup, then callfinish_debug_sessionbefore returning a final conclusion. Server shutdown repeats the same idempotent cleanup as a fallback.
🔒 Sessions and Concurrency
- Operations that share probe, Keil, ELF/SVD, log, and runtime configuration are serialized within
the same
Session. - Different sessions can run concurrently when they control unrelated boards.
- Stateless queries such as target matching and tool safety information can run alongside session operations.
- Cancellation cannot forcibly terminate a call that has entered a synchronous SDK. The server waits for the worker thread to finish before releasing the session lock.
This prevents one request from switching backends, disconnecting the probe, or changing shared state while another probe operation is still running.
📦 mcubuddy Skill
The repository includes skills/mcubuddy, which guides Codex and Claude Code to use these tools in an
“evidence first, judgment second” sequence instead of treating MCP tools as an unordered command list.
The Skill is an optional workflow enhancement, not a prerequisite for hardware debugging. A correctly installed and configured local McuBuddy MCP server remains fully usable without it.
Installed releases bundle the Skill. Register the persistent Codex integration without cloning the repository:
uv tool install McuBuddy
McuBuddy setup codex --confirm --json
Install for Codex:
python .\skills\mcubuddy\scripts\install_skill.py --target codex --overwrite
Install for Claude Code:
python .\skills\mcubuddy\scripts\install_skill.py --target cc --overwrite
Restart the client or open a new session after installation. For source-checkout recovery, installation registration, and usage boundaries, see Boundaries Between McuBuddy, MCP, and the Skill for details.
⚠️ Current Limitations
- Keil build and download currently require Windows with Keil MDK and invoke µVision through
UV4.exe, including in MDK v5 installations. - The probe-rs sidecar covers Flash and RTT but still requires target-specific real-board validation and does not yet have an official binary release.
- RTOS inspection depends on FreeRTOS symbols and an ELF/AXF that match the target firmware.
- SVD files are not bundled automatically for every chip and usually come from a CMSIS-Pack or the chip vendor.
- SWO text capture depends on chip configuration, probe capabilities, pin multiplexing, and board wiring.
- Device patches and connection strategies remain lightweight mechanisms rather than a complete board plugin system.
📚 Documentation
- Complete project overview and workflows: Project Guide
- Chinese project overview: 项目指南
- Complete tool index: Tool Reference
- Chinese tool usage: MCP 工具中文参考
- Backend and hardware validation: Support Matrix
- Project design: Architecture
- Release history: Changelog
🧪 Local Development
pip install -e ".[dev]"
pytest
ruff check src tests
See the Project Guide for repository layout and documentation ownership.
🙏 Upstream and Acknowledgements
McuBuddy is based on SolarWang233/mcudbg and continues its MIT-licensed work with additional architecture, safety boundaries, evidence workflows, backend support, and documentation. The original copyright notice is preserved in LICENSE, with provenance details in NOTICE.
📄 License
This project is licensed under the MIT License. See LICENSE for details.
If McuBuddy helps with your MCU debugging workflow, consider giving the project a Star.
If you have suggestions, open an Issue or email
zhou229449@gmail.com.
McuBuddy MCP 질문
McuBuddy MCP를 Claude Code에 추가하려면 어떻게 하나요?
터미널에서 claude mcp add mcubuddy -- uvx McuBuddy를 실행합니다. 모든 프로젝트에서 사용할 수 있게 하려면 --scope user를 추가합니다.
McuBuddy MCP를 Cursor에 추가하려면 어떻게 하나요?
~/.cursor/mcp.json를 열고 mcpServers 아래에 서버를 추가합니다. 위 설치 섹션에 표시된 Cursor 구성을 사용합니다.
McuBuddy는 어떤 하드웨어 프로브를 지원하나요?
pyOCD 및 probe-rs와 같은 백엔드를 통해 ST-Link, J-Link, CMSIS-DAP 및 other 프로브를 지원합니다.
Keil 연동을 위해 Windows가 필요한가요?
네, Keil 빌드 및 다운로드 기능을 사용하려면 UV4.exe를 통해 µVision을 호출해야 하므로 Keil MDK가 설치된 Windows 환경이 필요합니다.
McuBuddy로 RTOS 상태를 확인할 수 있나요?
네, ELF/AXF 심볼을 사용하여 FreeRTOS 태스크, 태스크 컨텍스트 및 스택 사용량을 확인할 수 있습니다.
이 서버는 네트워크 접속이 가능한 서비스인가요?
아니요, stdio를 사용하여 통신하는 로컬 전용 MCP 백엔드이며 HTTP나 WebSockets를 노출하지 않습니다.