Skip to main content
Glama
KiCad MCP Server
by brovk2008

KiCad MCP Server πŸ”ŒπŸ“

License: MIT Python: 3.10+ KiCad: 9.0+

An implementation of the Model Context Protocol (MCP) server for KiCad 9.0+, enabling Large Language Models (LLMs) like Claude to inspect, edit, analyze, and render PCB layouts in real-time.

It leverages the official kicad-python API to communicate with running KiCad instances over local Unix domain sockets or Windows named pipes.


πŸš€ Key Features

This server exposes 14 specialized modules providing comprehensive control over the board layout:

Module

Description

Key Tools

πŸŽ›οΈ Board

Inspect/update PCB configurations, units, and canvas settings

get_board_info, get_board_stackup, set_active_layer, undo_transaction

🧩 Footprints

Manage component properties, placements, and pads

get_footprints, move_footprint, set_footprint_property, delete_footprints

⚑ Tracks & Vias

List, route, resize, and remove traces and vias

get_tracks, create_track, get_vias, create_via, delete_tracks_in_rect

πŸ—ΊοΈ Zones

Control copper pours, fill/unfill, and rule boundaries

get_zones, create_zone, refill_zones

🌐 Nets

Import netlists, manage classes, and trace connectivity

get_nets, get_net_classes, import_netlist

πŸ”€ Text

Add and style free-standing board text labels and textboxes

get_text, create_text, create_textbox, delete_text

🎨 Shapes

Draw graphic segments, rects, circles, and polygons on user layers

get_shapes, create_shape

πŸ“ Dimensions

Place precise dimension and measurement markings

get_dimensions, create_dimension

πŸ‘₯ Groups

Read structural component groupings (KiCad 10+)

get_groups

🎯 Selection

Read active selection, select footprints, and invoke actions

get_selection, select_footprints, run_action

πŸ‘οΈ Appearance

Adjust layer visibility, contrast modes, ratsnest lines, and flip view

get_editor_appearance, set_board_flip, set_inactive_layer_display

πŸ“¦ Exports

Export manufacturing files (Gerbers, drills, position, ODB++, PDF, STEP)

export_gerbers, export_drill, export_position, export_3d, export_pdf

πŸ“Έ Screenshots

Render visual PNG screenshots of the board or specific selection

get_board_screenshot, get_selection_screenshot

πŸ’» CLI Wrapper

Headless CLI automation for schematics, ERC, DRC, and more

run_kicad_cli, run_erc, run_drc, export_schematic_pdf, export_schematic_netlist


Related MCP server: KiCAD MCP Server

πŸ“‹ Prerequisites

  1. KiCad 9.0 or higher must be installed and running.

  2. Enable the IPC API inside KiCad:

    • Go to Preferences βž” Preferences...

    • Navigate to Plugins

    • Check the Enable KiCad IPC API box.

  3. Python 3.10+ (tested on Python 3.10 through 3.14).


βš™οΈ Installation & Setup

We recommend using uv for fast and isolated environment setup.

1. Clone the Repository

git clone https://github.com/brovk2008/Kicad-MCP-server.git
cd Kicad-MCP-server

2. Set Up the Virtual Environment

# Using uv (recommended)
uv venv
uv pip install -e .

# Or using standard pip
python -m venv .venv
source .venv/bin/activate  # Or `.venv\Scripts\activate` on Windows
pip install -e .

Note: The project automatically applies a dynamic Protobuf descriptor pool patch to ensure compatibility with kicad-python 0.7.1 on Python 3.14.


πŸ› οΈ MCP Configuration

To use this server with Claude Desktop, add the configuration snippet below to your Claude configuration file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json

Configuration Snippet

{
  "mcpServers": {
    "kicad-mcp": {
      "command": "uv",
      "args": [
        "run",
        "--package",
        "kicad-mcp",
        "kicad-mcp"
      ],
      "cwd": "C:/Users/techp/Downloads/more projects/Kicad mcp",
      "env": {
        "KICAD_API_SOCKET": "ipc:///tmp/kicad/api.sock"
      }
    }
  }
}

