diff --git a/.gitignore b/.gitignore index 21b91f1..c13e2ca 100644 --- a/.gitignore +++ b/.gitignore @@ -89,6 +89,7 @@ Desktop.ini # Generated local config files (contain machine-specific paths) windows-mcp-config.json +.mcp.json # Personal notes / local contributions (not for upstream) myContribution/ diff --git a/CHANGELOG.md b/CHANGELOG.md index d00ab29..a140c5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,14 @@ All notable changes to the KiCAD MCP Server project are documented here. no-op removal, special-character escaping, UUID preservation, and the two new convenience tools. +### Removed + +- `add_schematic_junction` MCP tool has been removed. Junctions are now + inserted and removed automatically via `WireManager.sync_junctions` whenever + wires are added, deleted, or moved. +- Junction placement is pin-aware: `sync_junctions` consults component pin + positions so that T-junctions at component pins are correctly recognised. + --- ## [2.2.3] - 2026-03-11 diff --git a/python/commands/wire_manager.py b/python/commands/wire_manager.py index f52662d..bcbc257 100644 --- a/python/commands/wire_manager.py +++ b/python/commands/wire_manager.py @@ -32,6 +32,14 @@ _SYM_WIDTH = Symbol("width") _SYM_TYPE = Symbol("type") _SYM_UUID = Symbol("uuid") _SYM_SHEET_INSTANCES = Symbol("sheet_instances") +_SYM_JUNCTION = Symbol("junction") +_SYM_LIB_SYMBOLS = Symbol("lib_symbols") +_SYM_LIB_ID = Symbol("lib_id") +_SYM_MIRROR = Symbol("mirror") +_SYM_PIN = Symbol("pin") +_SYM_SYMBOL = Symbol("symbol") +_SYM_UNIT = Symbol("unit") +_IU_PER_MM = 10000 def _find_insertion_point(content: str) -> int: @@ -121,6 +129,11 @@ def _make_sheet_pin_text( class WireManager: """Manage wires in KiCad schematics using S-expression manipulation""" + # Regex to parse sub-unit names like "LM324_2_1" → (base="LM324", unit=2, style=1) + # The sub-unit suffix is __