Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
260 changes: 256 additions & 4 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ axum = { version = "0.8", features = ["macros"] }
# S-expression parsing
nom = "8"

# Specctra DSN/SES syntax. Konnect owns the KiCad lowering and manifest;
# Topola supplies the format AST and serializer/parser used for parity checks.
topola_specctra = "0.1.0"

# NNG for KiCAD 10 IPC (nanomsg-next-gen, replaces ZeroMQ)
nng = "1"
prost = "0.13"
Expand Down
26 changes: 17 additions & 9 deletions DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ Konnect/
│ │ ├── pcb_board.rs # 11 tools (S-expr file editing, IPC fallback, SVG logo import)
│ │ ├── pcb_components.rs # 19 tools (IPC real-time + safe headless single-placement fallback)
│ │ ├── pcb_footprint_update.rs # library refresh planner + one-commit IPC apply
│ │ ├── pcb_routing.rs # 12 tools (traces, vias, nets, netclasses)
│ │ ├── pcb_export.rs # 13 tools (Gerber, PDF, 3D, DRC, DXF/GenCAD/IPC-2581/ODB++)
│ │ ├── pcb_routing.rs # 15 tools (traces, vias, nets, netclasses, SES import)
│ │ ├── pcb_export.rs # 14 tools (Gerber, PDF, 3D, Specctra DSN, DRC, DXF/GenCAD/IPC-2581/ODB++)
│ │ ├── library.rs # 17 tools (symbol/footprint library management)
│ │ ├── footprint_graphics.rs # footprint primitive validation, inspection, and atomic edits
│ │ ├── footprint_metadata.rs # footprint description, tags, and attribute edits
│ │ ├── footprint_models.rs # footprint 3D model validation and atomic edits
│ │ ├── integration.rs # 8 tools (JLCPCB SQLite, Freerouting discovery, datasheets)
│ │ ├── integration.rs # 9 tools (JLCPCB SQLite, Freerouting MCP, datasheets)
│ │ ├── verification.rs # 10 tools (DRC, design rules, KiCAD UI)
│ │ ├── config.rs # 7 tools (user/project config, design rules)
│ │ ├── design_review.rs # 6 tools (decoupling/connection/power/DFM audits)
Expand Down Expand Up @@ -146,6 +146,7 @@ Konnect/
├── plugin/ # Python thin launcher (runs inside KiCAD)
│ ├── __init__.py # pcbnew.ActionPlugin — settings dialog (PCB Editor only)
│ ├── settings_dialog.py # wxPython settings UI (paths, server control)
│ ├── native_bridge.py # authenticated KiCad 10 native Specctra export bridge
│ └── plugin.json # KiCAD 10 IPC plugin manifest
├── packaging/
Expand Down Expand Up @@ -220,6 +221,11 @@ transaction abandon` escape hatch documented in
- **PCM zip** is the correct install method
- KiCAD installs to: `C:\Users\<YOU>\Documents\KiCad\10.0\3rdparty\plugins\com_github_mixelpixx_konnect\`
- Both `__init__.py` (SWIG ActionPlugin for PCB editor settings dialog) and `plugin.json` (IPC exec plugin) are included
- `native_bridge.py` is a KiCAD-10-only, opt-in compatibility bridge. It exposes
only authenticated status and native Specctra export over an ephemeral
loopback port. The caller cannot choose an output path; the plugin owns and
removes the temporary artifact. Do not grow it into a general Python RPC
surface or use it as the KiCAD 11 architecture.

## Structured Errors

Expand Down Expand Up @@ -303,7 +309,7 @@ Source: [`crates/konnect-core/src/observability.rs`](crates/konnect-core/src/obs

## Tool Routing (Starter Kit + On-Demand Loading)

The server does NOT expose all 217 tools (223 total with the 6 meta-tools) in `tools/list` by default — that would cost ~23K tokens of context on every listing. Instead:
The server does NOT expose all 221 tools (227 total with the 6 meta-tools) in `tools/list` by default — that would cost ~23K tokens of context on every listing. Instead:

- **Startup**: only `STARTER_KIT` toolsets are pre-loaded (see `router/registry.rs::STARTER_KIT`). Currently: `project`, `config`. Combined with the 6 meta-tools, baseline `tools/list` is 20 tools ≈ 2K tokens.
- **On demand**: the LLM reads `list_toolboxes` → calls `load_toolset(name)` to expose a toolset's tools in subsequent `tools/list` responses. `unload_toolset(name)` prunes them when the task shifts.
Expand Down Expand Up @@ -378,11 +384,13 @@ convention for other `kicad-cli`-calling code.

## Current Stats

- **20 toolsets, 217 tools** + 6 meta-tools (4 routing + 2 observability — see `tool-directory.md`)
- **20 toolsets, 221 tools** + 6 meta-tools (4 routing + 2 observability — see `tool-directory.md`)
- Baseline `tools/list`: 20 tools / ~2K tokens (starter kit + meta-tools)
- Full-catalog `tools/list` (all loaded): 223 tools (217 registered + 6 meta) / ~25K tokens
- Full-catalog `tools/list` (all loaded): 227 tools (221 registered + 6 meta) / ~25K tokens
- **0 IPC stubs** (all protobuf methods implemented)
- **0 unimplemented tools**
- **Specctra DSN/SES are PCB-editor operations**, not `kicad-cli` commands. Konnect
therefore does not advertise autorouting until it has a real editor bridge; the
`check_freerouting` diagnostic still discovers PCM installations and Java.
- **Specctra DSN/SES are PCB-editor operations**, not `kicad-cli` commands.
`export_specctra_dsn` creates a revision-bound routing job from the live
editor, `route_specctra_dsn` delegates the route to Freerouting's local native
MCP server, and `plan_specctra_ses_import` / `apply_specctra_ses` validate and
return the result through one KiCad undo transaction.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Rust binary — that lets Claude and other AI assistants design schematics and PCBs
through the [Model Context Protocol](https://modelcontextprotocol.io) (MCP).

**217 tools across 20 on-demand toolsets.** Schematic capture, PCB layout and
**221 tools across 20 on-demand toolsets.** Schematic capture, PCB layout and
routing, ERC/DRC, design-review audits, JLCPCB part search, reference
circuits, and a full manufacturing export pipeline — with bundled skills and agents
that teach Claude KiCAD conventions out of the box.
Expand Down Expand Up @@ -70,7 +70,7 @@ through its own S-expression engine with atomic writes (write, fsync, rename), U
preservation, and round-trip tests — no third-party schematic library with known
gaps, no text-manipulation workarounds.

**Context economy is a feature.** Exposing all 217 tools to an LLM costs roughly 23K
**Context economy is a feature.** Exposing all 221 tools to an LLM costs roughly 23K
tokens of context on every listing. Konnect's router loads a starter kit (~2K
tokens) and lets the model pull in toolsets on demand — plus built-in observability
(`get_recent_calls`, `server_stats`, JSONL call logs) so the model can diagnose its
Expand Down Expand Up @@ -106,6 +106,7 @@ The full tool catalog is documented in [tool-directory.md](tool-directory.md).
|-------|-----------|
| Schematic editing | Direct `.kicad_sch` S-expression editing with atomic writes (no KiCAD required) |
| PCB editing | KiCAD 10 IPC API (NNG + protobuf) — real-time and undo-aware; single-footprint placement has a safe headless fallback |
| Specctra export | Revision-bound Rust export, with an optional authenticated KiCAD 10 ActionPlugin bridge for KiCAD-native DSN output |
| Exports & checks | `kicad-cli` subprocess (Gerber, PDF, ERC, DRC, …) |
| Transport | MCP JSON-RPC over stdio (default), or Streamable HTTP (`transport = "http"` / `"both"`) |

Expand All @@ -126,6 +127,14 @@ The full tool catalog is documented in [tool-directory.md](tool-directory.md).
Verify: open the **PCB Editor** → **Tools → External Plugins** → you should see
**Konnect**.

For KiCAD 10, the Konnect settings dialog also offers an optional **native
Specctra bridge**. When enabled, `export_specctra_dsn` can ask the active PCB
Editor to generate its native DSN while Konnect still binds the export to the
exact IPC snapshot and creates the strict reverse manifest used during SES
import. The bridge is local-only, authenticated, disabled by default, and not
the KiCAD 11 integration path. If it is disabled or unavailable, the default
`prefer` policy falls back to Konnect's Rust exporter.

### Build from source

```bash
Expand Down
8 changes: 8 additions & 0 deletions THIRD_PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ projects. Konnect itself is licensed under the AGPL-3.0 (see LICENSE) with a
commercial option (see COMMERCIAL.md); the notices below travel with every
distribution of Konnect, under either license.

## topola_specctra

Konnect uses the `topola_specctra` parser, data model, and serializer from the
[Topola project](https://codeberg.org/topola/topola) to validate and emit
Specctra DSN syntax. Copyright 2024 Topola contributors; used under the MIT
license. The MIT permission grant and warranty disclaimer reproduced below
apply to this dependency.

## kicad-mcp-pro

Portions of Konnect — including the JLCPCB pick-and-place rotation
Expand Down
2 changes: 2 additions & 0 deletions crates/konnect-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ konnect-sexp.workspace = true
konnect-render.workspace = true
konnect-ipc.workspace = true
konnect-schematic-editor.workspace = true
topola_specctra.workspace = true

prost-types.workspace = true
prost.workspace = true
Expand All @@ -25,6 +26,7 @@ uuid.workspace = true
base64.workspace = true
sha2.workspace = true
reqwest.workspace = true
dirs.workspace = true
rusqlite.workspace = true
usvg.workspace = true
zip.workspace = true
Expand Down
Loading
Loading