by lamaalrajih
Enables natural‑language interaction with KiCad projects through a Model Context Protocol (MCP) server, providing project management, design analysis, netlist extraction, BOM generation, DRC execution, PCB visualization, and circuit pattern recognition.
The KiCad MCP Server exposes KiCad functionality as MCP resources, tools, and prompts that can be invoked by any MCP‑compliant client (e.g., Claude Desktop). It lets LLMs read project data, perform actions such as opening a design, and run analyses, all without writing explicit scripts.
make install
(uses uv
to create a virtual environment)..env
file from .env.example
and set KICAD_SEARCH_PATHS
to the directories containing your KiCad projects.python main.py
.mcpServers.kicad.command
to the Python interpreter inside .venv
and the args
to main.py
.Q: Do I need Claude Desktop to use the server? A: No. Any MCP‑compatible client can communicate with the server.
Q: Which KiCad versions are supported? A: KiCad 9.0 or newer.
Q: Can I add custom resources or tools?
A: Yes. Extend the kicad_mcp/resources
, tools
, or prompts
packages and register them in the server.
Q: How are environment variables handled?
A: The server reads configuration from a .env
file or the process environment (e.g., KICAD_SEARCH_PATHS
, KICAD_USER_DIR
, KICAD_APP_PATH
).
Q: Where are logs stored?
A: Logs are written to ~/Library/Logs/Claude/mcp-server-kicad.log
(macOS) or the equivalent path on Windows/Linux.
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.
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
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
Once the environment is set up, you can run the server:
python main.py
Now, let's configure Claude Desktop to use our MCP server:
# 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
{
"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.
Close and reopen your MCP client to load the new configuration.
The Model Context Protocol (MCP) defines three primary ways to provide capabilities:
Resources are read-only data sources that LLMs can reference:
kicad://projects
returns a list of all KiCad projectsTools are functions that perform actions or computations:
open_project()
launches KiCad with a specific projectPrompts are reusable templates for common interactions:
debug_pcb_issues
prompt helps users troubleshoot PCB problemsFor more information on resources vs tools vs prompts, read the MCP docs.
The KiCad MCP Server provides several key features, each with detailed documentation:
Project Management: List, examine, and open KiCad projects
PCB Design Analysis: Get insights about your PCB designs and schematics
Netlist Extraction: Extract and analyze component connections from schematics
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
Circuit Pattern Recognition: Automatically identify common circuit patterns in your schematics
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!
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.
Detailed documentation for each feature is available in the docs/
directory:
The KiCad MCP Server can be configured using environment variables or a .env
file:
Environment Variable | Description | Example |
---|---|---|
KICAD_SEARCH_PATHS |
Comma-separated list of directories to search for KiCad projects | ~/pcb,~/Electronics,~/Projects |
KICAD_USER_DIR |
Override the default KiCad user directory | ~/Documents/KiCadProjects |
KICAD_APP_PATH |
Override the default KiCad application path | /Applications/KiCad7/KiCad.app |
See Configuration Guide for more details.
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
To add new features to the KiCad MCP Server, follow these steps:
See Development Guide for more details.
If you encounter issues:
Server Not Appearing in MCP Client:
mcp
packageServer Errors:
~/Library/Logs/Claude/mcp-server-kicad.log
(server-specific logs)~/Library/Logs/Claude/mcp.log
(general MCP logs)Working Directory Issues:
See Troubleshooting Guide for more details.
If you're still not able to troubleshoot, please open a Github issue.
Want to contribute to the KiCad MCP Server? Here's how you can help improve this project:
Key areas for contribution:
See CONTRIBUTING.md for detailed contribution guidelines.
Interested in contributing? Here are some ideas for future development:
This project is open source under the MIT license.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.