Why Would You Do This?

Imagine telling an AI β€œput a 10mm countersunk hole in the top face” and watching it happen in SolidWorks β€” no menu diving, no macro hacking, no YouTube tutorial rabbit holes at 1 AM. That’s what a SolidWorks MCP server gives you.

MCP (Model Context Protocol) is an open standard that lets AI tools like Claude Code talk to external software. A SolidWorks MCP server translates natural-language intent into real CAD operations on a running SolidWorks session.

Since SolidWorks only runs on Windows, the simplest setup keeps everything on Windows: Claude Code, the MCP server, and SolidWorks all running natively. No WSL, no HTTP bridges, no cross-OS networking headaches. Just PowerShell and go.

The Architecture

Everything lives on one machine, one OS:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Windows (PowerShell)                            β”‚
β”‚                                                  β”‚
β”‚  Claude Code ─── stdio ──→ MCP Server ─── COM ──→ SolidWorks β”‚
β”‚                                                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Claude Code spawns the MCP server as a local child process using stdio (stdin/stdout). The MCP server talks to SolidWorks through the COM API. No network connection between Claude Code and the local MCP server β€” no ports, no firewall rules. It’s the simplest possible setup.

What You Need

  • Windows 10 or 11
  • SolidWorks 2024+ installed, licensed, and launchable
  • Node.js 18+ for Windows β€” download from nodejs.org or install via winget install OpenJS.NodeJS
  • Python 3.10+ for Windows β€” download from python.org or install via winget install Python.Python.3.12
  • Git for Windows β€” winget install Git.Git

Important: If you have Claude Code installed in WSL, that’s a separate installation. It won’t work from PowerShell. You need to install it on the Windows side too.

Automated Setup (The Easy Way)

Don’t want to do all these steps manually? We made a PowerShell script that does everything in this guide β€” checks prerequisites, clones the MCP server, creates the .mcp.json, installs skills, and sets up CLAUDE.md. One command and you’re done.

Download it: setup-solidworks-claude.ps1

Or grab it from PowerShell:

Invoke-WebRequest -Uri "https://james.alme.cloud/scripts/setup-solidworks-claude.ps1" -OutFile "setup-solidworks-claude.ps1"

Preview what it’ll do first (dry run β€” no files created or modified):

powershell -ExecutionPolicy Bypass -File setup-solidworks-claude.ps1 -DryRun

Run it for real:

powershell -ExecutionPolicy Bypass -File setup-solidworks-claude.ps1

The script is idempotent β€” safe to re-run. It won’t overwrite existing configs, it merges with them. If you want to understand what each step does, or prefer doing it by hand, keep reading.

Step 1: Install Claude Code on Windows

Open PowerShell and install Claude Code globally:

npm install -g @anthropic-ai/claude-code

Verify it works:

claude --version

If you get a β€œcommand not found” error, make sure your npm global bin directory is in your PATH. Run npm config get prefix to find it β€” the claude binary will be in that folder.

Step 2: Pick Your MCP Server

Several open-source SolidWorks MCP servers exist. Here are the main ones:

ServerLanguageApproach
SolidPilot (eyfel/mcp-server-solidworks)Python + C#Feature-level IR, compiles intent down to SolidWorks ops. Supports 2D drawing β†’ 3D reconstruction.
Solidworks-MCP (alisamsam)PythonDirect natural-language to SolidWorks control via COM.
SW_MCP (tylerstoltz)C# (.NET)Native C# SDK, targets SolidWorks 2020+.
SolidworksMCP-python (andrewbartels1)PythonPython-based automation with COM bridge.

This guide uses the Python-based approach. The concepts apply to all of them β€” only the install commands and entry point change.

Step 3: Clone and Install the MCP Server

In PowerShell:

# Clone the server
git clone https://github.com/alisamsam/Solidworks-MCP.git
cd Solidworks-MCP

# Create a virtual environment
python -m venv .venv
.venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Most SolidWorks MCP servers depend on pywin32 to talk to the COM API. If it’s not included in requirements.txt:

pip install pywin32

Note: Do not run the pywin32_postinstall.py script inside a virtual environment β€” the pywin32 project explicitly says it shouldn’t be run there, and it can break the venv. The standard pip install is sufficient.

Quick sanity check

Make sure SolidWorks is open, then test the server:

.venv\Scripts\python.exe solidworks_mcp_server.py

You should see output indicating the server is listening on stdio. If it crashes with a COM error, check:

  • Is SolidWorks actually running? Open it first, get past the splash screen.
  • 32-bit vs 64-bit Python. SolidWorks is 64-bit, so your Python must be too. Check: python -c "import struct; print(struct.calcsize('P') * 8)" β€” it should print 64.

