Skip to main content
Glama
SolidWorks MCP Server

SolidWorks MCP Server

by vespo92

SolidWorks MCP Server

TypeScript MCP Compatible Node.js License: MIT Windows

A Node.js MCP server for automating SolidWorks via COM interop. Connects AI assistants (Claude Desktop, etc.) to SolidWorks for CAD automation tasks.

Project Status: Alpha / Experimental

This project is under active development. While the architecture is in place and basic operations (sketch planes, simple extrusions) have been demonstrated, most tools have not been validated against a live SolidWorks instance. Expect rough edges, COM quirks, and incomplete functionality. Contributions and testing reports are very welcome.

How It Works

The server exposes SolidWorks operations as MCP tools over stdio. An intelligent routing layer handles a key limitation of Node.js COM bridges: methods with 13+ parameters often fail via direct COM calls.

  • Simple operations (12 params or fewer) - Direct COM call via winax

  • Complex operations (13+ params) - Auto-generated VBA macro executed by SolidWorks

  • Failed operations - Automatic fallback with error context

Related MCP server: solidworks-mcp

Prerequisites

  • Windows 10/11 (required - COM interop is Windows-only)

  • SolidWorks 2021-2025 (licensed, installed)

  • Node.js 20+

  • An MCP-compatible client (Claude Desktop, etc.)

Installation

git clone https://github.com/vespo92/SolidworksMCP-TS.git
cd SolidworksMCP-TS

# Install dependencies (compiles winax native module for your system)
npm install

# Build TypeScript
npm run build

Note: The winax native module must be compiled locally on each Windows machine. Global npm installation does not work.

Configure Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "solidworks": {
      "command": "node",
      "args": ["C:/path/to/SolidworksMCP-TS/dist/index.js"],
      "env": {
        "SOLIDWORKS_PATH": "C:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS",
        "ADAPTER_TYPE": "winax-enhanced"
      }
    }
  }
}

Available Tools

The server registers tools across these categories:

Category

Tools

Status

Modeling

create_part, create_extrusion, create_revolve, create_sweep, create_loft, create_fillet, create_chamfer, etc.

Partially tested

Sketch

create_sketch, add_line, add_circle, add_rectangle, add_arc, add_constraints, dimension_sketch

Basic ops verified

Drawing

create_drawing_from_model, add_drawing_view, add_section_view, add_dimensions, etc.

Untested

Export

export_file (STEP, IGES, STL, PDF, DWG, DXF), batch_export

Untested

Analysis

get_mass_properties, check_interference, measure_distance, check_geometry

Untested

VBA Generation

generate_vba_script, vba_sheet_metal, vba_configurations, vba_equations, etc.

Code generation works; execution untested

Macro

macro_start_recording, macro_stop_recording, macro_export_vba

Untested

"Partially tested" means the tool has been run against SolidWorks at least once but not comprehensively. "Untested" means only mock/unit tests exist (if any).

Architecture

MCP Protocol (stdio)
    |
Tool Registry (index.ts)
    |
Feature Complexity Analyzer --- routes by param count
    |                    |
Direct COM (winax)    VBA Macro Generator
    |                    |
    +--------------------+
    |
SolidWorks COM API

Key Design Decisions

  • COM parameter limit workaround: SolidWorks API methods like FeatureExtrusion3 take 20+ parameters. Node.js COM bridges choke on these. The complexity analyzer detects this and generates a VBA macro instead.

  • Never pass null to COM: Use undefined for optional parameters. COM interprets null as VT_NULL, causing type mismatch errors (this was the root cause of SelectByID2 failures).

  • Feature tree traversal over SelectByID2: FeatureByPositionReverse() + GetTypeName2() is more reliable for finding sketches than SelectByID2.

  • Winston logger only: Never use console.* - it corrupts the JSON-RPC stdio transport.

Development

npm run build        # TypeScript compile
npm run dev          # Hot-reload dev server (tsx watch)
npm run check        # TypeScript + Biome lint in one command
npm run lint         # Biome lint check
npm run lint:fix     # Biome auto-fix
npm run format       # Biome format
npm run typecheck    # Type check without emit

Testing

See TESTING.md for the full testing guide.

# Unit tests (mock adapter, no SolidWorks needed)
USE_MOCK_SOLIDWORKS=true npm test

# Watch mode
npm run test:watch

Current test status: Unit tests exist for config and environment utilities. Most tool modules lack test coverage. Integration tests require a Windows machine with SolidWorks and have not been run in CI.

