Enables direct interaction with KiCAD PCB design software, allowing for natural language control of operations including project management, board design, component placement and manipulation, routing, design rule implementation, and exporting designs in various formats.
KiCAD MCP Server
A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with KiCAD for PCB design automation. Built on the MCP 2025-06-18 specification, this server provides comprehensive tool schemas and real-time project state access for intelligent PCB design workflows.
Overview
The Model Context Protocol is an open standard from Anthropic that allows AI assistants to securely connect to external tools and data sources. This implementation provides a standardized bridge between AI assistants and KiCAD, enabling natural language control of PCB design operations.
Key Capabilities:
52 fully-documented tools with JSON Schema validation
8 dynamic resources exposing project state
Full MCP 2025-06-18 protocol compliance
Cross-platform support (Linux, Windows, macOS)
Real-time KiCAD UI integration via IPC API (experimental)
Comprehensive error handling and logging
Related MCP server: Kibana MCP Server
What's New in v2.1.0
IPC Backend (Experimental)
We are currently implementing and testing the KiCAD 9.0 IPC API for real-time UI synchronization:
Changes made via MCP tools appear immediately in the KiCAD UI
No manual reload required when IPC is active
Hybrid backend: uses IPC when available, falls back to SWIG API
20+ commands now support IPC including routing, component placement, and zone operations
Note: IPC features are under active development and testing. Enable IPC in KiCAD via Preferences > Plugins > Enable IPC API Server.
Comprehensive Tool Schemas
Every tool now includes complete JSON Schema definitions with:
Detailed parameter descriptions and constraints
Input validation with type checking
Required vs. optional parameter specifications
Enumerated values for categorical inputs
Clear documentation of what each tool does
Resources Capability
Access project state without executing tools:
kicad://project/current/info- Project metadatakicad://project/current/board- Board propertieskicad://project/current/components- Component list (JSON)kicad://project/current/nets- Electrical netskicad://project/current/layers- Layer stack configurationkicad://project/current/design-rules- Current DRC settingskicad://project/current/drc-report- Design rule violationskicad://board/preview.png- Board visualization (PNG)
Protocol Compliance
Updated to MCP SDK 1.21.0 (latest)
Full JSON-RPC 2.0 support
Proper capability negotiation
Standards-compliant error codes
Available Tools
The server provides 52 tools organized into functional categories:
Project Management (4 tools)
create_project- Initialize new KiCAD projectsopen_project- Load existing project filessave_project- Save current project stateget_project_info- Retrieve project metadata
Board Operations (9 tools)
set_board_size- Configure PCB dimensionsadd_board_outline- Create board edge (rectangle, circle, polygon)add_layer- Add custom layers to stackset_active_layer- Switch working layerget_layer_list- List all board layersget_board_info- Retrieve board propertiesget_board_2d_view- Generate board preview imageadd_mounting_hole- Place mounting holesadd_board_text- Add text annotations
Component Placement (10 tools)
place_component- Place single component with footprintmove_component- Reposition existing componentrotate_component- Rotate component by angledelete_component- Remove component from boardedit_component- Modify component propertiesget_component_properties- Query component detailsget_component_list- List all placed componentsplace_component_array- Create component grids/patternsalign_components- Align multiple componentsduplicate_component- Copy existing component
Routing & Nets (8 tools)
add_net- Create electrical netroute_trace- Route copper tracesadd_via- Place vias for layer transitionsdelete_trace- Remove tracesget_nets_list- List all netscreate_netclass- Define net class with rulesadd_copper_pour- Create copper zones/poursroute_differential_pair- Route differential signals
Library Management (4 tools)
list_libraries- List available footprint librariessearch_footprints- Search for footprintslist_library_footprints- List footprints in libraryget_footprint_info- Get footprint details
Design Rules (4 tools)
set_design_rules- Configure DRC parametersget_design_rules- Retrieve current rulesrun_drc- Execute design rule checkget_drc_violations- Get DRC error report
Export (5 tools)
export_gerber- Generate Gerber fabrication filesexport_pdf- Export PDF documentationexport_svg- Create SVG vector graphicsexport_3d- Generate 3D models (STEP/VRML)export_bom- Produce bill of materials
Schematic Design (6 tools)
create_schematic- Initialize new schematicload_schematic- Open existing schematicadd_schematic_component- Place symbolsadd_schematic_wire- Connect component pinslist_schematic_libraries- List symbol librariesexport_schematic_pdf- Export schematic PDF
UI Management (2 tools)
check_kicad_ui- Check if KiCAD is runninglaunch_kicad_ui- Launch KiCAD application
Prerequisites
Required Software
KiCAD 9.0 or Higher
Download from kicad.org/download
Must include Python module (pcbnew)
Verify installation:
python3 -c "import pcbnew; print(pcbnew.GetBuildVersion())"
Node.js 18 or Higher
Download from nodejs.org
Verify:
node --versionandnpm --version
Python 3.10 or Higher
Usually included with KiCAD
Required packages (auto-installed):
kicad-python (kipy) >= 0.5.0 (IPC API support, optional but recommended)
kicad-skip >= 0.1.0 (schematic support)
Pillow >= 9.0.0 (image processing)
cairosvg >= 2.7.0 (SVG rendering)
colorlog >= 6.7.0 (logging)
pydantic >= 2.5.0 (validation)
requests >= 2.32.5 (HTTP client)
python-dotenv >= 1.0.0 (environment)
MCP Client Choose one:
Claude Desktop - Official Anthropic desktop app
Claude Code - Official CLI tool
Cline - VSCode extension
Supported Platforms
Linux (Ubuntu 22.04+, Fedora, Arch) - Primary platform, fully tested
Windows 10/11 - Fully supported with automated setup
macOS - Experimental support
Installation
Linux (Ubuntu/Debian)
Windows 10/11
Automated Setup (Recommended):
The script will:
Detect KiCAD installation
Verify prerequisites
Install dependencies
Build project
Generate configuration
Run diagnostics
Manual Setup: See Windows Installation Guide for detailed instructions.
macOS
Configuration
Claude Desktop
Edit configuration file:
Linux/macOS:
~/.config/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Configuration:
Platform-specific PYTHONPATH:
Linux:
/usr/lib/kicad/lib/python3/dist-packagesWindows:
C:\Program Files\KiCad\9.0\lib\python3\dist-packagesmacOS:
/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages
Cline (VSCode)
Edit: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Use the same configuration format as Claude Desktop above.
Claude Code
Claude Code automatically detects MCP servers in the current directory. No additional configuration needed.
Usage Examples
Basic PCB Design Workflow
Component Placement
Routing
Design Verification
Using Resources
Resources provide read-only access to project state:
Architecture
MCP Protocol Layer
JSON-RPC 2.0 Transport: Bi-directional communication via STDIO
Protocol Version: MCP 2025-06-18
Capabilities: Tools (52), Resources (8)
Error Handling: Standard JSON-RPC error codes
TypeScript Server (src/)
Implements MCP protocol specification
Manages Python subprocess lifecycle
Handles message routing and validation
Provides logging and error recovery
Python Interface (python/)
kicad_interface.py: Main entry point, MCP message handler, command routing
kicad_api/: Backend implementations
base.py- Abstract base classes for backendsipc_backend.py- KiCAD 9.0 IPC API backend (real-time UI sync)swig_backend.py- pcbnew SWIG API backend (file-based operations)factory.py- Backend auto-detection and instantiation
schemas/tool_schemas.py: JSON Schema definitions for all tools
resources/resource_definitions.py: Resource handlers and URIs
commands/: Modular command implementations
project.py- Project operationsboard.py- Board manipulationcomponent.py- Component placementrouting.py- Trace routing and netsdesign_rules.py- DRC operationsexport.py- File generationschematic.py- Schematic designlibrary.py- Footprint libraries
KiCAD Integration
pcbnew API (SWIG): Direct Python bindings to KiCAD for file operations
IPC API (kipy): Real-time communication with running KiCAD instance (experimental)
Hybrid Backend: Automatically uses IPC when available, falls back to SWIG
kicad-skip: Schematic file manipulation
Platform Detection: Cross-platform path handling
UI Management: Automatic KiCAD UI launch/detection
Development
Building from Source
Running Tests
Linting and Formatting
Troubleshooting
Server Not Appearing in Client
Symptoms: MCP server doesn't show up in Claude Desktop or Cline
Solutions:
Verify build completed:
ls dist/index.jsCheck configuration paths are absolute
Restart MCP client completely
Check client logs for error messages
Python Module Import Errors
Symptoms: ModuleNotFoundError: No module named 'pcbnew'
Solutions:
Verify KiCAD installation:
python3 -c "import pcbnew"Check PYTHONPATH in configuration matches your KiCAD installation
Ensure KiCAD was installed with Python support
Tool Execution Failures
Symptoms: Tools fail with unclear errors
Solutions:
Check server logs:
~/.kicad-mcp/logs/kicad_interface.logVerify a project is loaded before running board operations
Ensure file paths are absolute, not relative
Check tool parameter types match schema requirements
Windows-Specific Issues
Symptoms: Server fails to start on Windows
Solutions:
Run automated diagnostics:
.\setup-windows.ps1Verify Python path uses double backslashes:
C:\\Program Files\\KiCad\\9.0Check Windows Event Viewer for Node.js errors
Getting Help
Check the GitHub Issues
Review server logs:
~/.kicad-mcp/logs/kicad_interface.logOpen a new issue with:
Operating system and version
KiCAD version (
python3 -c "import pcbnew; print(pcbnew.GetBuildVersion())")Node.js version (
node --version)Full error message and stack trace
Relevant log excerpts
Project Status
Current Version: 2.1.0-alpha
Working Features:
Project creation and management
Board outline and sizing
Layer management
Component placement with footprint library loading
Mounting holes and text annotations
Design rule checking
Export to Gerber, PDF, SVG, 3D
Schematic creation and editing
UI auto-launch
Full MCP protocol compliance
Under Active Development (IPC Backend):
Real-time UI synchronization via KiCAD 9.0 IPC API
IPC-enabled commands: route_trace, add_via, place_component, move_component, delete_component, add_copper_pour, refill_zones, add_board_outline, add_mounting_hole, and more
Hybrid footprint loading (SWIG for library access, IPC for placement)
Zone/copper pour support via IPC
Note: IPC features are experimental and under testing. Some commands may not work as expected in all scenarios.
Planned:
JLCPCB parts integration
Digikey API integration
Advanced routing algorithms
Smart BOM management
AI-assisted component selection
Design pattern library (Arduino shields, RPi HATs)
See ROADMAP.md for detailed development timeline.
Contributing
Contributions are welcome! Please follow these guidelines:
Report Bugs: Open an issue with reproduction steps
Suggest Features: Describe use case and expected behavior
Submit Pull Requests:
Fork the repository
Create a feature branch
Follow existing code style
Add tests for new functionality
Update documentation
Submit PR with clear description
See CONTRIBUTING.md for detailed guidelines.
License
This project is licensed under the MIT License. See LICENSE for details.
Acknowledgments
Built on the Model Context Protocol by Anthropic
Powered by KiCAD open-source PCB design software
Uses kicad-skip for schematic manipulation
Citation
If you use this project in your research or publication, please cite: