Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- **Modelled threads** (queue item 43): `list_thread_sizes` lists the
sizes SolidWorks's own thread profiles hold, metric or inch (M1.2 to
M64, #0 to 4 in), each with coarse or fine pitch, the ISO 68-1 basic depth
and the ISO 3508 runout (normal 2.5P, short 1.25P; for inch the same rule
on 1/TPI, labelled a reasoned default). `create_thread` cuts an external
(die) or internal (tap) thread with SolidWorks's Thread feature at the
circular edge picked by a point, checks the cylinder's diameter against
the size first, and fails and undoes a thread that cuts nothing. Its
`runout` ends the thread as a machined one: `fade` sweeps the groove out
of the material (any thread: straight along the helix's tangent on a rod,
so the round rod tapers it to a point; along an arc over DIN 76-1's x1
in a hole), and `undercut_a` /
`undercut_b` cut a DIN 76-1 Form A or B undercut (dg, g2, r from
DIN 76-1:2025-10 Table 1, a 30° flank) at the shoulder of an external
metric thread. Its `lead_in` chamfers the other end, the start, 45° to
just under the minor diameter (ISO 4753's chamfered end; M6: 4.7 mm), so
a bolt starts in a nut. Every thread starts two pitches outside the
part, so its groove runs out through the end face. `create_hole`'s description points to it for
fasteners. 173 tools in
all. Beta until the live demo; the live tests pass on SolidWorks 2026
(an M6 rod, a 1/4-20 rod, an M6 tapped hole, a faded M6 and an M6 with
a Form A undercut at a collar).
- **Colours** (queue item 36): `set_appearance` colours the whole part, one
feature, one body or the face at a point (`[r, g, b]` or `#rrggbb`, with
transparency), or with `reset` removes a level's own colour;
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![SolidWorks](https://img.shields.io/badge/tested%20on-SolidWorks%202026-red)](https://www.solidworks.com/)
[![Coverage](https://codecov.io/gh/andrewbartels1/SolidworksMCP-python/branch/main/graph/badge.svg)](https://codecov.io/gh/andrewbartels1/SolidworksMCP-python)

Python MCP server for SolidWorks automation with 171 tools, plus an optional agent/prompt-testing layer for AI-assisted workflows.
Python MCP server for SolidWorks automation with 173 tools, plus an optional agent/prompt-testing layer for AI-assisted workflows.

[![115 MCP tools by support level (the 8 deprecated ones not counted), and how much of the core SolidWorks COM API they reach](docs/assets/progress/progress.svg)](https://andrewbartels1.com/SolidworksMCP-python/progress/)

Expand Down Expand Up @@ -367,7 +367,7 @@ It works only with the circuit-breaker adapter wrapper (the default for real Sol

### A shorter tool list

All 171 tools cost about 72,000 tokens a turn. `SOLIDWORKS_MCP_TOOL_MODE=search` lists four instead (about 900 tokens); `SOLIDWORKS_MCP_TOOLSETS=core,drawing` lists only those groups. See [Choose which tools a client sees](https://andrewbartels1.com/SolidworksMCP-python/getting-started/installation/#4-choose-which-tools-a-client-sees).
All 173 tools cost about 73,000 tokens a turn. `SOLIDWORKS_MCP_TOOL_MODE=search` lists four instead (about 900 tokens); `SOLIDWORKS_MCP_TOOLSETS=core,drawing` lists only those groups. See [Choose which tools a client sees](https://andrewbartels1.com/SolidworksMCP-python/getting-started/installation/#4-choose-which-tools-a-client-sees).

## Teach your agent the workflow

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 17 additions & 3 deletions docs/assets/progress/progress.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"tools": {
"total": 171,
"total": 173,
"by_level": {
"stable": 149,
"beta": 14,
"beta": 16,
"experimental": 0,
"planned": 0,
"deprecated": 8
Expand Down Expand Up @@ -485,6 +485,13 @@
"reason": "",
"summary": "Place a model's three standard views (front, top and side) on the active drawing sheet in one call."
},
{
"name": "create_thread",
"family": "threads",
"level": "beta",
"reason": "new: checked on SolidWorks by a scratch run, not yet by a live demo.",
"summary": "Cut a modelled thread, external (a bolt) or internal (a tapped hole), at a standard size."
},
{
"name": "delete_bodies",
"family": "bodies",
Expand Down Expand Up @@ -835,6 +842,13 @@
"reason": "",
"summary": "List every document open in SolidWorks and say which one is active."
},
{
"name": "list_thread_sizes",
"family": "threads",
"level": "beta",
"reason": "new: checked on SolidWorks by a scratch run, not yet by a live demo.",
"summary": "List the standard thread sizes SolidWorks holds, metric or inch, with coarse or fine pitch, depth and runout."
},
{
"name": "load_assembly",
"family": "file_management",
Expand Down Expand Up @@ -1215,7 +1229,7 @@
"total": 2838
},
"api": {
"covered": 350,
"covered": 354,
"total": 5985
},
"interfaces": [
Expand Down
10 changes: 5 additions & 5 deletions docs/assets/progress/progress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/assets/progress/tables.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<tr data-level="stable" data-family="modeling"><td title="Bend a sheet-metal part along a line sketched on one of its faces."><code>create_sketched_bend</code></td><td>modeling</td><td><span class="level level-stable">stable</span></td><td>Bend a sheet-metal part along a line sketched on one of its faces.</td></tr>
<tr data-level="stable" data-family="modeling"><td title="Sweep a closed profile along a path to add material (Insert &gt; Boss/Base &gt; Sweep)."><code>create_sweep</code></td><td>modeling</td><td><span class="level level-stable">stable</span></td><td>Sweep a closed profile along a path to add material (Insert &gt; Boss/Base &gt; Sweep).</td></tr>
<tr data-level="stable" data-family="drawing"><td title="Place a model&#x27;s three standard views (front, top and side) on the active drawing sheet in one call."><code>create_technical_drawing</code></td><td>drawing</td><td><span class="level level-stable">stable</span></td><td>Place a model&#x27;s three standard views (front, top and side) on the active drawing sheet in one call.</td></tr>
<tr data-level="beta" data-family="threads"><td title="Cut a modelled thread, external (a bolt) or internal (a tapped hole), at a standard size."><code>create_thread</code></td><td>threads</td><td><span class="level level-beta">beta</span><br><small>new: checked on SolidWorks by a scratch run, not yet by a live demo.</small></td><td>Cut a modelled thread, external (a bolt) or internal (a tapped hole), at a standard size.</td></tr>
<tr data-level="beta" data-family="bodies"><td title="Delete bodies from the active part, or with keep=true keep only the named ones."><code>delete_bodies</code></td><td>bodies</td><td><span class="level level-beta">beta</span><br><small>new: passed its live demo (boolean logic on a cube and a sphere), not yet in wide use.</small></td><td>Delete bodies from the active part, or with keep=true keep only the named ones.</td></tr>
<tr data-level="stable" data-family="file_management"><td title="Delete a configuration of the active model; not the active one or the only one."><code>delete_configuration</code></td><td>file_management</td><td><span class="level level-stable">stable</span></td><td>Delete a configuration of the active model; not the active one or the only one.</td></tr>
<tr data-level="stable" data-family="equations"><td title="Delete an equation or global variable of the active part or assembly, by name."><code>delete_equation</code></td><td>equations</td><td><span class="level level-stable">stable</span></td><td>Delete an equation or global variable of the active part or assembly, by name.</td></tr>
Expand Down Expand Up @@ -120,6 +121,7 @@
<tr data-level="stable" data-family="modeling"><td title="List the Hole Wizard&#x27;s hole types and sizes for a standard, or one size&#x27;s dimensions."><code>list_hole_sizes</code></td><td>modeling</td><td><span class="level level-stable">stable</span></td><td>List the Hole Wizard&#x27;s hole types and sizes for a standard, or one size&#x27;s dimensions.</td></tr>
<tr data-level="stable" data-family="engineering_data"><td title="List every dimension in the active part or assembly with its full name and value."><code>list_model_dimensions</code></td><td>engineering_data</td><td><span class="level level-stable">stable</span></td><td>List every dimension in the active part or assembly with its full name and value.</td></tr>
<tr data-level="stable" data-family="file_management"><td title="List every document open in SolidWorks and say which one is active."><code>list_open_documents</code></td><td>file_management</td><td><span class="level level-stable">stable</span></td><td>List every document open in SolidWorks and say which one is active.</td></tr>
<tr data-level="beta" data-family="threads"><td title="List the standard thread sizes SolidWorks holds, metric or inch, with coarse or fine pitch, depth and runout."><code>list_thread_sizes</code></td><td>threads</td><td><span class="level level-beta">beta</span><br><small>new: checked on SolidWorks by a scratch run, not yet by a live demo.</small></td><td>List the standard thread sizes SolidWorks holds, metric or inch, with coarse or fine pitch, depth and runout.</td></tr>
<tr data-level="deprecated" data-family="file_management"><td title="Open an assembly (.sldasm) from disk and make it the active document."><code>load_assembly</code></td><td>file_management</td><td><span class="level level-deprecated">deprecated</span><br><small>use `open_model`.</small></td><td>Open an assembly (.sldasm) from disk and make it the active document.</td></tr>
<tr data-level="deprecated" data-family="file_management"><td title="Open a part (.sldprt) from disk and make it the active document."><code>load_part</code></td><td>file_management</td><td><span class="level level-deprecated">deprecated</span><br><small>use `open_model`.</small></td><td>Open a part (.sldprt) from disk and make it the active document.</td></tr>
<tr data-level="stable" data-family="docs_discovery"><td title="List every method and property of a SolidWorks COM interface."><code>lookup_api_interface</code></td><td>docs_discovery</td><td><span class="level level-stable">stable</span></td><td>List every method and property of a SolidWorks COM interface.</td></tr>
Expand Down
6 changes: 3 additions & 3 deletions docs/assets/progress/tool-list-size.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
| `SOLIDWORKS_MCP_TOOLSETS` | `SOLIDWORKS_MCP_TOOL_MODE` | Tools listed | Size | Tokens (estimate) | Of the full list |
| --- | --- | ---: | ---: | ---: | ---: |
| `all` | `list` | 171 | 279 KB | 71,512 | 100% |
| `core` | `list` | 130 | 202 KB | 51,608 | 72% |
| `all` | `list` | 173 | 284 KB | 72,744 | 100% |
| `core` | `list` | 132 | 206 KB | 52,841 | 73% |
| `drawing` | `list` | 22 | 39 KB | 10,074 | 14% |
| `automation` | `list` | 3 | 6 KB | 1,556 | 2% |
| `vba` | `list` | 10 | 17 KB | 4,356 | 6% |
| `docs` | `list` | 6 | 15 KB | 3,916 | 5% |
| `core,drawing` | `list` | 152 | 241 KB | 61,682 | 86% |
| `core,drawing` | `list` | 154 | 246 KB | 62,915 | 86% |
| `all` | `search` | 4 | 4 KB | 908 | 1% |
| `core` | `search` | 4 | 4 KB | 908 | 1% |
62 changes: 62 additions & 0 deletions docs/demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,68 @@ be used instead.
4. `create_cut_sweep({"path": "Helix/Spiral1", "profile": "Helix/Spiral1"})`, refused on purpose
5. `create_cut_sweep({"path": "Helix/Spiral1", "profile": "Sketch3"})`

## Modelled threads {#threads}

Source: [`tests/live/test_live_sw_threads.py`](https://github.com/andrewbartels1/SolidworksMCP-python/blob/main/tests/live/test_live_sw_threads.py).

### A bolt-like rod {#bolt-like-rod}

![The standard metric sizes read from SolidWorks, M10 refused on a 6 mm rod, an M6x1.0 thread cut 12 mm with its start chamfered 45 degrees, and a 1/4-20 inch thread, each seen side on](assets/demos/modelled-threads/test_a_bolt_like_rod-motion.gif)

> *Example prompt:* Thread the end of this 6 mm rod M6 for 12 mm, chamfered
> so it starts in a nut.

**What it shows.** `list_thread_sizes` reads the sizes from SolidWorks's
own die profile, and `create_thread` cuts one of them with SolidWorks's
Thread feature. The thread starts two pitches outside the rod, as a die
does, so its groove runs out through the end face; `lead_in` then chamfers
that end 45° to just under the minor diameter (ISO 4753's chamfered end):

| Step | Tools | Expected | Measured |
| --- | --- | --- | --- |
| The metric sizes | `list_thread_sizes` | M3x0.5 first, ISO 68-1 depth, ISO 3508 runout | 69 sizes; M3x0.5: depth 0.2706 mm, runout 1.25 mm |
| M10 on a 6 mm rod | `create_thread` | refused, nothing built | `invalid_input`: "wants a rod of about 10 mm" |
| M6x1.0, 12 mm, `lead_in` | `create_thread` | full thread y 13 to 25; end 4.7 mm, 0.65 mm long | y 13 to 25; 4.7 mm, 0.65 mm |
| 1/4-20 on a 6.35 mm rod | `create_thread` | 1.27 mm pitch, 12.7 mm | 1.27 mm; y 12.3 to 25 |

M10 is refused **on purpose**: the edge is 6 mm across.

**Tool calls**

1. `list_thread_sizes({"standard": "metric"})`
2. A 6 mm rod 25 mm long, then `create_thread({"size": "M10x1.5", "edge_point": [3, 25, 0], "length": 12})`, refused on purpose
3. `create_thread({"size": "M6x1.0", "edge_point": [3, 25, 0], "length": 12, "lead_in": true})`
4. A 6.35 mm rod, then `create_thread({"standard": "inch", "size": "1/4-20", "edge_point": [3.175, 25, 0], "length": 12.7})`

### Runouts and a lead-in {#thread-runouts}

![An M6 thread whose groove fades out along the helix's tangent, an M6 bolt to a collar ending in a DIN 76-1 Form A undercut with its free end chamfered, and an undercut in a tapped hole refused](assets/demos/modelled-threads/test_thread_runouts-motion.gif)

> *Example prompt:* Thread this M6 bolt up to its collar with a DIN 76-1
> undercut there, and chamfer its end.

**What it shows.** How a thread ends at the shoulder. `fade` cuts the
groove's end straight along the helix's tangent, out past the rod: the
straight cut leaves the round rod, so the groove tapers to a point.
`undercut_a` cuts DIN 76-1's Form A groove at the collar instead. The other
end, where the bolt enters a nut, is chamfered by `lead_in`:

| Step | Tools | Expected | Measured |
| --- | --- | --- | --- |
| M6x1.0, 12 mm, `fade` | `create_thread` | tangent; runs out over √(r² − (r − h)²) = 1.72 mm | tangent, 1.72 mm, −0.32 mm³ |
| M6x1.0 to a 10 mm collar, `undercut_a` | `create_thread` | DIN 76-1 Table 1: dg 4.4, g2 3.5, r 0.5, 30° flank | dg 4.4, g2 3.5, r 0.5, 30° |
| Its free end, `lead_in` | `create_thread` | 45° to 4.7 mm, 0.65 mm long | 4.7 mm, 0.65 mm, −1.38 mm³ |
| An undercut in a tapped hole | `create_thread` | refused, nothing built | `invalid_input`: "external metric threads only" |

The undercut in a tapped hole is refused **on purpose**: DIN 76-1's table is
for external threads.

**Tool calls**

1. A 6 mm rod 25 mm long, then `create_thread({"size": "M6x1.0", "edge_point": [3, 25, 0], "length": 12, "runout": "fade"})`
2. A 6 mm rod 25 mm long on a 10 mm collar 6 mm long, then `create_thread({"size": "M6x1.0", "edge_point": [3, 25, 0], "length": 25, "runout": "undercut_a", "lead_in": true})`
3. On the same part, `create_thread({"kind": "internal", "size": "M6x1.0", "edge_point": [2.5, 15, 0], "length": 10, "runout": "undercut_a"})`, refused on purpose

## Several bodies {#bodies}

Source: [`tests/live/test_live_sw_multi_body.py`](https://github.com/andrewbartels1/SolidworksMCP-python/blob/main/tests/live/test_live_sw_multi_body.py).
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Every tool's name, description and inputs are sent to the model on every turn, s

| Toolset | Tools |
| --- | --- |
| `core` | Parts and assemblies: modelling, equations, multi-body tools, colours, reference geometry, sketching, files, measuring and checking, materials and properties, export, the circuit-breaker reset |
| `core` | Parts and assemblies: modelling, equations, multi-body tools, threads, colours, reference geometry, sketching, files, measuring and checking, materials and properties, export, the circuit-breaker reset |
| `drawing` | Drawings: views, dimensions, the title block and sheet, the drawing package and check |
| `automation` | Macros, recording and batch automation |
| `vba` | The VBA code generators |
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

An MCP server that lets AI agents drive SolidWorks: describe a part, and the agent builds it with the server's 123 tools and checks what SolidWorks reports back.

🚀 **171 Tools** | 🤖 **Agent-Ready Workflows** | ⚡ **Automatic COM/VBA Routing** | 🧪 **Schema-Validated Prompt Runs**
🚀 **173 Tools** | 🤖 **Agent-Ready Workflows** | ⚡ **Automatic COM/VBA Routing** | 🧪 **Schema-Validated Prompt Runs**

## Overview

Expand Down Expand Up @@ -43,7 +43,7 @@ The project emphasizes an inspect -> classify -> delegate loop instead of blind

### 2) Broad Tool Surface with Practical Coverage

- 171 tools across modeling, multi-body parts, colours, reference geometry, assemblies, sketching, drawing, engineering data, analysis, export, automation, templates, macros, and docs discovery
- 173 tools across modeling, multi-body parts, modelled threads, colours, reference geometry, assemblies, sketching, drawing, engineering data, analysis, export, automation, templates, macros, and docs discovery
- one server API surface for both simple operations and advanced workflows

### 3) Reliable Execution Path for Complex Operations
Expand Down
Loading
Loading