# mixelpixx/konnect architecture

> Architecture diagram of the GitHub repository mixelpixx/konnect, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mixelpixx/konnect
- Repository: https://github.com/mixelpixx/konnect

## Overview

Konnect is a native KiCad plugin/server that exposes PCB-design operations to AI assistants through MCP. The principal workflow is an assistant request entering through stdio or HTTP, being dispatched to an on-demand toolset, and then editing a schematic or live PCB or running a check/export before returning a result. The README also documents component search, reference circuits, live viewing, and Specctra autorouting, which appear as distinct branches. The excerpts support the server dispatch, IPC client, S-expression parser, and Freerouting orchestration; some tool wiring is documented but its implementation was not sampled.

Main entry points: [`crates/konnect-core/src/router/mod.rs`](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/router/mod.rs) (Tool router), [`crates/konnect-core/src/tools/pcb_routing.rs`](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/pcb_routing.rs) (Specctra routing), [`crates/konnect-core/src/tools`](https://github.com/mixelpixx/konnect/tree/main/crates/konnect-core/src/tools) (PCB tools), [`crates/konnect/src/main.rs`](https://github.com/mixelpixx/konnect/blob/main/crates/konnect/src/main.rs) (Server entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["MCP server"]
  node_stdio["stdio transport<br/>[stdio.rs]"]
  node_http["HTTP transport<br/>[http.rs]"]
  node_entry["Server entry<br/>[main.rs]"]
  node_handler["MCP handler<br/>[handler.rs]"]
  node_router["Tool router<br/>[mod.rs]"]
end

subgraph group_schematic["Schematic design"]
  node_schemtools["Schematic tools"]
  node_sexp["S-expression engine<br/>[lib.rs]"]
end

subgraph group_pcb["PCB design"]
  node_pcbtools["PCB tools"]
  node_ipc["KiCad IPC client<br/>[client.rs]"]
end

subgraph group_checks["Checks and production"]
  node_checks["Design checks<br/>[verification.rs]"]
  node_review["Design review<br/>[design_review.rs]"]
  node_manufacturing["Manufacturing exports<br/>[manufacturing.rs]"]
end

subgraph group_support["Integrations and support"]
  node_parts[("Parts catalog<br/>[library.rs]")]
  node_templates["Reference circuits<br/>[templates.rs]"]
  node_routing["Specctra routing<br/>[pcb_routing.rs]"]
  node_viewer["Live schematic viewer<br/>[main.rs]"]
end

node_assistant(("AI assistant"))
node_kicad(("KiCad editor"))
node_cli["KiCad CLI"]
node_freerouting["Freerouting MCP"]
node_schemfile[("KiCad schematic files")]
node_boardfile[("KiCad board files")]

node_assistant -->|"sends MCP"| node_stdio
node_assistant -.->|"sends MCP"| node_http
node_stdio -->|"delivers requests"| node_entry
node_http -.->|"delivers requests"| node_entry
node_entry -->|"starts handler"| node_handler
node_handler -->|"dispatches tools"| node_router
node_router -->|"selects tool"| node_schemtools
node_router -->|"selects tool"| node_pcbtools
node_router -->|"selects tool"| node_checks
node_router -->|"selects tool"| node_review
node_router -->|"selects tool"| node_manufacturing
node_router -->|"selects tool"| node_parts
node_router -->|"selects tool"| node_templates
node_schemtools -->|"parses and edits"| node_sexp
node_sexp -->|"reads and writes"| node_schemfile
node_pcbtools -->|"sends commands"| node_ipc
node_ipc -->|"edits live board"| node_kicad
node_checks -->|"runs checks"| node_cli
node_review -->|"runs DRC"| node_cli
node_manufacturing -->|"runs exports"| node_cli
node_pcbtools -->|"edits board data"| node_boardfile
node_routing -->|"reads board snapshot"| node_ipc
node_routing -->|"requests routing"| node_freerouting
node_routing -->|"imports SES"| node_boardfile
node_viewer -->|"watches changes"| node_schemfile
node_templates -->|"provides circuit content"| node_schemfile

click node_stdio "https://github.com/mixelpixx/konnect/blob/main/crates/konnect/src/transport/stdio.rs"
click node_http "https://github.com/mixelpixx/konnect/blob/main/crates/konnect/src/transport/http.rs"
click node_entry "https://github.com/mixelpixx/konnect/blob/main/crates/konnect/src/main.rs"
click node_handler "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/mcp/handler.rs"
click node_router "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/router/mod.rs"
click node_schemtools "https://github.com/mixelpixx/konnect/tree/main/crates/konnect-core/src/tools"
click node_sexp "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-sexp/src/lib.rs"
click node_pcbtools "https://github.com/mixelpixx/konnect/tree/main/crates/konnect-core/src/tools"
click node_ipc "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-ipc/src/client.rs"
click node_checks "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/verification.rs"
click node_review "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/design_review.rs"
click node_manufacturing "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/manufacturing.rs"
click node_parts "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/library.rs"
click node_templates "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/templates.rs"
click node_routing "https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/pcb_routing.rs"
click node_viewer "https://github.com/mixelpixx/konnect/blob/main/crates/schematic-viewer/src/main.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_stdio,node_http,node_entry,node_handler,node_router toneBlue
class node_schemtools,node_sexp,node_schemfile,node_boardfile toneAmber
class node_pcbtools,node_ipc toneMint
class node_checks,node_review,node_manufacturing toneRose
class node_parts,node_templates,node_routing,node_viewer,node_assistant,node_kicad,node_cli,node_freerouting toneIndigo
```

## Components

### MCP server

- [stdio transport](https://github.com/mixelpixx/konnect/blob/main/crates/konnect/src/transport/stdio.rs): `crates/konnect/src/transport/stdio.rs`
- [HTTP transport](https://github.com/mixelpixx/konnect/blob/main/crates/konnect/src/transport/http.rs): `crates/konnect/src/transport/http.rs`
- [Server entry](https://github.com/mixelpixx/konnect/blob/main/crates/konnect/src/main.rs): `crates/konnect/src/main.rs`
- [MCP handler](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/mcp/handler.rs): `crates/konnect-core/src/mcp/handler.rs`
- [Tool router](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/router/mod.rs): `crates/konnect-core/src/router/mod.rs`

### Schematic design

- [Schematic tools](https://github.com/mixelpixx/konnect/tree/main/crates/konnect-core/src/tools): `crates/konnect-core/src/tools`
- [S-expression engine](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-sexp/src/lib.rs): `crates/konnect-sexp/src/lib.rs`

### PCB design

- [PCB tools](https://github.com/mixelpixx/konnect/tree/main/crates/konnect-core/src/tools): `crates/konnect-core/src/tools`
- [KiCad IPC client](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-ipc/src/client.rs): `crates/konnect-ipc/src/client.rs`

### Checks and production

- [Design checks](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/verification.rs): `crates/konnect-core/src/tools/verification.rs`
- [Design review](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/design_review.rs): `crates/konnect-core/src/tools/design_review.rs`
- [Manufacturing exports](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/manufacturing.rs): `crates/konnect-core/src/tools/manufacturing.rs`

### Integrations and support

- [Parts catalog](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/library.rs): `crates/konnect-core/src/tools/library.rs`
- [Reference circuits](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/templates.rs): `crates/konnect-core/src/tools/templates.rs`
- [Specctra routing](https://github.com/mixelpixx/konnect/blob/main/crates/konnect-core/src/tools/pcb_routing.rs): `crates/konnect-core/src/tools/pcb_routing.rs`
- [Live schematic viewer](https://github.com/mixelpixx/konnect/blob/main/crates/schematic-viewer/src/main.rs): `crates/schematic-viewer/src/main.rs`

### Other components

- **AI assistant**
- **KiCad editor**
- **KiCad CLI**
- **Freerouting MCP**
- **KiCad schematic files**
- **KiCad board files**

## Connections

- AI assistant → stdio transport: sends MCP
- AI assistant → HTTP transport: sends MCP
- stdio transport → Server entry: delivers requests
- HTTP transport → Server entry: delivers requests
- Server entry → MCP handler: starts handler
- MCP handler → Tool router: dispatches tools
- Tool router → Schematic tools: selects tool
- Tool router → PCB tools: selects tool
- Tool router → Design checks: selects tool
- Tool router → Design review: selects tool
- Tool router → Manufacturing exports: selects tool
- Tool router → Parts catalog: selects tool
- Tool router → Reference circuits: selects tool
- Schematic tools → S-expression engine: parses and edits
- S-expression engine → KiCad schematic files: reads and writes
- PCB tools → KiCad IPC client: sends commands
- KiCad IPC client → KiCad editor: edits live board
- Design checks → KiCad CLI: runs checks
- Design review → KiCad CLI: runs DRC
- Manufacturing exports → KiCad CLI: runs exports
- PCB tools → KiCad board files: edits board data
- Specctra routing → KiCad IPC client: reads board snapshot
- Specctra routing → Freerouting MCP: requests routing
- Specctra routing → KiCad board files: imports SES
- Live schematic viewer → KiCad schematic files: watches changes
- Reference circuits → KiCad schematic files: provides circuit content
