Skip to main content
Glama
TanPhan97

SolidWorks MCP Server

by TanPhan97

SolidWorks MCP Server

Control SolidWorks from Claude in plain language: parts, assemblies, drawings, exports. 132 tools — parts, surfaces, sheet metal, assemblies, drawings · v4.4.0 · tested live on SOLIDWORKS 2026 · Windows · Python 3.10+

License: MIT MCP SolidWorks

part

surface

sheet metal

Hole Wizard, fillet, draft

Surface extrude + thicken

Base + edge flange

sweep

assembly

mates

Sweep along line + arc

Component pattern, exploded view

Slot / hinge / width / gear mates

📘 Full manual (Vietnamese, Word): docs/SolidWorks_MCP_Huong_dan.docx · 📝 CHANGELOG

Quick start

Requires Windows, SolidWorks, Python 3.10+ (64-bit) and Claude Desktop.

git clone https://github.com/TanPhan97/solidworks-mcp.git D:\Solidworks-mcp
cd D:\Solidworks-mcp
py -3 -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txt
.venv\Scripts\python.exe scripts\register_claude_desktop.py

Then Quit Claude Desktop from the system tray, reopen it, and check that Settings → Developer shows solidworks as running. Try: "Connect to SolidWorks and tell me the version."

If the server does not show up, pass the file from Settings → Developer → Edit Config explicitly: register_claude_desktop.py --config "C:\path\to\claude_desktop_config.json" (also: --list, --dry-run, --remove).

Related MCP server: solidworks-mcp

What you can ask

  • "New part: 60×40 rectangle on Top, extrude 10 mm, three M3x0.5 tapped holes 8 deep, fillet the vertical edges R3, material 6061-T6, save to D:\Work\plate.SLDPRT and show me an isometric view."

  • "Change Boss-Extrude1 depth to 12 mm" · "Create global variable Wall = 2 and drive the shell thickness with it."

  • "New assembly with plate and cover, mate them, pattern the cover 3× at 100 mm, check interference, make an exploded view."

  • "Drawing of plate.SLDPRT: 3 views + iso, section A-A, detail at 3:1, model dimensions, center marks, then export PDF."

  • "Export every part in D:\Project to STEP and STL, drawings to PDF."

  • "Curved shell: extrude an R50 arc surface 40 mm and thicken it 2 mm; knit these surfaces into a solid."

  • "Sheet metal 80×50, t=1.5, R2; 20 mm edge flange on the front edge; export the flat pattern to DXF."

  • "Pin in the slot, second pin hinged in the hole, gears 1:2; export the BOM to CSV and Pack and Go to D:\Release."

  • "Drawing: hole table, revision A 'INITIAL RELEASE', auxiliary view of the chamfer."

Tools

Group

Tools

Connection & documents (12)

connect_solidworks, get_solidworks_info, create_new_part, create_new_assembly, open_document, import_file, save_document, close_document, activate_document, get_document_info, list_open_documents, set_units

Sketch (22)

create_sketch, create_sketch_on_face, close_sketch, get_sketch_status, draw_line, draw_circle, draw_rectangle, draw_arc, draw_polygon, draw_centerline, draw_slot, draw_spline, draw_ellipse, sketch_fillet, convert_entities, offset_entities, sketch_mirror, sketch_pattern, set_construction, add_sketch_dimension, add_sketch_relation, sketch_text

Part features (19)

extrude, extrude_sketch, cut_extrude, revolve, loft, sweep, fillet_edges, chamfer_edges, shell, rib, draft, hole_wizard, linear_pattern, circular_pattern, mirror, create_ref_plane, create_ref_axis, scale_part, cosmetic_thread

Multi-body (4)

list_bodies, combine_bodies, split_body, delete_body

Surface (9)

surface_extrude, surface_revolve, planar_surface, offset_surface, loft_surface, knit_surfaces, thicken_surface, cut_with_surface, delete_face

Sheet metal (4)

base_flange, edge_flange, flatten, export_flat_pattern

Selection & topology (8)

list_edges, list_faces, select_edges, select_faces, select_entity, clear_selection, get_selection, measure

Parametric edit (15)