Known Issues & Limitations

  • No CI integration testing - Tests only run against mocks. Real SolidWorks integration tests require a self-hosted Windows runner that doesn't exist yet.

  • winax compilation - Must be compiled locally on each machine. No pre-built binaries.

  • Edge.js adapter - Defined in architecture but not implemented.

  • PowerShell bridge - Defined in architecture but not implemented.

  • Connection pooling / circuit breaker - Referenced in code but not battle-tested.

  • Performance metrics are unverified - No real benchmarking has been done.

What Has Worked

Based on development testing:

  • Connecting to a running SolidWorks instance via COM

  • Creating sketch planes and basic sketch geometry

  • Simple extrusions with limited parameters

  • Feature tree traversal for sketch selection

  • VBA macro code generation (execution path needs more testing)

Roadmap

  • Comprehensive integration test suite on real SolidWorks

  • CI with self-hosted Windows runner

  • Validate all modeling tools end-to-end

  • Validate drawing and export tools

  • Edge.js adapter for .NET runtime path

  • PowerShell bridge as alternative COM path

  • Performance benchmarking with real metrics

Contributing

See CONTRIBUTING.md for guidelines.

Key areas where help is needed:

  • Testing against real SolidWorks - The biggest gap. If you have SolidWorks, running tools and reporting results is extremely valuable.

  • COM interop edge cases - Different SolidWorks versions behave differently.

  • Additional tool implementations - Many SolidWorks API methods aren't exposed yet.

Troubleshooting

