# SolidWorks MCP Server — AI CAD Automation (`obedient_hierarchy/solidworks-mcp-server`) Actor

MCP (Model Context Protocol) server that lets AI assistants like Claude control SolidWorks. Create parts, sketch, extrude, assemble, run FEA simulations, export to STEP/IGES/STL/PDF, and more — all via natural language. Supports 3DEXPERIENCE Works (cloud) and SolidWorks Desktop COM API (Windows).

- **URL**: https://apify.com/obedient\_hierarchy/solidworks-mcp-server.md
- **Developed by:** [Kritsana](https://apify.com/obedient_hierarchy) (community)
- **Categories:** Agents, AI, MCP servers
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## SolidWorks MCP Server

MCP (Model Context Protocol) server that lets AI assistants control SolidWorks — create parts, sketch, extrude, assemble, run FEA simulations, export files — all through natural language.

### Architecture

````

AI Client (Claude/Cursor)  ←→  MCP (SSE/stdio)  ←→  SolidWorks API
├── 3DEXPERIENCE Cloud
└── COM Desktop (Windows)

````

### Quick Start

#### Local (stdio)

```bash
pip install -e .
python -m solidworks_mcp_server --backend dxp --transport stdio
````

Claude Desktop config:

```json
{
  "mcpServers": {
    "solidworks": {
      "command": "python",
      "args": ["-m", "solidworks_mcp_server", "--backend", "dxp"],
      "env": {
        "DXP_BASE_URL": "https://your-platform.3dexperience.3ds.com",
        "DXP_SPACE_ID": "your-space-id",
        "DXP_API_KEY": "your-api-key"
      }
    }
  }
}
```

#### Local (SSE)

```bash
python -m solidworks_mcp_server --backend dxp --transport sse --port 8000
```

Connect at `http://localhost:8000/sse`

#### Apify Actor

```bash
apify push
```

Input:

```json
{
  "backend": "dxp",
  "dxpApiKey": "your-api-key",
  "dxpBaseUrl": "https://your-platform.3dexperience.3ds.com",
  "dxpSpaceId": "your-space-id",
  "mcpTransport": "sse",
  "mcpPort": 8000
}
```

### Prerequisites

#### 3DEXPERIENCE Works (Cloud — Any OS)

| Required | Source |
|---|---|
| API Key | 3DEXPERIENCE Platform → Profile → API Keys |
| Base URL | Platform URL from 3DS admin |
| Space ID | Collaborative Space ID |

#### SolidWorks Desktop COM (Windows Only)

| Required | Source |
|---|---|
| SolidWorks 2022+ | Professional or Premium license |
| pywin32 | `pip install pywin32` |

### 38 MCP Tools

#### Part

| Tool | Description |
|---|---|
| `sw_list_open_documents` | List all open documents |
| `sw_create_part` | Create a new part |
| `sw_open_part` | Open an existing part file |
| `sw_save_part` | Save a part (SLDPRT / STEP / IGES / STL / PDF) |
| `sw_close_part` | Close a part |
| `sw_get_part_info` | Get material, mass, volume, bounding box |

#### Sketch & Feature

| Tool | Description |
|---|---|
| `sw_create_sketch` | Create a 2D sketch on a plane (front / top / right) |
| `sw_draw_line` | Draw a line |
| `sw_draw_circle` | Draw a circle |
| `sw_draw_rectangle` | Draw a rectangle |
| `sw_add_dimension` | Add a dimension constraint |
| `sw_extrude` | Extrude a sketch into a solid |
| `sw_revolve` | Revolve a sketch |
| `sw_cut_extrude` | Cut extrude (remove material) |
| `sw_fillet` | Fillet / round edges |
| `sw_hole_wizard` | Create standard holes |

#### Assembly

| Tool | Description |
|---|---|
| `sw_create_assembly` | Create a new assembly |
| `sw_insert_component` | Insert a part into an assembly |
| `sw_add_mate` | Add a mate constraint |
| `sw_list_components` | List all components |
| `sw_create_exploded_view` | Create an exploded view |

#### Simulation (FEA)

| Tool | Description |
|---|---|
| `sw_apply_material` | Apply a material (e.g. AISI 304, 6061-T6) |
| `sw_apply_fixture` | Apply a fixture / constraint |
| `sw_apply_force` | Apply external force (fx, fy, fz in N) |
| `sw_run_static_study` | Run static stress analysis |
| `sw_get_simulation_results` | Get stress, displacement, factor of safety |

#### Export

| Tool | Description |
|---|---|
| `sw_export_step` | Export to STEP |
| `sw_export_iges` | Export to IGES |
| `sw_export_stl` | Export to STL (3D printing) |
| `sw_export_pdf` | Export drawing to PDF |
| `sw_export_dwg` | Export to DWG/DXF |
| `sw_take_screenshot` | Capture viewport screenshot |

#### Measure

| Tool | Description |
|---|---|
| `sw_measure_distance` | Measure distance between entities |
| `sw_get_mass_properties` | Mass, center of gravity, moments of inertia |
| `sw_get_bounding_box` | 3D bounding box dimensions |

#### Config

| Tool | Description |
|---|---|
| `sw_set_units` | Set document units (mm / inch / meter) |
| `sw_list_materials` | List available materials |
| `sw_set_document_template` | Set document template |

### Environment Variables

| Variable | Default | Description |
|---|---|---|
| `SW_BACKEND` | `dxp` | Backend: `dxp` or `com` |
| `MCP_TRANSPORT` | `stdio` | Transport: `stdio` or `sse` |
| `MCP_PORT` | `8000` | Port for SSE transport |
| `DXP_BASE_URL` | — | 3DEXPERIENCE platform URL |
| `DXP_SPACE_ID` | — | 3DEXPERIENCE space ID |
| `DXP_API_KEY` | — | 3DEXPERIENCE API key |
| `DXP_TENANT` | — | Optional tenant ID |

### Example

```
User: Create a mounting bracket — 100mm x 80mm x 10mm plate
      with four 8mm holes at the corners

AI:
  → sw_create_part("mounting_bracket")
  → sw_create_sketch("mounting_bracket", "front")
  → sw_draw_rectangle("sketch_1", 0, 0, 100, 80)
  → sw_extrude("mounting_bracket", "sketch_1", 10)
  → sw_create_sketch("mounting_bracket", "top")
  → sw_draw_circle("sketch_2", 10, 10, 4)
  → sw_draw_circle("sketch_2", 90, 10, 4)
  → sw_draw_circle("sketch_2", 10, 70, 4)
  → sw_draw_circle("sketch_2", 90, 70, 4)
  → sw_cut_extrude("mounting_bracket", "sketch_2", 10, true)
  → sw_apply_material("mounting_bracket", "AISI 304")
  → sw_export_stl("mounting_bracket", "bracket.stl")
  ✅ Done
```

### Project Structure

```
solidworks-mcp-server/
├── .actor/                    ## Apify Actor config
├── src/solidworks_mcp_server/
│   ├── server.py              ## MCP server entry point
│   ├── backends/
│   │   ├── base.py            ## Abstract interface
│   │   ├── dxp_backend.py     ## 3DEXPERIENCE REST API
│   │   └── com_backend.py     ## SolidWorks COM API (Windows)
│   ├── tools/                 ## 38 MCP tools (7 modules)
│   └── utils/                 ## Geometry & unit helpers
├── Dockerfile
├── pyproject.toml
└── requirements.txt
```

### License

MIT

# Actor input Schema

## `backend` (type: `string`):

Which SolidWorks API to use. DXP = 3DEXPERIENCE cloud platform (works on any OS). COM = SolidWorks Desktop on Windows.

## `dxpBaseUrl` (type: `string`):

Your 3DEXPERIENCE platform URL, e.g. https://r1132100503590-eu1.3dexperience.3ds.com

## `dxpSpaceId` (type: `string`):

Your 3DEXPERIENCE collaborative space ID

## `dxpApiKey` (type: `string`):

API key for 3DEXPERIENCE platform authentication

## `dxpTenant` (type: `string`):

Optional tenant identifier for multi-tenant setups

## `mcpTransport` (type: `string`):

SSE = Server-Sent Events for remote AI clients (Apify Actor mode). Stdio = standard I/O for local use.

## `mcpPort` (type: `integer`):

Port for SSE transport (only used when transport is SSE).

## Actor input object example

```json
{
  "backend": "dxp",
  "mcpTransport": "sse",
  "mcpPort": 8000
}
```

# Actor output Schema

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("obedient_hierarchy/solidworks-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("obedient_hierarchy/solidworks-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call obedient_hierarchy/solidworks-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=obedient_hierarchy/solidworks-mcp-server",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "SolidWorks MCP Server — AI CAD Automation",
        "description": "MCP (Model Context Protocol) server that lets AI assistants like Claude control SolidWorks. Create parts, sketch, extrude, assemble, run FEA simulations, export to STEP/IGES/STL/PDF, and more — all via natural language. Supports 3DEXPERIENCE Works (cloud) and SolidWorks Desktop COM API (Windows).",
        "version": "1.0",
        "x-build-id": "Rd8IMlbJ0Goa9oImB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/obedient_hierarchy~solidworks-mcp-server/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-obedient_hierarchy-solidworks-mcp-server",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/obedient_hierarchy~solidworks-mcp-server/runs": {
            "post": {
                "operationId": "runs-sync-obedient_hierarchy-solidworks-mcp-server",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/obedient_hierarchy~solidworks-mcp-server/run-sync": {
            "post": {
                "operationId": "run-sync-obedient_hierarchy-solidworks-mcp-server",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "backend": {
                        "title": "SolidWorks Backend",
                        "enum": [
                            "dxp",
                            "com"
                        ],
                        "type": "string",
                        "description": "Which SolidWorks API to use. DXP = 3DEXPERIENCE cloud platform (works on any OS). COM = SolidWorks Desktop on Windows.",
                        "default": "dxp"
                    },
                    "dxpBaseUrl": {
                        "title": "3DEXPERIENCE Base URL",
                        "type": "string",
                        "description": "Your 3DEXPERIENCE platform URL, e.g. https://r1132100503590-eu1.3dexperience.3ds.com"
                    },
                    "dxpSpaceId": {
                        "title": "3DEXPERIENCE Space ID",
                        "type": "string",
                        "description": "Your 3DEXPERIENCE collaborative space ID"
                    },
                    "dxpApiKey": {
                        "title": "3DEXPERIENCE API Key",
                        "type": "string",
                        "description": "API key for 3DEXPERIENCE platform authentication"
                    },
                    "dxpTenant": {
                        "title": "3DEXPERIENCE Tenant",
                        "type": "string",
                        "description": "Optional tenant identifier for multi-tenant setups"
                    },
                    "mcpTransport": {
                        "title": "MCP Transport",
                        "enum": [
                            "sse",
                            "stdio"
                        ],
                        "type": "string",
                        "description": "SSE = Server-Sent Events for remote AI clients (Apify Actor mode). Stdio = standard I/O for local use.",
                        "default": "sse"
                    },
                    "mcpPort": {
                        "title": "MCP Port",
                        "minimum": 1024,
                        "maximum": 65535,
                        "type": "integer",
                        "description": "Port for SSE transport (only used when transport is SSE).",
                        "default": 8000
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
