Skip to main content
Glama

KiCad MCP Server

Model Context Protocol (MCP) server for analyzing KiCad printed circuit boards. It provides a toolkit for PCB analysis, with multi-board schematic signal tracing and component datasheet lookup, exposed through a simple tool interface.

Single-board schematic text queries (component listings, per-net dumps, single-board connection tracing) have moved to the companion kicad-schema project, which renders a schematic as structured YAML. This server focuses on the analysis that is still hard to do in text form: signals that cross board boundaries, datasheet discovery, and the PCB layout surface that PCB-analysis tooling builds on.

Features

  • Multi-Board Analysis: Trace signals across multiple connected boards

  • Datasheet Lookup: Resolve a manufacturer and part number to a datasheet URL

  • Board & System Configuration: Register boards and systems; add or remove them without restarting

  • PCB Sources: Associate a .kicad_pcb layout with each board for PCB-analysis tooling

  • PCB Tools (kicad-cli): Headless design-rule checking, 3D board renders, and per-layer SVG export from .kicad_pcb layouts

  • Live KiCad Session: Connect to a running KiCad 9 PCB editor through the official IPC API for selection sync and reversible GUI cross-probing

  • Smart Caching: Optional file caching of parsed schematics for faster repeated queries

Related MCP server: kicad-mcp

Installation

# Install with uv (recommended)
uv sync

# Or with pip
pip install -e .

Requirements: Python 3.10+, and KiCad (for kicad-cli). The server discovers kicad-cli automatically at the macOS app-bundle path, /usr/bin, and on PATH; set the KICAD_CLI environment variable to point at a specific executable.

Quick Start

1. Configure MCP Client

Add to your MCP client configuration (e.g., Claude Desktop's claude_desktop_config.json):

{
  "mcpServers": {
    "kicad": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/kicad-mcp",
        "run",
        "kicad-mcp"
      ]
    }
  }
}

2. Create Configuration File

Create .kicad_mcp.yaml in your project directory:

boards:
  main:
    path: /path/to/main.kicad_sch
    pcb: /path/to/main.kicad_pcb        # optional: PCB layout for PCB-analysis tools
    description: Main controller board

  sensor:
    path: /path/to/sensor.kicad_sch
    description: Sensor board

systems:
  complete:
    boards: [main, sensor]
    description: Full system with all boards

cache:
  enabled: true
  directory: ~/.cache/kicad_mcp
  check_mtime: true

Configuration

Configuration files are searched in priority order:

  1. Environment variable: $KICAD_MCP_CONFIG

  2. Local project: .kicad_mcp.yaml (current directory or parent directories)

  3. Global config: ~/.config/kicad_mcp/config.yaml

  4. Default: Empty configuration (no boards pre-loaded)

Configuration Options

  • boards: Named board configurations. Each board has:

    • path: path to the .kicad_sch schematic file

    • pcb (optional): path to the .kicad_pcb layout file, used by PCB-analysis tools

    • description (optional): human-readable description

  • systems: Multi-board system definitions referencing board names

  • cache.enabled: Enable/disable pickle caching of parsed schematics

  • cache.directory: Where to store cache files

  • cache.check_mtime: Invalidate cache when source files change

Available Tools

Board Management

Tool

Description

list_configured_boards

List all boards from configuration

list_configured_systems

List all multi-board systems

load_board

Load a board by name (with caching)

load_system

Load a multi-board system

reload_config

Reload configuration without restarting

Configuration Management

Tool

Description

add_board

Add a new board to configuration (schematic path, optional pcb)

remove_board

Remove a board from configuration

add_system

Add a new multi-board system

remove_system

Remove a system from configuration

Multi-Board Analysis

Tool

Description

get_system_overview

Overview of a multi-board system

trace_cross_board_signal

Trace a signal across multiple boards

Datasheets

Tool

Description

search_datasheet

Resolve a manufacturer and part number to a datasheet URL

PCB Layout (kicad-cli)

These tools operate on the .kicad_pcb layout via KiCad's headless kicad-cli. The source argument accepts a configured board name (using its pcb path), a direct path to a .kicad_pcb, or a path to a .kicad_sch (resolved to its sibling .kicad_pcb).

