Skip to main content
Glama
jianzhichun

SolidWorks MCP Server

by jianzhichun

SolidWorks MCP Server - Intelligent COM Bridge with Dynamic Fallback

TypeScript MCP Compatible Node.js License: MIT Windows SolidWorks

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 build

Configure 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_sketch

plane (Front/Top/Right/Custom), offset (number, default: 0), reverse (boolean, default: false), customPlane (optional object)

success, sketchName, plane, offset, message

Create a new sketch on a specified plane or face

Initialize sketch for feature creation

1. Select plane/face2. Create sketch3. Return sketch name

edit_sketch

sketchName

success, sketchName, message

Enter sketch edit mode for an existing sketch

Modify existing sketch geometry

1. Find sketch by name2. Activate sketch3. Return status

exit_sketch

rebuild (boolean)

success, message

Exit sketch edit mode and optionally rebuild

Complete sketch editing

1. Exit sketch2. Optionally rebuild model

get_sketch_context

maxFeatures (optional, default: 5)

hasModel, modelName, modelType, activeSketch, recentSketchFeatures

Get current model and sketch context for diagnostics

Debug sketch operations

1. Get active model2. Get active sketch3. Return context

sketch_line

start ({x, y, z}), end ({x, y, z}), construction (boolean, default: false)

success, message, position

Draw a line in the active sketch

Add line geometry

1. Validate sketch active2. Create line from points3. Return entity info

sketch_centerline

start ({x, y}), end ({x, y})

success, message

Draw a centerline in the active sketch

Add construction centerline

1. Validate sketch active2. Create centerline3. Return entity info

sketch_circle

center ({x, y, z}), radius (number), construction (boolean, default: false)

success, message

Draw a circle in the active sketch

Add circle geometry

1. Validate sketch active2. Create circle by radius3. Return entity info

sketch_arc

center ({x, y}), start ({x, y}), end ({x, y}), direction (clockwise/counterclockwise, default: counterclockwise), construction (boolean, default: false)

success, message

Draw an arc in the active sketch

Add arc geometry

1. Validate sketch active2. Create arc by 3 points3. Return entity info

sketch_rectangle

corner1 ({x, y}), corner2 ({x, y}), centered (boolean, default: false), construction (boolean, default: false)

success, message

Draw a rectangle in the active sketch

Add rectangle geometry

1. Validate sketch active2. Create corner rectangle3. Return entity info

sketch_polygon

center ({x, y}), sides (number, 3-100), radius (number), rotation (number, default: 0), inscribed (boolean, default: false), construction (boolean, default: false)

success, message

Draw a regular polygon in the active sketch

Add polygon geometry

1. Validate sketch active2. Create polygon3. Return entity info

sketch_spline

points (array of {x, y, z}), closed (boolean, default: false), construction (boolean, default: false)

success, message

Draw a spline through points in the active sketch

Add spline geometry

1. Validate sketch active2. Create spline from points3. Return entity info

sketch_ellipse

center ({x, y}), majorAxis ({length, angle}), minorAxis (number), construction (boolean, default: false)

success, message

Draw an ellipse in the active sketch

Add ellipse geometry

1. Validate sketch active2. Create ellipse3. Return entity info

add_sketch_constraint

type (coincident/parallel/perpendicular/tangent/concentric/horizontal/vertical/equal/symmetric/colinear/midpoint/fix), entity1 (string, default: 'last'), entity2 (optional), entity3 (optional)

success, message

Add constraints between sketch entities

Constrain sketch geometry

1. Validate entities exist2. Apply constraint3. Return status

add_sketch_dimension

type (linear/angular/radial/diameter), entity (string), value (number), position (optional {x, y})

success, message, type, value

Add dimensions to sketch entities

Dimension sketch geometry

1. Validate entity exists2. Add dimension3. Return dimension info

sketch_linear_pattern

entities (array), direction1 ({x, y, count, spacing}), direction2 (optional {x, y, count, spacing})

success, message

Create a linear pattern of sketch entities

Pattern sketch geometry

1. Select entities2. Define pattern direction3. Create pattern

sketch_circular_pattern

entities (array), center ({x, y}), count (number), angle (number, default: 360), equalSpacing (boolean, default: true)

success, message

