Autoroute
autorouteAutomatically route PCB traces by running Freerouting on the current board, exporting to Specctra DSN and importing the routed result. Supports best-of-N attempts to maximize routed nets.
Instructions
Run Freerouting autorouter on the current PCB. Exports to Specctra DSN, runs Freerouting CLI, and imports the routed SES result. Requires Java 11+ and freerouting.jar (see check_freerouting). Set attempts > 1 to run best-of-N: Freerouting is invoked multiple times with varied --max-passes, each result is scored by (nets_routed * 1000 + segments, +50000 bonus when every targetNets entry routed), and the winning SES is imported. Single-attempt behaviour is unchanged when attempts is omitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | Per-attempt timeout in seconds (default: 300) | |
| attempts | No | Number of Freerouting runs to try (default: 1 — backward-compatible). When > 1, runs best-of-N: scores each attempt by routing completeness and keeps the SES with the highest score. Recommended: 3–5 for dense boards. | |
| boardPath | No | Path to .kicad_pcb file (default: current board) | |
| maxPasses | No | Maximum routing passes for single-attempt mode (default: 20). Ignored when `attempts` > 1; use `passSchedule` instead. | |
| targetNets | No | Optional list of critical net names. An attempt that routes all of them earns a 50,000-point scoring bonus, breaking ties in favour of designs that include the must-have nets. | |
| passSchedule | No | Per-attempt `--max-passes` values to cycle through (default: [50, 60, 65, 70, 75, 80, 85, 90, 55, 95]). The list wraps if `attempts` exceeds its length. | |
| freeroutingJar | No | Path to freerouting.jar (default: ~/.kicad-mcp/freerouting.jar or FREEROUTING_JAR env) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |