SolidWorks MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SolidWorks MCP ServerCreate a new sketch on the front plane"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SolidWorks MCP Server - Intelligent COM Bridge with Dynamic Fallback
The Most Intelligent Node.js-based SolidWorks Automation Solution
π 87 Tools | π¦ 4 Resources | π‘ 5 Prompts | π§ Intelligent COM Bridge | β‘ Dynamic Fallback | π― 100% Feature Coverage
π New Release v1.0.0 - This is a complete redesign of the SolidWorks MCP Server with intelligent COM bridge architecture, comprehensive tool coverage, and production-ready features.
π₯ Breaking the COM Barrier
Problem Solved: Node.js COM bridges fail when calling SolidWorks methods with 13+ parameters. This affects critical features like extrusions, sweeps, and lofts.
Our Solution: Intelligent adapter architecture that automatically routes operations:
Simple operations (β€12 params) β Direct COM (fast)
Complex operations (13+ params) β Dynamic VBA macro generation (reliable)
Failed operations β Automatic fallback with circuit breaker pattern
Related MCP server: SolidworksMCP-python
π― Quick Start
Prerequisites
Windows 10/11
SolidWorks 2024 (licensed)
Node.js 20+
Claude Desktop or any MCP-compatible client
Installation
# Clone the repository
git clone git@github.com:jianzhichun/solidworks-mcp-server.git
cd solidworks-mcp-server
# Install dependencies (compiles winax for your system)
npm install
# Build TypeScript
npm run buildConfigure Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"solidworks": {
"command": "node",
"args": ["C:/path/to/solidworks-mcp-server/dist/index.js"],
"env": {
"SOLIDWORKS_PATH": "C:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS",
"ADAPTER_TYPE": "winax-enhanced"
}
}
}
}π Complete Tool Reference
π¨ Sketch Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Create a new sketch on a specified plane or face | Initialize sketch for feature creation | 1. Select plane/face2. Create sketch3. Return sketch name |
|
|
| Enter sketch edit mode for an existing sketch | Modify existing sketch geometry | 1. Find sketch by name2. Activate sketch3. Return status |
|
|
| Exit sketch edit mode and optionally rebuild | Complete sketch editing | 1. Exit sketch2. Optionally rebuild model |
|
|
| Get current model and sketch context for diagnostics | Debug sketch operations | 1. Get active model2. Get active sketch3. Return context |
|
|
| Draw a line in the active sketch | Add line geometry | 1. Validate sketch active2. Create line from points3. Return entity info |
|
|
| Draw a centerline in the active sketch | Add construction centerline | 1. Validate sketch active2. Create centerline3. Return entity info |
|
|
| Draw a circle in the active sketch | Add circle geometry | 1. Validate sketch active2. Create circle by radius3. Return entity info |
|
|
| Draw an arc in the active sketch | Add arc geometry | 1. Validate sketch active2. Create arc by 3 points3. Return entity info |
|
|
| Draw a rectangle in the active sketch | Add rectangle geometry | 1. Validate sketch active2. Create corner rectangle3. Return entity info |
|
|
| Draw a regular polygon in the active sketch | Add polygon geometry | 1. Validate sketch active2. Create polygon3. Return entity info |
|
|
| Draw a spline through points in the active sketch | Add spline geometry | 1. Validate sketch active2. Create spline from points3. Return entity info |
|
|
| Draw an ellipse in the active sketch | Add ellipse geometry | 1. Validate sketch active2. Create ellipse3. Return entity info |
|
|
| Add constraints between sketch entities | Constrain sketch geometry | 1. Validate entities exist2. Apply constraint3. Return status |
|
|
| Add dimensions to sketch entities | Dimension sketch geometry | 1. Validate entity exists2. Add dimension3. Return dimension info |
|
|
| Create a linear pattern of sketch entities | Pattern sketch geometry | 1. Select entities2. Define pattern direction3. Create pattern |
|
|
| Create a circular pattern of sketch entities | Pattern sketch geometry circularly | 1. Select entities2. Define center point3. Create pattern |
|
|
| Mirror sketch entities about a line | Mirror sketch geometry | 1. Select entities2. Select mirror line3. Create mirror |
|
|
| Create offset curves from sketch entities | Offset sketch geometry | 1. Select entities2. Define offset distance3. Create offset |
π Drawing Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Create a new drawing from the current 3D model | Generate 2D drawing from 3D model | 1. Get active model2. Create drawing document3. Add base view4. Return drawing info |
|
|
| Add a standard or custom view to the current drawing sheet | Add model views to drawing | 1. Get model path2. Create view on sheet3. Position view4. Return view info |
|
|
| Add a section view to the drawing | Create section cut view | 1. Define section line2. Create section view3. Position view |
|
|
| Add automatic dimensions to a drawing view | Dimension drawing views | 1. Select view2. Auto-dimension entities3. Return dimension count |
|
|
| Update drawing sheet format and properties | Modify sheet format | 1. Get current sheet2. Update format3. Update properties |
|
|
| Add dimension with diameter symbol to a view | Add diameter dimension | 1. Select circular entity2. Add dimension3. Apply diameter symbol |
|
|
| Enhanced method to set view to grayscale | Convert view to grayscale | 1. Get view2. Set display mode3. Apply grayscale |
|
|
| Create multiple configurations with dimensions | Batch create configurations | 1. Iterate configurations2. Set dimensions3. Create config |
π€ Export Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Export the current model to various formats | Export model to different formats | 1. Get active model2. Determine format3. Execute export4. Verify file |
|
|
| Export multiple configurations or files to a format | Batch export operations | 1. Get configurations2. Iterate each config3. Export with naming4. Return list |
|
|
| Export with specific format options | Advanced export with options | 1. Set export options2. Execute export3. Return result |
|
|
| Capture a screenshot of the current model view | Capture model image | 1. Get active view2. Capture image3. Save to file |
π¬ Analysis Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Get mass properties of the current model | Calculate mass, volume, center of mass | 1. Get model2. Calculate properties3. Convert units4. Return values |
|
|
| Check for interference between components in an assembly | Detect component interference | 1. Get assembly2. Run interference check3. Return results |
|
| Returns string message | Measure distance between two selected entities | Measure entity distance | 1. Select entities2. Calculate distance3. Return value |
|
| Returns string message | Analyze draft angles on model faces | Check draft angles | 1. Get model2. Analyze faces3. Return draft info |
|
| Returns string message | Check geometry for errors and validation | Validate model geometry | 1. Get model2. Check geometry3. Return issues |
|
|
| Get model bounding box dimensions | Get model extents | 1. Get model2. Calculate bounds3. Return box |
π§ Template Manager Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Extract complete template settings from a parent drawing file | Extract drawing template | 1. Open parent drawing2. Extract format3. Extract properties4. Extract styles5. Save template |
|
|
| Apply template settings to a target drawing file | Apply template to drawing | 1. Open target drawing2. Load template3. Apply format4. Apply properties5. Apply styles |
|
|
| Apply template to multiple child drawing files | Batch apply template | 1. Get file list2. Iterate files3. Apply template4. Return results |
|
|
| Compare template settings between two drawings | Compare templates | 1. Load both templates2. Compare settings3. Return differences |
|
|
| Save a drawing template to a reusable library | Save template library | 1. Extract template2. Save to library3. Add metadata |
|
|
| List all templates in the library | List template library | 1. Load library index2. Filter by category/tags3. Return templates |
|
|
| List all templates in the library | List available templates | 1. Scan library directory2. Load metadata3. Return list |
π¬ Native Macro Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Start recording a macro using SolidWorks native VBA recorder | Start macro recording | 1. Set macro path2. Configure options3. Start recording4. Return status |
|
|
| Stop the current native macro recording and save | Stop macro recording | 1. Stop recording2. Save macro file3. Return path |
|
|
| Pause or resume the current macro recording | Control recording state | 1. Check recording state2. Pause/resume3. Return status |
|
|
| Run a SolidWorks macro file | Execute macro | 1. Load macro file2. Execute procedure3. Return result |
|
|
| Open a macro in the SolidWorks VBA editor | Edit macro | 1. Check file exists2. Open in editor3. Return status |
|
|
| Create a new macro with proper SolidWorks VBA initialization | Create macro template | 1. Create macro file2. Initialize VBA project3. Add template code4. Save macro |
|
|
| Convert plain text VBA code to a properly initialized SolidWorks macro | Convert text to macro | 1. Create initialized macro2. Add references3. Insert code4. Save macro |
|
|
| Run multiple macros in sequence | Batch execute macros | 1. Load macro list2. Execute each macro3. Return results |
|
|
| Open a macro in the SolidWorks VBA editor | Edit macro code | 1. Open VBA editor2. Load macro3. Return status |
|
|
| Create a new macro with proper SolidWorks VBA initialization | Create new macro | 1. Create macro file2. Add initialization code3. Return path |
|
|
| Convert plain text VBA code to a properly initialized SolidWorks macro | Convert text to macro | 1. Parse VBA code2. Add initialization3. Save macro |
|
|
| Run multiple macros in sequence | Batch execute macros | 1. Load macro list2. Execute sequentially3. Return results |
π Diagnostic Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Diagnose macro execution issues with detailed logging | Troubleshoot macro problems | 1. Check SolidWorks connection2. Verify file exists3. Check security settings4. Test execution methods5. Return diagnosis |
π Macro Security Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Attempt to set macro security level | Configure macro security | 1. Get SolidWorks app2. Set security level3. Verify change4. Return status |
| None (empty object) |
| Get detailed macro security information | Check security settings | 1. Get security level2. Check VBA enabled3. Return info |
π Macro Recording Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Start recording a new macro | Begin macro recording session | 1. Initialize recorder2. Start session3. Return macro ID |
| None (empty object) |
| Stop the current macro recording | End recording session | 1. Stop recording2. Return recorded actions |
|
|
| Export a recorded macro to VBA code | Convert recording to VBA | 1. Get recorded actions2. Generate VBA3. Return code |
π» VBA Generation Tools
Base VBA Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Generate a VBA script from a template with parameters | Generate VBA from template | 1. Load template2. Compile with Handlebars3. Fill parameters4. Return code |
|
|
| Generate VBA code to create a specific feature | Generate feature VBA | 1. Select feature type2. Generate code3. Return VBA |
|
|
| Generate VBA for batch processing multiple files | Generate batch VBA | 1. Define operation2. Generate batch code3. Return VBA |
|
|
| Execute a VBA macro in SolidWorks | Run macro | 1. Load macro file2. Execute procedure3. Return result |
|
|
| Generate VBA to create drawings from 3D models | Generate drawing VBA | 1. Load template2. Generate drawing code3. Return VBA |
Part Modeling VBA Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
| Generate VBA for creating reference geometry (planes, axes, points) | Create reference geometry VBA | 1. Select geometry type2. Generate code3. Return VBA |
|
|
| Generate VBA for advanced features (sweep, loft, boundary) | Generate advanced feature VBA | 1. Select feature type2. Generate code3. Return VBA |
|
|
|
|
| Generate VBA for pattern features | Generate pattern VBA | 1. Select pattern type2. Generate code3. Return VBA |
|
|
| Generate VBA for sheet metal operations | Generate sheet metal VBA | 1. Select operation2. Generate code3. Return VBA |
|
|
| Generate VBA for surface modeling operations | Generate surface VBA | 1. Select operation2. Generate code3. Return VBA |
Assembly VBA Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Generate VBA for creating assembly mates | Generate mate VBA | 1. Define mate types2. Generate code3. Return VBA |
|
|
| Generate VBA for inserting and managing components | Generate component VBA | 1. Define components2. Generate code3. Return VBA |
|
|
| Generate VBA for assembly analysis | Generate analysis VBA | 1. Select analysis type2. Generate code3. Return VBA |
|
|
| Generate VBA for managing assembly configurations | Generate config VBA | 1. Define configurations2. Generate code3. Return VBA |
Drawing VBA Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Generate VBA for creating drawing views | Generate view VBA | 1. Define views2. Generate code3. Return VBA |
|
|
| Generate VBA for adding dimensions to drawings | Generate dimension VBA | 1. Define dimensions2. Generate code3. Return VBA |
|
|
| Generate VBA for adding annotations to drawings | Generate annotation VBA | 1. Define annotations2. Generate code3. Return VBA |
|
|
| Generate VBA for creating tables in drawings | Generate table VBA | 1. Define table2. Generate code3. Return VBA |
|
|
| Generate VBA for managing drawing sheets and formats | Generate sheet format VBA | 1. Define format2. Generate code3. Return VBA |
File Management VBA Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Generate VBA for batch file operations | Generate batch VBA | 1. Define operation2. Generate code3. Return VBA |
|
|
| Generate VBA for managing custom properties | Generate property VBA | 1. Define properties2. Generate code3. Return VBA |
Advanced VBA Tools
Tool Name | Input Parameters | Output | Description | Use Case | Workflow |
|
|
| Generate VBA for managing configurations | Generate config VBA | 1. Define config operation2. Generate code3. Return VBA |
|
|
| Generate VBA for managing equations and global variables | Generate equation VBA | 1. Define equations2. Generate code3. Return VBA |
|
|
| Generate VBA for setting up simulation studies | Generate simulation VBA | 1. Define study type2. Generate code3. Return VBA |
|
|
| Generate VBA for advanced API automation and event handling | Generate automation VBA | 1. Define automation2. Generate code3. Return VBA |
|
|
| Generate VBA with comprehensive error handling and logging | Generate error handling VBA | 1. Define error handling2. Generate code3. Return VBA |
π‘ Prompts Reference
Prompts provide reusable workflow templates for common SolidWorks tasks. Each prompt guides you through a step-by-step process with best practices.
Prompt Name | Input Parameters | Description | Use Case | Workflow Steps | Prompt Description |
|
| Guides through part creation with complexity-based steps. Simple: basic features (4 steps). Medium: multiple features with constraints (6 steps). Complex: advanced features with reference geometry, configurations, and validation (7 steps). | Step-by-step guide to create a new SolidWorks part with best practices | Create new parts | 1. Create new part document2. Select plane3. Create base sketch4. Extrude initial feature5. Add additional features6. Apply material properties |
|
| Guides through assembly creation with best practices: fix first component, use minimal mates, avoid redundant constraints, check interference before finalizing. Includes mate types and verification steps. | Step-by-step guide to create a new SolidWorks assembly with components and mates | Create assemblies | 1. Create new assembly document2. Insert base component (fixed)3. Insert additional components4. Add mates (coincident, parallel, perpendicular, distance, angle, concentric)5. Verify constraints6. Check interference7. Create configurations if needed |
|
| Provides analysis workflow: Mass properties (mass, volume, center of mass, moments of inertia, material verification). Interference detection (identify interfering parts, measure volumes, suggest corrections). Geometry validation (check errors, validate faces/edges/vertices, check self-intersections, verify feature integrity). All: comprehensive report combining all analyses. | Template for analyzing a SolidWorks model with various analysis types | Analyze models | 1. Perform mass property analysis2. Check for interference3. Validate geometry4. Generate comprehensive report |
|
| Guides through export process with format-specific tips: STEP/IGES for CAD interoperability (version compatibility, units). STL for 3D printing (mesh quality: coarse/fine/custom, units). PDF/DXF/DWG for 2D drawings (sheet selection, scale settings). Best practices: save before export, verify settings, check exported file, use configurations for batch exports. | Guide for exporting SolidWorks models to various formats with proper settings | Export models | 1. Verify model is ready2. Set export options (format-specific)3. Execute export4. Verify exported file |
|
| Guides through sketching with best practices: always fully define sketches (black entities), use geometric constraints before dimensions, keep sketches simple, use construction geometry, avoid over-constraining, use parametric dimensions, name sketches descriptively. Simple: basic geometry (5 steps). Complex: advanced features with patterns (8 steps). | Guide for creating and editing sketches in SolidWorks with best practices | Create/edit sketches | 1. Create sketch on plane2. Draw geometry3. Add constraints4. Add dimensions5. Verify fully defined6. Exit sketch |
π¦ Resources Reference
Resources provide read-only access to SolidWorks configuration, materials, templates, and system status.
Resource Name | URI Pattern | Access Method | Description | Use Case | Data Structure |
|
| Static resource - Returns current SolidWorks configuration including version, units, precision settings, and template paths. No parameters required. | Current SolidWorks application configuration | Get system configuration | JSON: |
|
| Dynamic resource template - Requires | Material properties from SolidWorks database | Get material properties | JSON: |
|
| Dynamic resource template - Requires | List of available templates for document type | Get template list | JSON: |
|
| Static resource - Returns current system status including connection state, SolidWorks version, active document information, and list of open documents. No parameters required. | Current SolidWorks system status | Get system status | JSON: |
ποΈ Architecture
Intelligent Adapter Architecture
βββββββββββββββββββββββββββββββββββββββββββ
β MCP Protocol Layer β
βββββββββββββββββββββββββββββββββββββββββββ€
β Feature Complexity Analyzer β β Intelligent Routing
βββββββββββββββββββββββββββββββββββββββββββ€
β Adapter Abstraction Layer β
βββββββββββββββ¬ββββββββββββββββ¬ββββββββββββ€
β WinAx β Edge.js β PowerShellβ
β Adapter β Adapter β Bridge β
ββββββββββββββββ΄ββββββββββββββββ΄ββββββββββββ€
β Dynamic VBA Macro Generator β β Fallback System
βββββββββββββββββββββββββββββββββββββββββββ€
β SolidWorks COM API β
βββββββββββββββββββββββββββββββββββββββββββCode Structure
src/
βββ solidworks/ # Core SolidWorks API
β βββ api.ts # Main API class
β βββ types/ # Type definitions
β βββ operations/ # Operation classes
β βββ helpers/ # Helper functions
βββ tools/ # MCP Tools
β βββ sketch.ts # Sketch tools
β βββ drawing.ts # Drawing tools
β βββ export.ts # Export tools
β βββ analysis.ts # Analysis tools
β βββ vba/ # VBA generation tools
β βββ template-manager.ts # Template management
β βββ native-macro.ts # Native macro recording
β βββ diagnostics.ts # Diagnostic tools
β βββ macro-security.ts # Security tools
βββ prompts/ # MCP Prompts
β βββ index.ts # Workflow templates
βββ resources/ # MCP Resources
β βββ index.ts # Read-only data access
βββ utils/ # Utilities
βββ logger.ts # Logging
βββ config.ts # Configuration
βββ error-recovery.ts # Error handlingπ Statistics
Total Tools: 83
Total Prompts: 5
Total Resources: 4
VBA Templates: 9
Supported Formats: STEP, IGES, STL, PDF, DXF, DWG
SolidWorks Versions: 2024
π Usage Examples
Simple Operations (Direct COM - Fast)
// Simple extrusion - uses direct COM
await solidworks.create_extrusion({
depth: 50
});
// Simple revolve - uses direct COM
await solidworks.create_revolve({
angle: 270
});Complex Operations (Automatic Macro Fallback)
// Complex extrusion - automatically uses macro
await solidworks.create_extrusion_advanced({
depth: 50,
bothDirections: true,
depth2: 30,
draft: 5,
thinFeature: true,
thinThickness: 2
});Using Prompts
// Use create-part-workflow prompt
await solidworks.prompt('create-part-workflow', {
partName: 'MyPart',
complexity: 'medium'
});
// Use analyze-model prompt
await solidworks.prompt('analyze-model', {
analysisType: 'all',
modelName: 'CurrentModel'
});Accessing Resources
// Get SolidWorks configuration
const config = await solidworks.getResource('solidworks://config');
// Get material properties
const material = await solidworks.getResource('solidworks://materials/Steel');
// Get template list
const templates = await solidworks.getResource('solidworks://templates/part');
// Get system status
const status = await solidworks.getResource('solidworks://system');π‘οΈ Reliability Features
Circuit Breaker Pattern
Prevents cascading failures when operations fail repeatedly:
Monitors failure rates
Opens circuit after threshold
Auto-recovery with half-open state
Connection Pooling
Manages multiple SolidWorks connections efficiently:
Concurrent operation support
Resource management
Automatic cleanup
Intelligent Fallback
Every operation has a fallback strategy:
Primary: Direct COM call
Fallback: VBA macro generation
Emergency: Error recovery with suggestions
π§ͺ Testing
Quick Start
# Install dependencies
npm install
# Run unit tests (no SolidWorks required)
USE_MOCK_SOLIDWORKS=true npm test
# Run in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageTesting Without SolidWorks
Perfect for CI/CD and development without SolidWorks installed:
# Set environment variable
export USE_MOCK_SOLIDWORKS=true
# Run tests
npm testTesting With SolidWorks
# Ensure SolidWorks is running
# Run tests with real COM connection
npm testπ€ Contributing
We welcome contributions! Key areas:
Additional feature implementations
Performance optimizations
Edge.js adapter completion (.NET runtime)
PowerShell bridge implementation
Additional CAD format support
Development Process
Fork the repo and create your branch from
mainIf you've added code that should be tested, add tests
If you've changed APIs, update the documentation
Ensure the test suite passes
Make sure your code lints
Issue that pull request!
Pull Request Process
Update the README.md with details of changes to the interface
Update the CHANGELOG section in README.md with a note describing your changes
The PR will be merged once you have the sign-off of at least one maintainer
Any contributions you make will be under the MIT Software License.
π Roadmap
Intelligent adapter architecture
Feature complexity analyzer
Dynamic VBA macro generation
Circuit breaker pattern
Connection pooling
Code refactoring and modularization (Dec 2025)
Edge.js adapter (pending .NET setup)
PowerShell bridge
Cloud deployment support
Real-time collaboration
AI-powered design suggestions
π Changelog
[1.0.0] - 2025-12-21
Created
Initial Release - New project created with intelligent COM bridge architecture
π Troubleshooting
COM Registration Issues
# Re-register SolidWorks COM
regsvr32 "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\sldworks.tlb"Build Issues
# Clean rebuild
rm -rf node_modules dist
npm install
npm run buildEnable Debug Logging
// Set in environment
ENABLE_LOGGING=true
LOG_LEVEL=debugπ License
MIT License - See LICENSE file
π Acknowledgments
SolidWorks API Team for comprehensive documentation
winax contributors for COM bridge
Anthropic for MCP protocol specification
Community contributors and testers
π Support
Issues: GitHub Issues
Making SolidWorks automation accessible to everyone
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jianzhichun/solidworks-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server