Kill the server with Ctrl+C once you’ve confirmed it starts. Claude Code will manage its lifecycle from here.

Step 4: Register the MCP Server with Claude Code

This is the step where everything connects. Tell Claude Code to spawn the MCP server as a local stdio process:

claude mcp add --transport stdio --scope user solidworks -- "C:\path\to\Solidworks-MCP\.venv\Scripts\python.exe" "C:\path\to\Solidworks-MCP\solidworks_mcp_server.py"

Replace C:\path\to\Solidworks-MCP with the actual path where you cloned the repo. The --scope user flag makes the server available across all your projects, not just the current directory.

Or add it manually by creating a .mcp.json file in your project root:

{
  "mcpServers": {
    "solidworks": {
      "command": "C:\\path\\to\\Solidworks-MCP\\.venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\Solidworks-MCP\\solidworks_mcp_server.py"],
      "cwd": "C:\\path\\to\\Solidworks-MCP"
    }
  }
}

Note: The .mcp.json approach uses project scope β€” the server is only available in that project directory. The claude mcp add --scope user approach (above) makes it available everywhere. Choose whichever fits your workflow.

That’s it. No HTTP proxy, no port numbers, no firewall rules. Claude Code spawns the server process directly and communicates over stdin/stdout.

Step 5: Verify the Connection

Make sure SolidWorks is running, then start Claude Code:

claude

Check that the server is connected. Inside Claude Code, type:

/mcp

Or from PowerShell:

claude mcp list

You should see solidworks listed as connected with its available tools (e.g. create_sketch, extrude_sketch, cut_extrude, save_document). The exact tool list depends on your server version.

MCP connected β‰  SolidWorks connected. A successful MCP connection only means Claude Code can talk to the server process. It doesn’t prove the server can reach SolidWorks via COM. Test that separately β€” try a simple tool call like creating a new part document.

If it shows ✘:

SymptomFix
Server failed to startCheck the path in your .mcp.json β€” does solidworks_mcp_server.py exist there?
COM errorSolidWorks isn’t running, or 32/64-bit Python mismatch
command not found: pythonThe venv Python path in .mcp.json may be wrong. Verify the .venv\Scripts\python.exe path exists.
No tools listedThe server started but couldn’t connect to SolidWorks. Restart SolidWorks and try again.

Step 6: Start Designing with Natural Language

Now the fun part. In Claude Code, just ask:

> Create a new SolidWorks part with a 50mm Γ— 30mm Γ— 10mm rectangular block,
  then add a 5mm through-hole centered on the top face.

Claude will use the MCP server’s tools to (conceptual sequence β€” actual tool calls depend on server version):

  1. Open a new part document
  2. Create a sketch on the Top plane
  3. Draw a 50Γ—30mm rectangle
  4. Extrude the sketch 10mm
  5. Select the top face
  6. Sketch a circle at center
  7. Cut-extrude through all

Watch it happen in real time in SolidWorks on your screen.

Verify Your First Success

After the part is created, confirm things actually worked:

  1. Check dimensions β€” measure the block in SolidWorks. It should be 50Γ—30Γ—10mm, not meters.
  2. Check rebuild status β€” the feature tree should show no errors (no red X icons).
  3. Save, close, and reopen β€” make sure the file is intact and features rebuild cleanly.

If all three pass, your setup is working end-to-end. If not, check the troubleshooting table in Step 5.

Step 7: Add a SolidWorks Skill (You Really Should)

The MCP server gives Claude the tools β€” create a sketch, extrude, cut, fillet. But tools alone don’t make Claude good at CAD. SolidWorks has decades of conventions, constraints, and gotchas that a language model doesn’t inherently know. That’s where a skill comes in.

A skill is a markdown file (a SKILL.md inside a folder under .claude/skills/) that gives Claude domain-specific instructions it can pull in when working on relevant tasks. Think of it as a cheat sheet Claude loads when it needs that knowledge. Without one, Claude will make rookie SolidWorks mistakes: using the wrong units (the COM API works in meters, not millimeters), guessing parameter counts on 15-parameter API calls, extruding before constraining a sketch, or building features in an order that breaks the parametric tree.

The good news: you don’t have to write one from scratch. The community has already published skills specifically for SolidWorks.

Option A: Install a Community SolidWorks Skill

Several purpose-built SolidWorks skills exist on GitHub. Here are the ones worth knowing about:

