kicad-tools
Standalone Python tools for parsing and manipulating KiCad schematic and PCB files
kicad-tools turns KiCad projects into machine readable data for agents
A Python toolkit that parses, checks, and edits KiCad schematic and PCB files without launching the KiCad GUI, with optional LLM and MCP hooks.
Parsing and editing without a GUI
kicad-tools exists to give AI agents and automation scripts a way to work with KiCad files. Traditional EDA tools expect a human at a GUI, but this project parses KiCad schematic and PCB files into clean Python objects and emits machine readable JSON output. Nothing here needs a running KiCad instance. The quick start shows commands such as kct symbols to list symbols in a schematic, kct nets to trace connectivity, and kct bom to produce a bill of materials. On the Python side, load_schematic returns a Schematic object whose symbols and sheets you can walk directly. That structured access is the foundation for anything built on top. The library also ships reusable circuit blocks so you can assemble a design from tested pieces like an MCU block, a crystal oscillator, an LDO regulator, a USB connector, a debug header, I2C pull ups, and a reset button. Each block wires itself into the schematic through named ports, which keeps the tedious part of board bring up out of your hands. Because every command supports a --format json flag, the same tooling that a person uses at a terminal also feeds a pipeline or an agent loop without special handling. The schematic block helpers also keep net names consistent across a design, which reduces the silent mismatches that appear when someone wires ports by hand. That consistency pays off once a board grows past a few dozen components and the human cost of a typo rises.
Validation and design rule checks
Checking a board for mistakes is a first class feature. The tool runs electrical rules checks with kct erc and design rules checks with kct drc, where the latter asks for kicad-cli to be present. A separate command, kct check, performs a pure Python DRC that needs no external binary, and it can compare against manufacturer rule profiles for JLCPCB, OSHPark, PCBWay, and Seeed. For high voltage work there is a creepage audit that measures surface paths against IEC 60664-1 and 62368-1, plus an analyze command that lints signal integrity, current sense, and electrical rating issues. When problems show up, repair commands try to fix them automatically: kct fix-drc handles clearance and drill violations, kct fix-erc adds PWR_FLAG and no-connect markers, and kct fix-vias relocates vias to meet manufacturer specs. The project also exposes a manufacturing readiness audit that covers ERC, DRC, connectivity, and compatibility in one pass. All of these checks share the same JSON output convention, so a CI job can fail a pull request on a regression without anyone reading a terminal. The manufacturer rule profiles mean a board can be checked against the real limits of a specific fab rather than a generic guess. Because every command can emit JSON, a continuous integration job can parse the results and block a merge when a new violation appears, without a person reading terminal output.
Routing, placement, and LLM reasoning
Beyond inspection, kicad-tools can lay out and route boards. The Autorouter class implements an A* based router with configurable design rules such as grid resolution, trace width, and clearance, and it reports how many nets it finished. A trace optimizer then shortens paths and removes unneeded vias. Placement is handled two ways: a physics based optimizer pushes components apart with a force directed model, and an evolutionary optimizer applies a genetic algorithm, with a hybrid mode that combines the two. The LLM driven path is where the project is most unusual. A PCBReasoningAgent loads a board, hands the model a prompt describing the current state, executes the returned command, and returns a diagnosis, looping until the layout is complete. The kct reason command wraps this with export-state, interactive, and auto-route modes. The idea is that the model makes strategic choices while the tooling owns the geometry. Recent releases added search time high voltage clearance in the lattice router, a cosmetic field tidy command, and a strict connectivity check that uses real copper geometry rather than endpoint proximity. The hybrid placement mode is useful because a genetic search explores the global arrangement while the physics pass cleans up local overlaps. The reasoning loop keeps the model from touching raw geometry, so the risky part of layout stays in tested code and the model only picks strategy.
MCP server and parts tooling
To fit into agent ecosystems, kicad-tools ships an MCP server that Claude and similar assistants can call. Running kct mcp serve exposes tools grouped by purpose: analysis (analyze_board, get_drc_violations, measure_clearance), export (export_gerbers, export_bom, export_assembly), placement (placement_analyze, placement_suggestions), sessions (start_session, query_move, apply_move, commit, rollback), routing (route_net, route_net_auto, get_unrouted_nets), and optimization (optimize_placement, evaluate_placement). Around the core, datasheet tools search, download, and parse component PDFs, pulling pin tables and images out of the documents. Parts lookup reaches LCSC and JLCPCB through a tiered chain that starts with a local cache, tries an official API only when you supply your own key, falls back to an anonymous scrape path, and can use an offline jlcparts catalog of about 7.1 million components that works with no network. The documentation notes that the anonymous tier returned 404 as of July 2026, so the offline mirror or a bring your own key setup is the reliable choice. Footprint generators and symbol library management round out the library surface. The offline parts catalog is large enough to cover the common passives and actives a hobbyist uses, and it works with no network connection once synced. Datasheet parsing turns a dense PDF into tables and images a script can read, which saves the manual lookup that normally slows component research.
Editorial conclusion
The project is published under the MIT license and written in Python, and it is installable from PyPI as the kicad-tools package.
Community notes