### Copy Example .env File Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Copy the example .env file to create your own configuration file. This is the first step in configuring the server using a .env file. ```bash cp .env.example .env ``` -------------------------------- ### Set up Python Development Environment Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Create and activate a virtual environment, then install development dependencies using pip. ```bash # Create and activate a virtual environment python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install development dependencies pip install -r requirements.txt ``` -------------------------------- ### Run the Server Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Execute the main Python script to start the server. Ensure this is the first step in debugging. ```bash python main.py ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://github.com/f4ieh/kicad-mcp/blob/main/README.md Clone the KiCad MCP repository, create and activate a virtual environment, and install project dependencies using pip. ```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 ``` -------------------------------- ### Example Schematic Output Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md This is an example output format for schematic analysis, showing component details and estimated counts. ```text # Schematic: my_project.kicad_sch ## Components (Estimated Count: 42) (symbol (lib_id "Device:R") (at 127 87.63 0) (unit 1) (symbol (lib_id "Device:C") (at 142.24 90.17 0) (unit 1) (symbol (lib_id "MCU_Microchip_ATmega:ATmega328P-PU") (at 170.18 88.9 0) (unit 1) ... and 39 more components ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/f4ieh/kicad-mcp/blob/main/README.md Copy the example environment file and edit it to specify custom project directories for KiCad. ```bash # Copy the example environment file cp .env.example .env # Edit the .env file vim .env ``` ```dotenv # Add paths to your KiCad projects (comma-separated) KICAD_SEARCH_PATHS=~/pcb,~/Electronics,~/Projects/KiCad ``` -------------------------------- ### Install Dependencies with Pip Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Use this command to install all necessary Python packages listed in the requirements file. Ensure you are in the project's root directory. ```bash pip install -r requirements.txt ``` -------------------------------- ### Open KiCad Project Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/project_guide.md Use this prompt to launch a specific KiCad project directly within the KiCad application. Ensure KiCad is installed correctly. ```text Can you open my KiCad project at /path/to/your/project.kicad_pro? ``` -------------------------------- ### Run the KiCad MCP Server Source: https://github.com/f4ieh/kicad-mcp/blob/main/README.md Execute the main Python script to start the KiCad MCP server in development mode or directly. ```bash # Run in development mode python -m mcp.dev main.py # Or run directly python main.py ``` -------------------------------- ### Check Python Version Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Verify that your installed Python version meets the minimum requirement (3.10 or higher). This command displays the current Python version. ```bash python --version ``` -------------------------------- ### Get PCB Dimensions Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Retrieve the dimensions of your PCB layout to understand the physical size constraints of the board. ```text What are the dimensions of my PCB at /path/to/project.kicad_pcb? ``` -------------------------------- ### Extract Schematic Components Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Use this prompt to get a list of all components, their values, footprints, and connection information from a KiCad schematic file. ```text What components are in my schematic at /path/to/project.kicad_sch? ``` -------------------------------- ### Set KiCad Application Path Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Configure the KICAD_APP_PATH environment variable if KiCad is installed in a non-standard location. This helps the system find the KiCad executable. ```env KICAD_APP_PATH=/path/to/KiCad/KiCad.app ``` -------------------------------- ### Update Server Arguments to Absolute Path Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Modify the client configuration to use an absolute path for the server script. This prevents issues related to the working directory when the server starts. ```json "args": ["/absolute/path/to/main.py"] ``` -------------------------------- ### Get Specific Schematic Component Values Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Query for specific component values, such as all resistor values, within a schematic to understand component usage and design choices. ```text What are all the resistor values in my schematic at /path/to/project.kicad_sch? ``` -------------------------------- ### Configure Claude Desktop MCP Client Source: https://github.com/f4ieh/kicad-mcp/blob/main/README.md Set up the Claude Desktop configuration file to include the KiCad MCP server details. ```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 ``` ```json { "mcpServers": { "kicad": { "command": "/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/venv/bin/python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/main.py" ] } } } ``` -------------------------------- ### Windows Configuration File Creation Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Create the configuration directory and file for Claude Desktop on Windows. ```batch mkdir -p %APPDATA%\Claude notepad %APPDATA%\Claude\claude_desktop_config.json ``` -------------------------------- ### List All KiCad Projects Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/project_guide.md Use this prompt to discover and list all available KiCad projects on your system. The server searches standard directories and custom paths. ```text Could you list all my KiCad projects? ``` -------------------------------- ### View Formatted Netlist Report Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md This command loads the `kicad://netlist/project_path` resource to display a formatted netlist report, including component and net summaries, connection details, and potential issues. ```bash Show me the netlist report for /path/to/project.kicad_sch ``` -------------------------------- ### List Components on Power Net Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md This command lists all components connected to a specified power net, such as VCC. Ensure the project path is accurate. ```bash List all components connected to the VCC net in my project at /path/to/project.kicad_pro ``` -------------------------------- ### Run Server in Development Mode Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Use this command to run the server in development mode for more detailed output, which can help in diagnosing issues. ```bash python -m mcp.dev main.py ``` -------------------------------- ### Compare Netlist and BOM Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md Use this command to compare the netlist and Bill of Materials for your project. Ensure the path to your project file is correct. ```bash Compare the netlist and BOM for my project at /path/to/project.kicad_pro ``` -------------------------------- ### macOS Configuration File Creation Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Create the configuration directory and file for Claude Desktop on macOS. ```bash mkdir -p ~/Library/Application\ Support/Claude vim ~/Library/Application\ Support/Claude/claude_desktop_config.json ``` -------------------------------- ### Configure KiCad Search Paths Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Specify directories where the server should look for KiCad projects by setting the KICAD_SEARCH_PATHS environment variable. Separate multiple paths with commas. ```env KICAD_SEARCH_PATHS=~/pcb,~/Electronics,~/Projects/KiCad ``` -------------------------------- ### Run KiCad MCP Server in Development Mode Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Execute the server using the development mode for enhanced debugging capabilities. ```bash # Run with development server for better debugging python -m mcp.dev main.py ``` -------------------------------- ### KiCad MCP Server Configuration with Environment Variables Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Configure the KiCad MCP Server with custom environment variables for search paths. ```json { "mcpServers": { "kicad": { "command": "/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/venv/bin/python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/main.py" ], "env": { "KICAD_SEARCH_PATHS": "/custom/path1,/custom/path2", "KICAD_APP_PATH": "/custom/path" } } } } ``` -------------------------------- ### Verify Power Connections Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md Use this command to ensure all integrated circuits in your project have their power connections correctly verified. ```bash Verify power connections for all ICs in my project at /path/to/project.kicad_pro ``` -------------------------------- ### Export New BOM for KiCad Project Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/bom_guide.md Use this prompt to export a new BOM if one does not already exist. The tool finds the schematic, uses KiCad's command-line tools to generate the BOM, and saves it in the project directory. ```text Can you export a BOM for my KiCad project at /Users/username/Documents/KiCad/my_project/my_project.kicad_pro? ``` -------------------------------- ### View KiCad Project Details Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/project_guide.md Prompt to retrieve detailed information about a specific KiCad project, including its files, settings, and metadata. Requires the project file path. ```text Show me details about my KiCad project at /path/to/your/project.kicad_pro ``` ```text # Project: my_project ## Project Files - **project**: /path/to/my_project.kicad_pro - **schematic**: /path/to/my_project.kicad_sch - **pcb**: /path/to/my_project.kicad_pcb - **netlist**: /path/to/my_project_netlist.net ## Project Settings - **version**: 20210606 - **generator**: pcbnew - **board_thickness**: 1.6 ``` -------------------------------- ### View Claude Desktop Config (Windows) Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Display the contents of the Claude Desktop configuration file on Windows to check MCP server settings. This helps diagnose client integration issues. ```bash type %APPDATA%\Claude\claude_desktop_config.json ``` -------------------------------- ### Analyze Component Connections Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md Use this command to find all connections for a specific component within a schematic. It provides detailed component information, pin connections, and net names. ```bash Show me the connections for U1 in my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### View Circuit Pattern Report for Project Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Generates a formatted report of identified circuit patterns within a KiCad project, including summaries and detailed information. ```bash Show me the circuit patterns in my KiCad project at /path/to/project.kicad_pro ``` -------------------------------- ### Registering a New Tool Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Define and register a new tool (action or computation function) with the MCP server. This requires a function decorated with `@mcp.tool` and its registration in `server.py`. Tools can report progress and log information. ```python from typing import Dict, Any from mcp.server.fastmcp import FastMCP, Context def register_my_tools(mcp: FastMCP) -> None: """Register my custom tools with the MCP server.""" @mcp.tool() async def my_custom_tool(parameter: str, ctx: Context) -> Dict[str, Any]: """Description of what this tool does. Args: parameter: Description of parameter ctx: MCP context for progress reporting Returns: Dictionary with tool results """ # Report progress to the user await ctx.report_progress(10, 100) ctx.info(f"Starting operation on {parameter}") # Implementation goes here # Complete progress await ctx.report_progress(100, 100) ctx.info("Operation complete") return { "success": True, "message": "Operation completed successfully", "result": "Some result data" } ``` ```python from kicad_mcp.tools.my_tools import register_my_tools def create_server() -> FastMCP: # ... register_my_tools(mcp) # ... ``` -------------------------------- ### Validate KiCad Project Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Run this prompt to check a KiCad project for completeness and correctness, including missing files and valid formats. It helps identify issues before opening the project in KiCad. ```text Validate my KiCad project at /path/to/project.kicad_pro ``` -------------------------------- ### KiCad MCP Server Project Structure Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Overview of the modular architecture of the KiCad MCP Server, detailing the main entry point, package structure, and sub-modules. ```tree kicad-mcp/ ├── main.py # Entry point ├── kicad_mcp/ # Main package │ ├── __init__.py │ ├── server.py # Server creation and setup │ ├── config.py # Configuration settings │ ├── context.py # Lifespan context management │ ├── resources/ # Resource handlers │ │ ├── __init__.py │ │ ├── projects.py # Project listing resources │ │ ├── files.py # File content resources │ │ ├── drc_resources.py # DRC report resources │ │ └── bom_resources.py # BOM resources │ ├── tools/ # Tool handlers │ │ ├── __init__.py │ │ ├── project_tools.py # Project management tools │ │ ├── analysis_tools.py # Design analysis tools │ │ ├── drc_tools.py # DRC check tools │ │ ├── export_tools.py # Export and thumbnail tools │ │ └── bom_tools.py # BOM management tools │ ├── prompts/ # Prompt templates │ │ ├── __init__.py │ │ ├── templates.py # General KiCad prompts │ │ ├── drc_prompt.py # DRC-specific prompts │ │ └── bom_prompts.py # BOM-specific prompts │ └── utils/ # Utility functions │ ├── __init__.py │ ├── file_utils.py # File handling utilities │ ├── kicad_utils.py # KiCad-specific functions │ ├── python_path.py # Python path setup for KiCad modules │ ├── drc_history.py # DRC history tracking │ └── env.py # Environment variable handling ``` -------------------------------- ### Show Power Nets Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md This command lists all nets designated as power nets within your schematic. Provide the correct path to your schematic file. ```bash Show me all power nets in my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### KiCad MCP Server Configuration (Unix-like) Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Add the KiCad MCP Server configuration to the Claude Desktop JSON file for Unix-like systems. ```json { "mcpServers": { "kicad": { "command": "/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/venv/bin/python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/kicad-mcp/main.py" ] } } } ``` -------------------------------- ### Compare BOMs Across Projects Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/bom_guide.md Use this format to compare BOMs between different projects or revisions. Provide the paths to the respective project files. ```text Can you compare the BOMs between my projects at /path/to/project_v1.kicad_pro and /path/to/project_v2.kicad_pro? ``` -------------------------------- ### Registering a New Prompt Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Define and register a new reusable prompt template with the MCP server. This involves creating a function decorated with `@mcp.prompt` and registering it in `server.py`. Prompts are strings that can be used for common interactions. ```python from mcp.server.fastmcp import FastMCP def register_my_prompts(mcp: FastMCP) -> None: """Register my custom prompts with the MCP server.""" @mcp.prompt() def my_custom_prompt() -> str: """Description of what this prompt is for.""" prompt = """ I need help with [specific task] in KiCad. Please assist me with: 1. [First aspect] 2. [Second aspect] 3. [Third aspect] My KiCad project is located at: [Enter the full path to your .kicad_pro file here] [Additional contextual information or instructions] """ return prompt ``` ```python from kicad_mcp.prompts.my_prompts import register_my_prompts def create_server() -> FastMCP: # ... register_my_prompts(mcp) # ... ``` -------------------------------- ### Find Specific Power Supply Circuits Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Searches a schematic for all instances of power supply circuits. ```bash Find all power supply circuits in my schematic at /path/to/schematic.kicad_sch ``` -------------------------------- ### Edit .env File Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Open the .env file using a text editor to add your custom configuration settings. This allows for persistent configuration across server runs. ```bash vim .env ``` -------------------------------- ### Compare Digital Interfaces Across Projects Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md This command allows for a comparison of the digital interfaces used across all your KiCad projects. ```text Compare the digital interfaces used across all my KiCad projects ``` -------------------------------- ### Verify Environment Variables Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Check if environment variables, specifically KICAD_SEARCH_PATHS, are loaded correctly. This helps diagnose issues related to configuration loading. ```python python -c "import os; print(os.environ.get('KICAD_SEARCH_PATHS', 'Not set'))" ``` -------------------------------- ### Run Pytest Tests Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Commands for running tests using the pytest framework. Includes options for running all tests, specific files, and with verbose output. ```bash # Run all tests pytest ``` ```bash # Run specific test file pytest tests/test_resources.py ``` ```bash # Run with verbose output pytest -v ``` -------------------------------- ### KiCad MCP Server Configuration (Windows) Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Add the KiCad MCP Server configuration to the Claude Desktop JSON file for Windows. ```json { "mcpServers": { "kicad": { "command": "C:\\Path\\To\\Your\\Project\\kicad-mcp\\venv\\Scripts\\python.exe", "args": [ "C:\\Path\\To\\Your\\Project\\kicad-mcp\\main.py" ] } } } ``` -------------------------------- ### View Formatted BOM Report Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/bom_guide.md Request a formatted BOM report for a KiCad project. This loads the `kicad://bom/project_path` resource and displays a comprehensive overview including component counts, types, cost estimates, and optimization suggestions. ```text Show me the BOM report for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro ``` -------------------------------- ### Monitor Server Logs on macOS Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Use the tail command to continuously monitor the mcp-server-kicad.log file on macOS. This is useful for real-time debugging of server-specific issues. ```bash tail -n 20 -F ~/Library/Logs/Claude/mcp-server-kicad.log ``` -------------------------------- ### Analyze Circuit Patterns in KiCad Project Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md This command analyzes circuit patterns within a KiCad project by finding and processing its associated schematic file. ```bash Analyze circuit patterns in my KiCad project at /path/to/project.kicad_pro ``` -------------------------------- ### Identify Power Connections in Schematic Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Use this prompt to find all power connections within a schematic, aiding in the verification of power distribution network design. ```text Show me all the power connections in my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### Registering a New Resource Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Define and register a new read-only resource with the MCP server. This involves creating a function decorated with `@mcp.resource` and then calling its registration function in `server.py`. ```python from mcp.server.fastmcp import FastMCP def register_my_resources(mcp: FastMCP) -> None: """Register my custom resources with the MCP server.""" @mcp.resource("kicad://my-resource/{parameter}") def my_custom_resource(parameter: str) -> str: """Description of what this resource provides. Args: parameter: Description of parameter Returns: Formatted data for the LLM """ # Implementation goes here return f"Formatted data about {parameter}" ``` ```python from kicad_mcp.resources.my_resources import register_my_resources def create_server() -> FastMCP: # ... register_my_resources(mcp) # ... ``` -------------------------------- ### Custom BOM Analysis Query Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/bom_guide.md Use this format to ask specific questions about your BOM for deeper analysis, such as component optimization. Reference your project's BOM file path. ```text Looking at the BOM for my project at /path/to/project.kicad_pro, can you suggest ways to reduce the variety of resistor values while maintaining the same functionality? ``` -------------------------------- ### View Claude Desktop Config (macOS) Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Display the contents of the Claude Desktop configuration file on macOS to check MCP server settings. This helps diagnose client integration issues. ```bash cat ~/Library/Application\ Support/Claude/claude_desktop_config.json ``` -------------------------------- ### Analyze PCB Layout Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Use this prompt to gather information about a PCB layout, including board dimensions, layer structure, component placement, and trace characteristics. ```text Analyze the PCB layout at /path/to/project.kicad_pcb ``` -------------------------------- ### Query KiCad Projects with PCB Files Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/project_guide.md Filter projects based on the presence of PCB files and their directory location. Useful for finding projects in a specific workspace. ```text Show me all KiCad projects in my ~/Electronics directory that have a PCB file ``` -------------------------------- ### Extract Netlist from Schematic Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md Use this command to parse a schematic file, extract component information, identify connections, analyze nets, and return comprehensive netlist data. ```bash Extract the netlist from my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### Access Lifespan Context in KiCad MCP Tool Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/development.md Demonstrates how to access and utilize the typed lifespan context (KiCadAppContext) within a KiCad MCP tool. Shows how to check for KiCad module availability and use the cache for expensive operations. ```python from kicad_mcp.context import KiCadAppContext @mcp.tool() def my_tool(parameter: str, ctx: Context) -> Dict[str, Any]: """Example tool using lifespan context.""" # Access the typed context app_context: KiCadAppContext = ctx.request_context.lifespan_context # Check if KiCad modules are available if app_context.kicad_modules_available: # Use KiCad Python modules pass else: # Fall back to alternative method pass # Use the cache to store expensive results cache_key = f"my_operation_{parameter}" if cache_key in app_context.cache: return app_context.cache[cache_key] # Perform operation result = {} # Cache the result app_context.cache[cache_key] = result return result ``` -------------------------------- ### KiCad MCP Server Project Structure Source: https://github.com/f4ieh/kicad-mcp/blob/main/README.md Overview of the directory layout for the KiCad MCP Server project. This structure helps in understanding the organization of different modules and components. ```text 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 ``` -------------------------------- ### Monitor General MCP Logs on macOS Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Use the tail command to continuously monitor the general mcp.log file on macOS. This helps in tracking broader application behavior. ```bash tail -n 20 -F ~/Library/Logs/Claude/mcp.log ``` -------------------------------- ### Analyze Connectivity in Microcontroller and Sensor Interfaces Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Use this command to analyze the specific connections between microcontroller and sensor interfaces within your design. ```text Analyze the connections between the microcontroller and sensor interfaces in my design ``` -------------------------------- ### Find Specific Microcontroller Circuits Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Searches a KiCad project for all instances of microcontroller circuits. ```bash Show me the microcontroller circuits in my KiCad project at /path/to/project.kicad_pro ``` -------------------------------- ### Identify Circuit Patterns in Schematic Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Use this command to parse a schematic, apply pattern recognition algorithms, and generate a report of identified circuit blocks. ```bash Identify circuit patterns in my schematic at /path/to/schematic.kicad_sch ``` -------------------------------- ### Analyze KiCad Project BOM Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/bom_guide.md Use this prompt to analyze an existing BOM for your KiCad project. The tool searches for BOM files, parses component data, and generates a report with counts, categories, and cost estimates. ```text Please analyze the BOM for my KiCad project at /Users/username/Documents/KiCad/my_project/my_project.kicad_pro ``` -------------------------------- ### Configure KiCad Paths in .env File Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Set environment variables within the .env file to define KiCad project directories and the KiCad application path. This method is recommended for managing server configuration. ```dotenv # KiCad MCP Server Configuration # KiCad User Directory (where KiCad stores project files) KICAD_USER_DIR=~/Documents/KiCad # Additional directories to search for KiCad projects (comma-separated) KICAD_SEARCH_PATHS=~/pcb,~/Electronics,~/Projects/KiCad # KiCad application path (needed for opening projects and command-line tools) # macOS: KICAD_APP_PATH=/Applications/KiCad/KiCad.app # Windows: # KICAD_APP_PATH=C:\ Program Files\KiCad # Linux: # KICAD_APP_PATH=/usr/share/kicad ``` -------------------------------- ### Find Projects with Switching Regulator Circuits Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md This command searches your KiCad directory for projects that contain switching regulator circuits. ```text Find all projects in my KiCad directory that contain switching regulator circuits ``` -------------------------------- ### Identify Most Common Components Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/project_guide.md Discover the most frequently used components across your KiCad projects. This analysis aids in inventory management and component selection. ```text Which components are most commonly used across my KiCad projects? ``` -------------------------------- ### Run DRC Check with KiCad CLI Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/drc_guide.md Initiates a DRC check on a KiCad project using the `run_drc_check` tool. This method is recommended for KiCad 9.0+ as it utilizes the `kicad-cli` for analysis without needing a running KiCad instance. ```text Please run a DRC check on my project at /Users/username/Documents/KiCad/my_project/my_project.kicad_pro ``` -------------------------------- ### Add New Microcontroller Patterns Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Update the `mcu_patterns` dictionary to include regular expressions for new microcontroller families. This allows the system to recognize these components in schematics. ```python mcu_patterns = { # Existing patterns... "AVR": r"ATMEGA\d+|ATTINY\d+|AT90\w+", "STM32": r"STM32\w+", # Add your new pattern here "Renesas": r"R[A-Z]\d+|RL78|RX\d+", } ``` -------------------------------- ### Check for Floating Inputs Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md Execute this command to validate your schematic by checking for any unconnected input pins. ```bash Check for floating inputs in my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### Natural Language Circuit Pattern Request Source: https://github.com/f4ieh/kicad-mcp/blob/main/README.md Use this natural language request to ask the LLM to identify patterns within a specific circuit, such as a temperature sensor. ```text I'm working on the temperature sensor circuit. Can you identify what patterns it uses? ``` -------------------------------- ### Extract Netlist from KiCad Project Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/netlist_guide.md This command extracts the netlist from a KiCad project by finding the associated schematic and parsing it. It provides comprehensive netlist information. ```bash Extract the netlist for my KiCad project at /path/to/project.kicad_pro ``` -------------------------------- ### Set KiCad User Directory Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Define a custom directory for KiCad user data and projects using the KICAD_USER_DIR environment variable. This ensures custom project locations are recognized. ```env KICAD_USER_DIR=~/Documents/KiCadProjects ``` -------------------------------- ### Analyze BOM for Digital Interface Circuits Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md This command helps analyze the Bill of Materials breakdown for components used in the digital interface circuits of your design. ```text Show me the BOM breakdown for the digital interface circuits in my design ``` -------------------------------- ### Test Server with MCP Inspector Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Utilize the MCP Inspector to directly test the server. This tool is useful for isolating and debugging server-side functionalities. ```bash npx @modelcontextprotocol/inspector uv --directory . run main.py ``` -------------------------------- ### Query KiCad Projects Modified Recently Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/project_guide.md Ask specific questions about project modification dates. This query helps identify recently updated projects. ```text Which of my KiCad projects were modified in the last week? ``` -------------------------------- ### Calculate Average Board Size Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/project_guide.md Obtain statistical insights into board dimensions across all your KiCad projects. This helps in understanding typical project scales. ```text What's the average board size across all my KiCad projects? ``` -------------------------------- ### Review Power Distribution Network Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Perform a comprehensive review of the power distribution network in your schematic to ensure stable and reliable power delivery. ```text Review the power distribution network in my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### Find Specific Components in Schematic Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Locate specific types of components, like decoupling capacitors, in your schematic to ensure proper design practices are followed. ```text Find all decoupling capacitors in my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### Trace Signal Path in Schematic Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Trace a specific signal path, such as the clock signal, through your schematic to understand signal flow and identify potential issues. ```text Trace the clock signal path in my schematic at /path/to/project.kicad_sch ``` -------------------------------- ### Customize KiCad File Extensions Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/configuration.md Modify the KICAD_EXTENSIONS dictionary in `kicad_mcp/config.py` to add or change recognized file extensions for KiCad projects. ```python # File extensions KICAD_EXTENSIONS = { "project": ".kicad_pro", "pcb": ".kicad_pcb", "schematic": ".kicad_sch", # Add or modify extensions as needed } ``` -------------------------------- ### View Raw CSV BOM Data Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/bom_guide.md Retrieve raw BOM data in CSV format for your KiCad project. This loads the `kicad://bom/project_path/csv` resource, providing data suitable for import into spreadsheets or other tools. ```text Can I see the raw CSV BOM data for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro? ``` -------------------------------- ### View JSON BOM Data Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/bom_guide.md Access structured BOM data in JSON format for your KiCad project. This loads the `kicad://bom/project_path/json` resource, offering a machine-readable representation of all BOM data for programmatic processing. ```text Show me the JSON BOM data for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro ``` -------------------------------- ### Implement New Circuit Recognition Function Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Define a new Python function to identify a specific type of circuit. This function should take component and netlist data as input and return a list of identified circuits. ```python def identify_motor_drivers(components: Dict[str, Any], nets: Dict[str, Any]) -> List[Dict[str, Any]]: """Identify motor driver circuits in the schematic.""" # Your implementation here ... ``` -------------------------------- ### Locate Windows Logs Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/troubleshooting.md Access the directory where MCP logs are stored on Windows. This is necessary for manual inspection of log files to diagnose issues. ```text %APPDATA%\Claude\Logs\ ``` -------------------------------- ### Find DRC Issues in Power Supply Circuits Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/pattern_guide.md Use this command to identify Design Rule Check issues specifically within the power supply circuits of your schematic. ```text Find DRC issues affecting the power supply circuits in my schematic ``` -------------------------------- ### View Current DRC Report Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/drc_guide.md Retrieves the current DRC status and violation details for a specified KiCad project. This command loads the `kicad://drc/project_path` resource to display violation counts, categories, and specific issue locations. ```text Show me the DRC report for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro ``` -------------------------------- ### Count Vias in PCB Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Determine the number of vias present in your PCB layout, which can be useful for estimating manufacturing costs and assessing board complexity. ```text How many vias are in my PCB at /path/to/project.kicad_pcb? ``` -------------------------------- ### View DRC History Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/drc_guide.md Accesses the historical DRC data for a KiCad project to track changes and trends over time. This command loads the `kicad://drc/history/project_path` resource, providing visual trends and a table of past checks. ```text Show me the DRC history for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro ``` -------------------------------- ### Check PCB for EMI Issues Source: https://github.com/f4ieh/kicad-mcp/blob/main/docs/analysis_guide.md Analyze your PCB layout for potential electromagnetic interference (EMI) issues to improve signal integrity and reduce unwanted emissions. ```text Check my PCB at /path/to/project.kicad_pcb for potential EMI issues ``` -------------------------------- ### Natural Language DRC Request Source: https://github.com/f4ieh/kicad-mcp/blob/main/README.md This natural language query allows the LLM to understand your intent to check for design rule violations without needing the full project path. ```text Can you check if there are any design rule violations in my Arduino shield project? ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.