For winax native build failures on Windows 11 Build 26200+ / VS 2022 BuildTools 17.14+ (issue #23) and other install-time problems, see TROUBLESHOOTING.md.

COM Registration Issues

regsvr32 "C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\sldworks.tlb"

Build Issues

rm -rf node_modules dist
npm install
npm run build

Debug Logging

ENABLE_LOGGING=true LOG_LEVEL=debug node dist/index.js

License

MIT - See LICENSE

Acknowledgments

  • winax - COM bridge for Node.js

  • Anthropic MCP - Model Context Protocol

  • SolidWorks API documentation

Available Tools

86 tools
add_dimensionsB

Add dimensions to a drawing view

Inputs: viewName (required), autoArrange.

add_drawing_viewC

Add a view to the current drawing

Inputs: viewType (required), modelPath (required), x (required), y (required), +1 more.

add_section_viewC

Add a section view to the drawing

Inputs: parentView (required), x (required), y (required), sectionLine (required).

add_sketch_constraintC

Add constraints between sketch entities

Inputs: type (required), entity1 (required), entity2, entity3.

add_sketch_dimensionC

Add dimensions to sketch entities

Inputs: type (required), entity (required), value (required), position.

analyze_draftB

Analyze draft angles for molding

Inputs: pullDirection (required), requiredAngle.

apply_drawing_templateC

Apply template settings to a target drawing file

Inputs: targetFile (required), templateData, templateFile, applyFormat, +3 more.

batch_apply_templateB

Apply template to multiple child drawing files

Inputs: parentFile (required), childFiles (required), includeSubfolders, filePattern, +5 more.

batch_exportC

Export multiple configurations or files to a format

Inputs: format (required), outputDir (required), configurations, prefix.

batch_run_macrosB

Run multiple macros in sequence

Inputs: macros (required), delayBetween, stopOnError.

capture_screenshotB

Capture a screenshot of the current model view

Inputs: outputPath (required), width, height.

check_geometryC

Check model geometry for errors

Inputs: checkType.

check_interferenceC

Check for interference between components in an assembly

Inputs: treatCoincidenceAsInterference, treatSubAssembliesAsComponents, includeMultibodyParts.

close_modelC

Close the current model with option to save

Inputs: save.

compare_drawing_templatesB

Compare template settings between two drawings

Inputs: file1 (required), file2 (required), compareFormat, compareProperties, +1 more.

convert_text_to_native_macroB

Convert plain text VBA code to a properly initialized SolidWorks macro

Inputs: vbaCode (required), outputPath (required), macroName (required), addInitialization, +1 more.

create_batch_vbaC

Generate VBA for batch processing multiple files

Inputs: operation (required), filePattern (required), outputFormat, propertyName, +1 more.

create_drawing_from_modelC

Create a new drawing from the current 3D model

Inputs: template (required), sheet_size.

create_drawing_vbaC

Generate VBA to create drawings from 3D models

Inputs: modelPath (required), template (required), views (required), sheet_size (required).

create_extrusionD

Create an extrusion feature

Inputs: depth (required), draft, reverse.

create_feature_vbaC

Generate VBA code to create a specific feature

Inputs: featureType (required), parameters (required).

create_initialized_macroC

Create a new macro with proper SolidWorks VBA initialization

Inputs: macroPath (required), macroName (required), description, includeErrorHandling, +2 more.

create_partB

Create a new SolidWorks part document

Inputs: no named parameters.

create_sketchB

Create a new sketch on a specified plane or face

Inputs: plane, offset, reverse, customPlane.

design_table_createB

Create a new design table with optional SQL data source

Inputs: name (required), config.

design_table_refreshC

Refresh design table data from SQL source

Inputs: resourceId (required).

edit_macroB

Open a macro in the SolidWorks VBA editor

Inputs: macroPath (required).

edit_sketchB

Enter sketch edit mode for an existing sketch

Inputs: sketchName (required).

exit_sketchC

Exit sketch edit mode and rebuild

Inputs: rebuild.

export_fileB

Export the current model to various formats

Inputs: outputPath (required), format.

export_with_optionsC

Export with specific format options

Inputs: outputPath (required), format (required), options (required).

extract_drawing_templateB

Extract complete template settings from a parent drawing file

Inputs: filePath (required), includeFormat, includeProperties, includeStyles, +2 more.

generate_vba_scriptC

Generate a VBA script from a template with parameters

Inputs: template (required), parameters (required), outputPath.

get_bounding_boxB

Get the bounding box dimensions of the model

Inputs: no named parameters.

get_dimensionB

Get the value of a dimension

Inputs: name (required).

get_mass_propertiesB

Get mass properties of the current model

Inputs: units.

list_template_libraryC

List all templates in the library

Inputs: libraryPath, category, tags.

macro_export_vbaC

Export a recorded macro to VBA code

Inputs: macroId (required).

macro_start_recordingC

Start recording a new macro

Inputs: name (required), description.

macro_stop_recordingB

Stop the current macro recording

Inputs: no named parameters.

measure_distanceC

Measure distance between two selected entities

Inputs: entity1 (required), entity2 (required).

open_modelB

Open a SolidWorks part, assembly, or drawing file

Inputs: path (required).

pause_resume_macro_recordingB

Pause or resume the current macro recording

Inputs: action (required).

rebuild_modelC

Rebuild the current model

Inputs: force.

run_macroC

Run a SolidWorks macro file

Inputs: macroPath (required), moduleName, procedureName, arguments, +1 more.

run_vba_macroC

Execute a VBA macro in SolidWorks

Inputs: macroPath (required), procedureName (required), moduleName, arguments.

save_template_to_libraryC

Save a drawing template to a reusable library

Inputs: sourceFile (required), templateName (required), category, description, +2 more.

set_dimensionB

Set the value of a dimension

Inputs: name (required), value (required).

sketch_arcC

Draw an arc in the active sketch

Inputs: center (required), start (required), end (required), direction, +1 more.

sketch_centerlineC

Draw a centerline in the active sketch

Inputs: start (required), end (required).

sketch_circleB

Draw a circle in the active sketch

Inputs: center (required), radius (required), construction.

sketch_circular_patternB

Create a circular pattern of sketch entities

Inputs: entities (required), center (required), count (required), angle, +1 more.

sketch_ellipseB

Draw an ellipse in the active sketch

Inputs: center (required), majorAxis (required), minorAxis (required), construction.

sketch_lineC

Draw a line in the active sketch

Inputs: start (required), end (required), construction.

sketch_linear_patternC

Create a linear pattern of sketch entities

Inputs: entities (required), direction1 (required), direction2.

sketch_mirrorA

Mirror sketch entities about a line

Inputs: entities (required), mirrorLine (required), copy.

sketch_offsetC

Create offset curves from sketch entities

Inputs: entities (required), distance (required), side, corner, +1 more.

sketch_polygonB

Draw a regular polygon in the active sketch

Inputs: center (required), sides (required), radius (required), rotation, +2 more.

sketch_rectangleB

Draw a rectangle in the active sketch

Inputs: corner1 (required), corner2 (required), centered, construction.

sketch_splineB

Draw a spline through points in the active sketch

Inputs: points (required), closed, construction.

start_native_macro_recordingB

Start recording a macro using SolidWorks native VBA recorder

Inputs: macroPath (required), pauseRecording, recordViewCommands, recordFeatureManager, +1 more.

stop_native_macro_recordingB

Stop the current native macro recording and save

Inputs: openInEditor, runMacro.

update_sheet_formatC

Update drawing sheet format and properties

Inputs: properties (required).

vba_advanced_featuresC

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

Inputs: featureType (required), profiles (required), guideCurves, path, +3 more.

vba_api_automationC

Generate VBA for advanced API automation and event handling

Inputs: automationType (required), eventTypes, className, methods.

vba_assembly_analysisC

Generate VBA for assembly analysis

Inputs: analysisType (required), components, outputPath, includeSubassemblies, +1 more.

vba_assembly_componentsC

Generate VBA for inserting and managing components

Inputs: operation (required), componentPath, componentName, configurationName, +4 more.

vba_assembly_configurationsC

Generate VBA for managing assembly configurations

Inputs: operation (required), configName (required), parentConfig, componentsToSuppress, +2 more.

vba_assembly_matesC

Generate VBA for creating assembly mates

Inputs: mateType (required), component1 (required), face1 (required), component2 (required), +5 more.

vba_batch_operationsC

Generate VBA for batch file operations

Inputs: operation (required), sourcePath (required), destinationPath, fileFilter, +3 more.

vba_configurationsC

Generate VBA for managing configurations

Inputs: operation (required), configName (required), parentConfig, features, +3 more.

vba_create_drawing_viewsC

Generate VBA for creating drawing views

Inputs: viewType (required), modelPath (required), position (required), viewOrientation, +3 more.

vba_create_reference_geometryC

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

Inputs: geometryType (required), referenceType (required), references (required), offset, +2 more.

vba_custom_propertiesC

Generate VBA for managing custom properties

Inputs: operation (required), properties, sourcePath, templatePath, +1 more.

vba_design_tableC

Generate VBA for creating and managing design tables

Inputs: operation (required), tableName (required), parameters, excelPath, +1 more.

vba_drawing_annotationsC

Generate VBA for adding annotations to drawings

Inputs: annotationType (required), position (required), text, leaderPoints, +3 more.

vba_drawing_dimensionsC

Generate VBA for adding dimensions to drawings

Inputs: dimensionType (required), position (required), viewName, entities, +3 more.

vba_drawing_sheet_formatC

Generate VBA for managing drawing sheets and formats

Inputs: operation (required), sheetName, sheetSize, customSize, +3 more.

vba_drawing_tablesC

Generate VBA for creating tables in drawings

Inputs: tableType (required), position (required), rows, columns, +4 more.

vba_equationsC

Generate VBA for managing equations and global variables

Inputs: operation (required), equations, externalFile, linkExternal.

vba_error_handlingC

Generate VBA with comprehensive error handling and logging

Inputs: functionName (required), operationType (required), logToFile, logPath, +2 more.

vba_pattern_featuresC

Generate VBA for pattern features

Inputs: patternType (required), featureNames (required), direction1 (required), direction2, +3 more.

vba_pdm_operationsC

Generate VBA for PDM vault operations

Inputs: operation (required), vaultName (required), filePath, comment, +3 more.

vba_sheet_metalC

Generate VBA for sheet metal operations

Inputs: operation (required), thickness (required), bendRadius, bendAngle, +3 more.

vba_simulation_setupC

Generate VBA for setting up simulation studies

Inputs: studyType (required), studyName (required), materials, fixtures, +2 more.

vba_surface_modelingC

Generate VBA for surface modeling operations

Inputs: surfaceType (required), sketches (required), distance, angle, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.4/5.0

    Scored across 86 tools

    Disambiguation1/5

    There are many tools with highly overlapping purposes, particularly among the 26 VBA generation tools and 12 macro-related tools. For example, 'vba_assembly_analysis' and 'vba_assembly_components' are unclear in distinction, and multiple macro recording/export tools are redundant. An agent would struggle to select the correct tool.

    Naming Consistency3/5

    Most tools follow a verb_noun pattern (e.g., 'create_extrusion', 'add_dimensions'), but inconsistencies exist like 'design_table_create' (noun_verb) and the 'vba_*' prefix group that does not start with a verb. The naming is generally readable but not uniformly consistent.

    Tool Count2/5

    With 86 tools, the server is very large. Many tools are highly specialized (e.g., numerous VBA generators) and could be consolidated. This count feels excessive for a coherent MCP server, likely causing confusion and inefficiency.

    Completeness3/5

    The tool set covers a wide range of SolidWorks operations including sketching, features, drawings, and macros. However, there are notable gaps such as missing direct operations for revolved or swept features, and an over-reliance on VBA generation rather than direct API calls, which may limit practical use.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP bridge server for SolidWorks that enables AI assistants to control SolidWorks programmatically via COM automation.
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      Python MCP server for SolidWorks automation with 109 tools covering the full CAD lifecycle. Enables AI-assisted design workflows through COM automation on Windows.
      154
      97
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that drives SolidWorks 2023+ on Windows, exposing CAD operations like sketching, extrusions, assemblies, and exports through tools for AI assistants like Kimi and Claude.
      1
      -