70 Commits

Author SHA1 Message Date
67f3e92858 Add revolutionary conversational README showcasing complete EDA automation
Transform the project documentation from technical specs to an engaging
story that demonstrates the revolutionary capabilities we've built:

## New README Highlights

### 🎯 Story-Driven Approach
- Leads with the vision: "What if AI could design circuits for you?"
- Shows real conversation examples with AI automation
- Demonstrates complete workflows from concept to production
- Uses narrative to explain complex technical achievements

### 🌟 Key Sections
- **The Revolution**: Before/after comparison showing transformation
- **Real Examples**: Actual conversation flows showing AI automation
- **Technology Stack**: Clear explanation of integrated technologies
- **The Experience**: Complete workflow from natural language to PCB
- **Technical Deep Dive**: Architecture for developers
- **Performance Metrics**: Real benchmarks and quality scores

### 💡 Engaging Features
- Emoji-driven visual hierarchy for easy scanning
- Real conversation examples showing AI interactions
- Step-by-step workflow demonstrations
- Community-focused contribution guidelines
- Future roadmap with exciting developments

### 🚀 Impact
- Positions KiCad MCP as revolutionary EDA automation platform
- Shows progression from simple file analysis to complete automation
- Demonstrates real-world applications for different user types
- Establishes vision for future of AI-driven electronic design

This README transforms technical documentation into compelling narrative
that shows visitors exactly what makes this project revolutionary and
how it can transform their electronic design workflow.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 22:59:09 -06:00
04237dcdad Implement revolutionary KiCad MCP server with FreeRouting & IPC API integration
This massive feature update transforms the KiCad MCP server into a complete
EDA automation platform with real-time design capabilities:

## Major New Features

### KiCad IPC API Integration (`utils/ipc_client.py`)
- Real-time KiCad communication via kicad-python library
- Component placement and manipulation
- Live board analysis and statistics
- Real-time routing status monitoring
- Transaction-based operations with rollback support

### FreeRouting Integration (`utils/freerouting_engine.py`)
- Complete automated PCB routing pipeline
- DSN export → FreeRouting processing → SES import workflow
- Parameter optimization for different routing strategies
- Multi-technology support (standard, HDI, RF, automotive)
- Routing quality analysis and reporting

### Automated Routing Tools (`tools/routing_tools.py`)
- `route_pcb_automatically()` - Complete automated routing
- `optimize_component_placement()` - AI-driven placement optimization
- `analyze_routing_quality()` - Comprehensive routing analysis
- `interactive_routing_session()` - Guided routing assistance
- `route_specific_nets()` - Targeted net routing

### Complete Project Automation (`tools/project_automation.py`)
- `automate_complete_design()` - End-to-end project automation
- `create_outlet_tester_complete()` - Specialized outlet tester creation
- `batch_process_projects()` - Multi-project automation pipeline
- Seven-stage automation: validation → AI analysis → placement →
  routing → validation → manufacturing → final analysis

### Enhanced Analysis Tools (`tools/analysis_tools.py`)
- `analyze_board_real_time()` - Live board analysis via IPC API
- `get_component_details_live()` - Real-time component information
- Enhanced `validate_project()` with IPC integration
- Live connectivity and routing completion monitoring

## Technical Implementation

### Dependencies Added
- `kicad-python>=0.4.0` - Official KiCad IPC API bindings
- `requests>=2.31.0` - HTTP client for FreeRouting integration

### Architecture Enhancements
- Real-time KiCad session management with automatic cleanup
- Transaction-based operations for safe design manipulation
- Context managers for reliable resource handling
- Comprehensive error handling and recovery

### Integration Points
- Seamless CLI + IPC API hybrid approach
- FreeRouting autorouter integration via DSN/SES workflow
- AI-driven optimization with real-time feedback
- Manufacturing-ready file generation pipeline

## Automation Capabilities

### Complete EDA Workflow
1. **Project Setup & Validation** - File integrity and IPC availability
2. **AI Analysis** - Component suggestions and design rule recommendations
3. **Placement Optimization** - Thermal-aware component positioning
4. **Automated Routing** - FreeRouting integration with optimization
5. **Design Validation** - DRC checking and compliance verification
6. **Manufacturing Prep** - Gerber, drill, and assembly file generation
7. **Final Analysis** - Quality scoring and recommendations

### Real-time Capabilities
- Live board statistics and connectivity monitoring
- Interactive component placement and routing
- Real-time design quality scoring
- Live optimization opportunity identification

## Usage Examples