(Adjust the cwd directory to point to your local installation path. For Windows, the socket path defaults to ipc://%TEMP%\\kicad\\api.sock if not explicitly set).


πŸ§ͺ Running Tests

A test suite is included to verify unit conversions, coordinate mappings, and error wrappers:

# Activate your virtual environment and run:
pytest tests/unit/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

141 tools
add_aligned_dimensionB

Add an aligned dimension annotation to the board.

Inputs: end_x_mm (required), end_y_mm (required), height_mm (required), layer_name (required), +2 more.

add_arcC

Add a graphic arc to the board.

Inputs: end_x_mm (required), end_y_mm (required), mid_x_mm (required), mid_y_mm (required), +4 more.

add_arc_trackC

Add an arc track segment to the board.

Inputs: end_x_mm (required), end_y_mm (required), mid_x_mm (required), mid_y_mm (required), +6 more.

add_circleB

Add a graphic circle to the board.

Inputs: radius_mm (required), layer_name (required), center_x_mm (required), center_y_mm (required), +2 more.

add_polygonC

Add a graphic polygon to the board.

points_mm should be a list like [{"x_mm": 0, "y_mm": 0}, ...]

Inputs: points_mm (required), layer_name (required), filled, width_mm.

add_polygon_copper_zoneC

Add a polygonal copper pour zone to the board.

points_mm should be a list of dicts like [{"x_mm": 0, "y_mm": 0}, ...]

Inputs: points_mm (required), layer_name (required), name, net_name, +1 more.

add_rectangleC

Add a graphic rectangle to the board.

Inputs: x1_mm (required), x2_mm (required), y1_mm (required), y2_mm (required), +3 more.

add_rect_copper_zoneC

Add a rectangular copper pour zone to the board.

Inputs: x1_mm (required), x2_mm (required), y1_mm (required), y2_mm (required), +6 more.

add_rect_rule_areaB

Add a keep-out / rule area zone (non-copper) to the board.

Inputs: x1_mm (required), x2_mm (required), y1_mm (required), y2_mm (required), +2 more.

add_segmentC

Add a straight graphic segment (line) to the board.

Inputs: x1_mm (required), x2_mm (required), y1_mm (required), y2_mm (required), +2 more.

add_textC

Add a free text object to the board.

Inputs: x_mm (required), y_mm (required), value (required), bold, +4 more.

add_text_boxC

Add a text box to the board.

Inputs: value (required), x1_mm (required), x2_mm (required), y1_mm (required), +3 more.

add_to_selectionC

Add items to the active selection on the board by their IDs.

Inputs: item_ids (required).

add_trackC

Add a straight track segment to the board.

Inputs: end_x_mm (required), end_y_mm (required), start_x_mm (required), start_y_mm (required), +4 more.

add_viaC

Add a via to the board.

Inputs: x_mm (required), y_mm (required), locked, drill_mm, +3 more.

begin_commitA

Begin an edit transaction for batching multiple operations into a single Undo step.

Inputs: no named parameters.

clear_selectionA

Clear all active selections on the board.

Inputs: no named parameters.

drop_commitB

Drop/cancel the active transaction and discard changes.

Inputs: commit_id (required).

expand_text_variablesB

Expand text variables in the given string based on board/project settings.

Inputs: text (required).

export_3dC

Export the 3D STEP model of the board.

Inputs: output_path (required).

export_drillC

Export CNC drill files for manufacturing.

Inputs: output_path (required), format.

export_dxfC

Export the board layout to a DXF file.

Inputs: output_path (required), layers, polygon_mode.

export_gencadC

Export the board layout in GenCAD format.

Inputs: output_path (required).

export_gerbersC

Export the board layout to Gerber files in the specified output directory.

Inputs: output_dir (required), layers.

export_ipc2581C

Export the board in IPC-2581 assembly/manufacturing format.

Inputs: output_path (required).

export_ipc_d356B

Export netlist test data in IPC-D-356 format.

Inputs: output_path (required).

export_odbC

Export the board in ODB++ manufacturing format.

Inputs: output_path (required).

export_pdfC

Export the board to a PDF document.

Inputs: output_path (required), layers, single_document.

export_positionC

Export footprint component placement position files for assembly.

Inputs: output_path (required), side, format.

export_psC

Export the board layout to PostScript files.

Inputs: output_path (required), force_a4.

export_renderC

Render the 3D raytrace view of the board to an image file.

Inputs: output_path (required), width_px, height_px.

export_schematic_netlistC

Export the schematic design headlessly to a netlist file (e.g. ipc356).

Inputs: output_path (required), schematic_path (required), format.

export_schematic_pdfC

Export the schematic design headlessly to a PDF file.

Inputs: output_path (required), schematic_path (required).

export_statsC

Export board statistics report.

Inputs: output_path (required).

export_svgC

Export the board to an SVG file.

Inputs: output_path (required), layers, precision, fit_page_to_board.

flip_footprintB

Flip a footprint to the opposite side of the board (F.Cu <=> B.Cu).

Inputs: reference (required).

get_active_layerA

Get current active board layer name.

Inputs: no named parameters.

get_board_as_stringA

Retrieve the entire board (.kicad_pcb) content as text.

Inputs: no named parameters.

get_board_infoA

Get high-level information about the currently open board.

Inputs: no named parameters.

get_board_originC

Get board origin coordinates (grid or drill).

Inputs: origin_type.

get_board_screenshotC

Take a visual screenshot of the board and return it as a base64 PNG.

Inputs: layers, width_px.

get_board_screenshot_svgB

Retrieve the board visual layout as raw SVG text.

Inputs: layers.

get_connected_itemsC

Retrieve items connected to a specific pad.

Inputs: reference (required), pad_number (required).

get_custom_design_rulesA

Get custom design rules text and any parsing errors (KiCad 11+).

Inputs: no named parameters.

get_design_rulesA

Get raw design rules (KiCad 11+).

Inputs: no named parameters.

get_dimensionB

Get details of a specific dimension annotation by its ID.

Inputs: dim_id (required).

get_editor_appearanceB

Retrieve current visual settings for the PCB editor.

Inputs: no named parameters.

get_enabled_layersB

Get list of currently enabled board layers.

Inputs: no named parameters.

get_footprintB

Retrieve detailed information about a specific footprint by its reference designator.

Inputs: reference (required).

get_footprint_bounding_boxC

Get the bounding box of a footprint (in millimeters).

Inputs: reference (required).

get_groupB

Retrieve detailed information about a group and its member items by ID (KiCad 10+).

Inputs: group_id (required).

get_items_by_netclassC

Retrieve all board items associated with nets in a specific netclass.

Inputs: netclass (required), item_types.

get_netclass_for_netC

Retrieve netclass settings for a given net.

Inputs: net_name (required).

get_net_itemsC

Retrieve all board items associated with a specific net.

Inputs: net_name (required), item_types.

get_padB

Get detailed information for a single pad of a footprint.

Inputs: reference (required), pad_number (required).

get_selectionC

Retrieve items in the current board editor selection.

Inputs: no named parameters.

get_selection_as_stringA

Retrieve the selection content serialized in KiCad's board file format.

Inputs: no named parameters.

get_selection_screenshotC

Take a visual screenshot of only the selected items and return as base64 PNG.

Inputs: width_px.

get_shapeB

Get details of a specific graphic shape by its ID.

Inputs: shape_id (required).

get_stackupA

Get stackup layers, thickness, material, and electrical properties.

Inputs: no named parameters.

get_text_itemA

Get details of a specific text or text box item by its ID.

Inputs: text_id (required).

get_title_blockB

Get the board title block info.

Inputs: no named parameters.

get_trackC

Get details of a specific track by its ID.

Inputs: track_id (required).

get_tracks_by_netC

List tracks belonging to a specific net.

Inputs: net_name (required).

get_tracks_by_netclassA

List tracks belonging to all nets in a net class.

Inputs: netclass (required).

get_viaC

Get details of a specific via by its ID.

Inputs: via_id (required).

get_visible_layersB

Get list of visible board layers.

Inputs: no named parameters.

get_zoneC

Get details of a specific zone by its ID.

Inputs: zone_id (required).

import_netlistC

Import a netlist file into the board. (Requires newer KiCad/kipy API).

Inputs: netlist_path (required), dry_run, delete_extra, override_locks, +1 more.

interactive_move_footprintA

Initiates an interactive move in the GUI. Returns immediately but blocks further API calls until complete.

Inputs: reference (required).

kicad_check_versionA

Check if the connected KiCad version matches the kipy library version.

Inputs: no named parameters.

kicad_pingA

Check connection to KiCad and return version info.

Inputs: no named parameters.

list_dimensionsA

List dimension annotations on the board, optionally filtered by layer name.

Inputs: layer_name.

list_footprintsA

List footprints on the board, optionally filtered by reference designator substring.

Inputs: ref_filter.

list_groupsA

List structural groups of items defined on the board (KiCad 10+).

Inputs: no named parameters.

list_netsB

List nets on the board, optionally filtered by netclass name.

Inputs: netclass_filter.

list_padsC

List all pads of a footprint.

Inputs: reference (required).

list_shapesA

List graphic shapes on the board, optionally filtered by layer name.

Inputs: layer_name.

list_textA

List free text and text box items on the board, optionally filtered by layer name.

Inputs: layer_name.

list_tracksC

List tracks on the board, optionally filtered by net name and/or layer name.

Inputs: net_name, layer_name.

list_viasA

List vias on the board, optionally filtered by net name.

Inputs: net_name.

list_zonesA

List zones on the board, optionally filtered by net and/or layer.

Inputs: net_name, layer_name.

lock_dimensionC

Lock or unlock a dimension annotation.

Inputs: dim_id (required), locked (required).

lock_footprintC

Lock or unlock a footprint to prevent accidental movement.

Inputs: locked (required), reference (required).

lock_shapeC

Lock or unlock a shape.

Inputs: locked (required), shape_id (required).

lock_textC

Lock or unlock a text or text box item.

Inputs: locked (required), text_id (required).

lock_trackC

Lock or unlock a track segment.

Inputs: locked (required), track_id (required).

lock_viaC

Lock or unlock a via.

Inputs: locked (required), via_id (required).

lock_zoneC

Lock or unlock a zone.

Inputs: locked (required), zone_id (required).

move_and_rotate_footprintC

Move and rotate a footprint in one operation.

Inputs: x_mm (required), y_mm (required), reference (required), rotation_deg (required).

move_footprintB

Move a footprint to absolute coordinates (in millimeters).

Inputs: x_mm (required), y_mm (required), reference (required).

move_shapeC

Move a shape by a relative offset (in millimeters).

Inputs: shape_id (required), delta_x_mm (required), delta_y_mm (required).

move_trackB

Move a track by a relative delta (in millimeters).

Inputs: track_id (required), delta_x_mm (required), delta_y_mm (required).

move_zoneB

Shift a zone by a relative delta (in millimeters).

Inputs: zone_id (required), delta_x_mm (required), delta_y_mm (required).

push_commitC

Push/apply the active transaction and close the commit.

Inputs: commit_id (required), message.

refill_zonesC

Trigger refilling of all zones on the board.

Inputs: block, timeout_s.

remove_dimensionC

Remove a dimension annotation from the board.

Inputs: dim_id (required).

remove_footprintC

Remove a footprint from the board.

Inputs: reference (required).

remove_from_selectionA

Remove items from the active selection on the board by their IDs.

Inputs: item_ids (required).

remove_shapeB

Remove a shape from the board.

Inputs: shape_id (required).

remove_textC

Remove a text or text box item from the board.

Inputs: text_id (required).

remove_trackB

Remove a track segment from the board.

Inputs: track_id (required).

remove_tracks_in_rectA

Remove all tracks within a bounding box, optionally filtered by layer name.

Inputs: x1_mm (required), x2_mm (required), y1_mm (required), y2_mm (required), +1 more.

remove_viaC

Remove a via from the board.

Inputs: via_id (required).

remove_zoneC

Remove a zone from the board.

Inputs: zone_id (required).

revert_boardA

Revert board to the last saved state on disk.

Inputs: no named parameters.

rotate_footprintC

Rotate a footprint to a specific absolute angle (in degrees).

Inputs: reference (required), rotation_deg (required).

rotate_shapeB

Rotate a shape by an angle around a center point (in degrees).

Inputs: shape_id (required), angle_deg (required), center_x_mm (required), center_y_mm (required).

run_actionB

Trigger a KiCad TOOL_ACTION in the editor.

WARNING: Action names can be unstable between KiCad versions. Use with caution. Known actions:

  • 'pcbnew.ZoneFiller.zoneFill'

  • 'pcbnew.InteractiveRouter.DRCCheck'

  • 'pcbnew.ZoneFiller.zoneUnfill'

  • 'pcbnew.Editor.selectAll'

Inputs: action (required).

run_drcC

Run Design Rules Check (DRC) on a PCB layout.

Returns the report and any violations detected.

Inputs: board_path (required), severity.

run_ercB

Run Electrical Rules Check (ERC) on a schematic sheet.

Returns the report and any violations detected.

Inputs: schematic_path (required), severity.

run_kicad_cliC

Run an arbitrary headless kicad-cli command.

Example: command="sch", args=["erc", "project.kicad_sch"] command="pcb", args=["drc", "project.kicad_pcb"]

Inputs: args (required), command (required).

save_boardC

Save the board changes to file.

Inputs: no named parameters.

save_board_asC

Save the board as a new file.

Inputs: path (required), overwrite, include_project.

select_footprintsB

Select footprints on the board by their reference designators.

Inputs: references (required).

set_active_layerC

Set the active board layer.

Inputs: layer_name (required).

set_board_flipC

Flip the editor board view (view from back).

Inputs: flipped (required).

set_board_originC

Set board origin coordinates (grid or drill).

Inputs: x_mm (required), y_mm (required), origin_type (required).

set_custom_design_rulesC

Set custom design rules text (KiCad 11+).

Inputs: rules_text (required).

set_footprint_bom_excludedC

Set whether a footprint is excluded from the Bill of Materials (BOM).

Inputs: excluded (required), reference (required).

set_footprint_dnpC

Set the Do Not Populate (DNP) flag on a footprint.

Inputs: dnp (required), reference (required).

set_footprint_fieldB

Update or add a field on a footprint (e.g. Reference, Value, custom fields).

Inputs: value (required), reference (required), field_name (required), visible.

set_inactive_layer_displayA

Set the display mode of inactive layers.

Choose: 'normal', 'dimmed', or 'hidden'

Inputs: mode (required).

set_net_color_displayB

Set the display mode of net and netclass colors.

Choose: 'all', 'ratsnest', or 'off'

Inputs: mode (required).

set_ratsnest_displayA

Set the display mode of ratsnest lines.

Choose: 'all' (all layers) or 'visible' (visible layers only)

Inputs: mode (required).

set_title_blockA

Update title block information for the board.

All parameters are optional. Values not specified will remain unchanged.

Inputs: date, title, company, comments, +1 more.

set_visible_layersC

Set the list of visible board layers.

Inputs: layer_names (required).

update_dimension_layerC

Change the layer of a dimension annotation.

Inputs: dim_id (required), layer_name (required).

update_shape_layerC

Change the layer of a shape.

Inputs: shape_id (required), layer_name (required).

update_shape_widthC

Update the stroke line width of a shape.

Inputs: shape_id (required), width_mm (required).

update_text_attributesB

Update text formatting attributes.

Inputs: text_id (required), bold, italic, size_mm, +1 more.

update_text_layerB

Update the layer of a text or text box item.

Inputs: text_id (required), layer_name (required).

update_text_positionB

Update the position of a text item (top-left for text boxes).

Inputs: x_mm (required), y_mm (required), text_id (required).

update_text_valueC

Update the text value of a text or text box item.

Inputs: value (required), text_id (required).

update_track_netC

Update the net assigned to a track.

Inputs: net_name (required), track_id (required).

update_track_widthC

Update the width of a track segment.

Inputs: track_id (required), width_mm (required).

update_via_netC

Update the net assigned to a via.

Inputs: via_id (required), net_name (required).

update_via_sizeB

Update the diameter and/or drill size of a via.

Inputs: via_id (required), drill_mm, diameter_mm.

update_zone_clearanceC

Update the clearance setting of a copper zone.

Inputs: zone_id (required), clearance_mm (required).

update_zone_netB

Change the net assigned to a copper zone.

Inputs: zone_id (required), net_name (required).

update_zone_priorityC

Change the priority level of a zone.

Inputs: zone_id (required), priority (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.8/5.0

    Scored across 141 tools

    Disambiguation5/5

    Each tool has a distinct prefix (add_, remove_, list_, get_, set_, update_, etc.) and targets a specific board element (footprint, track, via, zone, etc.), making them easily distinguishable.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., add_track, remove_footprint, get_zone), with no mixing of conventions.

    Tool Count1/5

    With 141 tools, the set is far too large. This overwhelms the agent and indicates a lack of scoping to essential operations.

    Completeness2/5

    Despite the huge number of tools, there are obvious gaps: no tool to add a footprint or add/edit nets directly, only import_netlist. Core lifecycle operations are missing.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to read and modify KiCAD PCB designs through the KiCAD IPC API, providing tools for board queries, footprint placement, track creation, DRC, and export.
      14
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to interact with KiCAD for PCB design automation. Users can design PCBs using natural language, including component placement, routing, checks, and export.
      59 npm
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to interact with KiCAD for PCB design automation, including schematic editing, component placement, routing, DRC/ERC, and export.
      100
      27 npm
      2
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables creating and editing KiCad projects through natural language, including scaffolding projects, placing schematic symbols, wires and labels, and adding PCB footprints, tracks and nets. It also runs ERC/DRC checks and exports to PDF, SVG, netlist, BOM, STEP, DXF, gerbers and drill files via kicad-cli.
      14
      1
      MIT