Skip to main content
Glama
SolidWorks MCP Server

SolidWorks MCP Server

by gychant

SolidWorks MCP Server šŸ”§

Automate SolidWorks using natural language through Claude AI and the Model Context Protocol (MCP)

License: MIT Python 3.10+ SolidWorks 2025 MCP


šŸŽÆ What is This?

SolidWorks MCP Server is a production-ready Model Context Protocol server that lets Claude AI control SolidWorks through natural language. Instead of manually clicking through menus, you simply tell Claude what to design — and it builds it for you.

Example prompts you can use:

  • "Create a new part, draw a circle with radius 30mm and extrude it 15mm"

  • "Add a fillet of 2mm to all edges"

  • "Draw a hexagon and cut extrude it 10mm"

  • "List all features in the current part"


Related MCP server: SolidWorks MCP Server

✨ Features

  • āœ… 22 Tools covering parts, sketches, features, and utilities

  • āœ… SolidWorks 2023–2025 Compatible with version-aware API fallbacks

  • āœ… Auto-detects SolidWorks installation via Windows registry

  • āœ… Multi-unit support — mm, cm, inch, meter, foot

  • āœ… Modular architecture — clean, extensible Python package

  • āœ… Robust error handling — cascading fallback chains for COM API

  • āœ… JSON configuration — easy to customize without touching code

  • āœ… Comprehensive logging — full debug output for troubleshooting


šŸ› ļø Available Tools

42 tools (v4.1.0). Method signatures verified against the official SolidWorks 2025 API help. Notes: extrude uses FeatureExtrusion3 (current in 2025; FeatureExtrusion2 is obsolete); patterns use the CreateDefinition feature-data route; sweep (InsertProtrusionSwept3) is intentionally NOT included — its exact 20-parameter signature did not surface from the 2025 docs, verify it against the installed type library before adding it.

Category

Tool

Description

Connection

connect_solidworks

Connect to running SolidWorks instance

Connection

get_solidworks_info

Get version and installation info

Documents

create_new_part

Create a new part document

Documents

create_new_assembly

Create a new assembly document

Documents

open_document

Open an existing SolidWorks file

Documents

close_document

Close the active document

Documents

save_document

Save the active document

Documents

get_document_info

Get information about the active document

Documents

list_open_documents

List all open documents

Sketches

create_sketch

Create a sketch on a plane (Front/Top/Right)

Sketches

create_sketch_on_face

Create a sketch on an existing body face

Sketches

close_sketch

Exit the active sketch

Sketches

get_sketch_status

Sketch diagnostics (active state, names)

Sketches

draw_circle

Draw a circle by center and radius

Sketches

draw_rectangle

Draw a rectangle by two corners

Sketches

draw_line

Draw a line between two points

Sketches

draw_arc

Draw an arc by center and angles

Sketches

draw_arc_3point

Draw an arc through 3 points

Sketches

draw_spline

Draw a spline through points

Sketches

draw_slot

Draw a slot (straight/centerline/arc/3-point arc)

Sketches

draw_centerline

Draw a construction centerline (revolve axis)

Sketches

draw_polygon

Draw a regular polygon (triangle, hex, etc.)

Sketches

trim_entities

Trim selected sketch entities at a pick point

Features

extrude_sketch

Boss-extrude the active sketch

Features

cut_extrude

Cut-extrude to remove material

Features

fillet_edges

Add fillets to selected edges

Features

chamfer_edges

Add chamfers to selected edges

Features

list_features

List all features in the model

Features

revolve_sketch

Revolve the last sketch around its centerline

Features

loft_boss

Loft a boss between the last two sketches

Features

loft_cut

Loft a cut through the last two sketches

Features

hole_wizard

Hole Wizard hole at sketch points

Features

linear_pattern

Linear-pattern features along a direction

Features

circular_pattern

Circular-pattern features around an axis

Features

shell

Shell the solid, removing faces at given points

Features

mirror_feature

Mirror features (or body) about a plane

Measure

measure_distance

Measure distance between entities

Measure

get_mass_properties

Mass, volume, area, center of mass, inertia

Export

export_document

Export STL / STEP / IGES / PDF / Parasolid

Export

create_reference_plane

Reference plane offset from a plane

Utilities

set_units

Change default unit (mm/inch/cm/m/ft)

Utilities

execute_python