```python
# Complete project automation
automate_complete_design("/path/to/project.kicad_pro", "rf",
                        ["signal_integrity", "thermal"])

# Automated routing with strategy selection
route_pcb_automatically("/path/to/project.kicad_pro", "aggressive")

# Real-time board analysis
analyze_board_real_time("/path/to/project.kicad_pro")

# Outlet tester project creation
create_outlet_tester_complete("/path/to/new_project.kicad_pro",
                             "gfci", ["voltage_display", "gfci_test"])
```

This update establishes the foundation for Claude Code to provide complete
EDA project automation, from initial design through production-ready
manufacturing files, with real-time KiCad integration and automated routing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 22:03:50 -06:00
50f17eff35 Fix validate_project tool to handle directory paths and json import error
Some checks failed
CI / Lint and Format (push) Has been cancelled
CI / Test Python 3.11 on macos-latest (push) Has been cancelled
CI / Test Python 3.12 on macos-latest (push) Has been cancelled
CI / Test Python 3.13 on macos-latest (push) Has been cancelled
CI / Test Python 3.10 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Test Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Build Package (push) Has been cancelled
- Move json import to module level to fix NameError
- Add directory path handling to automatically find .kicad_pro files
- Improve error messages and validation logic
- Add proper file type validation

Fixes IsADirectoryError and 'json' variable access errors.
v1.0.0-ai-integration
2025-08-11 17:54:14 -06:00
bc0f3db97c Implement comprehensive AI/LLM integration for KiCad MCP server
Some checks are pending
CI / Lint and Format (push) Waiting to run
CI / Test Python 3.11 on macos-latest (push) Waiting to run
CI / Test Python 3.12 on macos-latest (push) Waiting to run
CI / Test Python 3.13 on macos-latest (push) Waiting to run
CI / Test Python 3.10 on ubuntu-latest (push) Waiting to run
CI / Test Python 3.11 on ubuntu-latest (push) Waiting to run
CI / Test Python 3.12 on ubuntu-latest (push) Waiting to run
CI / Test Python 3.13 on ubuntu-latest (push) Waiting to run
CI / Security Scan (push) Waiting to run
CI / Build Package (push) Blocked by required conditions
Add intelligent analysis and recommendation tools for KiCad designs:

## New AI Tools (kicad_mcp/tools/ai_tools.py)
- suggest_components_for_circuit: Smart component suggestions based on circuit analysis
- recommend_design_rules: Automated design rule recommendations for different technologies
- optimize_pcb_layout: PCB layout optimization for signal integrity, thermal, and cost
- analyze_design_completeness: Comprehensive design completeness analysis

## Enhanced Utilities
- component_utils.py: Add ComponentType enum and component classification functions
- pattern_recognition.py: Enhanced circuit pattern analysis and recommendations
- netlist_parser.py: Implement missing parse_netlist_file function for AI tools

## Key Features
- Circuit pattern recognition for power supplies, amplifiers, microcontrollers
- Technology-specific design rules (standard, HDI, RF, automotive)
- Layout optimization suggestions with implementation steps
- Component suggestion system with standard values and examples
- Design completeness scoring with actionable recommendations

## Server Integration
- Register AI tools in FastMCP server
- Integrate with existing KiCad utilities and file parsers
- Error handling and graceful fallbacks for missing data

Fixes ImportError that prevented server startup and enables advanced
AI-powered design assistance for KiCad projects.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 16:15:58 -06:00
995dfd57c1 Add comprehensive advanced KiCad features and fix MCP compatibility issues
- Implement 3D model analysis and mechanical constraints checking
- Add advanced DRC rule customization for HDI, RF, and automotive applications
- Create symbol library management with analysis and validation tools
- Implement PCB layer stack-up analysis with impedance calculations
- Fix Context parameter validation errors causing client failures
- Add enhanced tool annotations with examples for better LLM compatibility
- Include comprehensive test coverage improvements (22.21% coverage)
- Add CLAUDE.md documentation for development guidance

