VISUAL_FEEDBACK.mdโข6.31 kB
# Visual Feedback: Seeing MCP Changes in KiCAD UI
This document explains how to see changes made by the MCP server in the KiCAD UI in real-time or near-real-time.
## Current Status (Week 1 - SWIG Backend)
**Active Backend:** SWIG (legacy pcbnew Python API)
**Real-time Updates:** Not available yet
**IPC Backend:** Skeleton implemented, operations coming in Weeks 2-3
---
## ๐ฏ Best Current Workflow (SWIG + Manual Reload)
### Setup
1. **Open your project in KiCAD PCB Editor**
```bash
pcbnew /tmp/kicad_test_project/New_Project.kicad_pcb
```
2. **Make changes via MCP** (Claude Code, Claude Desktop, etc.)
- Example: Add board outline, mounting holes, etc.
- Each operation saves the file automatically
3. **Reload in KiCAD UI**
- **Option A (Automatic):** KiCAD 8.0+ detects file changes and shows a reload prompt
- **Option B (Manual):** File โ Revert to reload from disk
- **Keyboard shortcut:** None by default (but you can assign one)
### Workflow Example
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Terminal: Claude Code โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ You: "Create a 100x80mm board with 4 mounting holes" โ
โ โ
โ Claude: โ Added board outline (100x80mm) โ
โ โ Added mounting hole at (5,5) โ
โ โ Added mounting hole at (95,5) โ
โ โ Added mounting hole at (95,75) โ
โ โ Added mounting hole at (5,75) โ
โ โ Saved project โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ KiCAD PCB Editor โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ [Reload prompt appears] โ
โ "File has been modified. Reload?" โ
โ โ
โ Click "Yes" โ Changes appear instantly! ๐ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
---
## ๐ฎ Future: IPC Backend (Weeks 2-3)
When fully implemented, the IPC backend will provide **true real-time updates**:
### How It Will Work
```
Claude MCP โ IPC Socket โ Running KiCAD โ Instant UI Update
```
**No file reloading required** - changes appear as you make them!
### IPC Setup (When Available)
1. **Enable IPC in KiCAD**
- Preferences โ Advanced Preferences
- Search for "IPC"
- Enable: "Enable IPC API Server"
- Restart KiCAD
2. **Install kicad-python** (Already installed โ)
```bash
pip install kicad-python
```
3. **Configure MCP Server**
Add to your MCP config:
```json
{
"env": {
"KICAD_BACKEND": "ipc"
}
}
```
4. **Start KiCAD first, then use MCP**
- Changes will appear in real-time
- No manual reloading needed
### Current IPC Status
| Feature | Status |
|---------|--------|
| Connection to KiCAD | โ
Working |
| Version checking | โ
Working |
| Project operations | โณ Week 2-3 |
| Board operations | โณ Week 2-3 |
| Component operations | โณ Week 2-3 |
| Routing operations | โณ Week 2-3 |
---
## ๐ ๏ธ Monitoring Helper (Optional)
A helper script is available to monitor file changes:
```bash
# Watch for changes and notify
./scripts/auto_refresh_kicad.sh /tmp/kicad_test_project/New_Project.kicad_pcb
```
This will print a message each time the MCP server saves changes.
---
## ๐ก Tips for Best Experience
### 1. Side-by-Side Windows
```
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ Claude Code โ KiCAD PCB โ
โ (Terminal) โ Editor โ
โ โ โ
โ Making changes โ Viewing results โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
```
### 2. Quick Reload Workflow
- Keep KiCAD focused in one window
- Make changes via Claude in another
- Press Alt+Tab โ Click "Reload" โ See changes
- Repeat
### 3. Save Frequently
The MCP server auto-saves after each operation, so changes are immediately available for reload.
### 4. Verify Before Complex Operations
For complex changes (multiple components, routing, etc.):
1. Make the change
2. Reload in KiCAD
3. Verify it looks correct
4. Proceed with next change
---
## ๐ Troubleshooting
### KiCAD Doesn't Detect File Changes
**Cause:** Some KiCAD versions or configurations don't auto-detect
**Solution:** Use File โ Revert manually
### Changes Don't Appear After Reload
**Cause:** MCP operation may have failed
**Solution:** Check the MCP response for success: true
### File is Locked
**Cause:** KiCAD has the file open exclusively
**Solution:**
- KiCAD should allow external modifications
- If not, close the file in KiCAD, let MCP make changes, then reopen
---
## ๐
Roadmap
**Current (Week 1):** SWIG backend with manual reload
**Week 2-3:** IPC backend implementation
**Week 4+:** Real-time collaboration features
---
**Last Updated:** 2025-10-26
**Version:** 2.0.0-alpha.1