Execute custom Python code in SW context


šŸ“‹ Requirements

  • OS: Windows 10 or Windows 11

  • SolidWorks: 2023, 2024, or 2025 (must be installed and licensed)

  • Python: 3.10 or higher

  • Claude: Claude Desktop app or Claude Code


⚔ Quick Start

1. Clone the Repository

git clone https://github.com/alisamsam/solidworks-mcp.git
cd solidworks-mcp

2. Install Dependencies

pip install -r requirements.txt

3. Configure Claude Desktop

Add the following to your claude_desktop_config.json:

Location: C:\Users\YOUR_NAME\AppData\Roaming\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "solidworks": {
      "command": "python",
      "args": ["C:\\path\\to\\solidworks-mcp\\solidworks_mcp_server.py"]
    }
  }
}

4. Launch

  1. Open SolidWorks first

  2. Restart Claude Desktop

  3. In Claude, type: "Connect to SolidWorks"

  4. Start designing! šŸŽ‰


šŸ“ Project Structure

solidworks-mcp/
ā”œā”€ā”€ solidworks_mcp_server.py      # Entry point
ā”œā”€ā”€ solidworks_mcp/               # Main package
│   ā”œā”€ā”€ __init__.py              # Package exports (v3.0.0)
│   ā”œā”€ā”€ server.py                # MCP server & tool definitions
│   ā”œā”€ā”€ config.py                # Configuration management
│   ā”œā”€ā”€ config.json              # Default settings
│   ā”œā”€ā”€ constants.py             # SolidWorks constants & enums
│   ā”œā”€ā”€ automation/              # Core automation modules
│   │   ā”œā”€ā”€ base.py             # Connection management
│   │   ā”œā”€ā”€ documents.py        # Document operations
│   │   ā”œā”€ā”€ sketches.py         # Sketch operations
│   │   └── features.py         # Feature operations (SW 2025 fixed)
│   └── utils/                   # Utility modules
│       ā”œā”€ā”€ units.py            # Unit conversion system
│       └── sw_finder.py        # Auto-detect SolidWorks
ā”œā”€ā”€ requirements.txt
ā”œā”€ā”€ .gitignore
└── DEVELOPMENT_ROADMAP.md       # Future development plan

āš™ļø Configuration

Edit solidworks_mcp/config.json to customize behavior:

{
  "exe_path": "auto",
  "default_unit": "mm",
  "startup_timeout": 120,
  "log_level": "INFO",
  "default_extrude_depth": 10.0,
  "default_fillet_radius": 2.0
}

Setting

Default

Description

exe_path

"auto"

Path to SLDWORKS.exe or auto-detect

default_unit

"mm"

Default unit for all dimensions

startup_timeout

120

Seconds to wait for SW startup

log_level

"INFO"

Logging verbosity


šŸ”§ SolidWorks 2025 Compatibility

This server includes special handling for SolidWorks 2025 API changes:

  • Extrusion fallback chain: FeatureExtrusion3 → FeatureExtrusion2 → FeatureBossSimple

  • Safe property access for feat.Name, feat.GetTypeName2(), IsSuppressed2()

  • stdout capture fix for execute_python tool

  • Registry-based SolidWorks auto-detection


šŸ¤ Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/my-feature

  3. Commit your changes: git commit -m "Add my feature"

  4. Push to the branch: git push origin feature/my-feature

  5. Open a Pull Request


šŸ“„ License

This project is licensed under the MIT License — see the LICENSE file for details.


šŸ‘¤ Author

Samsaam Ali Baig


šŸ™ Acknowledgements


⭐ If this project helps you, please give it a star!

Tool Schema Changelog

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

Loading tool schema changelog…

    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.
      12
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents such as Claude to drive SolidWorks through its COM API using natural language, creating parts and assemblies, sketching geometry, and adding features without clicking menus. Also supports running arbitrary API scripts and verifying results through model reports, rendered views, interference checks, and exports.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude to control SolidWorks through natural language, supporting part and assembly creation, sketches, advanced features, dimension editing, selection inspection, screenshots, and rebuilds.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude to drive SolidWorks in natural language, creating parts and assemblies, sketching and modeling features, editing dimensions, setting materials, and exporting CAD files. It also exposes selection, mass-property, and viewport-capture tools so 3D designs can be built and verified conversationally.
      MIT