# mixelpixx/kicad-mcp-server architecture

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

- Interactive diagram: https://gitdiagram.com/mixelpixx/kicad-mcp-server
- Repository: https://github.com/mixelpixx/kicad-mcp-server

## Overview

KiCAD MCP Server lets an AI assistant use MCP tools and resources to work with KiCAD projects. The main workflow is client request → TypeScript MCP server and tool handlers → Python command interface → KiCAD APIs or project files → result returned to the client. The product also exposes project/board/library resources, design prompts, symbol and footprint creation, manufacturing integrations, routing, validation, and export. The map follows README capabilities and indexed imports; unsampled command implementations and some wiring are represented at subsystem level.

Main entry points: [`python/kicad_interface.py`](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/kicad_interface.py) (Python command interface), [`src/server.ts`](https://github.com/mixelpixx/kicad-mcp-server/blob/main/src/server.ts) (MCP server), [`src/tools`](https://github.com/mixelpixx/kicad-mcp-server/tree/main/src/tools) (Tool handlers), [`python/commands/schematic_handlers.py`](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/schematic_handlers.py) (Schematic editing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mcp["MCP interface"]
  node_server["MCP server<br/>[server.ts]"]
  node_tools["Tool handlers"]
  node_resources["Project resources"]
  node_prompts["Design prompts"]
end

subgraph group_design["Design workflows"]
  node_project["Project management<br/>[project.py]"]
  node_schematic["Schematic editing"]
  node_wiring["Wire connectivity<br/>[wire_manager.py]"]
  node_library["Library management<br/>[library.py]"]
  node_components["Components and footprints<br/>[component.py]"]
  node_board["Board editing"]
  node_routing["PCB routing<br/>[routing.py]"]
  node_validation["Design validation<br/>[design_rules.py]"]
  node_export["Manufacturing export<br/>[export.py]"]
end

subgraph group_python["KiCAD command runtime"]
  node_pyinterface["Python command interface<br/>[kicad_interface.py]"]
  node_kicad["KiCAD APIs"]
end

subgraph group_integrations["External services"]
  node_jlcpcb["JLCPCB parts<br/>[jlcpcb-api.ts]"]
  node_freerouting["Freerouting<br/>[freerouting.ts]"]
end

node_assistant(("AI assistant"))

node_assistant -->|"sends requests"| node_server
node_server -->|"registers tools"| node_tools
node_server -->|"registers resources"| node_resources
node_server -->|"registers prompts"| node_prompts
node_server -->|"starts worker"| node_pyinterface
node_tools -.->|"dispatches commands"| node_pyinterface
node_pyinterface -->|"routes commands"| node_project
node_pyinterface -->|"routes commands"| node_schematic
node_schematic -->|"delegates wire edits"| node_wiring
node_pyinterface -->|"routes commands"| node_library
node_pyinterface -->|"routes commands"| node_components
node_pyinterface -->|"routes commands"| node_board
node_pyinterface -->|"routes commands"| node_routing
node_pyinterface -->|"routes commands"| node_validation
node_pyinterface -->|"routes commands"| node_export
node_pyinterface -->|"uses backend"| node_kicad
node_tools -.->|"offers parts lookup"| node_jlcpcb
node_tools -.->|"offers autorouting"| node_freerouting

click node_server "https://github.com/mixelpixx/kicad-mcp-server/blob/main/src/server.ts"
click node_tools "https://github.com/mixelpixx/kicad-mcp-server/tree/main/src/tools"
click node_resources "https://github.com/mixelpixx/kicad-mcp-server/tree/main/src/resources"
click node_prompts "https://github.com/mixelpixx/kicad-mcp-server/tree/main/src/prompts"
click node_pyinterface "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/kicad_interface.py"
click node_project "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/project.py"
click node_schematic "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/schematic_handlers.py"
click node_wiring "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/wire_manager.py"
click node_library "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/library.py"
click node_components "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/component.py"
click node_board "https://github.com/mixelpixx/kicad-mcp-server/tree/main/python/commands/board"
click node_routing "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/routing.py"
click node_validation "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/design_rules.py"
click node_export "https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/export.py"
click node_kicad "https://github.com/mixelpixx/kicad-mcp-server/tree/main/python/kicad_api"
click node_jlcpcb "https://github.com/mixelpixx/kicad-mcp-server/blob/main/src/tools/jlcpcb-api.ts"
click node_freerouting "https://github.com/mixelpixx/kicad-mcp-server/blob/main/src/tools/freerouting.ts"

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_server,node_tools,node_resources,node_prompts toneBlue
class node_project,node_schematic,node_wiring,node_library,node_components,node_board,node_routing,node_validation,node_export toneAmber
class node_pyinterface,node_kicad toneMint
class node_jlcpcb,node_freerouting toneRose
class node_assistant toneIndigo
```

## Components

### MCP interface

- [MCP server](https://github.com/mixelpixx/kicad-mcp-server/blob/main/src/server.ts): `src/server.ts`
- [Tool handlers](https://github.com/mixelpixx/kicad-mcp-server/tree/main/src/tools): `src/tools`
- [Project resources](https://github.com/mixelpixx/kicad-mcp-server/tree/main/src/resources): `src/resources`
- [Design prompts](https://github.com/mixelpixx/kicad-mcp-server/tree/main/src/prompts): `src/prompts`

### Design workflows

- [Project management](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/project.py): `python/commands/project.py`
- [Schematic editing](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/schematic_handlers.py): `python/commands/schematic_handlers.py`
- [Wire connectivity](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/wire_manager.py): `python/commands/wire_manager.py`
- [Library management](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/library.py): `python/commands/library.py`
- [Components and footprints](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/component.py): `python/commands/component.py`
- [Board editing](https://github.com/mixelpixx/kicad-mcp-server/tree/main/python/commands/board): `python/commands/board`
- [PCB routing](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/routing.py): `python/commands/routing.py`
- [Design validation](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/design_rules.py): `python/commands/design_rules.py`
- [Manufacturing export](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/commands/export.py): `python/commands/export.py`

### KiCAD command runtime

- [Python command interface](https://github.com/mixelpixx/kicad-mcp-server/blob/main/python/kicad_interface.py): `python/kicad_interface.py`
- [KiCAD APIs](https://github.com/mixelpixx/kicad-mcp-server/tree/main/python/kicad_api): `python/kicad_api`

### External services

- [JLCPCB parts](https://github.com/mixelpixx/kicad-mcp-server/blob/main/src/tools/jlcpcb-api.ts): `src/tools/jlcpcb-api.ts`
- [Freerouting](https://github.com/mixelpixx/kicad-mcp-server/blob/main/src/tools/freerouting.ts): `src/tools/freerouting.ts`

### Other components

- **AI assistant**

## Connections

- AI assistant → MCP server: sends requests
- MCP server → Tool handlers: registers tools (evidence: `src/server.ts`)
- MCP server → Project resources: registers resources (evidence: `src/resources/index.ts`)
- MCP server → Design prompts: registers prompts (evidence: `src/prompts/index.ts`)
- MCP server → Python command interface: starts worker (evidence: `src/server.ts`)
- Tool handlers → Python command interface: dispatches commands
- Python command interface → Project management: routes commands (evidence: `python/kicad_interface.py`)
- Python command interface → Schematic editing: routes commands (evidence: `python/kicad_interface.py`)
- Schematic editing → Wire connectivity: delegates wire edits (evidence: `python/commands/schematic_handlers.py`)
- Python command interface → Library management: routes commands (evidence: `python/kicad_interface.py`)
- Python command interface → Components and footprints: routes commands (evidence: `python/kicad_interface.py`)
- Python command interface → Board editing: routes commands (evidence: `python/kicad_interface.py`)
- Python command interface → PCB routing: routes commands (evidence: `python/kicad_interface.py`)
- Python command interface → Design validation: routes commands (evidence: `python/kicad_interface.py`)
- Python command interface → Manufacturing export: routes commands (evidence: `python/kicad_interface.py`)
- Python command interface → KiCAD APIs: uses backend (evidence: `python/kicad_interface.py`)
- Tool handlers → JLCPCB parts: offers parts lookup
- Tool handlers → Freerouting: offers autorouting
