Skip to content

feat(kicad): add KiCad UI plugin - #115

Closed
fxp wants to merge 1 commit into
zai-org:mainfrom
fxp:feat/kicad-plugin
Closed

fxp wants to merge 1 commit into
zai-org:mainfrom
fxp:feat/kicad-plugin

Conversation

@fxp

@fxp fxp commented Oct 21, 2026

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI)
  • Not applicable / 不适用

Affected plugin name(s) / 涉及的插件名称:kicad (UI Plugin)

What / 改动内容

Adds the kicad community UI plugin (external_plugins/kicad, source in ui-plugins/kicad, icon in assets/kicad, one marketplace.json entry).

User problem. An agent can design a two-layer PCB with the user's local KiCad 10 — circuit spec → real KiCad symbol/footprint libraries → auto-route → DRC → Gerber/BOM/pos — and the user sees and checks the result inside the conversation instead of in a pile of files.

Visible behaviour. A session side panel (ui.surfaces[board], also shown inline for kicad_board_view) with tabs: Board (3D render, DRC verdict, part list), Live (the editor the user already has open, read through KiCad's own API), Layers, 3D views, Schematic, Checks (DRC + ERC), Library browser, Artifacts. "Open in KiCad" exports a normal KiCad project and opens the real PCB Editor; every ⌘S is imported back as a new artifact with a DRC run.

Screenshots (the real ZCode window, a fresh profile, the plugin installed through the app's Plugin Marketplace; a real agent turn built the board):

KiCad panel in ZCode: Board tab with the 3D render, DRC verdict and part list

KiCad panel in ZCode: 3D tab

UI integration. One App per page (official @modelcontextprotocol/ext-apps, handlers before connect(), no window.zcode, availableDisplayModes: ["inline", "fullscreen"]), host theme/locale, widget state and message/updateModelContext only behind capability checks, onteardown; kicad_board_view carries _meta.ui.resourceUri/surface; eight tools are app-only; the initial tool result is 2.1 KB structured / 0.4 KB content (host limits 64 / 32 KiB).

Tested.

  • pnpm install --frozen-lockfile, the root builder staging, validate.py (48 plugins), build_dist.build_zip (32 files, 256 KiB, no binaries), test-mcp-app-artifacts.mjs (kicad PASS), oxlint (0 warnings in kicad), pnpm --filter @zcode/plugin-kicad test 14/14 (also with a stdlib-only Python 3.12 and on a case-sensitive volume), the repository's Python unit tests 31/31, git diff --check.
  • pnpm test:e2e: real KiCad 10.0.6 + headless Chrome through the official App/AppBridge handshake (20 checks, light/dark, en/zh).
  • ZCode's own desktop e2e harness with the real host, and the app itself: installed through the Plugin Marketplace into a fresh profile, a real agent turn built a board and every panel tab worked.
  • Not run: the repository CI itself (this was checked on macOS; the macOS-only paths skip elsewhere), the full pnpm build/build_dist.py for all plugins (blocked here by photocraft's Rust toolchain), "Open in KiCad" against a real GUI.

Version / registration. 0.6.0 in plugin.json, marketplace.json, package.json; category developer-tools; componentTypes: ["ui"].

Dependencies, network, side effects. KiCad 10 is used from the user's installation (not bundled). The MCP server is Python: it needs uv (the plugin then fetches fastmcp, pydantic, numpy and optionally kicad-python on first start) or a Python ≥ 3.11 that has them; without either the plugin still starts, the panel says what to install (kicad_setup_help). uv runs with UV_NO_CONFIG=1. Commands run: kicad-cli, KiCad's bundled Python, uv, and open -a "PCB Editor.app" on request. Files: ./kicad/ in the workspace (the file tools are confined to the workspace; nothing user-edited is overwritten) and the plugin data directory; KiCad runs on a private config so the user's ~/Library/Preferences/kicad is never rewritten. The Live tab polls KiCad's local API socket while the panel is open. No hooks, no telemetry.

Provenance / licenses. MIT. server/kicad/ is the author's own KiCad worker (placement, router, DRC, fabrication export); icon is original artwork (assets/icon-sources.json); bundled SDK notices in dist/THIRD_PARTY_NOTICES.txt; KiCad (GPL-3.0-or-later, not redistributed), fastmcp, pydantic, numpy, kicad-python licenses listed in the README.

Follow-up. An optional macOS-only part (an Edit tab that shows and operates KiCad's real windows through a small native helper app) is deliberately not in this PR; it is a separate stacked PR (0.7.0).

Self-check / 自查清单

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/kicad/
  • Usage category is set (developer-tools)
  • Plugin type and affected names are declared above
  • version bumped in BOTH plugin.json and marketplace.json (new plugin, 0.6.0)
  • README.md (EN) and README_CN.md (中文) both present and equivalent
  • description_i18n has both en and zh-CN
  • No secrets, machine-specific paths, or private dependencies
  • Model/API/network dependencies documented
  • python3 scripts/validate.py and python3 scripts/build_dist.py pass locally (build_dist for kicad alone: the rest of the repository's build is blocked here by photocraft's Rust toolchain)

Adds the `kicad` community UI plugin (external_plugins/kicad, source in
ui-plugins/kicad, icon in assets/kicad, one marketplace.json entry).

An agent can design a two-layer PCB with the user's local KiCad 10 (circuit
spec -> real KiCad libraries -> auto-route -> DRC -> Gerber/BOM/pos), and the
session side panel shows the result: 3D render, layers, schematic, DRC/ERC,
library browser, artifacts and a live view of the open PCB Editor through
KiCad's API. "Open in KiCad" exports a normal KiCad project; every save is
imported back with a DRC run.

Plugin type: UI Plugin (ui.surfaces[board], kicad_board_view _meta.ui).
Version 0.6.0, category developer-tools, MIT.
@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@panda920

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! The change has been accepted by the maintainers. Publication to the marketplace is tracked separately; this contribution is now closed.

@panda920 panda920 closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants