MCP Servers / Solidworks
Solidworks
MCP server to automate SolidWorks using Claude AI β 22 tools for parts, sketches & features
Transport
Tools (20)
Category
Tool
connect_solidworks
Connect to running SolidWorks instance
get_solidworks_info
Get version and installation info
create_new_part
Create a new part document
create_new_assembly
Create a new assembly document
open_document
Open an existing SolidWorks file
close_document
Close the active document
save_document
Save the active document
list_open_documents
List all open documents
create_sketch
Create a sketch on a plane (Front/Top/Right)
close_sketch
Exit the active sketch
draw_circle
Draw a circle by center and radius
draw_rectangle
Draw a rectangle by two corners
draw_line
Draw a line between two points
draw_arc
Draw an arc by center and angles
draw_polygon
Draw a regular polygon (triangle, hex, etc.)
extrude_sketch
Boss-extrude the active sketch
cut_extrude
Cut-extrude to remove material
fillet_edges
Add fillets to selected edges
chamfer_edges
Add chamfers to selected edges
Documentation
SolidWorks MCP Server π§
Automate SolidWorks using natural language through Claude AI and the Model Context Protocol (MCP)
π― What is This?
SolidWorks MCP Server is a production-ready Model Context Protocol server that lets Claude AI control SolidWorks through natural language. Instead of manually clicking through menus, you simply tell Claude what to design β and it builds it for you.
Example prompts you can use:
- "Create a new part, draw a circle with radius 30mm and extrude it 15mm"
- "Add a fillet of 2mm to all edges"
- "Draw a hexagon and cut extrude it 10mm"
- "List all features in the current part"
β¨ Features
- β 22 Tools covering parts, sketches, features, and utilities
- β SolidWorks 2023β2025 Compatible with version-aware API fallbacks
- β Auto-detects SolidWorks installation via Windows registry
- β Multi-unit support β mm, cm, inch, meter, foot
- β Modular architecture β clean, extensible Python package
- β Robust error handling β cascading fallback chains for COM API
- β JSON configuration β easy to customize without touching code
- β Comprehensive logging β full debug output for troubleshooting
π οΈ Available Tools
| Category | Tool | Description |
|----------|------|-------------|
| Connection | connect_solidworks | Connect to running SolidWorks instance |
| Connection | get_solidworks_info | Get version and installation info |
| Documents | create_new_part | Create a new part document |
| Documents | create_new_assembly | Create a new assembly document |
| Documents | open_document | Open an existing SolidWorks file |
| Documents | close_document | Close the active document |
| Documents | save_document | Save the active document |
| Documents | list_open_documents | List all open documents |
| Sketches | create_sketch | Create a sketch on a plane (Front/Top/Right) |
| Sketches | close_sketch | Exit the active sketch |
| Sketches | draw_circle | Draw a circle by center and radius |
| Sketches | draw_rectangle | Draw a rectangle by two corners |
| Sketches | draw_line | Draw a line between two points |
| Sketches | draw_arc | Draw an arc by center and angles |
| Sketches | draw_polygon | Draw a regular polygon (triangle, hex, etc.) |
| Features | extrude_sketch | Boss-extrude the active sketch |
| Features | cut_extrude | Cut-extrude to remove material |
| Features | fillet_edges | Add fillets to selected edges |
| Features | chamfer_edges | Add chamfers to selected edges |
| Features | list_features | List all features in the model |
| Utilities | set_units | Change default unit (mm/inch/cm/m/ft) |
| Utilities | execute_python | Execute custom Python code in SW context |
π Requirements
- OS: Windows 10 or Windows 11
- SolidWorks: 2023, 2024, or 2025 (must be installed and licensed)
- Python: 3.10 or higher
- Claude: Claude Desktop app or Claude Code
β‘ Quick Start
1. Clone the Repository
git clone https://github.com/alisamsam/solidworks-mcp.git
cd solidworks-mcp
2. Install Dependencies
pip install -r requirements.txt
3. Configure Claude Desktop
Add the following to your claude_desktop_config.json:
Location: C:\Users\YOUR_NAME\AppData\Roaming\Claude\claude_desktop_config.json
{
"mcpServers": {
"solidworks": {
"command": "python",
"args": ["C:\\path\\to\\solidworks-mcp\\solidworks_mcp_server.py"]
}
}
}
4. Launch
- Open SolidWorks first
- Restart Claude Desktop
- In Claude, type: "Connect to SolidWorks"
- Start designing! π
π Project Structure
solidworks-mcp/
βββ solidworks_mcp_server.py # Entry point
βββ solidworks_mcp/ # Main package
β βββ __init__.py # Package exports (v3.0.0)
β βββ server.py # MCP server & tool definitions
β βββ config.py # Configuration management
β βββ config.json # Default settings
β βββ constants.py # SolidWorks constants & enums
β βββ automation/ # Core automation modules
β β βββ base.py # Connection management
β β βββ documents.py # Document operations
β β βββ sketches.py # Sketch operations
β β βββ features.py # Feature operations (SW 2025 fixed)
β βββ utils/ # Utility modules
β βββ units.py # Unit conversion system
β βββ sw_finder.py # Auto-detect SolidWorks
βββ requirements.txt
βββ .gitignore
βββ DEVELOPMENT_ROADMAP.md # Future development plan
βοΈ Configuration
Edit solidworks_mcp/config.json to customize behavior:
{
"exe_path": "auto",
"default_unit": "mm",
"startup_timeout": 120,
"log_level": "INFO",
"default_extrude_depth": 10.0,
"default_fillet_radius": 2.0
}
| Setting | Default | Description |
|---------|---------|-------------|
| exe_path | "auto" | Path to SLDWORKS.exe or auto-detect |
| default_unit | "mm" | Default unit for all dimensions |
| startup_timeout | 120 | Seconds to wait for SW startup |
| log_level | "INFO" | Logging verbosity |
π§ SolidWorks 2025 Compatibility
This server includes special handling for SolidWorks 2025 API changes:
- Extrusion fallback chain:
FeatureExtrusion3βFeatureExtrusion2βFeatureBossSimple - Safe property access for
feat.Name,feat.GetTypeName2(),IsSuppressed2() - stdout capture fix for
execute_pythontool - Registry-based SolidWorks auto-detection
π€ Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "Add my feature" - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
π License
This project is licensed under the MIT License β see the LICENSE file for details.
π€ Author
Samsaam Ali Baig
- GitHub: @alisamsam
π Acknowledgements
- Anthropic for Claude AI and the MCP framework
- SolidWorks COM API documentation
- Inspired by ros2-claude-code-template by Harun KURT
β If this project helps you, please give it a star!