kicad-mcp/docs/drc_guide.md
Lama 100f64186d Add Design Rule Check (DRC) functionality to KiCad MCP server
This commit implements comprehensive DRC support including:
- DRC check tool integration with both pcbnew Python module and CLI fallback
- Detailed DRC reports as resources with violation categorization
- Historical tracking of DRC results with visual trend analysis
- Comparison between current and previous DRC runs
- New prompt templates for fixing violations and custom design rules
- Full documentation in drc_guide.md

The DRC system helps users track their progress over time, focusing on the
most critical design rule violations as they improve their PCB designs.
2025-03-20 02:41:52 -04:00

4.0 KiB

KiCad Design Rule Check (DRC) Guide

This guide explains how to use the Design Rule Check (DRC) features in the KiCad MCP Server.

Overview

The Design Rule Check (DRC) functionality allows you to:

  1. Run DRC checks on your KiCad PCB designs
  2. Get detailed reports of violations
  3. Track your progress over time as you fix issues
  4. Compare current results with previous checks

Using DRC Features

Running a DRC Check

To run a DRC check on your KiCad project:

  1. In Claude Desktop, select the KiCad MCP server from the tools dropdown
  2. Use the run_drc_check tool with your project path:
Please run a DRC check on my project at /Users/username/Documents/KiCad/my_project/my_project.kicad_pro

The tool will:

  • Analyze your PCB design for rule violations
  • Generate a comprehensive report
  • Save the results to your DRC history
  • Compare with previous runs (if available)

Viewing DRC Reports

There are two ways to view DRC information:

Current DRC Report

To view the current DRC status of your project:

Show me the DRC report for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro

This will load the kicad://drc/project_path resource, showing:

  • Total number of violations
  • Categorized list of issues
  • Violation details with locations
  • Recommendations for fixing common issues

DRC History

To see how your project's DRC status has changed over time:

Show me the DRC history for /Users/username/Documents/KiCad/my_project/my_project.kicad_pro

This will load the kicad://drc/history/project_path resource, showing:

  • A visual trend of violations over time
  • Table of all DRC check runs
  • Comparison between first and most recent checks
  • Progress indicators

Getting Help with DRC Issues

If you need help understanding or fixing DRC violations, use the "Fix DRC Violations" prompt template:

  1. Click on the prompt templates button in Claude Desktop
  2. Select "Fix DRC Violations"
  3. Fill in the specifics about your DRC issues
  4. Claude will provide guidance on resolving the violations

Understanding DRC Results

Violation Categories

Common DRC violation categories include:

Category Description Common Fixes
Clearance Items are too close together Increase spacing, reroute traces
Track Width Traces are too narrow Increase trace width, reconsider current requirements
Annular Ring Via rings are too small Increase via size, adjust PCB manufacturing settings
Drill Size Holes are too small Increase drill diameter, check manufacturing capabilities
Silkscreen Silkscreen conflicts with pads Adjust silkscreen position, resize text
Courtyard Component courtyards overlap Adjust component placement, reduce footprint sizes

Progress Tracking

The DRC history feature tracks your progress over time, helping you:

  • Identify if you're making progress (reducing violations)
  • Spot when new violations are introduced
  • Focus on resolving the most common issues
  • Document your design improvements

Advanced Usage

Custom Design Rules

If your project has specific requirements, you can use the "Custom Design Rules" prompt template to get help creating specialized rules for:

  • High-voltage circuits
  • High-current paths
  • RF design constraints
  • Specialized manufacturing requirements

Integrating with KiCad

The DRC checks are designed to work alongside KiCad's built-in DRC tool:

  1. Run the MCP server's DRC check to get an overview and track progress
  2. Use KiCad's built-in DRC for interactive fixes (which highlight the exact location in the editor)
  3. Re-run the MCP server's DRC to verify your fixes and update the history

Troubleshooting

DRC Check Fails

If the DRC check fails to run:

  1. Ensure your KiCad project exists at the specified path
  2. Verify that the project contains a PCB file (.kicad_pcb)
  3. Check that the KiCad installation is detected correctly
  4. Try using the full absolute path to your project file