Create a circular pattern of sketch entities

Pattern sketch geometry circularly

1. Select entities2. Define center point3. Create pattern

sketch_mirror

entities (array), mirrorLine (string), copy (boolean, default: true)

success, message

Mirror sketch entities about a line

Mirror sketch geometry

1. Select entities2. Select mirror line3. Create mirror

sketch_offset

entities (array), distance (number), side (both/left/right, default: both), corner (sharp/round/natural, default: natural), cap (boolean, default: true)

success, message

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_drawing_from_model

template (string, path), sheet_size (optional: A4/A3/A2/A1/A0/Letter/Tabloid)

success, message, drawingName, warnings

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_drawing_view

viewType (front/top/right/back/bottom/left/iso/current), modelPath (string), x (number, mm), y (number, mm), scale (optional number)

success, message, viewName, position

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_section_view

parentView (string), x (number, mm), y (number, mm), sectionLine ({x1, y1, x2, y2})

success, message

Add a section view to the drawing

Create section cut view

1. Define section line2. Create section view3. Position view

add_dimensions

viewName (string), autoArrange (boolean, default: true)

success, message, viewName, dimensionCount

Add automatic dimensions to a drawing view

Dimension drawing views

1. Select view2. Auto-dimension entities3. Return dimension count

update_sheet_format

properties ({title, drawnBy, checkedBy, date, scale, material, finish})

success, message, updatedProperties

Update drawing sheet format and properties

Modify sheet format

1. Get current sheet2. Update format3. Update properties

add_diameter_dimension

viewName (string), x (number), y (number), text (optional string)

success, message, position

Add dimension with diameter symbol to a view

Add diameter dimension

1. Select circular entity2. Add dimension3. Apply diameter symbol

set_view_grayscale_enhanced

viewName (string)

success, message, methods

Enhanced method to set view to grayscale

Convert view to grayscale

1. Get view2. Set display mode3. Apply grayscale

create_configurations_batch

configs (array of {name, outsideDiameter, insideDiameter, thickness})

success, message, createdConfigs, failedConfigs

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_file

outputPath (string), format (optional: step/iges/stl/pdf/dxf/dwg)

success, message, outputPath, format

Export the current model to various formats

Export model to different formats

1. Get active model2. Determine format3. Execute export4. Verify file

batch_export

format (step/iges/stl/pdf/dxf/dwg), outputDir (string), configurations (optional array), prefix (optional string)

success, message, exportedFiles, count

Export multiple configurations or files to a format

Batch export operations

1. Get configurations2. Iterate each config3. Export with naming4. Return list

export_with_options

outputPath (string), format (stl/step/iges), options ({units, binary, version, quality})

success, message, outputPath, format

Export with specific format options

Advanced export with options

1. Set export options2. Execute export3. Return result

capture_screenshot

outputPath, width, height

success, outputPath

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

units (kg/g/lb, default: kg)

mass, volume, surfaceArea, centerOfMass

Get mass properties of the current model

Calculate mass, volume, center of mass

1. Get model2. Calculate properties3. Convert units4. Return values

check_interference

treatCoincidenceAsInterference (boolean, default: false), treatSubAssembliesAsComponents (boolean, default: false), includeMultibodyParts (boolean, default: true)

message, count

Check for interference between components in an assembly

Detect component interference

1. Get assembly2. Run interference check3. Return results

measure_distance

entity1 (string), entity2 (string)

Returns string message

Measure distance between two selected entities

Measure entity distance

1. Select entities2. Calculate distance3. Return value

analyze_draft

pullDirection (x/y/z/-x/-y/-z), requiredAngle (number, default: 1)

Returns string message

Analyze draft angles on model faces

Check draft angles

1. Get model2. Analyze faces3. Return draft info

check_geometry

checkType (all/faces/edges/vertices, default: all)

Returns string message

Check geometry for errors and validation

Validate model geometry

1. Get model2. Check geometry3. Return issues

get_bounding_box

includeHiddenBodies (boolean, default: false)

dimensions, volume, diagonal, note

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_drawing_template

filePath (string), includeFormat (boolean, default: true), includeProperties (boolean, default: true), includeStyles (boolean, default: true), includeViews (boolean, default: false), saveAs (optional string)

