# kicad-mcp

> MCP Server

This repository provides a Model Context Protocol (MCP) server for KiCad, enabling communication with MCP-compliant clients like Claude Desktop for natural language interaction with KiCad projects. It supports macOS, Windows, and Linux.

## Overview

- **Category:** Developer Tools
- **Language:** Python
- **Stars:** 495
- **Forks:** 2
- **Owner:** lamaalrajih
- **GitHub:** https://github.com/lamaalrajih/kicad-mcp
- **Created:** 2025-03-20T04:47:00+00:00
- **Updated:** 2025-03-28T00:42:13+00:00
- **Source:** https://model-context-protocol.com/servers/kicad-model-context-protocol-mcp-server

## Setup

## Setup

### 1. Set Up Your Python Environment

```bash
# 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 Your Environment

Create a `.env` file to customize where the server looks for your KiCad projects:

```bash
# 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:

```bash
# Run in development mode
python -m mcp.dev main.py

# Or run directly
python main.py
```

### 4. Configure an MCP Client

Now, let's configure Claude Desktop to use our MCP server:

1. Create or edit the Claude Desktop configuration file:

```bash
# 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
```

2. Add the KiCad MCP server to the configuration:

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

### 5. Restart Your MCP Client

Close and reopen your MCP client to load the new configuration.

## Tools

## Available Tools

1.  Project Management: List, examine, and open KiCad projects.
2.  PCB Design Analysis: Get insights about your PCB designs and schematics.
3.  Netlist Extraction: Extract and analyze component connections from schematics.
4.  BOM Management: Analyze and export Bills of Materials.
5.  Design Rule Checking: Run DRC checks and track your progress over time.
6.  PCB Visualization: Generate visual representations of your PCB layouts.
7.  Circuit Pattern Recognition: Automatically identify common circuit patterns in your schematics.