Tool

Description

pcb_drc

Run Design Rule Check; returns violations grouped by rule with severities, mm coordinates, totals, and the JSON report path. Fails closed — a failed run returns an explicit error, never a false clean pass. Accepts severity and max_violations filters.

pcb_render

Render the board in 3D to a PNG, returned as an inline image plus the saved file path. Camera controls: side, zoom, rotate, pan, pivot, perspective, floor, width, height, quality, background.

pcb_export_layers

Export one SVG per layer (e.g. F.Cu,B.Cu,Edge.Cuts) and return the file paths. fit defaults to board (board-area only) for downstream cropping.

The underlying wrappers live in kicad_mcp.kicad_cli and are importable as plain functions, so non-MCP consumers (such as a crop/highlight tool that needs board-area-fitted per-layer SVGs) can call them directly.

PCB Layout (parsed model)

These tools read a typed, in-memory model of the .kicad_pcb (placement, copper, stackup, pads, tracks, vias, zones) parsed with the pure-Python kiutils library and cached per (path, mtime) — no kicad-cli process. Their source resolves through KiCadMCPConfig.resolve_pcb_source (a configured board's pcb path, a direct .kicad_pcb path, or a .kicad_sch sibling). The queryable model lives in kicad_mcp.pcb_model; direct 2D PNG rendering lives in kicad_mcp.pcb_rendering.

Tool

Description

pcb_overview

Board dimensions, layer/stackup summary, footprint/track/via/zone counts, net count, and top nets by copper element count

pcb_component

A component's placement (position, side, rotation), footprint id, and pads with their nets

pcb_components_near

Footprints placed within a radius (mm) of a component, with distances

pcb_net_route

Routed copper length, layer usage, widths, vias, endpoints, and copper-island connectivity for one net

pcb_diff_pair

Length and via-count comparison for a differential pair, with pair-name inference for common _P/_N and +/- conventions

pcb_net_lengths

Sorted routed lengths for nets matching a glob or regular expression

pcb_current_capacity

Pattern-first current-capacity estimates for matched nets, sorted by weakest neck, using IPC-2221 trace current formulas

pcb_impedance_estimate

Pattern-first or hypothetical trace IPC-2141 impedance estimates, including coupled differential estimates when a matched pair is resolved

pcb_crop

Inline PNG crop of a component, a net's copper bounds, or an explicit board-coordinate window; returns MCP ImageContent plus the saved path

pcb_highlight_net

Inline PNG with one net drawn bright over dimmed board copper, including lower-alpha zones; returns MCP ImageContent plus the saved path

Electrical estimates — IPC-2221 ampacity and IPC-2141 impedance

pcb_current_capacity and pcb_impedance_estimate are estimate tools, not thermal simulation or a field solver. They use the same pattern-first behavior as pcb_net_lengths: a glob or regular expression matches nets and returns a table across all matches. When exactly one net matches, pcb_current_capacity appends per-segment detail for each (layer, width) geometry.

pcb_current_capacity estimates each routed track geometry from copper width, stackup copper thickness, layer type, and requested temperature rise using the IPC-2221 internal or external trace current formula as appropriate for the layer. Rows sort ascending by estimated current so the weakest necks are first; min_current_a turns the table into a pass/flag check. Via barrels are estimated with IPC-2221 using a stated plating assumption.

pcb_impedance_estimate reports IPC-2141 closed-form microstrip or stripline estimates for each matched (layer, width) geometry, or for a hypothetical width_mm plus layer when iterating toward a target width. If a pattern resolves to a differential pair by the existing _P/_N or +/- conventions, it derives the same-layer spacing from route geometry and appends a coupled differential estimate.

Both tools always print assumptions. Missing stackup copper thickness defaults to 0.035 mm (1 oz), via plating defaults to 25 µm, and missing dielectric constant defaults to εr 4.4 only when the height can still be derived or is provided explicitly. For two-layer boards without stackup, impedance uses board thickness minus two 35 µm copper foils; multilayer boards without dielectric thickness refuse the affected layer with an explicit message. Nets carried by zones are flagged because the pour cross-section is not modeled, so the track neck may not be the true current limit.

Live KiCad session (IPC API)

These tools talk to a running KiCad 9 PCB editor through KiCad's official kicad-python (kipy) IPC client. They are different from the file-based PCB model tools above: they operate on the user's visible KiCad GUI session and fail closed when no IPC server is reachable. To use them, enable KiCad's API server in KiCad Preferences → Plugins, then keep the target PCB open in the PCB editor. The server attempts KiCad's default IPC socket, or KICAD_API_SOCKET when that environment variable is set, and every IPC call uses a short timeout so the MCP server does not hang.

The KiCad 9 Python IPC surface exposes open-document discovery, board item queries, selection read/write, net queries, and item-by-net queries. It does not expose a typed zoom or pan command in kicad-python 0.7.1, so live focus selects the target footprint or item and reports that view centering is unavailable rather than fabricating a GUI state.

Tool

Description

kicad_session

Report whether KiCad IPC is reachable, the KiCad version, the attempted API socket, and open PCB document paths

kicad_focus

Select a footprint reference or a board position (x_mm, y_mm) in the running PCB editor; view centering is reported as unsupported when the IPC client cannot do it

kicad_highlight_net

Select all selectable copper items on a live board net so KiCad visibly highlights the routed net in the GUI

kicad_get_selection

Read the user's current GUI selection as references, nets, item types, and item summaries that compose with parsed-model tools such as pcb_component and pcb_net_route

kicad_open_board

Resolves a configured board or PCB path through KiCadMCPConfig.resolve_pcb_source, then fails closed because KiCad 9's Python IPC client does not expose an open-board command

Usage Examples

Multi-Board Systems

# Load and overview a system
load_system(system_name="complete")
get_system_overview(system_name="complete")

# Trace SPI signal across boards
trace_cross_board_signal(
    system_name="complete",
    signal_net="/MISO",
    start_component="main:U1",
    end_component="sensor:U2"
)

Datasheet Lookup

search_datasheet(
    manufacturer="Texas Instruments",
    part_number="ADS1299IPAGR"
)

Dynamic Configuration

# Add a new board, including its PCB layout
add_board(
    name="power",
    path="/path/to/power.kicad_sch",
    pcb="/path/to/power.kicad_pcb",
    description="Power supply board"
)

# Create a system with it
add_system(
    name="full_system",
    boards=["main", "sensor", "power"],
    description="Complete system with power"
)

# Reload after manual config edits
reload_config()

Development

# Install with dev dependencies
uv sync --extra dev

# Run tests
uv run pytest

# Lint
uv run ruff check src/

License

MIT

Available Tools

30 tools
add_boardB

Add a new board to the configuration

Inputs: name (required), path (required), pcb, description.

add_systemB

Add a new multi-board system to the configuration

Inputs: name (required), boards (required), description.

get_system_overviewC

Get an overview of a multi-board system

Inputs: system_name (required).

kicad_focusB

Select a footprint reference or board position in the running KiCad PCB editor. View zoom/pan is reported when unsupported by the IPC client.

Inputs: position, reference.

kicad_get_selectionA

Read the user's current live KiCad PCB selection as references, nets, item types, and item summaries.

Inputs: no named parameters.

kicad_highlight_netA

Select all selectable copper items on a net in the running KiCad PCB editor so the GUI highlights them live.

Inputs: net (required).

kicad_open_boardB

Resolve a PCB source and fail closed if the installed KiCad IPC client cannot open documents.

Inputs: source (required).

kicad_sessionA

Report live KiCad IPC reachability, version, attempted socket, and open PCB documents.

Inputs: no named parameters.

list_configured_boardsA

List all boards configured in .kicad_mcp.yaml

Inputs: no named parameters.

list_configured_systemsA

List all multi-board systems configured in .kicad_mcp.yaml

Inputs: no named parameters.

load_boardB

Load a board by name from configuration

Inputs: board_name (required).

load_systemB

Load a multi-board system by name from configuration

Inputs: system_name (required).

pcb_componentA

Get a component's PCB placement (position, side, rotation), footprint id, and pads with their nets.

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

pcb_components_nearB

Find footprints placed within a radius (mm) of a given component, with distances.

Inputs: source (required), reference (required), radius_mm.

pcb_cropA

Render a 2D PNG crop of a PCB region as ImageContent. Select exactly one target: reference plus margin_mm, net plus margin_mm, or explicit x_mm/y_mm/width_mm/height_mm. Layers default to the target side copper plus silkscreen and Edge.Cuts for reference crops, or all copper plus Edge.Cuts otherwise.

Inputs: source (required), net, x_mm, y_mm, +7 more.

pcb_current_capacityA

Estimate current capacity for nets matching a glob or regex, sorted weakest first, using IPC-2221 trace current formulas.

Inputs: source (required), pattern (required), limit, plating_um, +2 more.

pcb_diff_pairA

Compare routed lengths for a differential pair. Pass explicit net_p/net_n or pass net_p as the base name using _P/_N or +/- conventions.

Inputs: net_p (required), source (required), net_n.

pcb_drcA

Run headless Design Rule Check on a PCB and return violations grouped by rule with severities, mm coordinates, totals, and the JSON report path. Fails closed (explicit error) if the run fails rather than reporting a false clean pass.

Inputs: source (required), severity, max_violations.

pcb_export_layersB

Export one SVG per PCB layer (e.g. F.Cu,B.Cu,Edge.Cuts) and return the generated file paths. Defaults to board-area fit for downstream cropping.

Inputs: layers (required), source (required), fit, output_dir, +1 more.

pcb_highlight_netB

Render a 2D PNG with one net's tracks, vias, pads, and zones drawn bright over a dimmed board. Defaults to the whole board and all copper layers.

Inputs: net (required), source (required), x_mm, y_mm, +5 more.

pcb_impedance_estimateA

Estimate single-ended and differential impedance with IPC-2141 closed-form formulas for matching nets, or a hypothetical width/layer.

Inputs: source (required), er, layer, limit, +3 more.

pcb_net_lengthsA

List routed lengths for nets whose names match a glob or regular expression, sorted by length for bus matching review.

Inputs: source (required), pattern (required), limit.

pcb_net_routeA

Analyze one PCB net's routed copper length, layer usage, widths, vias, endpoints, and copper-island connectivity.

Inputs: net (required), source (required).

pcb_overviewB

Get a PCB layout overview: board dimensions, layer/stackup summary, footprint/track/via/zone counts, net count, and top nets by copper element count.

Inputs: source (required).

pcb_renderA

Render a PCB in 3D to a PNG and return the image plus the saved file path. Supports camera controls: side, zoom, rotate, pan, pivot, perspective, floor.

Inputs: source (required), pan, side, zoom, +8 more.

reload_configA

Reload configuration from disk without restarting the server

Inputs: no named parameters.

remove_boardB

Remove a board from the configuration

Inputs: name (required).

remove_systemB

Remove a system from the configuration

Inputs: name (required).

search_datasheetB

Search for component datasheet URL using manufacturer and part number

Inputs: part_number (required), manufacturer (required), force_refresh.

trace_cross_board_signalC

Trace a signal across multiple boards in a system

Inputs: signal_net (required), system_name (required), end_component, start_component.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 30 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose, with detailed descriptions that prevent overlap. Tools like pcb_net_lengths and pcb_net_route both deal with nets but address different analysis aspects, and kicad_* functions for GUI interaction are uniquely scoped.

    Naming Consistency4/5

    Naming follows consistent prefixes within domains (kicad_, pcb_, add/remove/list/load) but varies between domains. The pattern is predictable and readable, though not uniform across all tools.

    Tool Count5/5

    30 tools cover a comprehensive range of PCB design operations and KiCad integration without redundancy. The count aligns well with the server's intended scope as an MCP assistant for KiCad.

    Completeness4/5

    The set covers board management, PCB analysis, rendering, and live KiCad interaction thoroughly. Minor gaps exist (e.g., no schematic or component editing tools), but these are reasonable given the server's focus on analysis and retrieval.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural language search and exploration of KiCad component symbol libraries with fast full-text search across 20,000+ components including metadata like datasheets, footprints, and descriptions.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural language interaction with KiCad projects, schematics, and PCBs, supporting project management, design rule checking, netlist extraction, and datasheet RAG search.
      3
      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