Skip to main content
Glama

SolidworksMCP

SolidworksMCP is a production-oriented Model Context Protocol server for controlling a live SOLIDWORKS session through the Windows COM API.

This is a fork of alisamsam/Solidworks-MCP that extends it from 82 to 143 tools, adding drawings, assembly editing, sheet metal, manufacturing package export and document reference tracing. See What this fork adds.

Current release: 6.5.31. The release was acceptance-tested with SOLIDWORKS 2026 SP2.1 and retains compatibility guards for SOLIDWORKS 2025.

Highlights

  • Native sketch, feature, body, reference-geometry, view, probe, and export operations.

  • Transactional CAD plans with checkpoints, invariants, idempotency, budgets, and rollback.

  • Parametric sketches with named entities, constraints, dimensions, equations, persistent IDs, and degree-of-freedom analysis.

  • Multibody tools with explicit merge scope, clearance, interference, bounding box, and volume verification.

  • Deterministic raster-to-sketch pipelines for silhouettes and line art, including GPU-backed segmentation, topology preservation, primitive fitting, and reverse-raster quality gates.

  • Native sketch/body export and calibrated geometric comparison instead of screenshot-only acceptance.

  • Verified active-sketch Normal To and Fit to Screen. The server reads the resulting camera matrix and pixel occupancy instead of trusting a UI command.

  • Drawing documents end to end: sheets, views, model annotations, manual dimensions, notes, balloons, centre marks, and BOM tables.

  • Assembly editing: components, mates, patterns, suppression, replacement, and exploded views.

  • Sheet metal from base flange to flat pattern DXF, and a one-call manufacturing package that exports STEP, DXF and PDF for a whole assembly.

  • Document search and reference tracing in both directions, including where-used across a project folder.

  • Structured diagnostics, modal-dialog preflight, a narrowly scoped Modify watchdog, and finite recovery policies.

  • A desktop chat application that drives all of it in plain language, with per-message effort selection and approval before any change to the model.

Related MCP server: solidworks-mcp

What this fork adds

This repository is a fork of alisamsam/Solidworks-MCP. The upstream release exposed 82 tools covering sketches, solid features, bodies, probes, vectorization and the transactional layer. This fork brings that to 143 tools and the server's test suite from 155 to 382 tests. It also adds a desktop application that uses the server, with a suite of its own; all 474 tests pass.

The additions follow the discipline the upstream project already established: no COM return value is trusted. Every new operation reads the resulting state back - annotation counts, component lists, suppression flags, face counts, files on disk - and reports failure when the model does not actually show the change, rather than when the API says so.

Drawings (17 tools)

Upstream had no drawing document support at all. This fork covers the full detailing path: create_new_drawing, add_sheet, activate_sheet, list_sheets, insert_drawing_view, insert_standard_views, insert_section_view, insert_detail_view, list_drawing_views, set_view_scale, insert_model_annotations, insert_bom_table, add_drawing_dimension, insert_drawing_note, insert_balloons, insert_center_marks and list_drawing_annotations.

Views and annotations are verified by counting what appeared on the sheet; CreateDrawViewFromModelView3 and InsertModelAnnotations3 both report success for views and annotations that were never created.

Assemblies (14 tools)

Upstream stopped at opening an assembly. This fork adds component and mate work: insert_component, list_components, add_mate, delete_mate, list_mates, set_component_fixed, check_assembly_interference, delete_component, replace_component, set_component_suppression, pattern_components, explode_assembly, show_exploded and list_exploded_views.

Sheet metal (6 tools)

Sheet metal is the one part discipline whose deliverable is not the solid but the flat pattern - the DXF a laser or turret consumes. create_base_flange thickens a sketch into a sheet metal body; convert_to_sheet_metal turns an existing solid into one, which is the route imported geometry has to take since a STEP of a bent bracket carries no bend information; create_edge_flange bends flanges off edges without a profile sketch; set_flat_pattern flattens or folds; export_flat_pattern writes the DXF or DWG; get_sheet_metal_info reports the thickness, radius, K-factor and flat pattern extents a quote or a nesting run needs.

ExportFlatPatternView reports success for a part whose flat pattern failed to build, so the export is verified against the file on disk. The flat pattern feature is found by its API type name rather than its displayed name, because displayed names are localized.

Manufacturing package (1 tool)

export_manufacturing_package produces the folder a shop actually receives, in one call: a STEP for every part and for the assembly, a DXF for every sheet metal part, a PDF of the drawing sitting beside each model, and a manifest.json listing every file with the material and mass of each part. It walks an assembly component by component, so a twenty-part machine takes one call rather than sixty. Documents it had to open are closed again afterwards and the originally active document is restored.

Document search and references (3 tools)