New Advanced Tools:
• 3D model analysis: analyze_3d_models, check_mechanical_constraints
• Advanced DRC: create_drc_rule_set, analyze_pcb_drc_violations
• Symbol management: analyze_symbol_library, validate_symbol_library
• Layer analysis: analyze_pcb_stackup, calculate_trace_impedance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 15:57:46 -06:00
Lama Al Rajih
cc809c563c
Merge pull request #21 from laurigates/pr-3-security-input-validation
feat: add comprehensive security and input validation system
2025-07-23 12:15:40 -07:00
Lama
d8e2f73d2d update makefile and remove empty test file 2025-07-22 21:45:06 -07:00
Lama
e7e11dc068 fix packages 2025-07-22 17:50:37 -07:00
Lama Al Rajih
0bbb78b0a9
Merge branch 'main' into pr-3-security-input-validation 2025-07-22 20:47:47 -04:00
Lama Al Rajih
9dbea131d6
Merge pull request #20 from laurigates/pr-2-infrastructure-ci-cd
Development Infrastructure & CI/CD
2025-07-22 20:42:04 -04:00
Lama
99fce1ebec add fastmcp to pyproject.toml, add make run to makefile, update uv.lock 2025-07-22 17:41:34 -07:00
Lama
cbe54114eb update uv.lock 2025-07-22 17:33:15 -07:00
Lama Al Rajih
6ef68572f1
Merge branch 'main' into pr-2-infrastructure-ci-cd 2025-07-22 20:31:30 -04:00
Lama
371ce03685 update readme and remove requirements.txt 2025-07-22 17:26:03 -07:00
Lama Al Rajih
e6961ceefb
Merge pull request #19 from laurigates/pr-1-fastmcp-2.0-migration
FastMCP 2.0 Migration & Foundation
2025-07-21 13:26:18 -04:00
Lama
af947ee182 fix(server): make FastMCP-2.x start correctly
• Replace deprecated `lifespan_kwargs=` with functools.partial
• Drop extra asyncio layer – call `server.run()` directly
• Add missing `functools` import

Now `python -m kicad_mcp.server` and `kicad-mcp` block and run cleanly.
2025-07-18 14:34:41 -04:00
Lama Al Rajih
d7c269211a
Merge branch 'main' into pr-1-fastmcp-2.0-migration 2025-07-18 11:44:21 -04:00
Lama Al Rajih
b4d3bfa6b4
Merge pull request #12 from lamaalrajih/publish-pip
Add repo to pip package
2025-07-18 11:13:27 -04:00
Lama
74ad42eedf remove files accidentally commited 2025-07-18 11:05:25 -04:00
Lama
9bfc6da76d update pyproject.toml 2025-07-18 11:03:41 -04:00
Lama
2b425d458d update init and remove email placeholder from pyproject.toml 2025-07-18 01:57:04 -04:00
Lama Al Rajih
fb4e9ecfb0
Merge pull request #17 from mannie-exe/publish-pip
fix: migrate to uv; pydantic schema error
2025-07-17 19:34:49 -04:00
Lauri Gates
bd08a47a6f feat: add comprehensive security and input validation system
- Add PathValidator class for preventing path traversal attacks
- Add SecureSubprocessRunner for safe command execution
- Replace unsafe XML parsing with defusedxml for security
- Add comprehensive input validation tools for circuit generation
- Include security dependencies (defusedxml, bandit) in pyproject.toml
- Add security scanning job to CI/CD pipeline
- Add comprehensive test coverage for security utilities
- Add timeout constants for safe operation limits
- Add boundary validation for component positioning

This establishes a strong security foundation for the KiCad MCP server
by implementing defense-in-depth security measures across all input
vectors and external process interactions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 21:34:16 +03:00
Lauri Gates
a67eb41523 feat: add comprehensive development infrastructure and CI/CD pipeline
- Add GitHub Actions CI/CD workflow with multi-OS testing (Ubuntu, macOS)
- Add pyproject.toml for modern Python packaging with hatchling
- Add pre-commit hooks for code quality (ruff, mypy, trailing whitespace)
- Add Makefile for common development tasks (install, test, lint, format, build)
- Add run_tests.py script for comprehensive test execution
- Update requirements.txt with development dependencies
- Update .gitignore for modern Python tooling (uv, ruff, pytest)
- Add KiCad-specific ignore patterns for backup files

This establishes a robust development workflow with:
- Automated testing on Python 3.10, 3.11, 3.12
- Code formatting and linting with ruff
- Type checking with mypy
- Coverage reporting with pytest-cov
- Package building with uv

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 20:29:27 +03:00
Lauri Gates
9bea0f4ebf feat: migrate to FastMCP 2.0 framework with modern Python packaging
- Update imports from 'mcp.server.fastmcp' to 'fastmcp' per FastMCP 2.0 migration
- Add pyproject.toml for modern Python packaging with hatchling build backend
- Implement missing server lifecycle functions: main(), setup_logging(), cleanup_handler()
- Add async main() entry point for proper server execution
- Update main.py to use async server execution pattern
- Add fastmcp>=0.1.0 dependency to replace legacy mcp server imports

This establishes the foundation for all subsequent feature additions and ensures
compatibility with modern MCP clients and development workflows.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 20:13:01 +03:00
mannie-exe
639b54d637 fix: migrate to uv; fix pydantic schema error
- add uv.lock for reproducible dependencies
- add .python-version file for python version consistency
- pin dependency versions in pyproject.toml (mcp>=1.11.0, pandas>=2.3.1, pytest>=8.4.1)
- remove type annotations from Image-returning functions to avoid pydantic v2 schema generation errors
  - resolves MCP server startup failure
