KiCAD MCP Bot
62d97f1fa6
feat: Dynamic symbol loading - CORE FUNCTIONALITY WORKING! 🎉
...
**MAJOR BREAKTHROUGH:** Implemented dynamic symbol loading from KiCad library files!
This eliminates the 13-component limitation and enables access to ALL KiCad symbols.
**What Works (Phase A Complete):**
✅ Symbol extraction from .kicad_sym library files
✅ S-expression parsing and manipulation
✅ Dynamic injection of symbols into schematics
✅ Template instance creation for cloning
✅ Full end-to-end workflow tested successfully
**Test Results:**
- Loaded 5 symbols dynamically (R, C, LED, L, D) from Device.kicad_sym
- Injected symbol definitions into schematic's lib_symbols section
- Created template instances at offscreen positions
- Successfully cloned components from dynamic templates
- All operations work with kicad-skip library
**New File:**
- python/commands/dynamic_symbol_loader.py (400+ lines)
- DynamicSymbolLoader class
- find_kicad_symbol_libraries() - cross-platform library discovery
- parse_library_file() - S-expression parsing with caching
- extract_symbol_definition() - extract specific symbols
- inject_symbol_into_schematic() - inject symbols into lib_symbols
- create_template_instance() - create cloneable templates
- load_symbol_dynamically() - complete workflow
**Modified:**
- python/commands/component_schematic.py
- Added dynamic loader integration hooks
- get_or_create_template() method for hybrid approach
- Falls back to static templates gracefully
**How It Works:**
1. Parse .kicad_sym file with sexpdata library
2. Extract specific symbol definition (S-expression tree)
3. Inject into schematic's lib_symbols section
4. Create offscreen template instance (_TEMPLATE_Device_R)
5. kicad-skip can clone() the template to create components
**Benefits:**
- Access to ~10,000+ standard KiCad symbols
- No manual template maintenance required
- Works with ANY .kicad_sym library file
- Maintains static template fallback
**Next Steps (Integration):**
- Wire through MCP interface layer (has schematic path)
- Create add_schematic_component_dynamic MCP tool
- Add symbol search/discovery tools
- Cross-platform testing (Windows, macOS)
**Technical Notes:**
- Uses sexpdata library for S-expression manipulation
- Caches parsed libraries for performance
- Generates unique UUIDs for template instances
- Positions templates offscreen (y = -100 - offset)
- Preserves schematic structure and formatting
This is a MASSIVE step forward! The hardest part (S-expression manipulation
and template injection) is DONE and WORKING. 🚀
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-10 10:10:57 -05:00
KiCAD MCP Bot
4a543313eb
feat: Expand schematic component support from 3 to 13 types + plan dynamic loading
...
Issue #26 Follow-up: The original fix only supported 3 component types (R, C, LED).
This expands the template-based approach to 13 types while planning for unlimited access.
**Expanded Template (Option 1 - Immediate Solution):**
- Added 10 new component types to template
- Passives: R, C, L, Crystal (4 types)
- Semiconductors: D, LED, Q_NPN, Q_NMOS (4 types)
- ICs: OpAmp, Voltage Regulator (2 types)
- Connectors: Conn_2pin, Conn_4pin (2 types)
- Misc: Switch/Button (1 type)
**Components Now Supported:**
1. Resistor (R)
2. Capacitor (C)
3. Inductor (L)
4. Crystal (Y)
5. Diode (D)
6. LED
7. NPN Transistor (Q_NPN)
8. N-Channel MOSFET (Q_NMOS)
9. Op-Amp (U)
10. Voltage Regulator (U_REG)
11. 2-pin Connector (J2)
12. 4-pin Connector (J4)
13. Push Button/Switch (SW)
**Implementation:**
- Created template_with_symbols_expanded.kicad_sch with all 13 types
- Updated TEMPLATE_MAP with comprehensive type mappings
- Updated project.py to use expanded template by default
- All tests passing (13/13 components added successfully)
**Future Plan (Option 2 - Dynamic Library Loading):**
- Documented comprehensive plan for accessing ALL KiCad symbols (~10,000+)
- Dynamic loading from .kicad_sym library files
- S-expression injection approach
- 6-8 week implementation timeline
- Maintains template fallback for compatibility
**Files Added:**
- python/templates/template_with_symbols_expanded.kicad_sch
- docs/DYNAMIC_LIBRARY_LOADING_PLAN.md
**Files Modified:**
- python/commands/component_schematic.py (expanded TEMPLATE_MAP)
- python/commands/project.py (use expanded template)
This provides immediate value (13 types vs 3) while we plan the long-term
solution of unlimited symbol access through dynamic library loading.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-10 09:54:51 -05:00
KiCAD MCP Bot
994965e041
feat: Complete Phase 1 & 2 - Schematic workflow fix and JLCPCB integration
...
Phase 1: Schematic Workflow Fix (Issue #26 )
- Fixed broken schematic workflow using template-based symbol cloning
- Updated create_project to generate both PCB and schematic files
- Rewrote add_schematic_component to use kicad-skip clone() API
- Added template schematics with cloneable R, C, LED symbols
- All schematic tests now passing
Phase 2: JLCPCB Integration Complete
- Integrated JLCSearch public API (no authentication required)
- Access to ~100k JLCPCB parts with real-time stock and pricing
- Implemented parametric search for resistors, capacitors, components
- Added package-to-footprint mapping for KiCad integration
- Cost optimization with Basic vs Extended library classification
- Alternative part suggestions with price comparison
New Components:
- python/commands/jlcsearch.py - JLCSearch API client
- python/templates/ - Template schematics for symbol cloning
- docs/JLCPCB_INTEGRATION.md - Comprehensive API documentation
- docs/SCHEMATIC_WORKFLOW_FIX.md - Phase 1 technical details
- CHANGELOG.md - Consolidated unified changelog
- PHASE_2_COMPLETE.md - Phase 2 implementation summary
MCP Tools Available:
- download_jlcpcb_database - Download full parts catalog
- search_jlcpcb_parts - Parametric search with filters
- get_jlcpcb_part - Part details + footprint suggestions
- get_jlcpcb_database_stats - Database statistics
- suggest_jlcpcb_alternatives - Find similar/cheaper parts
Technical Improvements:
- SQLite database with FTS5 full-text search
- HMAC-SHA256 authentication support (official JLCPCB API)
- Improved .gitignore to exclude credentials and databases
- Template-based schematic creation workflow
Testing:
- All integration tests passing
- Database operations validated
- Live API connectivity confirmed
- Schematic workflow end-to-end verified
Credits:
- JLCSearch API: @tscircuit
- Local JLCPCB search: @l3wi
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-10 09:04:56 -05:00
Lewis Freiberg
0227dd48d2
feat: Add local symbol library search and 3rd party library support ( #25 )
...
Adds comprehensive local KiCad symbol library search functionality and fixes KICAD9_3RD_PARTY environment variable resolution.
Features:
- Symbol library search by name, LCSC ID, description, manufacturer, MPN
- Support for 3rd party libraries installed via Plugin and Content Manager
- New MCP tools: search_symbols, list_symbol_libraries, get_symbol_info
- Enhanced library path resolution for KiCad 8 and 9
This enables users with locally installed JLCPCB libraries to search and use components directly.
Co-authored-by: l3wi <l3wi@users.noreply.github.com >
2025-12-31 10:57:10 -05:00
KiCAD MCP Bot
e4c7119c51
feat: Week 1 complete - Linux support + IPC API prep
...
🎉 Major v2.0 rebuild kickoff - Week 1 accomplished!
## Highlights
### Cross-Platform Support 🌍
- ✅ Linux primary platform (Ubuntu/Debian tested)
- ✅ Windows fully supported
- ✅ macOS experimental support
- ✅ Platform-agnostic path handling (XDG spec)
- ✅ Auto-detection of KiCAD installation
### Infrastructure 🏗️
- ✅ GitHub Actions CI/CD pipeline
- ✅ Pytest framework with 20+ tests
- ✅ Pre-commit hooks (Black, MyPy, ESLint)
- ✅ Automated Linux installation script
- ✅ Enhanced npm scripts
### IPC API Migration Prep 🚀
- ✅ Comprehensive migration plan (30 pages)
- ✅ Backend abstraction layer (800+ lines)
- ✅ Factory pattern with auto-detection
- ✅ SWIG backward compatibility wrapper
- ✅ IPC backend skeleton ready
### Documentation 📚
- ✅ Updated README (Linux installation)
- ✅ CONTRIBUTING.md guide
- ✅ Linux compatibility audit
- ✅ IPC API migration plan
- ✅ Session summaries
- ✅ Platform-specific config templates
## Files Changed
- 27 files created
- ~3,000 lines of code/docs
- 8 comprehensive documentation pages
- 20+ unit tests
- 5 abstraction layer modules
## Next Steps
- Week 2: IPC API migration (project.py → component.py → routing.py)
- Migrate from deprecated SWIG to official IPC API
- JLCPCB/Digikey integration prep
🤖 Generated with Claude Code
https://claude.com/claude-code
Co-Authored-By: Claude <noreply@anthropic.com >
2025-10-25 20:48:00 -04:00