search_documents finds SolidWorks files in a folder by name fragment and type. list_document_references reports what a document uses and whether each of those files is still on disk. find_where_used answers the reverse question - which assemblies and drawings use this part - which SolidWorks cannot answer directly, since a document records what it references and never what references it. The reverse map is built by reading the dependencies of every assembly and drawing in a folder tree, which is affordable only because GetDocumentDependencies2 reads a file's references without opening it.

Features (5 tools)

create_loft, create_rib, apply_draft, simple_hole and hole_wizard, each with the dead-feature guard: a feature that reports success while adding no geometry is deleted rather than left in the tree.

Configurations, properties and parameters (15 tools)

activate_configuration, list_configurations, list_custom_properties, set_custom_property, delete_custom_property, get_material, set_material, get_mass_properties, get_dimension, set_dimension, add_equation, set_equation, delete_equation, list_equations and rebuild_document.

ShowConfiguration2 is one of the verified liars: it returns success for a configuration that was never activated, so the active configuration is read back afterwards.

Workflow and control (13 tools)

clear_selection, get_selection, select_by_name, measure, list_rebuild_errors, undo, suppress_feature, unsuppress_feature, set_rollback, add_configuration, delete_configuration, activate_document and get_document_units. State-changing tools verify the result by reading it back.

Material names are localized to the SolidWorks UI language (a Turkish install wants 1060 Alaşım, not 1060 Alloy); set_material fails with a hint instead of silently keeping the old material. Default plane names are localized too, so create_sketch("Front") resolves the real plane from the feature tree.

Extra parameters (all verified against a live SolidWorks 2025)

  • advanced_extrude / advanced_cut: draft_angle_deg, draft_outward, depth2 and draft_angle2_deg (second direction).

  • revolve_boss / revolve_cut: both_directions + angle2, mid_plane, thin_type, thin_thickness2.

  • fillet_edges: propagate_tangent, keep_features. chamfer_edges: chamfer_type (angle_distance, distance_distance, equal_distance), distance2, flip_direction. Both fail instead of creating a partial feature when only some of the edge_rays hit (require_all_selections).

  • linear_pattern: skip_instances as [column, row] pairs, geometry_pattern. circular_pattern: symmetric, geometry_pattern (falls back to a full feature pattern when SolidWorks rejects the geometry-only variant). mirror_feature: geometry_pattern, knit_surfaces.

  • reference_plane: mode=mid_plane; reverse now really flips the side (SolidWorks clamps a negative distance to zero).

  • export_file: step_ap (203/214/242), configuration, stl (binary, units, quality). save_document: copy, save_referenced. open_document: open options and STEP/IGES/Parasolid/ACIS/STL import.

  • get_mass_properties: include_moments, include_hidden. delete_feature / delete_component: dry_run lists dependents.

Not available: variable-radius, face and full-round fillets, vertex chamfers, multi-thickness shells, angle reference planes and up-to-body extrudes (SolidWorks rejected or silently ignored every call variant that was tried).

Desktop application

solidworks_mcp_app/ is a chat window that drives the server directly, so the tools can be used without a separate MCP client. It adds an approval gate in front of every change to the model, a local classifier that picks a thinking budget per message, and a live view of the session and the active document. See Desktop application.

Beyond the tools

  • Tool schemas moved out of server.py into a schemas/ package grouped by family, which cut server.py from 3819 lines to 2300.

  • Packaging metadata (pyproject.toml), a separate vision extra for the multi-gigabyte PyTorch backend, and a GitHub Actions workflow running the suite.

  • LICENSE records both copyright holders and what the fork changes.

Requirements

  • Windows 10 or Windows 11.

  • SOLIDWORKS 2025 or 2026, installed and licensed.

  • Python 3.10 or newer; Python 3.11 is the acceptance-tested runtime.

  • Git LFS for the packaged line-art checkpoints.

  • An NVIDIA CUDA environment is strongly recommended for the deep vectorization modes. get_capabilities reports the actual backend state.

The server drives the interactive SOLIDWORKS process. It is not a headless CAD kernel, and an unknown modal dialog must be inspected by a human.

Clone and install

Install Git LFS before cloning, or pull the model objects afterwards:

git lfs install
git clone https://github.com/aryesil/SolidworksMCP.git
Set-Location SolidworksMCP
git lfs pull

Create an isolated Python environment and install the package:

py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e .

The base install covers every tool except deep silhouette vectorization, whose PyTorch backend lives in the vision extra:

python -m pip install -e ".[vision]"

The extra is separate because the CUDA wheels add several gigabytes to an install that most tools never touch. Install the PyTorch build appropriate for the machine's CUDA driver first if the default wheel does not match it; get_capabilities reports the backend that is actually active.

requirements.txt still lists the base dependencies for anyone installing without the package metadata.

Desktop application