list_features, get_feature_info, edit_feature, list_dimensions, set_dimension, list_equations, set_equation, list_configurations, add_configuration, activate_configuration, suppress_feature, delete_feature, rename_feature, rebuild, undo

Properties & output (8)

get_mass_properties, set_material, set_custom_property, get_custom_properties, export_document, batch_export, set_view, capture_view

Assembly (14)

insert_component, add_mate, list_components, list_mates, move_component, fix_component, set_component_state, replace_component, component_pattern, check_interference, create_exploded_view, add_advanced_mate, export_bom, pack_and_go

Drawing (16)

create_drawing, list_drawing_views, add_drawing_view, add_section_view, add_detail_view, insert_model_annotations, insert_center_marks, insert_bom, auto_balloon, add_note, add_sheet, activate_sheet, add_revision, insert_hole_table, add_auxiliary_view, add_broken_out_section

Advanced (1)

execute_python

All lengths take an optional unit (mm default; cm, m, inch, ft). Angles are in degrees.

Configuration (optional)

solidworks_mcp/config.json. Every key is optional, and auto means auto-detect:

{ "default_unit": "mm", "part_template": "auto", "assembly_template": "auto",
  "drawing_template": "C:\\Templates\\A4.drwdot", "log_level": "INFO" }

Logs go to solidworks_mcp/solidworks_mcp.log; stdout is reserved for MCP.

Testing

.venv\Scripts\python.exe -m pytest -q solidworks_mcp\tests          :: offline, fake COM (51 tests)
.venv\Scripts\python.exe scripts\smoke_test.py D:\swmcp_test        :: live, SolidWorks open (216 checks, 13 sections)

Use a new output folder for each smoke run. SolidWorks cannot open two files with the same name.

Troubleshooting

Problem

Fix

Server missing in Claude Desktop

Register with --config (Store installs use another folder), then fully Quit and reopen

"No part template found"

Set part_template in config.json or a default template in SolidWorks Options

A tool hangs or times out

A modal dialog is open in SolidWorks: close it. The known dialogs are suppressed in code

"Critically low on memory"

Too many open documents: close some

Advanced mate reports over-defined

The first inserted component is fixed: fix_component(names, fixed=false)

New tools do not appear

Quit and reopen Claude Desktop

Safety

execute_python runs arbitrary Python with your user rights. Use it only in trusted setups, or remove it from TOOL_TABLE in solidworks_mcp/tools_ext.py. The server never calls CloseAllDocuments, and batch export never closes documents that were already open or have unsaved changes.

Project layout

solidworks_mcp_server.py      entry point (launched by Claude Desktop)
solidworks_mcp/server.py      MCP server: list_tools / call_tool
solidworks_mcp/tools_ext.py   tool registry: schema + dispatch for all 132 tools
solidworks_mcp/automation/    SolidWorks logic (sketch, features, surfaces, sheet metal, assembly, drawing…)
solidworks_mcp/tests/         offline unit tests
scripts/                      smoke test, Claude Desktop registration

To add a tool, write the method in an automation/ mixin and add one line to TOOL_TABLE and CATEGORIES.

Credits

Original project by Samsaam Ali Baig (alisamsam/solidworks-mcp), MIT License. v4.x extensions (part / assembly / drawing tools, registry, tests) by Phan Chu Tan.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to create and manipulate SolidWorks CAD models through natural language commands, automating part creation, sketching, and extrusion.
    10
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI (e.g., Claude) to control SolidWorks via natural language, automating part creation, sketching, and feature operations through the Model Context Protocol.
    1
    MIT
  • A
    license
    B
    quality
    B
    maintenance
    Enables Claude or any MCP client to drive a live SOLIDWORKS session through its COM API, modeling parts, building assemblies with mates, checking interferences and machining feasibility, and exporting STEP or DXF files. It also exposes a local semantic index of the SOLIDWORKS API so the model can look up signatures, enums, and official examples before running arbitrary Python against the session.
    22
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables Claude to create and modify real Onshape CAD models — sketches, extrudes, fillets, patterns, mates, and parametric variables — with every mutation returning structured status, warnings, and geometric deltas. Includes multi-view PNG rendering, image-reference decomposition, and drawing OCR so the agent can visually verify and iterate on parts and assemblies.
    MIT