HiCAD AI Assistant (CAD_MCP)
A local-first AI assistant for HiCAD 2025 with zero-cost runtime, powered by Qwen3 models and the Model Context Protocol (MCP).
Overview
CAD_MCP enables natural language control of HiCAD 2025 through a local AI assistant. Users can issue commands like "Create an I-beam 300mm high" and have HiCAD execute them automatically.
Key Features:
- Zero-Cost Runtime: Local LLM inference via LM Studio (no API costs)
- Natural Language CAD Control: Intuitive commands for HiCAD operations
- Intelligent Context: RAG database with HiCAD API knowledge
- Safe Automation: Validation workflows and operation confirmations
- Extensible Architecture: Easy to add new HiCAD capabilities
Project Structure```
CAD_MCP/
├── docs/ # Documentation and research
│ ├── research/ # API discovery documentation
│ ├── architecture/ # Design documents
│ ├── guides/ # User guides
│ └── task_completion_reports/ # Task validation reports
├── hicad_mcp_server/ # HiCAD MCP Server (main product)
│ ├── server.py # MCP server entry point
│ ├── connection_manager.py # HiCAD connection handling
│ ├── tools/ # MCP tool implementations
│ └── prototypes/ # Connection test scripts
├── qwen_agent_config/ # Qwen-Agent configuration
│ ├── agent_config.py # Agent initialization
│ ├── rag_config.json # RAG database settings
│ └── system_prompt_*.txt # System prompts
├── rag_data/ # RAG knowledge base
│ ├── api_schemas/ # HiCAD API schemas
│ ├── official_docs/ # HiCAD documentation
│ └── code_examples/ # Curated code examples
├── examples/ # Reference implementations
│ ├── c_sharp/ # C# HiCAD examples
│ └── python/ # Python integration examples
├── tests/ # Test suite (target: ≥85% coverage)
├── tools/ # Development tools
│ └── lm_studio_delegate/ # Multi-agent workflow tool
├── DELETED/ # Archive for removed files
├── project_genesis.md # Project charter (immutable)
├── AI_coding_standards.md # Coding standards for AI agents
├── DELEGATION_STRATEGY.md # AI task assignments
├── research_plan_improved.md # 6-phase implementation plan
└── README.md # This file
---
## System Architecture```
┌─────────────────────────────────────────────────────────────┐
│ USER │
│ (Natural Language Commands) │
└─────────────┬───────────────────────────────────────────────┘
│
↓
┌─────────────────────────────────────────────────────────────┐
│ QWEN-AGENT FRAMEWORK │
│ ┌────────────────────┐ ┌───────────────────┐ │
│ │ Qwen3-7B-Thinking │◄────────┤ Built-in RAG │ │
│ │ (LM Studio) │ │ Database │ │
│ │ Local GPU │ │ (HiCAD Context) │ │
│ └────────┬───────────┘ └───────────────────┘ │
│ │ │
│ │ Tool Selection & Parameters │
│ ↓ │
│ ┌──────────────────────┐ │
│ │ MCP Client │ │
│ │ (Native) │ │
│ └────────┬─────────────┘ │
└───────────┼──────────────────────────────────────────────────┘
│
│ MCP Protocol (JSON-RPC)
↓
┌─────────────────────────────────────────────────────────────┐
│ HICAD MCP SERVER (Python - Custom Built) │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Tool Registry (15+ tools): │ │
│ │ • hicad_get_version() │ │
│ │ • hicad_create_beam(profile, height, ...) │ │
│ │ • hicad_query_parts(filter_criteria) │ │
│ │ • hicad_traverse_assembly(assembly_id) │ │
│ │ • hicad_export_file(format, path) │ │
│ └──────────────────┬───────────────────────────────────┘ │
│ │ │
│ ┌──────────────────▼───────────────────────────────────┐ │
│ │ Connection Manager │ │
│ │ • pythonnet or comtypes (TBD Phase 1) │ │
│ │ • Singleton connection pool │ │
│ │ • Health checks & reconnection │ │
│ └──────────────────┬───────────────────────────────────┘ │
└────────────────────┼────────────────────────────────────────┘
│
│ .NET/COM Interop
↓
┌─────────────────────────────────────────────────────────────┐
│ HICAD 2025 APPLICATION │
│ (.NET API / COM Interface) │
└─────────────────────────────────────────────────────────────┘
Technology Stack
Core Technologies
- CAD Software: HiCAD 2025 (ISD Group)
- Local LLM: Qwen3-7B-Thinking via LM Studio
- AI Framework: Qwen-Agent 0.1.0+ (with MCP and RAG support)
- MCP Server: Python 3.10+ with FastMCP
- HiCAD Integration: pythonnet (for .NET) or comtypes (for COM)
Python Dependencies```python
qwen-agent[gui,mcp,rag]>=0.1.0
pythonnet>=3.0.0 or comtypes>=1.2.0
fastmcp>=0.1.0
httpx>=0.27.0
pytest>=7.4.0
### Hardware Requirements
- **GPU**: NVIDIA RTX 5070 Ti (16GB VRAM) or similar
- **RAM**: 32GB recommended
- **OS**: Windows (with HiCAD 2025 installed)
---
## Installation
### Prerequisites
1. **HiCAD 2025** installed and licensed
2. **Python 3.10+** installed
3. **LM Studio** installed with Qwen3-7B-Thinking model
4. **Git** installed
### Quick Start```bash
# Clone the repository
git clone https://github.com/CADcoLabs/CAD_MCP.git
cd CAD_MCP
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.template .env
# Edit .env with your settings
# Run tests (when available)
pytest tests/
Project Status
Current Phase: Phase 0 - Foundation (Week 1)
| Phase | Status | Description |
|---|---|---|
| Phase 0 | 🟢 In Progress | Project foundation and documentation |
| Phase 1 | ⏳ Pending | API discovery and connection prototypes |
| Phase 2 | ⏳ Pending | Schema generation and data preparation |
| Phase 3 | ⏳ Pending | MCP server implementation |
| Phase 4 | ⏳ Pending | Integration and RAG population |
| Phase 5 | ⏳ Pending | Testing and refinement |
Timeline: 6 weeks (42 days)
Budget: $100-120 development cost, $0 runtime cost
Development Tools
LM Studio Delegate
Located in tools/lm_studio_delegate/, this is a development meta-tool for multi-agent workflows between Claude Code and LM Studio.
Features:
- Two-way communication between Claude Code and LM Studio
- Structured task delegation with completion reports
- File-based task persistence for audit trails
- Auto-validation workflows
Usage:```python
In Claude Code
delegate_query("Write a Python function to parse JSON")
delegate_task("Create a simple HTTP server script")
```
See tools/lm_studio_delegate/README.md for details.
Documentation
Core Documents
- project_genesis.md - Project charter and architecture (WHAT we're building)
- AI_coding_standards.md - Coding standards and AI behavioral rules (HOW to build)
- DELEGATION_STRATEGY.md - AI model assignments and task workflow
- research_plan_improved.md - Detailed 6-phase implementation plan
Additional Resources
- SessionHandoff.md - Current project state and next steps
- task_completion_report_template.md - Validation report format
Reference Projects
This project builds on and learns from:
- RickdeM/HicadCommunity - HiCAD automation patterns
- FreeCAD MCP - MCP + CAD integration reference
- MecAgent - AI CAD copilot (competitive analysis)
Contributing
AI Agent Guidelines
All AI agents working on this project MUST:
1. Read project_genesis.md and AI_coding_standards.md before starting work
2. Follow the task delegation matrix in DELEGATION_STRATEGY.md
3. Generate task_completion_report.md for all tasks
4. Never delete files (move to DELETED/ folder instead)
5. No authorship credits until user approval after testing
6. Maintain ≥85% test coverage
Code Standards
- Python: PEP 8, type hints, Google-style docstrings
- C#: Microsoft conventions, XML doc comments
- Git: Conventional Commits (feat:, fix:, docs:, test:, refactor:)
- Testing: pytest with ≥85% coverage
Security & Privacy
- Local-First: All LLM inference runs locally (no data sent to cloud)
- No Credentials in Code: Use
.envfile for configuration - HiCAD Data Protection: All HiCAD data remains on local machine
- Sanitized Logs: Sensitive paths and usernames redacted from logs
License
MIT License - See LICENSE file for details.
Support & Contact
Issues: GitHub Issues
Discussions: GitHub Discussions
Documentation: See docs/ folder
Roadmap
Short Term (Weeks 1-2)
- ✅ Project documentation and foundation
- ⏳ Environment setup and Qwen-Agent installation
- ⏳ HiCAD API discovery and connection prototypes
Medium Term (Weeks 3-4)
- ⏳ MCP server implementation with core tools
- ⏳ API schema generation and documentation
Long Term (Weeks 5-6)
- ⏳ RAG database population
- ⏳ Qwen-Agent integration and testing
- ⏳ End-to-end validation and optimization
Success Metrics
Technical Targets:
- ✅ Zero-cost runtime (local LLM)
- 🎯 15+ HiCAD MCP tools operational
- 🎯 200+ API methods in RAG database
- 🎯 <5 second response time for simple operations
- 🎯 ≥85% test coverage maintained
- 🎯 ≥95% tool call success rate
User Experience Targets:
- 🎯 ≤30 minutes installation time
- 🎯 ≥85% natural language command success rate
- 🎯 <5% operations cause HiCAD crashes
- 🎯 User satisfaction: "This is useful and saves time"
Acknowledgments
Built with insights from:
- Qwen-Agent framework by Alibaba Cloud
- Model Context Protocol by Anthropic
- RickdeM's HicadCommunity project
- The broader CAD automation and AI agent community
Status: 🟢 Active Development (Phase 0)
Last Updated: 2026-01-14
Version: 0.1.0-alpha
Built for engineers, by engineers. Making CAD work smarter, not harder.
