KiCad MCP server

Enables Claude to analyze and validate KiCad electronic design projects through PCB visualization, design rule checking, and schematic analysis for improved troubleshooting and manufacturing preparation.
Back to servers
Provider
Lama Alrajih
Release date
Mar 20, 2025
Language
Python
Stats
70 stars

The KiCad MCP Server provides an interface between KiCad PCB design software and AI assistants that implement the Model Context Protocol (MCP), enabling you to interact with your KiCad projects through natural language. This allows you to analyze PCB designs, check design rules, manage BOMs, and more through conversation with compatible clients like Claude Desktop.

Prerequisites

  • macOS, Windows, or Linux with KiCad installed
  • Python 3.10 or higher
  • KiCad 9.0 or higher
  • Claude Desktop (or another MCP client)
  • Basic familiarity with the terminal

Installation

1. Set Up Python Environment

# Clone the repository
git clone https://github.com/lamaalrajih/kicad-mcp.git .

# Create a virtual environment and activate it
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install the MCP SDK and other dependencies
pip install -r requirements.txt

2. Configure Environment

Create a .env file to specify 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

Start the MCP server:

python main.py

4. Configure an MCP Client

Set up Claude Desktop to use the KiCad MCP server:

  1. 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
  1. 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.

Using the KiCad MCP Server

Available Features

  • 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
  • BOM Management: Analyze and export Bills of Materials
  • Design Rule Checking: Run DRC checks using the KiCad CLI
  • PCB Visualization: Generate visual representations of PCB layouts
  • Circuit Pattern Recognition: Identify common circuit patterns in schematics

Natural Language Interaction

You don't need to use formal commands or full file paths. Instead, you can use natural language requests like:

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 MCP client will interpret your request and communicate with the KiCad MCP Server to get the information you need.

Configuration Options

The 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

Troubleshooting

If you encounter issues:

Server Not Appearing in MCP Client

  • Check your client's configuration file for errors
  • Make sure the path to your project and Python interpreter is correct
  • Ensure Python can access the mcp package
  • Check if your KiCad installation is detected

Server Errors

  • Check the terminal output when running the server
  • Check Claude logs at:
    • ~/Library/Logs/Claude/mcp-server-kicad.log (server-specific logs)
    • ~/Library/Logs/Claude/mcp.log (general MCP logs)

Working Directory Issues

  • Always use absolute paths in your configuration and .env files
  • For testing servers via command line, the working directory will be where you run the command

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later