KiCad 9 API

KiCad Version 9 introduced a new socket-based API for controlling PCB design elements. It is designed to be more stable and better supported than the legacy Python based API, with schematic control planned for future releases. For an MCP server, this is the perfect interface.

The Goal

KiCad has a rich plugin ecosystem, but I frequently encounter repetitive tasks that are too small to justify writing a dedicated script, but too tedious to do manually. I wanted to see if I could use a Claude prompt to handle those quick tasks like strange layout patterns or board audits that are too small to automate with a dedicated script.

The Test:

I created a board with 64 LEDs and asked Claude to arrange them in two concentric circles. The agent had to:
1. Analyze the board: Retrieve the Edge.Cuts geometry and identify all LED footprints.
2. Calculate the geometry: Determine the polar coordinates for two rings.
3. Execute the layout: Batch move the footprints into their final positions.

Note: While KiCad 9 can do this via the GUI Array Tool, the goal was to see how it handle a simple test.

The Result

The result was correct, but the execution took about two minutes, which is a bit slower than I’d like. The bottleneck seems to be the planning phase where Claude interprets the layout.

I found that for complex tasks, it’s better to ask Claude to write a Python script for the API rather than performing individual actions. It seems tobe more reliable at executing complex math within a script than trying to "think" through coordinates behind the scenes.

Overall, while the Oscilloscope MCP feels it will be more useful in my workflow, I could see KiCad integration helpful for one-off tasks where you're too lazy to make a script.

The MCP Server

Here are the commands the tool supports:

Tool Description
ping Check KiCad connectivity
get_version Get KiCad version string
get_board_info Summary of footprints, tracks, vias, nets, and zones
get_footprints List footprints with position, layer, and value
get_nets List all nets by name and code
get_tracks List all copper track segments
get_vias List all vias
get_zones List all copper zones
get_board_outline Return the Edge.Cuts geometry
get_component_connections Show net connectivity and shared neighbors
move_footprint Move a footprint to an absolute position
rotate_footprint Set absolute rotation in degrees
batch_move_footprints Move multiple footprints in one undo step
create_track Add a copper track segment to a named net
remove_items_by_id Remove board items by ID
refill_zones Refill all copper zones
save_board Save the board to disk

A Note on Token Usage

Commands like get_component_connections can use a lot of tokens on even simple boards. To keep things efficient, use the reference_filter to narrow your scope and rely on get_board_info for high level summaries.

Github: https://github.com/Netlist-Studio/kicad-mcp

Demo https://www.youtube.com/shorts/931JnJHDEdY