solidworks-api-skill β€” A Claude Code skill focused on writing correct SolidWorks API automation code. It encodes the parameter signatures, COM gotchas, and constant enums (swConst) that Claude would otherwise guess wrong. Covers sketches, extrusions, revolves, cuts, patterns, mates, materials, and STEP export. Built from a real shield-machine cutterhead modeling project, so the pain points are battle-tested.

Key things this skill teaches Claude:

  • SolidWorks API uses meters internally, not millimeters (1 mm = 0.001)
  • Methods like FeatureExtrusion2 take 10–15 parameters with mixed types β€” the skill provides the exact signatures
  • Late-binding COM calls fail with >12 parameters β€” the skill documents workarounds
  • swConst enums like swDocPART, swEndCondBlind, swPlaneTop instead of magic numbers

Install it in PowerShell:

git clone https://github.com/guoleizhen717/solidworks-api-skill.git $env:TEMP\sw-skill
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.claude\skills\solidworks-api"
Copy-Item "$env:TEMP\sw-skill\SKILL.md" "$env:USERPROFILE\.claude\skills\solidworks-api\SKILL.md"

text-to-cad β€” A broader library of CAD/CAM agent skills. While not SolidWorks-specific (it uses CadQuery/OpenCascade under the hood), it includes skills for STL export, DXF generation, DfAM (Design for Additive Manufacturing) printability checks, and even Bambu Labs printer integration. Useful as a complement to a SolidWorks-specific skill if your workflow goes all the way to the printer.

Install via the skills CLI:

npx skills add earthtojake/text-to-cad

Or for Claude Code specifically:

claude plugin marketplace add earthtojake/text-to-cad
claude plugin install cad@text-to-cad

cad-skill (flowful-ai) β€” A Claude Code skill for parametric 3D-printable model generation. Focuses on a describe β†’ model β†’ export STL β†’ preview β†’ iterate loop. It uses CadQuery rather than SolidWorks directly, but the design patterns (fully constrain before extruding, build large-to-small, validate before export) overlap heavily.

Install it:

git clone https://github.com/flowful-ai/cad-skill "$env:USERPROFILE\.claude\skills\parametric-3d-printing"

Option B: Write Your Own Custom Skill

Community skills cover API patterns and general CAD discipline, but they don’t know your workflow β€” your templates, naming conventions, default units, or print settings. A custom skill fills that gap.

Create a skill directory and file in your project:

New-Item -ItemType Directory -Force -Path ".claude\skills\solidworks-custom"

Then create .claude\skills\solidworks-custom\SKILL.md with rules that match how you work:

---
name: solidworks-custom
description: Project-specific SolidWorks conventions, templates, units, and print export rules
---

# SolidWorks β€” Project-Specific Rules

## Units and Templates
- Default to MMGS (millimeters, grams, seconds) for all new parts.
- Use the company part template at
  C:\ProgramData\SolidWorks\templates\custom-part.prtdot
- Save after every major feature, not just at the end.

## Sketch Discipline
- Every sketch must be fully constrained (black lines, not blue)
  before extruding or cutting.
- Use construction geometry (centerlines) for symmetry instead of
  manually mirroring dimensions.
- Place sketches on standard planes (Front, Top, Right) or existing
  flat faces.

## Feature Tree
- Build large to small: base extrude β†’ cuts β†’ fillets β†’ chamfers.
- Name features descriptively ("Base Plate", "Mounting Hole Left"),
  never leave default names.

## File Paths and Naming
- Save to: C:\Users\me\Documents\SolidWorks\project\
- Convention: PROJ-XXX-description-vN.SLDPRT

## 3D Print Export (example defaults β€” adjust for your printer/material)
- STL tolerance: 0.02mm deviation, 5Β° angle.
- Minimum wall: 1.2mm (3 perimeters at 0.4mm nozzle).
- Minimum hole diameter: 2mm for clean FDM prints.
- Orient largest flat face on build plate.

## Error Handling
- On COM drops, tell the user to restart SolidWorks and the MCP
  server. Don't silently retry.
- On sketch over-constraint (red lines), identify the conflicting
  constraint before removing it β€” don't blindly remove the last one added.

The best setup layers multiple skills:

  1. Community API skill (solidworks-api-skill) β€” teaches Claude the correct API signatures, parameter types, unit conversions, and COM workarounds. This prevents the low-level β€œwrong number of arguments” crashes.

  2. Your custom skill β€” teaches Claude your project conventions, templates, naming, and print-specific rules. This prevents the β€œtechnically correct but useless for my workflow” problem.

  3. (Optional) CAD/printing skill (text-to-cad or cad-skill) β€” adds printability checks, STL validation, and slicer-aware design rules. Useful if your output goes directly to a printer.

