KiCad MCP Server
An MCP server for KiCad providing project management, PCB design analysis, BOM management, and design rule checking.
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
| 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.
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
See Development Guide for more details.
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
mcppackage - Check if your KiCad installation is detected
-
Server Errors:
- Check the terminal output when running the server in development mode
- 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:
- The working directory for servers launched via client configs may be undefined
- 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
See Troubleshooting Guide for more details.
If you're still not able to troubleshoot, please open a Github issue.
Contributing
Want to contribute to the KiCad MCP Server? Here's how you can help improve this project:
- Fork the repository
- Create a feature branch
- Add your changes
- Submit a pull request
Key areas for contribution:
- Adding support for more component patterns in the Circuit Pattern Recognition system
- Improving documentation and examples
- Adding new features or enhancing existing ones
- Fixing bugs and improving error handling
See CONTRIBUTING.md for detailed contribution guidelines.
Future Development Ideas
Interested in contributing? Here are some ideas for future development:
- 3D Model Visualization - Implement tools to visualize 3D models of PCBs
- PCB Review Tools - Create annotation features for design reviews
- Manufacturing File Generation - Add support for generating Gerber files and other manufacturing outputs
- Component Search - Implement search functionality for components across KiCad libraries
- BOM Enhancement - Add supplier integration for component sourcing and pricing
- Interactive Design Checks - Develop interactive tools for checking design quality
- Web UI - Create a simple web interface for configuration and monitoring
- Circuit Analysis - Add automated circuit analysis features
- Test Coverage - Improve test coverage across the codebase
- Circuit Pattern Recognition - Expand the pattern database with more component types and circuit topologies
License
This project is open source under the MIT license.
관련 서버
Alpha Vantage MCP Server
스폰서Access financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Claude Code MCP
Orchestrates multiple Claude Code agents across iTerm2 sessions, providing centralized management and inter-agent communication.
MockLoop
An AI-native API testing platform for generating scenarios, executing tests, and analyzing results.
Codebase Context Dumper
Easily provide codebase context to Large Language Models (LLMs).
Choose MCP Server
An MCP server for integration with the Claude Desktop Client, with optional DBT manifest path configuration.
WinTerm MCP
Provides programmatic access to the Windows terminal, enabling AI models to interact with the command line interface.
LLMS.TXT Documentation Server
Access and read llms.txt documentation files for various Large Language Models.
Keycloak MCP Server
An MCP server for Keycloak administration, offering over 30 tools to manage users, realms, clients, roles, and more from AI assistants.
Repo Map
An MCP server (and command-line tool) to provide a dynamic map of chat-related files from the repository with their function prototypes and related files in order of relevance. Based on the "Repo Map" functionality in Aider.chat
BCMS MCP
Give me a one - two sentence description of the BCMS MCP # MCP The BCMS Model Context Protocol (MCP) integration enables AI assistants like Claude, Cursor, and other MCP-compatible tools to interact directly with your BCMS content. This allows you to create, read, and update content entries, manage media files, and explore your content structure—all through natural language conversations with AI. ## What is MCP? The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard developed by Anthropic that allows AI applications to securely connect to external data sources and tools. With BCMS MCP support, you can leverage AI assistants to: - Query and explore your content structure - Create new content entries with AI-generated content - Update existing entries - Manage your media library - Get intelligent suggestions based on your content model --- ## Getting Started ### Prerequisites 1. A BCMS account with an active instance 2. An MCP key with appropriate permissions 3. An MCP-compatible client (Claude Desktop, Cursor, or any MCP client) ### Step 1: Create an MCP Key 1. Navigate to your BCMS dashboard 2. Go to Settings → MCP 3. Click Create MCP Key 4. Configure the permissions for templates you want the AI to access:GET: Read entries 5. POST: Create entries 6. PUT: Update entries 7. DELETE: Delete entries Note: Right now, MCP only supports creating, reading and updating content. ### Step 2: Configure Your MCP Client You can find full instructions for integrating BCMS with your AI tools right inside BCMS, on the MCP page. But in general, installing BCMS MCP works in a standard way: ``` { "mcpServers": { "bcms": { "url": "https://app.thebcms.com/api/v3/mcp?mcpKey=YOUR_MCP_KEY" } } } ``` ## Available Tools Once connected, your AI assistant will have access to the following tools based on your MCP key permissions: ### Content Discovery #### list_templates_and_entries Lists all templates and their entries that you have access to. This is typically the first tool to call when exploring your BCMS content. Returns: - Template IDs, names, and slugs - Entry IDs with titles and slugs for each language Example prompt: "Show me all the templates and entries in my BCMS" --- ### Entry Management #### list_entries_for_{templateId} Retrieves all entries for a specific template with full content data. A separate tool is generated for each template you have access to. Returns: - Complete entry data including all meta fields - Content in all configured languages - Entry statuses Example prompt: "List all blog posts from my Blog template" --- #### create_entry_for_{templateId} Creates a new entry for a specific template. The input schema is dynamically generated based on your template's field structure. Input: - statuses: Array of status assignments per language - meta: Array of metadata for each language (title, slug, custom fields) - content: Array of content nodes for each language Example prompt: "Create a new blog post titled 'Getting Started with BCMS' with a brief introduction paragraph" --- #### update_entry_for_{templateId} Updates an existing entry for a specific language. Input: - entryId: The ID of the entry to update - lng: Language code (e.g., "en") - status: Optional status ID - meta: Updated metadata - content: Updated content nodes Example prompt: "Update the introduction paragraph of my 'Getting Started' blog post" --- ### Media Management #### list_all_media Lists all media files in your media library. Returns: - Media IDs, names, and types - File metadata (size, dimensions for images) - Parent directory information Example prompt: "Show me all images in my media library" --- #### list_media_dirs Lists the directory structure of your media library. Returns: - Hierarchical directory structure - Directory IDs and names Example prompt: "Show me the folder structure of my media library" --- #### create-media-directory Creates a new directory in your media library. Input: - name: Name of the directory - parentId: Optional parent directory ID (root if not specified) Example prompt: "Create a new folder called 'Blog Images' in my media library" --- #### request-upload-media-url Returns a URL you use to upload a file (for example via POST with multipart form data), which avoids pushing large binaries through the MCP tool payload. You still need a valid file name and MIME type when uploading, as described in the tool response. Availability: Only when the MCP key has Can mutate media enabled. Example prompt: “Give me an upload URL for a new hero image, then tell me how to upload it.” Input: - fileName: Name of the file with extension - fileData: Base64-encoded file data (with data URI prefix) - parentId: Optional parent directory ID Example prompt: "Upload this image to my Blog Images folder" --- ### Linking Tools #### get_entry_pointer_link Generates an internal BCMS link to an entry for use in content. Input: - entryId: The ID of the entry to link to Returns: - Internal link format: entry:{entryId}@*_{templateId}:entry Example prompt: "Get me the internal link for the 'About Us' page entry" --- #### get_media_pointer_link Generates an internal BCMS link to a media item for use in content. Input: - mediaId: The ID of the media item Returns: - Internal link format: media:{mediaId}@*_@*_:entry Example prompt: "Get the link for the hero image so I can use it in my blog post" --- ## Content Structure ### Entry Content Nodes When creating or updating entries, content is structured as an array of nodes. Supported node types include: Type Description paragraph Standard text paragraph heading Heading (h1-h6) bulletList Unordered list orderedList Numbered list listItem List item codeBlock Code block with syntax highlighting blockquote Quote block image Image node widget Custom widget with props ### Example Content Structure ``` { "content": [ { "lng": "en", "nodes": [ { "type": "heading", "attrs": { "level": 1 }, "content": [ { "type": "text", "text": "Welcome to BCMS" } ] }, { "type": "paragraph", "content": [ { "type": "text", "text": "This is your first paragraph." } ] } ] } ] } ``` ## Security & Permissions ### MCP Key Scopes Your MCP key controls what the AI can access: - Template Access: Only templates explicitly granted in the MCP key are visible - Operation Permissions: Each template can have independent GET/POST/PUT/DELETE permissions - Media Access: Media operations are controlled separately ### Best Practices 1. Principle of Least Privilege: Only grant the permissions needed for your use case 2. Separate Keys: Create different MCP keys for different purposes or team members 3. Regular Rotation: Periodically rotate your MCP keys ## Use Cases ### Content Creation Workflows Blog Post Creation "Create a new blog post about the benefits of headless CMS. Include an introduction, three main benefits with explanations, and a conclusion. Use the Blog template." Product Updates "Update the price field for all products in the Electronics category to apply a 10% discount" ### Content Exploration Content Audit "List all blog posts that don't have a featured image set" Translation Status "Show me which entries are missing German translations" ### Media Organization Library Cleanup "Show me all unused images in the media library" Folder Setup "Create folder structure for: Products > Categories > Electronics, Clothing, Home" ## Troubleshooting ### Common Issues #### "MCP key not found" - Verify your MCP key format: keyId.keySecret.instanceId - Ensure the MCP key hasn't been deleted or deactivated - Check that you're using the correct instance #### "MCP key does not have access to template" - Review your MCP key permissions in the dashboard - Ensure the required operation (GET/POST/PUT/DELETE) is enabled for the template #### Session Expired - MCP sessions may timeout after periods of inactivity - Simply start a new conversation to establish a fresh session ### Getting Help - Documentation: [thebcms.com/docs](https://thebcms.com/docs) - Support: [[email protected]](mailto:[email protected]) - Community: [Join BCMS Discord](https://discord.com/invite/SYBY89ccaR) for community support ## Technical Reference ### Endpoint POST https://app.thebcms.com/api/v3/mcp?mcpKey={MCP_KEY} ### Transport BCMS MCP uses the Streamable HTTP transport with session management. Sessions are maintained via the mcp-session-id header. ### Response Format All tools return structured JSON responses conforming to the MCP specification with: - content: Array of content blocks - structuredContent: Typed response data ## Rate Limits MCP requests are subject to the same rate limits as API requests: - Requests are tracked per MCP key - Contact support if you need higher limits for production workloads
Apifox
A TypeScript MCP server to access Apifox API data via Stdio.