mcp-server-kicad-tools
Provides KiCad automation tools for parsing and round-tripping KiCad S-expression files, classifying DRC/ERC JSON reports, and generating pin-header footprint S-expressions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-kicad-toolsgenerate a 4-pin through-hole header footprint"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kicad-mcp-tools
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 serializerkicad_mcp_tools.atomic_write— same-directory atomic file replacement helperkicad_mcp_tools.drc_classify— DRC/ERC JSON classifier for clean/findings/malformed stateskicad_mcp_tools.pin_header_footprint_gen— simple through-hole pin-header footprint generatorscripts/kicad-cli.sh— pinned Docker wrapper forkicad-clidemo/— tiny sample schematic and PCB inputs for CLI experiments
Related MCP server: mcp-kicad-cli
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-toolsFrom 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-toolsExample 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 asclean,findings,malformed, orunavailable.generate_pin_header_footprint— generate a KiCad.kicad_modpin-header footprint S-expression.
Run tests
python3 -m unittest discover testsQuickstart
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"))) # 4Available Tools
4 toolsclassify_drc_reportB
Classify KiCad DRC/ERC JSON as clean, findings, malformed, or unavailable.
| Name | Required | Description | Default |
|---|---|---|---|
| json_text | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the classification categories but doesn't disclose what the output looks like, whether it's a read-only operation, or any side effects. The output schema exists but the description doesn't explain the classification logic or edge cases. For a tool with no annotations, this is a gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, concise and front-loaded with the action. It lists the classification categories efficiently. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has one parameter and an output schema, so the description doesn't need to explain return values. However, with no annotations and 0% schema coverage, the description should provide more context about the input format and classification behavior. It's adequate but leaves gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description only mentions 'KiCad DRC/ERC JSON' as input. The parameter 'json_text' is a string, but the description doesn't clarify expected format (e.g., raw JSON string, pretty-printed, etc.) or any constraints. The description adds minimal meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: classifying KiCad DRC/ERC JSON into one of four categories (clean, findings, malformed, unavailable). It uses a specific verb ('Classify') and resource ('KiCad DRC/ERC JSON'). It doesn't explicitly distinguish from siblings, but the sibling names are about parsing/generating sexpr data, so the classification purpose is distinct enough.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool: when you have KiCad DRC/ERC JSON and need a classification. It doesn't explicitly state when not to use it or mention alternatives. Sibling tools like parse_kicad_sexpr handle different formats, so the context is somewhat clear but not explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_pin_header_footprintA
Generate a through-hole pin-header footprint as KiCad .kicad_mod S-expression text.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| rows | No | ||
| pitch_mm | No | ||
| pin_count | Yes | ||
| description | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must carry behavioral disclosure. It does tell the agent that the tool produces textual S-expression data rather than, say, writing a file directly, but it does not disclose side effects, validation behavior, or any constraints such as minimum pin count.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. Every word carries meaning, and the essential object, action, and output format are communicated immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The presence of an output schema reduces the need to describe return values, and the tool is relatively simple. Still, without parameter semantics or usage guidance, the description leaves the agent to infer important details about how rows or pitch affect the generated footprint.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, yet the description mentions no parameters at all. Fields like pin_count, rows, and pitch_mm are somewhat inferable from their names and defaults, but the description adds no semantic detail about how they affect the generated footprint.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action ('Generate') on a specific resource ('through-hole pin-header footprint') and the exact output format ('KiCad .kicad_mod S-expression text'). This clearly distinguishes it from sibling tools like parse_kicad_sexpr and roundtrip_kicad_sexpr, which perform different operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage context is implied by the verb 'Generate' and the S-expression output, which contrasts with the parsing/classifying siblings. However, there is no explicit guidance on when to choose this tool over alternatives or any exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
parse_kicad_sexprB
Parse KiCad S-expression text into a structured CST-like representation.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It reveals that the output is CST-like, which hints at structure preservation, but it does not disclose behavior on malformed input, validation strictness, error handling, or whether positions/comments are preserved. These details matter for a parser and are absent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler. Every word contributes meaning, and the core action and output are stated immediately. This is appropriately concise for a tool with one parameter and an output schema.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With a single, self-explanatory parameter and an output schema present, the description is mostly sufficient for a basic call. The main gaps are lack of error-behavior details and no mention of how this relates to the roundtrip sibling. Still, the core information an agent needs to invoke it correctly is present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema provides no description for the 'text' parameter, and schema description coverage is 0%. The description adds some meaning by clarifying that the text should be KiCad S-expression text, not arbitrary S-expressions. However, it does not specify whether the parameter expects raw file contents, a path, or how large inputs are handled.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Parse'), a specific resource ('KiCad S-expression text'), and a concrete output ('structured CST-like representation'). It clearly identifies what the tool does and is easily distinguishable from siblings like roundtrip_kicad_sexpr, which implies serialization back to text.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the use case: parse KiCad S-expression text when you need a structured representation. However, it gives no explicit guidance on when to choose this over roundtrip_kicad_sexpr or any of the other sibling tools, and there are no stated exclusions or context about typical invocation scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
roundtrip_kicad_sexprC
Parse and re-serialize KiCad S-expression text to validate byte-preserving round-trips.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the full burden of behavioral disclosure. It mentions the parse and re-serialize operation but does not disclose what the tool returns (e.g., a boolean, a comparison result), how errors are handled, or any side effects. This is a significant gap for a validation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, focused sentence with no unnecessary words. It front-loads the action and purpose, making it easy to grasp at a glance.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Although an output schema exists (which covers return values), the description is sparse for a validation tool. It does not define what constitutes a successful round-trip, mention any failure modes, or provide context on how the validation result should be interpreted. With no annotations, this is incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description only clarifies that the 'text' parameter is KiCad S-expression text, which is a modest addition. It does not elaborate on encoding, size limits, or format specifics, so it only partially compensates for the lack of schema documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (parse and re-serialize) and the specific purpose (validate byte-preserving round-trips) on KiCad S-expression text. It is distinct from a simple parser like parse_kicad_sexpr by focusing on round-trip fidelity, though it does not explicitly name the sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'to validate byte-preserving round-trips' implies the intended use case, but the description does not explicitly state when to use this tool versus parse_kicad_sexpr or any alternatives. No exclusions are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
classify_drc_report - First observed
generate_pin_header_footprint - First observed
parse_kicad_sexpr - First observed
roundtrip_kicad_sexpr
TDQS
Scored across 4 tools
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).
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.
Four tools is an appropriate, focused size for a KiCad utility server. Each tool provides a distinct operation without unnecessary bloat or redundancy.
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.
Maintenance
Related MCP Connectors
Search and review real KiCad and Altium PCB designs: schematics, BOMs, netlists, DRC/ERC.
Verified KiCad footprints, symbols & 3D models for AI agents. No signup, CC-BY-4.0, quality-gated.
Electronic component sourcing, BOM management, and PCB design workflows.
Geometry and CAD file metadata extraction for STL, OBJ, PLY, PCD, LAS/LAZ, glTF/GLB.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI tools to create, edit, and inspect KiCAD schematic files, including components, wires, labels, and sheets.MIT
- AlicenseBqualityCmaintenanceEnables KiCad CLI automation via MCP, providing tools for ERC, DRC, BOM export, netlist export, Gerbers, drill files, STEP, IPC-2581, and GLB output.10Apache 2.0
- AlicenseBqualityBmaintenanceEnables AI assistants to interact with KiCAD for PCB design automation, including schematic editing, component placement, routing, DRC/ERC, and export.10011 npm1MIT
- AlicenseBqualityCmaintenanceProvides schematic/PCB analysis, authoring, and SPICE simulation through MCP, enabling direct KiCad file manipulation and verification without requiring KiCad for reading.18MIT