success, message, templateData, propertyCount, viewCount

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_drawing_template

targetFile (string), templateData (optional object), templateFile (optional string), applyFormat (boolean, default: true), applyProperties (boolean, default: true), applyStyles (boolean, default: true), overwriteExisting (boolean, default: false)

success, message, changedItems, appliedFormat, appliedProperties, appliedStyles

Apply template settings to a target drawing file

Apply template to drawing

1. Open target drawing2. Load template3. Apply format4. Apply properties5. Apply styles

batch_apply_template

parentFile (string), childFiles (array), includeSubfolders (boolean, default: false), filePattern (string, default: '*.SLDDRW'), applyFormat (boolean, default: true), applyProperties (boolean, default: true), applyStyles (boolean, default: true), overwriteExisting (boolean, default: false), saveReport (optional string)

success, message, summary, processedFiles, failedFiles

Apply template to multiple child drawing files

Batch apply template

1. Get file list2. Iterate files3. Apply template4. Return results

compare_drawing_templates

file1 (string), file2 (string), compareFormat (boolean, default: true), compareProperties (boolean, default: true), compareStyles (boolean, default: true)

success, message, file1, file2, differences, identical

Compare template settings between two drawings

Compare templates

1. Load both templates2. Compare settings3. Return differences

save_template_to_library

sourceFile (string), templateName (string), category (string, default: 'General'), description (optional string), tags (array, default: []), libraryPath (string, default: './templates')

success, message, path, templateName

Save a drawing template to a reusable library

Save template library

1. Extract template2. Save to library3. Add metadata

list_template_library

libraryPath (string, default: './templates'), category (optional string), tags (optional array)

success, message, templates, count, categories, allTags

List all templates in the library

List template library

1. Load library index2. Filter by category/tags3. Return templates

list_template_library

category (optional)

templates (array)

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_native_macro_recording

macroPath (string), pauseRecording (boolean, default: false), recordViewCommands (boolean, default: false), recordFeatureManager (boolean, default: true), recordSelections (boolean, default: true)

success, message, macroPath, status, options

Start recording a macro using SolidWorks native VBA recorder

Start macro recording

1. Set macro path2. Configure options3. Start recording4. Return status

stop_native_macro_recording

openInEditor (boolean, default: false), runMacro (boolean, default: false)

success, message, macroPath, openedInEditor, executed

Stop the current native macro recording and save

Stop macro recording

1. Stop recording2. Save macro file3. Return path

pause_resume_macro_recording

action (pause/resume)

success, message, status

Pause or resume the current macro recording

Control recording state

1. Check recording state2. Pause/resume3. Return status

run_macro

macroPath (string), moduleName (string, default: 'main'), procedureName (string, default: 'main'), arguments (optional array), unloadAfterRun (boolean, default: true)

success, message, macroPath, module, procedure, hadArguments

Run a SolidWorks macro file

Execute macro

1. Load macro file2. Execute procedure3. Return result

edit_macro

macroPath (string)

success, message, macroPath

Open a macro in the SolidWorks VBA editor

Edit macro

1. Check file exists2. Open in editor3. Return status

create_initialized_macro

macroPath (string), macroName (string), description (optional string), includeErrorHandling (boolean, default: true), includeComments (boolean, default: true), template (basic/part/assembly/drawing, default: basic)

success, message, macroPath, macroName, template, linesOfCode

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_text_to_native_macro

vbaCode (string), outputPath (string), macroName (string), addInitialization (boolean, default: true), addReferences (boolean, default: true)

success, message, outputPath, macroName, linesOfCode, referencesAdded, initializationAdded

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

batch_run_macros

macros (array of {path, module, procedure, arguments}), stopOnError (boolean, default: false)

success, message, results, executed, failed

Run multiple macros in sequence

Batch execute macros

1. Load macro list2. Execute each macro3. Return results

edit_macro

macroPath

success, message

Open a macro in the SolidWorks VBA editor

Edit macro code

1. Open VBA editor2. Load macro3. Return status

create_initialized_macro

macroPath, description

success, macroPath

Create a new macro with proper SolidWorks VBA initialization

Create new macro

1. Create macro file2. Add initialization code3. Return path

convert_text_to_native_macro

vbaCode, macroPath

