KiCad
lamaalrajih/kicad-mcp · 453 stars · Python · MIT
MCP server Model Context Protocol server for KiCad on Mac, Windows, and Linux
Install
The repo has no one-line install. Follow its README.
Files
KiCad MCP Server
This guide will help you set up a Model Context Protocol (MCP) server for KiCad. While the examples in this guide often reference Claude Desktop, the server is compatible with any MCP-compliant client. You can use it with Claude Desktop, your own custom MCP clients, or any other application that implements the Model Context Protocol.
Table of Contents
- Prerequisites
- Installation Steps
- Understanding MCP Components
- Feature Highlights
- Natural Language Interaction
- Documentation
- Configuration
- Development Guide
- Troubleshooting
- Contributing
- Future Development Ideas
- License
Prerequisites
- macOS, Windows, or Linux
- Python 3.10 or higher
- KiCad 9.0 or higher
- uv 0.8.0 or higher
- Claude Desktop (or another MCP client)
Installation Steps
1. Set Up Your Python Environment
First, let's install dependencies and set up our environment:
# Clone the repository
git clone https://github.com/lamaalrajih/kicad-mcp.git
cd kicad-mcp
# Install dependencies – `uv` will create a `.venv/` folder automatically
# (Install `uv` first: `brew install uv` on macOS or `pipx install uv`)
make install
# Optional: activate the environment for manual commands
source .venv/bin/activate
2. Configure Your Environment
Create a .env file to customize where the server looks for your KiCad projects:
# Copy the example environment file
cp .env.example .env
# Edit the .env file
vim .env
In the .env file, add your custom project directories:
# Add paths to your KiCad projects (comma-separated)
KICAD_SEARCH_PATHS=~/pcb,~/Electronics,~/Projects/KiCad
3. Run the Server
Once the environment is set up, you can run the server:
python main.py
4. Configure an MCP Client
Now, let's configure Claude Desktop to use our MCP server:
- Create or edit the Claude Desktop configuration file:
# Create the directory if it doesn't exist
mkdir -p ~/Library/Application\ Support/Claude
# Edit the configuration file
vim ~/Library/Application\ Support/Claude/claude_desktop_config.json
- Add the KiCad MCP server to the configuration:
{
"mcpServers": {
"kicad": {
"command": "/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/.venv/bin/python",
"args": [
"/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/main.py"
]
}
}
}
Replace /ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp with the actual path to your project directory.
5. Restart Your MCP Client
Close and reopen your MCP client to load the new configuration.
Understanding MCP Components
The Model Context Protocol (MCP) defines three primary ways to provide capabilities:
Resources vs Tools vs Prompts
Resources are read-only data sources that LLMs can reference:
- Similar to GET endpoints in REST APIs
- Provide data without performing significant computation
- Used when the LLM needs to read information
- Typically accessed programmatically by the client application
- Example:
kicad://projectsreturns a list of all KiCad projects
Tools are functions that perform actions or computations:
- Similar to POST/PUT endpoints in REST APIs
- Can have side effects (like opening applications or generating files)
- Used when the LLM needs to perform actions in the world
- Typically invoked directly by the LLM (with user approval)
- Example:
open_project()launches KiCad with a specific project
Prompts are reusable templates for common interactions:
- Pre-defined conversation starters or instructions
- Help users articulate common questions or tasks
- Invoked by user choice (typically from a menu)
- Example: The
debug_pcb_issuesprompt helps users troubleshoot PCB problems
For more information on resources vs tools vs prompts, read the MCP docs.
Feature Highlights
The KiCad MCP Server provides several key features, each with detailed documentation:
- Project Management: List, examine, and open KiCad projects
- Example: "Show me all my recent KiCad projects" → Lists all projects sorted by modification date
- PCB Design Analysis: Get insights about your PCB designs and schematics
- Example: "Analyze the component density of my temperature sensor board" → Provides component spacing analysis
- Netlist Extraction: Extract and analyze component connections from schematics
- Example: "What components are connected to the MCU in my Arduino shield?" → Shows all connections to the microcontroller
- BOM Management: Analyze and export Bills of Materials
- Example: "Generate a BOM for my smart watch project" → Creates a detailed bill of materials
- Design Rule Checking: Run DRC checks using the KiCad CLI and track your progress over time
- Example: "Run DRC on my power supply board and compare to last week" → Shows progress in fixing violations
- PCB Visualization: Generate visual representations of your PCB layouts
- Example: "Show me a thumbnail of my audio amplifier PCB" → Displays a visual render of the board
- Circuit Pattern Recognition: Automatically identify common circuit patterns in your schematics
- Example: "What power supply topologies am I using in my IoT device?" → Identifies buck, boost, or linear regulators
For more examples and details on each feature, see the dedicated guides in the documentation. You can also ask the LLM what tools it has access to!
Natural Language Interaction
While our documentation often shows examples like:
Show me the DRC report for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro
You don't need to type the full path to your files! The LLM can understand more natural language requests.
For example, instead of the formal command above, you can simply ask:
Can you check if there are any design rule violations in my Arduino shield project?
Or:
I'm working on the temperature sensor circuit. Can you identify what patterns it uses?
The LLM will understand your intent and request the relevant information from the KiCad MCP Server. If it needs clarification about which project you're referring to, it will ask.
Documentation
Detailed documentation for each feature is available in the docs/ directory:
- Project Management
- PCB Design Analysis
- Netlist Extraction
- Bill of Materials (BOM)
- Design Rule Checking (DRC)
- PCB Visualization
- Circuit Pattern Recognition
- Prompt Templates
Configuration
The KiCad MCP Server can be configured using environment variables or a .env file:
Key Configuration Options
See Configuration Guide for more details.
Development Guide
Project Structure
The KiCad MCP Server is organized into a modular structure:
kicad-mcp/
├── README.md # Project documentation
├── main.py # Entry point that runs the server
├── requirements.txt # Python dependencies
├── .env.example # Example environment configuration
├── kicad_mcp/ # Main package directory
│ ├── __init__.py
│ ├── server.py # MCP server setup
│ ├── config.py # Configuration constants and settings
│ ├── context.py # Lifespan management and shared context
│ ├── resources/ # Resource handlers
│ ├── tools/ # Tool handlers
│ ├── prompts/ # Prompt templates
│ └── utils/ # Utility functions
├── docs/ # Documentation
└── tests/ # Unit tests
Adding New Features
To add new features to the KiCad MCP Server, follow these steps:
- Identify the category for your feature (resource, tool, or prompt)
- Add your implementation to the appropriate module
- Register your feature in the corresponding register function
- Test your changes with the development tools
Facts
- Kind
- MCP server
- Repo
- lamaalrajih/kicad-mcp
- Group
- Uncategorized
- Stars
- 453
- License
- MIT
- Language
- Python
- Last push
- 2025-10-17
- Forks
- 84
- 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
- 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
- 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
- 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
- 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k