2025-07-13 21:30:40 -07:00
Lama Al Rajih
7019df0ccc
Merge pull request #14 from laurigates/patch-1
Create LICENSE
2025-07-11 16:04:12 -04:00
Lauri Gates
fb294215f0
Create LICENSE 2025-07-10 13:13:00 +03:00
Lama
d866184d86 Add repo to pip package 2025-07-08 19:49:17 -04:00
Lama
4dd49122f1 fix file name 2025-07-08 19:38:21 -04:00
Lama Al Rajih
798436cd35
Update README.md 2025-04-29 16:57:13 -04:00
Lama
e5c87df088 Removed unnecessary IPC drc - defaulting to only using the CLI 2025-04-24 16:07:36 -04:00
Lama
a95c0a40ba add issue and pr templates 2025-04-24 14:34:34 -04:00
Lama Al Rajih
b2d3099505
Merge pull request #6 from madaerodog/main - feat: Fix tools, improve stability, and update docs
- Fix open_project tool for Linux compatibility (uses xdg-open).
- Force DRC tool to use kicad-cli due to kipy import errors, ensuring reliability.
- Correct thumbnail generation to use svg export via kicad-cli instead of unsupported png.
- Save generated thumbnails directly into the project directory.
- Remove debug logging added during troubleshooting.
- Update .gitignore to correctly ignore the .venv directory.
- Remove mcp.dev usage from documentation as a method for running the server.
- Remove obsolete python_path.py utility and deleted test file.
2025-04-24 14:09:42 -04:00
Constantin Craciun
5b9d237d7d feat: Fix tools, improve stability, and update docs 2025-04-23 18:37:56 +03:00
Lama
44b0bda19d add more graceful server shutdown 2025-03-22 09:41:10 -04:00
Lama
921e087351 logging docs cleanup 2025-03-22 09:23:22 -04:00
Lama
fda329cc8f remove all instances of logger.py (see issue #1) 2025-03-22 09:18:29 -04:00
Lama
3596bae34e fix find_component_connections() in netlist_tools.py 2025-03-22 08:58:57 -04:00
Lama
a3613f273a Fix drc issues - swap out pbnew for kicad cli and ipc 2025-03-21 15:27:36 -04:00
Lama
b1cb48ecf7 fix random import, etc issues 2025-03-21 13:08:15 -04:00
Lama
7343e032c1 Add circuit pattern recognition feature for KiCad schematics
This commit introduces a new circuit pattern recognition system that can
automatically identify common circuit patterns in KiCad schematics, including:

- Power supply circuits (linear regulators, switching converters)
- Amplifier circuits (op-amps, transistor amplifiers)
- Filter circuits (passive and active)
- Oscillator circuits (crystal, RC, IC-based)
- Digital interfaces (I2C, SPI, UART, USB)
- Microcontroller circuits
- Sensor interfaces

The implementation includes:
- Pattern recognition algorithms for common components
- Component value extraction and normalization utilities
- MCP tools for running pattern analysis
- MCP resources for displaying formatted results
- Comprehensive documentation

Users can easily extend the pattern recognition by adding new component
patterns or circuit recognition functions.
2025-03-21 10:43:34 -04:00
Lama
750dd260c4 Add comprehensive netlist extraction functionality
- Implement schematic netlist parser with S-expression parsing
- Create netlist tools for extraction and connection analysis
- Add resources for netlist and component connection reporting
- Include documentation with usage guide and troubleshooting
- Register new tools and resources in server configuration

This enables extracting component connections from KiCad schematics
and analyzing connectivity between components.
2025-03-21 09:31:15 -04:00
Lama
f8bafe8beb refactor readme and add more docs 2025-03-20 21:19:19 -04:00
Lama
6953e5dc9a Add comprehensive BOM management functionality with analysis, export, and viewing features 2025-03-20 13:54:48 -04:00
Lama
c69bd66f71 update readme and requirements.txt 2025-03-20 12:51:52 -04:00
Lama
60b10c54b2 nit 2025-03-20 12:48:10 -04:00
Lama
82c0a2dccb nit 2025-03-20 12:35:21 -04:00
Lama
46ad082fda update readme 2025-03-20 12:34:14 -04:00
Lama
cc73df8e77 Add flexible environment configuration to support custom project paths
- Added environment variable support for configuring KiCad project search paths
- Implemented auto-detection of common project directories (~/pcb, ~/Electronics, etc.)
- Created .env file support for user-friendly configuration
- Added utility module for environment variable loading and management
- Updated documentation with detailed configuration options and troubleshooting steps
- Improved logging to help diagnose path-related issues
- Removed hardcoded paths to make the MCP server more generally usable
2025-03-20 12:13:38 -04:00