success, macroPath

Convert plain text VBA code to a properly initialized SolidWorks macro

Convert text to macro

1. Parse VBA code2. Add initialization3. Save macro

batch_run_macros

macros (array)

success, results

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

macroPath (string), moduleName (string, default: 'Module1'), procedureName (string)

success, message, steps, recommendations

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

macro_set_security

level (low/medium/high)

success, message, level, requiresRestart

Attempt to set macro security level

Configure macro security

1. Get SolidWorks app2. Set security level3. Verify change4. Return status

macro_get_security_info

None (empty object)

success, message, securityLevel, vbaEnabled, instructions

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

macro_start_recording

name (string), description (optional string)

macroId, status

Start recording a new macro

Begin macro recording session

1. Initialize recorder2. Start session3. Return macro ID

macro_stop_recording

None (empty object)

id, name, description, actions

Stop the current macro recording

End recording session

1. Stop recording2. Return recorded actions

macro_export_vba

macroId (string)

code

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_vba_script

template (string), parameters (object), outputPath (optional string)

success, message, vbaCode, outputPath, linesOfCode

Generate a VBA script from a template with parameters

Generate VBA from template

1. Load template2. Compile with Handlebars3. Fill parameters4. Return code

create_feature_vba

featureType (extrude/revolve/sweep/loft/hole/fillet/chamfer), parameters ({depth, angle, radius, count})

success, message, vbaCode, linesOfCode

Generate VBA code to create a specific feature

Generate feature VBA

1. Select feature type2. Generate code3. Return VBA

create_batch_vba

operation (export/update_property/rebuild/print), filePattern (string), outputFormat (optional string), propertyName (optional string), propertyValue (optional string)

success, message, vbaCode, linesOfCode

Generate VBA for batch processing multiple files

Generate batch VBA

1. Define operation2. Generate batch code3. Return VBA

run_vba_macro

macroPath (string), moduleName (string, default: 'Module1'), procedureName (string), arguments (optional array)

success, message, result

Execute a VBA macro in SolidWorks

Run macro

1. Load macro file2. Execute procedure3. Return result

create_drawing_vba

modelPath (string), template (string), views (array of front/top/right/iso/section/detail), sheet_size (A4/A3/A2/A1/A0/Letter/Tabloid)

success, message, vbaCode, linesOfCode

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

vba_create_reference_geometry

Generate VBA for creating reference geometry (planes, axes, points)

Create reference geometry VBA

1. Select geometry type2. Generate code3. Return VBA

geometryType (plane/axis/point/coordinate_system), parameters (object)

success, message, vbaCode, linesOfCode

vba_advanced_features

Generate VBA for advanced features (sweep, loft, boundary)

Generate advanced feature VBA

1. Select feature type2. Generate code3. Return VBA

featureType (sweep/loft/boundary), parameters (object)

success, message, vbaCode, linesOfCode

vba_pattern_features

patternType (linear/circular/curve), parameters (object)

success, message, vbaCode, linesOfCode

Generate VBA for pattern features

Generate pattern VBA

1. Select pattern type2. Generate code3. Return VBA

vba_sheet_metal

operation (string), parameters (object)

success, message, vbaCode, linesOfCode

Generate VBA for sheet metal operations

Generate sheet metal VBA

1. Select operation2. Generate code3. Return VBA

vba_surface_modeling

operation (string), parameters (object)

success, message, vbaCode, linesOfCode

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

vba_assembly_mates

mates (array), components (array)

success, message, vbaCode, linesOfCode

Generate VBA for creating assembly mates

Generate mate VBA

1. Define mate types2. Generate code3. Return VBA

vba_assembly_components

components (array), positions (array)

success, message, vbaCode, linesOfCode

Generate VBA for inserting and managing components

Generate component VBA

1. Define components2. Generate code3. Return VBA

vba_assembly_analysis

analysisType (interference/clearance/collision/mass_properties), components (array)

success, message, vbaCode, linesOfCode

Generate VBA for assembly analysis

Generate analysis VBA

1. Select analysis type2. Generate code3. Return VBA

vba_assembly_configurations

configurations (array), options (object)

success, message, vbaCode, linesOfCode

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

vba_create_drawing_views

views (array), modelPath (string)