The MCP server needs an MCP client. solidworks_mcp_app/ is one: a desktop chat window that puts Claude in front of the 143 tools, so SOLIDWORKS can be driven in plain language without a separate editor or IDE in the loop.

python -m pip install -e ".[app]"
python -m solidworks_mcp_app

--browser opens the interface in the default browser instead of a native window, and --no-window serves it without opening anything.

Which account pays for it

The window can be answered by either of two backends, chosen in the sidebar.

Claude Code is the default and needs no key. It runs the conversation through the Claude Code CLI, which means the session is billed to whatever that CLI is signed in with - a Pro or Max subscription included - and the plan's remaining headroom is reported in the transcript when the CLI sends it. It requires the CLI to be installed and signed in once:

irm https://claude.ai/install.ps1 | iex
claude

The native claude.exe is what is needed here; the npm package installs a .cmd shim that cannot be launched directly. The login is interactive and belongs to the user - nothing in this application reads, stores or forwards those credentials. If the CLI ends up somewhere the SDK cannot find, set its path as cli_path in the settings file.

Anthropic API is the alternative. It calls the API directly and needs a key, which is billed to Console credits rather than to a plan:

$env:ANTHROPIC_API_KEY = "sk-ant-..."

The key can also be entered in the window; the environment variable wins when both are set.

Either way the tools, the approval gate and the effort classifier are the same, and so is what appears on screen - the backend decides who is billed, not what the application can do.

What the window adds over a general-purpose MCP client:

  • Approval before change. Every tool that alters the model, writes a file or closes a document is shown with its arguments and waits. Read-only tools run immediately. The classification is imported from the server's own registry, so a tool added there cannot start running unannounced, and a name the registry does not recognise is treated as a change. Auto-accept is one toggle, and a refused call is reported to the model as refused so it proposes something else rather than retrying.

  • Automatic effort. Extended thinking is chosen per message by a local classifier that reads the request in Turkish or English: reading the model costs nothing, a multi-step sheet metal job or an open-ended design question buys a large budget, and a turn that ended in a tool error raises the next one. The level can also be pinned, and the badge under the composer says which reasons produced it.

  • The session, visible. Connection state distinguishes "the MCP server is not running" from "SOLIDWORKS is not open", the active document is polled from the live session, and reconnect restarts the child process rather than pretending a stale COM session can be revived.

  • The turn, as it happens. Reasoning, each tool call, its arguments and its verified result stream into the transcript, so a wrong plan is visible while it can still be stopped.

The application holds the conversation, the approval gate and the window. It contains no CAD logic at all: every operation goes through the same MCP server any other client would use.

MCP configuration

Point the MCP client at the repository entry point using the virtual environment's Python executable:

{
  "mcpServers": {
    "SolidworksMCP": {
      "command": "C:\\path\\to\\SolidworksMCP\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\path\\to\\SolidworksMCP\\solidworks_mcp_server.py"
      ]
    }
  }
}

Start SOLIDWORKS, restart or reconnect the MCP client, then call get_capabilities and get_environment_status before a substantial modeling operation.

Stable compatibility identifiers

SolidworksMCP is the public project and MCP handshake name. The Python package remains solidworks_mcp, the configured tool namespace remains solidworks, and existing artifact schemas retain their solidworks-mcp/... identifiers. Those internal names are compatibility contracts and are intentionally not renamed.

Operation families

The server exposes both small native operations and higher-level verified workflows. Important families include:

  • documents and environment: create/open/save/close, capabilities, session metrics, modal-state inspection, recovery;

  • sketches: standard planes, planar faces, exact model-coordinate contours, primitive drawing, parametric sketches, dimensions, constraints, equations;

  • features: verified extrude/cut, revolve, sweep, fillet, chamfer, shell, mirrors, patterns, reference axes and planes;

  • bodies: visibility, naming, appearance, volume, clearance, interference, multibody insert workflows;

  • verification: ray/section probes, sketch topology, native geometry export, sketch-to-sketch and calibrated image comparisons, body silhouettes;

  • vectorization: selectable silhouette/region/line-art modes, deep segmentation, controllable approximation, CAD commit, and reverse-raster verification;

  • drawings: sheets, model and standard views, section and detail views, model annotations, manual dimensions, notes, balloons, centre marks, BOM tables;

  • assemblies: component insertion and deletion, mates, replacement, suppression, component patterns, exploded views, interference checks;

  • sheet metal: base flange, conversion of imported solids, edge flanges, flat pattern state, DXF/DWG flat pattern export, sheet metal parameters;

  • manufacturing output: one-call package export of STEP, DXF and PDF with a manifest, for a part or a whole assembly;

  • documents on disk: file search by name and type, outgoing references with missing-file detection, and where-used across a folder tree;

  • configurations and parameters: configurations, custom properties, materials, mass properties, dimensions, equations;

  • orchestration: transactions, declarative CAD plans, semantic primitives, model-graph synchronization, atomic export bundles.

