Skip to main content
Glama
mcp-server-kicad-tools

mcp-server-kicad-tools

by rjmendez

kicad-mcp-tools

CI License: MIT PyPI

Standalone KiCad automation toolkit extracted from the MycoMIDI project.

What is this?

kicad-mcp-tools is a small, stdlib-only Python toolkit for automating common KiCad-adjacent tasks without depending on a running KiCad instance. It packages reusable helpers that started life inside MycoMIDI and proved useful enough to stand alone.

It currently includes:

  • kicad_mcp_tools.sexpr_cst — lossless KiCad S-expression CST parser and serializer

  • kicad_mcp_tools.atomic_write — same-directory atomic file replacement helper

  • kicad_mcp_tools.drc_classify — DRC/ERC JSON classifier for clean/findings/malformed states

  • kicad_mcp_tools.pin_header_footprint_gen — simple through-hole pin-header footprint generator

  • scripts/kicad-cli.sh — pinned Docker wrapper for kicad-cli

  • demo/ — tiny sample schematic and PCB inputs for CLI experiments

Related MCP server: KiCAD MCP Server

Why does it exist?

This repository was split out from the hardware-design automation work behind MycoMIDI, a bioelectric-signal-to-MIDI project that needed lightweight, scriptable KiCad tooling during schematic, PCB, and validation workflows.

The extraction keeps that tooling reusable for other projects while preserving credit to the open-source KiCad MCP server work that informed the approach:

Origin and attribution

These files were extracted from MycoMIDI without removing MycoMIDI's own copy. The implementation and attribution headers were preserved from that origin.

The toolkit also preserves attribution to the upstream MIT-licensed projects whose patterns were adapted in MycoMIDI:

See THIRD_PARTY_LICENSES.md for the preserved third-party license text and provenance notes.

Installation

Once the package is published:

pip install kicad-mcp-tools

From source today:

git clone https://github.com/rjmendez/kicad-mcp-tools.git
cd kicad-mcp-tools
pip install -e .

Using as an MCP server

Run the stdio server directly from the published package with uvx:

uvx --from kicad-mcp-tools mcp-server-kicad-tools

Example MCP client configuration:

{
  "mcpServers": {
    "kicad-tools": {
      "command": "uvx",
      "args": ["--from", "kicad-mcp-tools", "mcp-server-kicad-tools"]
    }
  }
}

Exposed tools:

  • parse_kicad_sexpr — parse KiCad S-expression text into a structured CST-like tree.

  • roundtrip_kicad_sexpr — re-serialize parsed KiCad S-expression text and report whether it round-trips exactly.

  • classify_drc_report — classify KiCad DRC/ERC JSON as clean, findings, malformed, or unavailable.

  • generate_pin_header_footprint — generate a KiCad .kicad_mod pin-header footprint S-expression.

Run tests

python3 -m unittest discover tests

Quickstart

from kicad_mcp_tools import generate_electrode_connector_footprint, parse

footprint = generate_electrode_connector_footprint(4)
tree = parse(footprint.encode("utf-8"))

print(tree.lists[0].head)          # footprint
print(len(tree.lists[0].find_all("pad")))  # 4

Available Tools

4 tools
classify_drc_reportB

Classify KiCad DRC/ERC JSON as clean, findings, malformed, or unavailable.

Inputs: json_text (required). Returns: object

generate_pin_header_footprintA

Generate a through-hole pin-header footprint as KiCad .kicad_mod S-expression text.

Inputs: pin_count (required), name, rows, pitch_mm, +1 more. Returns: result

parse_kicad_sexprB

Parse KiCad S-expression text into a structured CST-like representation.

Inputs: text (required). Returns: object

roundtrip_kicad_sexprC

Parse and re-serialize KiCad S-expression text to validate byte-preserving round-trips.

Inputs: text (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct purpose: parsing S-expressions, validating round-trips, classifying DRC reports, and generating footprints. Even parse_kicad_sexpr and roundtrip_kicad_sexpr are clearly separated by their output intent (CST representation vs. byte-preserving validation).

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern with clear domain objects: parse_kicad_sexpr, roundtrip_kicad_sexpr, classify_drc_report, and generate_pin_header_footprint. There are no mixed conventions or vague verbs.

    Tool Count5/5

    Four tools is an appropriate, focused size for a KiCad utility server. Each tool provides a distinct operation without unnecessary bloat or redundancy.

    Completeness4/5

    The set covers S-expression parsing, round-trip validation, DRC/ERC classification, and a common footprint generation task. The main gap is the narrow footprint-generation scope—only pin headers are supported—so broader KiCad footprint workflows are not covered, but this is a minor limitation for the apparent utility toolkit.

    Related MCP Connectors

    Related MCP Servers

    • 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
      Provides schematic/PCB analysis, authoring, and SPICE simulation through MCP, enabling direct KiCad file manipulation and verification without requiring KiCad for reading.
      18
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients such as Claude Code to work on KiCad 10 designs by driving kicad-cli for ERC, DRC, netlists and fabrication exports, KiCad's IPC API for live board editing, and lossless edits of schematic and project files. It also provides design review, routing, parts and datasheet tooling so a board can be treated as data and checked against fab limits.
      35
      3
      MIT