success, message, vbaCode, linesOfCode

Generate VBA for creating drawing views

Generate view VBA

1. Define views2. Generate code3. Return VBA

vba_drawing_dimensions

dimensions (array), viewName (string)

success, message, vbaCode, linesOfCode

Generate VBA for adding dimensions to drawings

Generate dimension VBA

1. Define dimensions2. Generate code3. Return VBA

vba_drawing_annotations

annotations (array), viewName (string)

success, message, vbaCode, linesOfCode

Generate VBA for adding annotations to drawings

Generate annotation VBA

1. Define annotations2. Generate code3. Return VBA

vba_drawing_tables

tableType (string), data (array/object), position (object)

success, message, vbaCode, linesOfCode

Generate VBA for creating tables in drawings

Generate table VBA

1. Define table2. Generate code3. Return VBA

vba_drawing_sheet_format

formatPath (string), properties (object)

success, message, vbaCode, linesOfCode

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

vba_batch_operations

operation (string), filePattern (string), options (object)

success, message, vbaCode, linesOfCode

Generate VBA for batch file operations

Generate batch VBA

1. Define operation2. Generate code3. Return VBA

vba_custom_properties

operation (add/modify/delete/export), properties (array/object)

success, message, vbaCode, linesOfCode

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

vba_configurations

operation (create/derive/suppress_features/set_properties), parameters (object)

success, message, vbaCode, linesOfCode

Generate VBA for managing configurations

Generate config VBA

1. Define config operation2. Generate code3. Return VBA

vba_equations

equations (array), operation (string)

success, message, vbaCode, linesOfCode

Generate VBA for managing equations and global variables

Generate equation VBA

1. Define equations2. Generate code3. Return VBA

vba_simulation_setup

studyType (string), parameters (object)

success, message, vbaCode, linesOfCode

Generate VBA for setting up simulation studies

Generate simulation VBA

1. Define study type2. Generate code3. Return VBA

vba_api_automation

automationType (string), parameters (object)

success, message, vbaCode, linesOfCode

Generate VBA for advanced API automation and event handling

Generate automation VBA

1. Define automation2. Generate code3. Return VBA

vba_error_handling

errorHandlingType (string), parameters (object)

success, message, vbaCode, linesOfCode

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

create-part-workflow

partName (string), complexity (optional: simple/medium/complex, default: simple)

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

create-assembly-workflow

assemblyName (string), componentCount (optional string)

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

analyze-model

analysisType (mass/interference/geometry/all), modelName (optional string)

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

export-workflow

format (STEP/IGES/STL/PDF/DXF/DWG), outputPath (optional string)

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

sketch-workflow

plane (optional: Front/Top/Right, default: Front), sketchType (optional: simple/complex, default: simple)

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

sw-config

solidworks://config

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: {version, units, precision, templatePaths, ...}

material

solidworks://materials/{materialName}

Dynamic resource template - Requires materialName parameter (string). Returns material properties from SolidWorks material database: density, elastic modulus, Poisson's ratio, yield strength, and other mechanical properties.

Material properties from SolidWorks database

Get material properties

JSON: {name, density, modulus, poissonRatio, yieldStrength, ...}

templates

solidworks://templates/{type}

Dynamic resource template - Requires type parameter (string, must be one of: part, assembly, drawing). Returns list of available templates for the specified document type with names, paths, and descriptions.

List of available templates for document type

Get template list

JSON: {type, templates: [{name, path, description}]}

sw-system

solidworks://system

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: {connected, version, activeDocument, openDocuments, ...}


πŸ—οΈ 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:coverage

Testing Without SolidWorks

Perfect for CI/CD and development without SolidWorks installed:

# Set environment variable
export USE_MOCK_SOLIDWORKS=true

# Run tests
npm test

Testing 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

  1. Fork the repo and create your branch from main

  2. If you've added code that should be tested, add tests

  3. If you've changed APIs, update the documentation

  4. Ensure the test suite passes

  5. Make sure your code lints

  6. Issue that pull request!

Pull Request Process

  1. Update the README.md with details of changes to the interface

  2. Update the CHANGELOG section in README.md with a note describing your changes

  3. 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 build

Enable 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


Making SolidWorks automation accessible to everyone

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

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

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