Use MCP tool discovery for the authoritative live schema. Tool descriptions and get_capabilities are versioned with the server.

Safety rules

  • Supply an absolute save_path before the first mutation of an unsaved document, or explicitly opt into disposable work with allow_unsaved_document=true.

  • Treat success as execution evidence. Verify topology, body count, bounding boxes, volume, tolerances, and a readable independent artifact.

  • Use scope_bodies and expected_merge_bodies for multibody cuts and bosses.

  • Do not auto-confirm unknown dialogs. Only the recognized, operation-scoped dimension Modify dialog may be handled by the watchdog.

  • Native MCP tool coordinates use the declared user unit, normally millimetres. Raw SOLIDWORKS COM coordinates use metres.

  • Do not invoke a blind Ctrl+8 after sketch operations. Version 6.5.31 already applies and verifies the stable side/up orientation and working-geometry fit.

Vectorization models

The deterministic line-art checkpoints live under solidworks_mcp/models/lineart/ and are stored with Git LFS:

  • dexined_biped_v2.pt

  • teed_biped_5.pt

Their source and license notices are documented in solidworks_mcp/models/lineart/LICENSES.md. A clone containing small LFS pointer files instead of the binary objects is incomplete; run git lfs pull before starting the server.

SOLIDWORKS Autotrace/Picture to Sketch is an interactive PropertyManager feature and has no supported public API entry point. This server therefore uses its own deterministic segmentation and line-art pipelines.

Configuration

Default runtime settings are stored in solidworks_mcp/config.json. Keep machine-specific or sensitive overrides in config.local.json; that file is ignored by Git.

Notable defaults include:

  • automatic SOLIDWORKS executable and template discovery;

  • millimetres as the user unit;

  • operation-scoped dimension dialog guard;

  • bounded transaction/runtime limits;

  • automatic checkpoint directory management;

  • INFO-level file logging.

Relative log_file values are written under %LOCALAPPDATA%\SolidworksMCP\, not into the source checkout. An absolute path in config.json remains supported.

Tests

The repository contains the deterministic unit and regression suite:

python -m unittest discover -s tests -p "test_*.py"

The suite passes 474 tests. These tests do not replace live acceptance for COM behavior: qualifying another SOLIDWORKS major version should also cover standard planes, planar faces, existing-sketch activation, view recovery, features, transactions, vectorization, and export.

Project layout

SolidworksMCP/
|-- solidworks_mcp_server.py       MCP stdio entry point
|-- requirements.txt
|-- LICENSE
|-- solidworks_mcp/
|   |-- server.py                  MCP dispatch and handlers
|   |-- schemas/                   tool schemas, grouped by family
|   |-- tool_registry.py           high-level tool metadata
|   |-- vector_worker.py           isolated scientific worker
|   |-- config.py / config.json
|   |-- constants.py
|   |-- automation/                SOLIDWORKS COM implementation
|   |-- models/lineart/            Git-LFS checkpoints and licenses
|   `-- utils/
|-- solidworks_mcp_app/            desktop chat application (MCP client)
|   |-- __main__.py                window launcher
|   |-- server.py                  local HTTP and event stream
|   |-- agent.py                   Claude agent loop
|   |-- mcp_client.py              stdio session with the MCP server
|   |-- approval.py                what needs approving, and the gate
|   |-- effort.py                  automatic thinking-budget selection
|   |-- settings.py                per-user configuration
|   `-- static/                    interface
`-- tests/
    |-- test_v6.py                 unit and regression suite
    `-- test_app.py                desktop application suite

Runtime logs, caches, local client settings, checkpoints, generated reports, acceptance artifacts, and manual probes are intentionally excluded from the repository.

License

The server is distributed under the MIT License; see LICENSE. Packaged model notices are retained separately in solidworks_mcp/models/lineart/LICENSES.md.

This repository is a fork of alisamsam/Solidworks-MCP by Samsaam Ali Baig. The original copyright notice is retained, and the modifications made here are released under the same MIT License. LICENSE records both copyright holders and summarises what this fork adds.

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

    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for controlling a live SOLIDWORKS session through the Windows COM API, enabling native CAD operations like sketches, features, bodies, views, and exports, plus transactional plans and vectorization.
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables building and modifying parametric solid models in a local SOLIDWORKS installation via the COM API.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to build, measure, verify, and correct parametric SolidWorks parts and assemblies locally via the COM API, supporting operations like sketching, extruding, modeling, dimensioning, material assignment, export, and assembly mating.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an AI assistant to drive an already-running SOLIDWORKS session over its COM API, so it can build sketches, solid features, reference geometry, assemblies, mates, and engineering drawings, then inspect the result through topology listings, mass properties, measurements, and screenshots returned as images.
      1
      Apache 2.0