feat: add export_ipcd356 tool (kicad-cli, IPC-D-356 netlist)

New MCP tool `export_ipcd356` wrapping `kicad-cli pcb export ipcd356`:
generates an IPC-D-356 bare-board electrical-test netlist for flying-probe
and bed-of-nails testers. Minimal option set (outputPath + boardPath only,
matching the subcommand's --help). Self-contained interface handler reading
the saved .kicad_pcb.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gavin Colonese
2026-06-12 10:55:02 -04:00
parent 0f07ccd593
commit cdaa1eb635
3 changed files with 81 additions and 0 deletions

View File

@@ -534,5 +534,29 @@ export function registerExportTools(server: McpServer, callKicadScript: CommandF
},
);
// ------------------------------------------------------
// Export IPC-D-356 Netlist Tool (kicad-cli)
// ------------------------------------------------------
server.tool(
"export_ipcd356",
"Generate an IPC-D-356 bare-board electrical-test netlist via kicad-cli. Consumed by flying-probe and bed-of-nails testers. Reads the last SAVED state of the .kicad_pcb.",
{
outputPath: z.string().describe("Output .ipc / netlist file path"),
boardPath: z.string().optional().describe("Path to the .kicad_pcb (default: current board)"),
},
async (args) => {
logger.debug(`Exporting IPC-D-356 netlist to: ${args.outputPath}`);
const result = await callKicadScript("export_ipcd356", args);
return {
content: [
{
type: "text",
text: JSON.stringify(result),
},
],
};
},
);
logger.info("Export tools registered");
}