feat: Extend IPC backend with 21 commands and hybrid footprint placement

- Add IPC handlers for zone operations (add_copper_pour, refill_zones)
- Add IPC handlers for board operations (add_board_outline, add_mounting_hole, get_layer_list)
- Add IPC handlers for component operations (rotate_component, get_component_properties)
- Add IPC handlers for net operations (delete_trace, get_nets_list)
- Implement hybrid footprint placement (SWIG library loading + IPC placement)
- Extend create_schematic to handle filename, title, projectName params
- Update documentation for IPC backend status and known issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
KiCAD MCP Bot
2025-12-03 08:48:37 -05:00
parent 03d7de980a
commit 119f1dfc16
6 changed files with 1040 additions and 446 deletions

View File

@@ -1,60 +1,17 @@
# Known Issues & Workarounds
**Last Updated:** 2025-10-26
**Version:** 2.0.0-alpha.2
**Last Updated:** 2025-12-02
**Version:** 2.1.0-alpha
This document tracks known issues and provides workarounds where available.
---
## 🐛 Current Issues
## Current Issues
### 1. Component Placement Fails - Library Path Not Found
### 1. `get_board_info` KiCAD 9.0 API Issue
**Status:** 🔴 **BLOCKING** - Cannot place components
**Symptoms:**
```
Error: Could not find footprint library
```
**Root Cause:** MCP server doesn't have access to KiCAD's footprint library paths
**Workaround:** None currently - feature not usable
**Fix Plan:** Week 2 priority
- Detect KiCAD library paths from environment
- Add configuration for custom library paths
- Integrate JLCPCB/Digikey part databases
**Tracking:** High Priority - Required for any real PCB design
---
### 2. Routing Operations Untested with KiCAD 9.0
**Status:** 🟡 **UNKNOWN** - May have API compatibility issues
**Affected Commands:**
- `route_trace`
- `add_via`
- `add_copper_pour`
- `route_differential_pair`
**Symptoms:** May fail with API type mismatch errors (like set_board_size did)
**Workaround:** None - needs testing and fixes
**Fix Plan:** Week 2 priority
- Test each routing command with KiCAD 9.0
- Fix API compatibility issues
- Add comprehensive routing examples
---
### 3. `get_board_info` KiCAD 9.0 API Issue
**Status:** 🟡 **KNOWN** - Non-critical
**Status:** KNOWN - Non-critical
**Symptoms:**
```
@@ -65,26 +22,37 @@ AttributeError: 'BOARD' object has no attribute 'LT_USER'
**Workaround:** Use `get_project_info` instead for basic project details
**Fix Plan:** Week 2
- Update to use KiCAD 9.0 layer constants
- Add backward compatibility for KiCAD 8.x
**Impact:** Low - informational command only
---
### 4. UI Auto-Reload Requires Manual Confirmation
### 2. Zone Filling via SWIG Causes Segfault
**Status:** 🟢 **BY DESIGN** - Will be fixed by IPC
**Status:** KNOWN - Workaround available
**Symptoms:**
- MCP makes changes
- KiCAD detects file change
- User must click "Reload" button to see changes
- Copper pours created but not filled automatically when using SWIG backend
- Calling `ZONE_FILLER` via SWIG causes segfault
**Workaround Options:**
1. Use IPC backend (zones fill correctly via IPC)
2. Open the board in KiCAD UI - zones fill automatically when opened
**Impact:** Medium - affects copper pour visualization until opened in KiCAD
---
### 3. UI Manual Reload Required (SWIG Backend)
**Status:** BY DESIGN - Fixed by IPC
**Symptoms:**
- MCP makes changes via SWIG backend
- KiCAD doesn't show changes until file is reloaded
**Current Workflow:**
```
1. Claude makes change via MCP
1. MCP makes change via SWIG
2. KiCAD shows: "File has been modified. Reload? [Yes] [No]"
3. User clicks "Yes"
4. Changes appear in UI
@@ -92,45 +60,88 @@ AttributeError: 'BOARD' object has no attribute 'LT_USER'
**Why:** SWIG-based backend requires file I/O, can't push changes to running UI
**Fix Plan:** Weeks 2-3 - IPC Backend Migration
- Connect to KiCAD via IPC socket
- Make changes directly in running instance
- No file reload needed - instant visual feedback
**Fix:** Use IPC backend for real-time updates (requires KiCAD to be running with IPC enabled)
**Workaround:** This is the current expected behavior - just click reload!
**Workaround:** Click reload prompt or use File > Revert
---
## 🔧 Recently Fixed
### 4. IPC Backend Experimental
### ✅ KiCAD Process Detection (Fixed 2025-10-26)
**Status:** UNDER DEVELOPMENT
**Description:**
The IPC backend is currently being implemented and tested. Some commands may not work as expected in all scenarios.
**Known IPC Limitations:**
- KiCAD must be running with IPC enabled
- Some commands fall back to SWIG (e.g., delete_trace)
- Footprint loading uses hybrid approach (SWIG for library, IPC for placement)
- Error handling may not be comprehensive in all cases
**Workaround:** If IPC fails, the server automatically falls back to SWIG backend
---
### 5. Schematic Support Limited
**Status:** KNOWN - Partial support
**Description:**
Schematic operations use the kicad-skip library which has some limitations with KiCAD 9.0 file format changes.
**Affected Commands:**
- `create_schematic`
- `add_schematic_component`
- `add_schematic_wire`
**Workaround:** Manual schematic creation may be more reliable for complex designs
---
## Recently Fixed
### Component Library Integration (Fixed 2025-11-01)
**Was:** Could not find footprint libraries
**Now:** Auto-discovers 153 KiCAD footprint libraries, search and list working
### Routing Operations KiCAD 9.0 (Fixed 2025-11-01)
**Was:** Multiple API compatibility issues with KiCAD 9.0
**Now:** All routing commands tested and working:
- `netinfo.FindNet()` -> `netinfo.NetsByName()[name]`
- `zone.SetPriority()` -> `zone.SetAssignedPriority()`
- `ZONE_FILL_MODE_POLYGON` -> `ZONE_FILL_MODE_POLYGONS`
### KiCAD Process Detection (Fixed 2025-10-26)
**Was:** `check_kicad_ui` detected MCP server's own processes
**Now:** Properly filters to only detect actual KiCAD binaries
### set_board_size KiCAD 9.0 (Fixed 2025-10-26)
### set_board_size KiCAD 9.0 (Fixed 2025-10-26)
**Was:** Failed with `BOX2I_SetSize` type error
**Now:** Works with KiCAD 9.0 API, backward compatible with 8.x
**Now:** Works with KiCAD 9.0 API
### add_board_text KiCAD 9.0 (Fixed 2025-10-26)
### add_board_text KiCAD 9.0 (Fixed 2025-10-26)
**Was:** Failed with `EDA_ANGLE` type error
**Now:** Works with KiCAD 9.0 API, backward compatible with 8.x
**Now:** Works with KiCAD 9.0 API
### ✅ Missing add_board_text Command (Fixed 2025-10-26)
### Schematic Parameter Mismatch (Fixed 2025-12-02)
**Was:** Command not found error
**Now:** Properly mapped to Python handler
**Was:** `create_schematic` failed due to parameter name differences between TypeScript and Python
**Now:** Accepts multiple parameter naming conventions (`name`, `projectName`, `title`, `filename`)
---
## 📋 Reporting New Issues
## Reporting New Issues
If you encounter an issue not listed here:
1. **Check MCP logs:** `~/.kicad-mcp/logs/kicad_interface.log`
2. **Check KiCAD version:** `pcbnew --version` (must be 9.0+)
2. **Check KiCAD version:** `python3 -c "import pcbnew; print(pcbnew.GetBuildVersion())"` (must be 9.0+)
3. **Try the operation in KiCAD directly** - is it a KiCAD issue?
4. **Open GitHub issue** with:
- Error message
@@ -141,18 +152,18 @@ If you encounter an issue not listed here:
---
## 🎯 Priority Matrix
## Priority Matrix
| Issue | Priority | Impact | Effort | Status |
|-------|----------|--------|--------|--------|
| Component Library Integration | 🔴 Critical | High | Medium | Week 2 |
| Routing KiCAD 9.0 Compatibility | 🟡 High | High | Low | Week 2 |
| IPC Backend (Real-time UI) | 🟡 High | Medium | High | Week 2-3 |
| get_board_info Fix | 🟢 Low | Low | Low | Week 2 |
| Issue | Priority | Impact | Status |
|-------|----------|--------|--------|
| IPC Backend Testing | High | Medium | In Progress |
| get_board_info Fix | Low | Low | Known |
| Zone Filling (SWIG) | Medium | Medium | Workaround Available |
| Schematic Support | Medium | Medium | Partial |
---
## 💡 General Workarounds
## General Workarounds
### Server Won't Start
```bash
@@ -169,15 +180,25 @@ python3 python/utils/platform_helper.py
# Always run open_project after server restart
```
### KiCAD UI Doesn't Show Changes
### KiCAD UI Doesn't Show Changes (SWIG Mode)
```
# File Revert (or click reload prompt)
# File > Revert (or click reload prompt)
# Or: Close and reopen file in KiCAD
# Or: Use IPC backend for automatic updates
```
### IPC Not Connecting
```
# Ensure KiCAD is running
# Enable IPC: Preferences > Plugins > Enable IPC API Server
# Have a board open in PCB editor
# Check socket exists: ls /tmp/kicad/api.sock
```
---
**Need Help?**
- Check [docs/VISUAL_FEEDBACK.md](VISUAL_FEEDBACK.md) for workflow tips
- Check [docs/UI_AUTO_LAUNCH.md](UI_AUTO_LAUNCH.md) for UI setup
- Check [IPC_BACKEND_STATUS.md](IPC_BACKEND_STATUS.md) for IPC details
- Check [REALTIME_WORKFLOW.md](REALTIME_WORKFLOW.md) for workflow tips
- Check logs: `~/.kicad-mcp/logs/kicad_interface.log`
- Open an issue on GitHub