pcb-doctor
Provides deterministic auditing, repair planning, and pre-order validation for EasyEDA Pro .eprj3 projects, including netlist/BOM collection, assembly-variant and PCB sync checks, isolated .evar repairs, and offline HTML reports.
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., "@pcb-doctor run an audit on examples/power-mcu/faulty.json and summarize the failed rules"
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.
PCB Doctor · 嘉立创 EDA 首板上电与装配变体闭环验收工具
PCB Doctor 是一款面向嘉立创 EDA 专业版(.eprj3)的确定性工程验收、受控修复与投板总检工具,覆盖 11 大类确定性规则(USB-C CC、电源去耦、I²C 上拉、晶振负载、MCU 复位、LED 限流、BOM 追溯、变体差集、离线 .epcb2 PCB 焊盘网络同步、UTF-16LE 贴片坐标 CPL 与 Gerber ZIP 归档完整度),支持 隔离 .evar 修复 + 隔离 CPL 清洗 + 一键 pre-order 单页离线 HTML 仪表盘,并同时提供 CLI(python3 -m pcb_doctor / pyproject.toml)、零依赖 stdio MCP Server(9 工具)+ Agent SKILL.md 与嘉立创 EDA 原生 .eext 扩展包。
参赛赛道:工具生态赛道(确定性规则内核 + 隔离副本受控修复 + 一键投板总检 HTML + 零依赖 MCP/Skill + 嘉立创
.eext插件生态)运行依赖:仅需 Python 3.9+(零第三方依赖、Linux / macOS / Windows 离线即跑,支持
pip install ./python3 -m pcb_doctor);实时取证与写后重采需本机安装嘉立创 EDA 专业版桌面客户端(已实测 macOS4.1.105)统一参赛话题:
#嘉立创EDA AI生态热身赛(同步保留灵感库完整短语:#嘉立创EDA CLI API AI硬件开发工具生态热身赛)
与现有官方工具的清晰边界
工具 | 定位 | PCB Doctor 的独有工程闭环 |
官方 | 只读原理图静态审查 | 交叉核验 原理图 |
官方 | 纯 BOM 表格位号对比 | 结合原理图电气拓扑定位失效引脚/网络(如 |
Related MCP server: jlceda-mcp
快速上手(3 分钟无 EDA 客户端复现)
git clone https://github.com/lsaac1208/pcb-doctor.git
cd pcb-doctor仓库包含真实导出、真实日志摘录与人工建模三类离线测试数据:双变体实物验证小板(examples/demo-board/,原创 2 层 40.64 × 25.4 mm USB-C + 3.3V LDO 双指示灯工程,SCH DRC / PCB DRC 均 0 违规,含嘉立创 EDA 4.1.105 真实导出的 .enet 2.0.0、双变体 BOM、UTF-16LE 贴片坐标与 15 件套 Gerber)及 USB-C 最小夹具(examples/usb-c-cc/,同样为真机真实导出);PCB 焊盘同步案例(examples/pcb-sync/)中的 .epcb2 为自真实 4 层工程摘录的合法 PCB 记录,配套 synced.json / drifted.json 为离线建模快照;MCU + LDO 电源树(examples/power-mcu/)与贴片坐标 CPL(examples/pack-cpl/,含嘉立创真实格式 UTF-16LE BOM + TAB)为按官方格式规范构建的离线夹具。无嘉立创 EDA 客户端即可直接运行全套诊断、PCB 同步、生产包门禁、一键 pre-order 总检、MCP 服务、.eext 扩展打包与 141 项自动化单元测试:
# 1. 运行全部自动化验收测试(141 项:11 类确定性规则 + 隔离 .evar/.cpl 修复 + 离线 PCB/CPL/Gerber 门禁 + 模拟 EDA `--cpl-out` + MCP 9 工具与演示客户端 + `.eext` 扩展打包 + 双变体演示板 + HTML 安全)
python3 -B -m unittest discover -s tests -v
# 2. 案例 1(原创真工程 USB-C CC 装配变体):正常通过 vs 故障拦截
python3 scripts/pcb_doctor.py check examples/usb-c-cc/basis.json --connector J1
python3 scripts/pcb_doctor.py check examples/usb-c-cc/r2-dnp.json --connector J1
python3 scripts/pcb_doctor.py audit examples/usb-c-cc/r2-dnp.json --connector J1
# 3. 案例 2(MCU + LDO 电源树人工建模夹具):健康 100 分 vs 故障 55 分
python3 scripts/pcb_doctor.py audit examples/power-mcu/healthy.json
python3 scripts/pcb_doctor.py audit examples/power-mcu/faulty.json
# 4. 案例 3(可打样 2 层演示小板一键四件套 pre-order 总检 + 安全 CPL 清洗 pack-fix + 一键 MCP 演示)
python3 -B -m pcb_doctor pre-order examples/demo-board/basis.json \
--project 'examples/demo-board/project/PCB Doctor USB-C Power Demo.eprj3' \
--cpl examples/demo-board/cpl-basis-utf16.csv \
--gerber examples/demo-board/gerber.zip \
--html-out /tmp/demo-preorder.html
python3 -B -m pcb_doctor pack-fix examples/demo-board/r2-dnp.json examples/demo-board/cpl-basis-utf16.csv \
--project 'examples/demo-board/project/PCB Doctor USB-C Power Demo.eprj3' \
--out /tmp/demo-cpl-clean.csv --approve
python3 -B scripts/demo_mcp_client.py
# 5. 案例 4(修复计划 → dry-run 预览 → 授权修复隔离副本 → 差分与离线 HTML 体检报告)
rm -rf /tmp/pcb-repaired
python3 scripts/pcb_doctor.py plan examples/usb-c-cc/r2-dnp.json --connector J1 > /tmp/pcb-plan.json
python3 scripts/pcb_doctor.py fix 'examples/usb-c-cc/project/PCB Doctor USB-C CC Assembly Fixture.eprj3' \
--plan /tmp/pcb-plan.json --out /tmp/pcb-repaired --schematic Schematic1 --dry-run
python3 scripts/pcb_doctor.py fix 'examples/usb-c-cc/project/PCB Doctor USB-C CC Assembly Fixture.eprj3' \
--plan /tmp/pcb-plan.json --out /tmp/pcb-repaired --schematic Schematic1 --approve
# 离线环境以 basis.json 作为修复后期望快照代理;对修复副本执行真 EDA 重新取证请使用下方 fix --verify
python3 scripts/pcb_doctor.py diff examples/usb-c-cc/r2-dnp.json examples/usb-c-cc/basis.json --connector J1 > /tmp/pcb-diff.json
python3 scripts/pcb_doctor.py report examples/usb-c-cc/basis.json --diff /tmp/pcb-diff.json --connector J1 --out /tmp/pcb-report.html打开 /tmp/pcb-report.html 即可查看零外部资源依赖(内联 CSS/JS 且启用 CSP default-src 'none')的单页交互体检仪表盘,包含健康度环、修复前后分数跃升、网表零误改标识、状态筛选/搜索、器件 Datasheet 链接(含立创/原厂手册)、亮暗色切换与 Markdown 纪要导出。
核心命令一览
子命令 | 作用 | 退出码约定 |
| 通过嘉立创 EDA CLI 在临时副本中无头打开 |
|
| 首版兼容命令:检查指定 USB-C 受电连接器分立 CC1/CC2 5.1 kΩ 下拉与装配 |
|
| 多规则审查( |
|
| 从审查证据生成带显式前置条件的修复计划 |
|
| 默认 |
|
| 确定性比对两份证据/报告的网表等价性、BOM 增删、健康度变化与检查项翻转 |
|
| 直接解析 |
|
| 核验贴片坐标 CPL(支持嘉立创 UTF-16LE TAB 与 UTF-8 CSV)× 有效 BOM × 可选 PCB 旋转角/顶底层 |
|
| 默认 |
|
| 一键投板总检:合并 |
|
| 将 |
|
| 启动零依赖 stdio MCP Server(JSON-RPC 2.0,兼容 NDJSON 与 |
|
AI Agent 与 MCP 生态集成(供其他参赛 Agent 直接调用)
仓库根目录自带标准 SKILL.md 与零依赖 MCP Server(python3 -m pcb_doctor.mcp_server 或 python3 scripts/pcb_doctor.py mcp),可直接接入 Claude Code、Codex、OpenCode、Cursor 及嘉立创专用 Agent:
{
"mcpServers": {
"pcb-doctor": {
"command": "python3",
"args": ["-m", "pcb_doctor.mcp_server"],
"cwd": "/absolute/path/to/pcb-doctor"
}
}
}MCP 暴露 pcb_doctor_audit、pcb_doctor_plan、pcb_doctor_diff、pcb_doctor_fix_preview、pcb_doctor_pcb_sync、pcb_doctor_pack_check、pcb_doctor_pre_order、pcb_doctor_pack_fix_preview(固定只读预览不写盘)与 pcb_doctor_report 共 9 个确定性工具。
也可直接打包并安装嘉立创 EDA 专业版原生扩展包(.eext),在编辑器顶部菜单栏一键执行快速体检与快照导出(详见 easyeda-extension/README.md):
python3 -B easyeda-extension/build_eext.py --out /tmp/pcb-doctor-ext.eext从嘉立创 EDA 桌面客户端现场取证与写后复验
本机已实测 macOS 嘉立创 EDA 专业版 4.1.105。程序自动在 PATH(lceda-pro)与 macOS 应用目录查找 CLI,也可通过 --eda-cli 指定路径,并在 EDA 子进程中剥离 ELECTRON_RUN_AS_NODE:
project='examples/usb-c-cc/project/PCB Doctor USB-C CC Assembly Fixture.eprj3'
# 现场重新取证(源工程只读零改动)
python3 scripts/pcb_doctor.py collect "$project" --schematic Schematic1 --variant basis > /tmp/live-basis.json
python3 scripts/pcb_doctor.py collect "$project" --schematic Schematic1 --variant R2-DNP > /tmp/live-dnp.json
# 生成计划并执行「授权隔离修复 + EDA 重新采集 + 差分复验」完整闭环
rm -rf /tmp/live-repaired
python3 scripts/pcb_doctor.py plan /tmp/live-dnp.json --connector J1 > /tmp/live-plan.json
python3 scripts/pcb_doctor.py fix "$project" --plan /tmp/live-plan.json --out /tmp/live-repaired \
--schematic Schematic1 --approve --verify > /tmp/live-fix.json
python3 scripts/pcb_doctor.py report /tmp/live-fix.json --out /tmp/live-closed-loop.html注:嘉立创 EDA
4.1.105直接向getBomFile传入故障变体配置会超时。collect已采用实测可靠的兼容路径:解析原理图目录下的原生.evar,在临时工程副本上应用明确的{"Add into BOM":"no"}漏装记录,再调用客户端重新导出默认 BOM 并核对差集完全一致(详见 嘉立创 EDA 导出研究)。
可运行的测试案例(≥ 3 组)
案例 | 输入文件 | 运行命令 | 预期结果与退出码 |
案例 1 · USB-C 正常/故障变体(真实导出) |
|
| 正常版 |
案例 2 · MCU + LDO 电源树多规则(建模夹具) |
|
| 健康版 |
案例 3 · 异常防误放行 & 隔离修复闭环 | 缺失 BOM / 冒充基础 BOM / 共享分组 / 错位号前置条件 |
| 异常证据强制返回 |
目标验收表(可机测)
ID | 类别 | 权重 | 目标与二元验收条件 | 证据 / 命令 |
G1 | 核心 | 25% | 多规则精准诊断:USB-C 正常版 |
|
G2 | 核心 | 25% | 证据不足与冒充零误放行:缺少目标 BOM、用基础 BOM 冒充故障 BOM、重复/多余位号等均返回 |
|
G3 | 核心 | 25% | 前置条件门禁与隔离修复闭环: |
|
G4 | 核心 | 15% | 离线交付与安全报告:零外链单页交互 HTML 报告支持健康度环、筛选搜索、修复前后闭环面板、严格 XSS 转义与 |
|
G5 | 延伸 | 10% | 社区实测与现场演示:至少 1 名外部试用者按任务卡完成复现留 Issue;演示视频覆盖正常、故障、异常拦截及条件反转闭环;尝试至少 1 个外部 | 大众评审任务卡 + Issue + 视频 |
当前明确边界(不做与后续规划)
当前明确不做:PCB 走线/铺铜自动修改、Gerber/钻孔物理场求解、多图页或嵌套/共享分组的
.evar自动写回、替代器件类变体写回、以及依赖外部大模型 API 的主观裁判。此外,fix对源工程所在目录做整目录哈希与隔离复制,要求每个.eprj3工程独占独立目录(遵循嘉立创文件夹工程默认规范)。后续演进:完成
examples/demo-board/实物回板与 C-to-C 正反插实拍对比、升级复测新版嘉立创 EDA 客户端(4.1.117+/4.1.123+原生变体 BOM 接口)、扩充更多真实开源.eprj3外部夹具。
仓库文档索引
Available Tools
9 toolspcb_doctor_auditB
对嘉立创 EDA 装配证据做确定性审查,返回 pcb-doctor/report/v2。status 为 fail 或 unknown 表示门禁结论,工具调用本身仍然成功。
Inputs: evidence_path (required), ground, connector.
pcb_doctor_diffB
比较两份装配证据或审查报告,返回 pcb-doctor/diff/v1。
Inputs: after_path (required), before_path (required), ground, connector.
pcb_doctor_fix_previewA
以 approve=false 且 verify=false 预览 .evar 装配修复。不修改源工程,也不把补丁写入输出目录。真正写盘只能由人工执行 CLI --approve。
Inputs: out_dir (required), plan_path (required), project_path (required), schematic.
pcb_doctor_pack_checkB
核验 BOM/CPL 生产包。软调用 pcb_doctor.pack_check.check_production_pack。若提供 project_path,则再软调用 pcb_doctor.pcb_sync.inspect_project_pcb 取得 pcb_data。
Inputs: cpl_path (required), evidence_path (required), pcb_name, project_path.
pcb_doctor_pack_fix_previewA
以 approve=false 只读预览贴片坐标 CPL 清洗计划(移除 DNP 泄漏与非 BOM 幽灵位号)。绝不修改源 CPL 或写入磁盘;真正写出清洗后副本须由人工执行 CLI pack-fix --approve。
Inputs: cpl_path (required), out_path (required), evidence_path (required), pcb_name, +1 more.
pcb_doctor_pcb_syncB
核对原理图装配证据与 PCB。软调用 pcb_doctor.pcb_sync.check_pcb_sync;模块尚未合入时返回可读错误,合入后自动生效。
Inputs: project_path (required), evidence_path (required), pcb_name.
pcb_doctor_planB
从装配证据生成修复计划 pcb-doctor/repair-plan/v1。只生成计划,不写盘。
Inputs: evidence_path (required), ground, connector.
pcb_doctor_pre_orderB
一键投板总检:合并原理图/变体多规则审查、可选 .epcb2 同步、可选贴片坐标 CPL 与可选 Gerber ZIP 归档完整度,返回统一 pcb-doctor/report/v2 报告(含 stages 分项)。
Inputs: evidence_path (required), ground, cpl_path, pcb_name, +3 more.
pcb_doctor_reportA
把 evidence、report/v2 或 fix --verify 产物渲染为离线单页 HTML。会创建 HTML 父目录。拒绝未开启 --verify 的 fix 产物。
Inputs: input_path (required), out_html_path (required), ground, connector, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools target distinct artifacts (diff, report, pcb_sync, pack_check), but pcb_doctor_audit and pcb_doctor_pre_order overlap heavily since pre_order explicitly merges the multi-rule audit into a broader check. Likewise pcb_doctor_fix_preview (.evar assembly repair) and pcb_doctor_pack_fix_preview (CPL cleaning) share near-identical names and must be read carefully to distinguish.
All nine tools share a uniform pcb_doctor_ snake_case prefix, which is predictable. Minor deviation: some names are bare nouns (plan, diff, report, audit) while others are action phrases (fix_preview, pack_check, pre_order, pcb_sync), so there is no single verb_noun convention.
Nine tools is well within the ideal range and each maps to a distinct stage of the PCB assembly workflow (plan, diff, audit, sync, pack check, previews, report, pre-order). No filler or trivially duplicative tools.
The surface covers the full read-only lifecycle: evidence audit, cross-check against PCB, production pack validation, repair planning, diffing, fix previews, and HTML reporting. Apply/write operations are deliberately delegated to human-run CLI --approve, which is a defensible design choice rather than a true gap, though an agent cannot complete a fix end-to-end.
Maintenance
Related MCP Connectors
Preflight QA for AI-agent deliverables with structured verdicts and repair guidance.
Agent verification tools: CSV quality, citation checks, AI-readiness audits, requirement extraction
30+ deterministic dev and delivery tools: linting, metrics, diagrams, model advice, AI-text checks.
Paid deterministic data-quality and execution-verification tools for AI agents.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables AI coding assistants to control JLCPCB EDA for PCB automation, exposing 39 tools for component manipulation, routing, copper pour, DRC, and more. Includes a built-in PCB agent for orchestrating multi-step tasks.59290MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to interact with 嘉立创 EDA for PCB design tasks including project management, component libraries, rule checking, and manufacturing constraints.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to audit KiCad PCB designs through deterministic DRC/ERC checks, spatial heuristics, and multimodal vision review, returning structured, prioritized findings with coordinates and fix guidance.10MIT
- AlicenseNot gradedqualityBmaintenanceGives AI agents local hardware-design checks and tools for 3D-print DFM, fit and screw lengths, KiCad/JLCPCB PCB readiness, Gerber/BOM/stencil validation, live component pricing, optics calculations, and queued heavy jobs. It returns PASS/WARN/FAIL results with supporting numbers so agents can verify designs and block bad orders.MIT