@bacnh85/pi-kicad

extensionmaintained

KiCad CAD-design extension for Pi — drive schematic capture and PCB layout via the Konnect binary over a local HTTP daemon (no MCP SDK).

by · v0.1.3 · published 4d ago

$ pi install npm:@bacnh85/pi-kicad
downloads/mo
413
stars
8
last push
12h ago
open issues
1

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

413 downloads · last 12 weeks (weekly)

README

@bacnh85/pi-kicad

KiCad CAD-design extension for the Pi coding agent. Design schematics and PCB layouts by driving the Konnect binary — no MCP SDK, no generic MCP client. Konnect is launched once in its built-in HTTP mode as a managed local daemon, and each tool call is a single stateless POST /mcp JSON-RPC request.

Install

pi install npm:@bacnh85/pi-kicad

Tools

ToolPurpose
kicad_callInvoke any of Konnect's 185 tools by name (schematic capture, layout, routing, ERC/DRC, exports, design review, JLCPCB parts, Freerouting, reference circuits).
kicad_statusResolve the Konnect binary, kicad-cli, and IPC socket; start/health-check the daemon; report version + active tool count. Use first when something isn't working.

Konnect loads only a small toolset starter kit for context economy. Call list_toolboxesload_toolset("<name>") before domain tools; unload_toolset to prune. See the bundled kicad skill for the full design workflow.

Prerequisites

  • KiCad 10 — Konnect's PCB tools use the v10 IPC API. Schematic + export tools work without KiCad running.
  • The Konnect binary — install separately (this package does not vendor it):
    • KiCad 10 → Plugin and Content Manager → Install from File → the konnect-pcm-* zip for your OS, or
    • a GitHub release tarball.
    • macOS browser download: clear quarantine first — xattr -d com.apple.quarantine ./konnect.
  • For PCB layout/routing: open KiCad 10 and enable Preferences → Plugins → "Enable KiCad API", with the target board open.

Configuration

All optional — auto-discovered. Override with environment variables:

VariableDefaultMeaning
KONNECT_BINARY (or KICAD_BINARY)auto (KiCad 10 PCM path, then release cache)Path to the konnect binary
KICAD_CLIauto (app bundle / /usr/bin / Program Files)Path to kicad-cli
KICAD_API_SOCKETKonnect auto-detectKiCad IPC socket, e.g. ipc:///tmp/kicad/api.sock
KICAD_HTTP_PORT31337Preferred daemon port (falls back to a free one)
KICAD_LOG_LEVELinfoKonnect log level (error/warn/info/debug/trace)

How it works

Pi agent ── kicad_call ──► POST http://127.0.0.1:<port>/mcp   ──► Konnect daemon (HTTP mode)
                                                                         │
                                          ┌──────────────────────────────┴───┐
                                          ▼                                   ▼
                              .kicad_sch S-expr engine               KiCad 10 IPC API (NNG)
                              (atomic writes, no UI)                 (PCB edits, undo-aware)
                                                  │
                                                  ▼
                                         kicad-cli subprocess
                                         (ERC, DRC, Gerber, PDF, BOM, 3D…)

The daemon is reused if a healthy one is already running on the port; otherwise pi-kicad spawns konnect --config <tmp-toml> (transport=http), polls GET /health, and kills it on Pi exit.

Changelog

See CHANGELOG.md for release history.

License

This package is MIT. Konnect is AGPL-3.0 (free for hobbyists/students/OS; commercial license otherwise). pi-kicad communicates with Konnect as a separate process over a standard local protocol — it does not bundle or link Konnect, so it is not a derivative work. The Konnect binary remains a user-installed prerequisite.