Claude loads all skills in its context, and they stack β€” the API skill tells it how to call FeatureExtrusion2, your custom skill tells it when and why, and the print skill tells it what to check before exporting.

How skill loading works: Skill bodies aren’t always in context β€” they load when Claude invokes the skill based on the task at hand. For instructions that should always be available (project-wide conventions, key gotchas), put them in CLAUDE.md at your project root instead. Use skills for domain-specific knowledge that Claude should pull in when working on relevant tasks.

How Skills and MCP Servers Actually Work Together

This is the part that confuses people: you don’t need to configure anything to make a skill β€œtalk to” an MCP server. They’re two separate inputs to Claude that combine automatically at runtime.

Here’s what happens when you type β€œcreate a 50mm mounting bracket” in Claude Code:

1. Claude reads your prompt
       ↓
2. Claude's context already includes:
   β”œβ”€β”€ Skill: "SolidWorks COM API uses meters. 50mm = 0.05.
   β”‚          Fully constrain sketches. Build large β†’ small."
   └── MCP tools: create_sketch(), extrude_sketch(), cut_extrude(), save_document()
       ↓
3. Claude plans the approach (informed by the skill):
   "Create sketch on Top plane β†’ constrain β†’ extrude 50mm β†’ save"
       ↓
4. Claude calls MCP tools in sequence (pseudocode):
   create_sketch(plane="Top") β†’ draw_rectangle(width=50, height=30) β†’
   add_constraints() β†’ extrude_sketch(depth=10) β†’ save_document()
       ↓
5. Each tool call goes over stdio to the local MCP server process
       ↓
6. The MCP server translates units as needed and executes the COM call in SolidWorks

Units note: The Solidworks-MCP server defaults to millimetres in its tool interface β€” check the server’s configuration and tool documentation for the unit contract each tool expects. The underlying SolidWorks COM API uses meters internally, but the MCP server may handle that conversion for you. Don’t double-convert: if a tool accepts millimetres, pass millimetres.

The skill shapes how Claude thinks about the task. The MCP server gives Claude the hands to do it. They don’t communicate with each other β€” they both communicate with Claude.

To set this up, you just need two things in place:

1. The MCP server registered (from Step 4):

{
  "mcpServers": {
    "solidworks": {
      "command": "C:\\path\\to\\Solidworks-MCP\\.venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\Solidworks-MCP\\solidworks_mcp_server.py"],
      "cwd": "C:\\path\\to\\Solidworks-MCP"
    }
  }
}

2. The skill file installed (from earlier in this step):

%USERPROFILE%\.claude\skills\solidworks-api\SKILL.md       ← community skill
.claude\skills\solidworks-custom\SKILL.md                   ← your custom skill

That’s it. No linking, no glue code, no config that says β€œuse this skill with that server.” Claude sees both and uses them together when it’s working on SolidWorks tasks. The skill prevents Claude from making dumb calls; the MCP server executes the smart ones.

Why This Matters

Without any skill, here’s what happens when you ask Claude to β€œcreate a 50mm bracket with two M4 mounting holes”:

  1. Claude calls FeatureExtrusion2 with the wrong number of parameters β†’ COM error
  2. Even if the call works, it passes 50 raw to an API that interprets the value in meters β†’ your bracket is 50 meters wide instead of 50 mm
  3. It adds holes before the face they belong on exists in the feature tree β†’ rebuild failure
  4. It doesn’t save β†’ one COM hiccup and everything is lost
  5. It exports STL with default tolerance β†’ the file is either 200MB or looks like a polygon from 1997

With the API skill, the calls are correct. With your custom skill, the workflow makes sense. With the print skill, the output is actually printable. Three layers, each solving a different class of problem.

Practical Tips

Keep SolidWorks in the foreground. Some COM operations silently fail when SolidWorks is minimized. Keep it visible β€” ideally on a second monitor so you can watch Claude work.

32-bit vs 64-bit Python. This trips up everyone. SolidWorks is 64-bit, so your Python must be too. Check in PowerShell:

python -c "import struct; print(struct.calcsize('P') * 8)"

It should print 64. If it prints 32, uninstall and get the 64-bit installer from python.org.

COM connection drops. SolidWorks COM connections are fragile. If the server loses connection, restart SolidWorks and then restart Claude Code (which will respawn the MCP server). Some servers include auto-reconnect logic β€” check your server’s docs.

Start simple. Don’t try to build a full assembly on your first go. Start with a single extruded block. Then add a hole. Then try a fillet. Build up trust in the pipeline before attempting anything complex.

