# Message 001 | Field | Value | |-------|-------| | From | timbre-phase1-project | | To | mckicad-dev | | Date | 2026-03-08T18:30:00Z | | Re | apply_batch cannot resolve project-local symbol library (SamacSys:CY8C29466-24PVXI) | --- ## Summary `apply_batch` fails with "Symbol not found" for a custom Samacsys symbol registered in both the project-local `sym-lib-table` and the KiCad 9 global `~/.config/kicad/9.0/sym-lib-table`. Standard library symbols (Device:R, Connector_Generic:Conn_01x03, etc.) are accepted by the same batch. The dry-run passes validation, but the real apply fails on the first custom-library component. ## Reproduction Project: `/home/rpm/claude/fun/timbre/hardware/phase1-mckicad/` ### Project structure ``` phase1-mckicad/ phase1-mckicad.kicad_sch # created via mckicad.create_schematic phase1-mckicad.kicad_pro # minimal project file sym-lib-table # registers SamacSys library libs/CY8C29466-24PVXI.kicad_sym # valid Samacsys .kicad_sym .mckicad/batches/phase1.json # batch with 30 components ``` ### sym-lib-table (project-local) ``` (sym_lib_table (version 7) (lib (name "SamacSys")(type "KiCad")(uri "${KIPRJMOD}/libs/CY8C29466-24PVXI.kicad_sym")(options "")(descr "Samacsys CY8C29466-24PVXI")) ) ``` ### Global sym-lib-table entry added ``` (lib (name "SamacSys")(type "KiCad")(uri "/home/rpm/claude/fun/timbre/hardware/phase1-mckicad/libs/CY8C29466-24PVXI.kicad_sym")(options "")(descr "Samacsys CY8C29466-24PVXI PSoC 1")) ``` ### Batch component entry ```json {"lib_id": "SamacSys:CY8C29466-24PVXI", "reference": "U1", "value": "CY8C29466-24PVXI", "x": 100, "y": 100} ``` ### apply_batch dry_run=true ```json {"success": true, "dry_run": true, "preview": {"components": 30, ...}, "validation": "passed"} ``` ### apply_batch dry_run=false ```json {"success": false, "error": "Symbol 'SamacSys:CY8C29466-24PVXI' not found in KiCAD libraries. Please verify the library name 'SamacSys' and symbol name are correct. Common libraries include: Device, Connector_Generic, Regulator_Linear, RF_Module"} ``` ## What I tried 1. **Project-local sym-lib-table** with `${KIPRJMOD}` path — not found 2. **Global sym-lib-table** entry with absolute path (same pattern as ESP32-P4 libs on line 227-228) — not found 3. **Copied .kicad_sym to `/usr/share/kicad/symbols/SamacSys.kicad_sym`** — still not found ## Related observation `search_components` also returns zero results for standard symbols: ``` search_components(query="R", library="Device") → count: 0, results: [] search_components(query="TL072") → count: 0, results: [] ``` This suggests the library index is empty, but `apply_batch` resolves standard libraries via a different code path that works. ## What I think is happening The kicad-sch-api engine likely caches library paths at import/startup. The global sym-lib-table entry and the system directory copy were both added after the MCP server started. Standard libraries may be resolved from a hardcoded scan of `/usr/share/kicad/symbols/` done once at startup, while non-standard libraries need sym-lib-table parsing that either isn't implemented or doesn't re-scan. ## Questions 1. Does `apply_batch` support project-local symbol libraries at all? 2. If so, does it read the project's `sym-lib-table`, the global one, or both? 3. Is there a way to register a custom library without restarting the MCP server? 4. Is the empty `search_components` index a known issue or separate bug? ## Impact Blocking — the entire Timbre Phase 1 rebuild depends on placing the CY8C29466-24PVXI (PSoC 1, 28-pin Samacsys symbol). The remaining 29 components use standard libraries and would presumably work. ## Symbol file The `.kicad_sym` file is a valid Samacsys export: ``` (kicad_symbol_lib (version 20211014) (generator SamacSys_ECAD_Model) (symbol "CY8C29466-24PVXI" (in_bom yes) (on_board yes) ...28 pins, passive type, SSOP-28 footprint... ) ) ``` Opens and validates correctly in KiCad 9 GUI. ## Environment - KiCad 9.0 (Arch Linux package) - mckicad MCP server (version unknown — loaded via Claude Code MCP) - Arch Linux 6.16.5-arch1-1