Design Rule Checks
The DRC tools let you run Design Rule Checks on your KiCad PCB designs, get detailed violation reports, track progress over time, and generate technology-specific rule sets. All DRC operations use kicad-cli and do not require a running KiCad instance.
Prerequisites
Section titled “Prerequisites”- KiCad 9.0 or newer installed
kicad-cliavailable in your system PATH (included with KiCad 9.0+)
Running a DRC check
Section titled “Running a DRC check”Run a DRC check on my project at /path/to/project.kicad_proThe run_drc_check tool:
- Locates the
.kicad_pcbfile for the project - Runs DRC via
kicad-cli pcb drc - Parses the JSON report to extract violations
- Saves results to DRC history
- Compares with previous runs (if available)
Viewing DRC reports
Section titled “Viewing DRC reports”Current report
Section titled “Current report”Show me the DRC report for /path/to/project.kicad_proLoads the kicad://drc/project_path resource, showing total violations, categorized issues, violation details with locations, and recommendations for common fixes.
DRC history
Section titled “DRC history”Show me the DRC history for /path/to/project.kicad_proLoads the kicad://drc/history/project_path resource, showing a visual trend of violations over time, table of all check runs, comparison between first and most recent checks, and progress indicators.
Understanding violations
Section titled “Understanding violations”Common categories
Section titled “Common categories”| Category | Description | Common fixes |
|---|---|---|
| Clearance | Items too close together | Increase spacing, reroute traces |
| Track Width | Traces too narrow | Increase trace width, check current requirements |
| Annular Ring | Via rings too small | Increase via size, adjust manufacturing settings |
| Drill Size | Holes too small | Increase drill diameter, check fab capabilities |
| Silkscreen | Silkscreen conflicts with pads | Adjust silkscreen position, resize text |
| Courtyard | Component courtyards overlap | Adjust placement, reduce footprint sizes |
Generating rule sets
Section titled “Generating rule sets”Technology-specific rules
Section titled “Technology-specific rules”Create a DRC rule set for HDI technologyThe create_drc_rule_set tool generates rules tailored to specific PCB technologies:
- standard — conventional PCB manufacturing
- HDI — high-density interconnect
- RF — radio frequency designs
- automotive — automotive-grade requirements
Exporting rules
Section titled “Exporting rules”Export DRC rules for RF technology in KiCad formatThe export_kicad_drc_rules tool outputs rules in KiCad-compatible text format, ready to paste into your project’s design rules.
Manufacturing constraints
Section titled “Manufacturing constraints”Get manufacturing constraints for automotive technologyThe get_manufacturing_constraints tool returns numeric limits (minimum track width, clearance, via size, etc.) along with design recommendations and notes for the specified technology.
Workflow
Section titled “Workflow”The DRC tools work alongside KiCad’s built-in DRC:
- Run the mckicad DRC check to get an overview and start tracking progress
- Use KiCad’s built-in DRC for interactive fixes (highlights exact locations in the editor)
- Re-run the mckicad DRC to verify fixes and update the history
Custom design rules
Section titled “Custom design rules”Use the DRC prompt templates for help creating specialized rules:
I need custom design rules for a high-voltage circuit with 2kV isolationThis provides guidance for high-voltage circuits, high-current paths, RF constraints, and specialized manufacturing requirements.
Troubleshooting
Section titled “Troubleshooting”DRC check fails
Section titled “DRC check fails”- Ensure the project exists at the specified path
- Verify the project contains a
.kicad_pcbfile - Check that
kicad-cliis in your PATH or setKICAD_CLI_PATH - Use the full absolute path to the project file
- Check the server logs for detailed error information
Incomplete results
Section titled “Incomplete results”- Verify the PCB file is not corrupted — try opening it in KiCad
- Ensure you are using KiCad 9.0+ for full kicad-cli DRC support
- Check that all referenced libraries are available