Use full paths when saving. Tell Claude exactly where to save: C:\Users\you\Documents\SolidWorks\bracket.SLDPRT. Claude doesn’t know your folder structure unless you tell it β€” or put it in your custom skill.

The Startup Checklist

Every time you sit down to use this setup:

  1. Launch SolidWorks β€” open it, get past the splash screen
  2. Open PowerShell and cd to your project directory
  3. Run claude β€” it will automatically spawn the MCP server
  4. Verify: claude mcp list shows solidworks: βœ” Connected
  5. Design away

That’s it. No proxy servers to start, no ports to configure, no IPs to look up. Claude Code manages the MCP server process for you.

What About ChatGPT?

This guide focuses on Claude Code, but MCP is an open standard β€” ChatGPT supports it too. The SolidWorks MCP server doesn’t care which AI client spawns it; it just reads stdin and writes stdout. Here’s how to connect it to ChatGPT Desktop on Windows.

Prerequisites

You need the same setup from earlier: SolidWorks, the cloned MCP server with its venv, and 64-bit Python. The only difference is the client.

You also need ChatGPT Desktop for Windows β€” the MCP integration is in the desktop app, not the browser. Download it from openai.com/chatgpt/desktop if you haven’t already.

Register the Server

ChatGPT Desktop uses a JSON config file to manage MCP servers, similar to Claude Code’s .mcp.json.

  1. Open ChatGPT Desktop
  2. Go to Settings β†’ MCP Servers (or Settings β†’ Beta features and enable MCP if you don’t see it)
  3. Add a new server with these details:
{
  "solidworks": {
    "command": "C:\\path\\to\\Solidworks-MCP\\.venv\\Scripts\\python.exe",
    "args": ["C:\\path\\to\\Solidworks-MCP\\solidworks_mcp_server.py"]
  }
}

Replace the paths with your actual install location. The transport is stdio β€” same as with Claude Code.

Key Differences from Claude Code

A few things work differently with ChatGPT:

  • No skills system. ChatGPT doesn’t have Claude Code’s skills or CLAUDE.md. You’ll need to paste key instructions (unit conventions, API gotchas, your workflow rules) into the ChatGPT custom instructions or into the conversation itself. The community API skill content makes a good starting point β€” copy the critical parts into your ChatGPT system prompt or custom instructions.
  • No /mcp command. Check the server status in the ChatGPT settings panel instead.
  • Tool approval may differ. ChatGPT may prompt you to approve each MCP tool call, or batch-approve them β€” this depends on the current ChatGPT Desktop version.
  • Same COM requirements. SolidWorks must be open, Python must be 64-bit, and COM connections are still fragile regardless of which client you use.

The Architecture Is Identical

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Windows                                             β”‚
β”‚                                                      β”‚
β”‚  ChatGPT Desktop ─── stdio ──→ MCP Server ─── COM ──→ SolidWorks β”‚
β”‚                                                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Everything from the troubleshooting section still applies: 64-bit Python, SolidWorks in the foreground, restart on COM drops. The server is the same β€” only the AI client changed.

The Bigger Picture for 3D Printing

If you’re a 3D printing nerd like me, this setup is a game-changer. The workflow becomes:

  1. Describe the part you need to Claude
  2. Claude designs it in SolidWorks via MCP
  3. Export as STL directly from SolidWorks
  4. Open the STL in your slicer, slice, and print

No more fumbling with TinkerCAD for quick functional parts. No more manually modeling the same parametric bracket for the 50th time. Describe it, let Claude build it, tweak the parameters if needed, and send it to the printer.

This is especially powerful for parametric designs β€” tell Claude β€œmake the bracket 5mm wider and add M4 mounting holes” and it modifies the existing part instead of starting over.

Wrapping Up

Keeping everything on native Windows is the path of least resistance for SolidWorks + Claude Code. No WSL bridge, no HTTP proxy, no firewall rules, no gateway IPs that change on reboot. Just PowerShell, a .mcp.json, and a skill file.

Setup takes about 10 minutes β€” or about 30 seconds if you use the automated setup script.

Tested with: SolidWorks 2024, Python 3.12 (64-bit), Claude Code on Windows 11. Other versions may work but haven’t been verified.

Quick troubleshooting checklist if things don’t work:

  • Python must be 64-bit (the most common setup failure)
  • SolidWorks must be running and past the splash screen before starting Claude Code
  • The .mcp.json paths must point to the actual venv Python and actual server entry point
  • COM connections are fragile β€” restart SolidWorks first, then Claude Code

Once connected: describe a part, watch it appear in SolidWorks, iterate with natural language, export, and print.

Now go print something you designed with words.