solidworks-mcp
An MCP server that lets AI agents (Claude Code, Claude Desktop and other MCP clients) drive a running SOLIDWORKS. With its 127 tools, agents can sketch and model parts (extrudes, revolves, sweeps, lofts, holes, patterns, shells, surfaces, sheet metal, weldment frames), edit imported bodies directly (delete, offset and move faces), build assemblies with mates (also limit, symmetric, width, hinge, gear and rack mates) and component patterns, make drawings with views, dimensions, GD&T, balloons and tables, import and export (STEP, IGES, STL, Parasolid, PDF, DXF …), run static stress studies, and inspect, measure and screenshot the result. It is written in C# against SolidWorks' official COM API.
Unofficial. This project is not affiliated with, endorsed by or supported by Dassault Systèmes. SOLIDWORKS is a trademark of Dassault Systèmes SolidWorks Corporation.
Status: 0.1.0 pre-release. Every tool passes the offline contract tests and the live tests against a real SOLIDWORKS 2025 (live status, known issues). Other SOLIDWORKS versions are untested; please report what you find.
Why another SolidWorks MCP server? It was built from the lessons of testing every tool of an earlier server, where about 115 of 187 tools were broken or silently wrong.
Safety and data — read this first
- It drives your live SOLIDWORKS. Save your work before letting an agent use it, and don't work in SOLIDWORKS at the same time. If SOLIDWORKS crashes, unsaved work in every open document is lost.
- Your documents are read-only for the server unless you allow edits. Documents it creates are "owned". The agent
can edit a document you opened only after
doc_activate {doc, allowEdit:true}, which saves a backup copy first, and it never discards or closes your documents. - Data leaves your machine. Screenshots, geometry, names, properties and file paths go to the model provider, which matters for NDAs and export control (ITAR/EAR). The server itself makes no network calls and collects no telemetry.
- VBA is off by default.
vba_runexecutes arbitrary code with your rights. Enable it only if you need it (SWMCP_VBA=on), and never wildcard-allow it in your client. - Files:
- Relative paths go under
Documents\solidworks-mcp. - Overwriting needs
overwrite:true, and files the server didn't write are backed up to%LOCALAPPDATA%\solidworks-mcp\backups. - Writes outside your profile and
%TEMP%are refused (SWMCP_WRITE_ROOTSadds folders), and so are network paths.
- Relative paths go under
- System options are only changed temporarily, such as the STEP application protocol during an export. They are
journaled under
%LOCALAPPDATA%\solidworks-mcpand restored, even after a crash. - Run one agent at a time per SOLIDWORKS. Several server processes are serialized by a lock, but they still share one SOLIDWORKS.
Quickstart (build from source)
Requirements:
- Windows 10/11 x64;
- SOLIDWORKS (tested: 2025 SP1.2; other versions are untested, so please report results);
- the .NET 10 SDK;
- git.
git clone https://github.com/soheil-mp/solidworks-mcp.git
cd solidworks-mcp
powershell -ExecutionPolicy Bypass -File tools\install.ps1
install.ps1 builds the server, publishes it to %LOCALAPPDATA%\solidworks-mcp\bin\<version>, so a running copy
never blocks an update, and registers it with Claude Code at user scope.
To register it yourself instead:
dotnet publish src\SolidWorksMcp.Server -c Release -o "$env:LOCALAPPDATA\solidworks-mcp\bin\dev"
claude mcp add --scope user solidworks -- "$env:LOCALAPPDATA\solidworks-mcp\bin\dev\solidworks-mcp.exe"
Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json):
{
"mcpServers": {
"solidworks": {
"command": "C:\\Users\\<you>\\AppData\\Local\\solidworks-mcp\\bin\\dev\\solidworks-mcp.exe",
"env": { "SWMCP_VBA": "off" }
}
}
}
Start SOLIDWORKS, then ask the agent something like "Check the SOLIDWORKS status" or "Make a 100 × 60 × 6 mm plate with rounded corners and two 6 mm holes, then show me a screenshot."
Smart App Control / Application Control
Windows Smart App Control judges each unsigned binary by its hash, and it can block a freshly built
solidworks-mcp.exe or SolidWorksMcp.Core.dll with "An Application Control policy has blocked this file" (Code
Integrity event 3077). When the exe is blocked, tools\install.ps1 registers the DLL through the Microsoft-signed
dotnet host instead (-Dotnet goes that way from the start); by hand that is
claude mcp add --scope user solidworks -- dotnet "<folder>\solidworks-mcp.dll". When a DLL is blocked, run the script
again: it publishes a new binary, which gets a new verdict. Signed releases will avoid this.
Tools
127 tools in 15 toolsets. The full, current list with parameters is in docs/tools.md, generated from
the server.
Live test status
Every area has live tests that drive a real SOLIDWORKS (2025 SP1.2) and check the result against an exact answer (volumes, positions, angles, file headers, restored system options). All 352 pass:
The golden scenarios in tools/mcp_smoke.py (drawing, plate, enclosure, edit, assembly, sheet metal) run through the
real MCP protocol within their call budgets, each with an exact oracle (volumes, interference, inserted dimensions, a
PDF, a flat blank and its DXF).
Known issues
- Long sessions slow SOLIDWORKS down. After a few hundred documents in one SOLIDWORKS session (heavy agent use or the test suite), creating and closing documents can take 20 s to minutes. Restart SOLIDWORKS.
- Drawing annotations in a long session.
drw_center_marksanddrw_dimensions_autosometimes stop adding anything after other modeling in the same session, until SOLIDWORKS is restarted (cause unknown; their hints say so). - A hung call, once. In the final test run, one drawing test never returned (SOLIDWORKS stayed responsive and showed
no dialog) until its process was stopped; it passed when run again. If a call seems stuck, check
sw_status, then restart the MCP server, and SOLIDWORKS if needed. - STEP AP242 may come out as AP203 depending on the installation's license; the export then refuses with
NOT_SUPPORTEDinstead of passing the file off as AP242. - Tapped holes are made as their tap-drill holes, without thread geometry, unless
SWMCP_EXPERIMENTAL=1. - Not available: screw mates (SOLIDWORKS 2025 ignores their pitch set through the API, so
asm_mate_addrefuses them) and sheet-metal jogs. Gear mates read their ratio back reversed; the tool accepts and reports that.
A typical modelling loop:
doc_new → sketch_start {on:{name:"top"}} → sketch_add {entities:[{kind:"rectangle",center:[0,0],widthMm:100,heightMm:60}]}
→ feature_extrude {depthMm:6} → feature_fillet {radiusMm:5, edges:[{where:{curve:"line",parallelTo:"y"},expect:4}]}
→ view_screenshot → doc_save {mode:"as", path:"plate.sldprt"}
Conventions:
- Units are mm, degrees and kg.
- SOLIDWORKS is Y-up: the top plane is XZ.
- Geometry is referenced as
{id},{at:[x,y,z]},{name}or{where, expect}.
The server sends these rules to the client as instructions, and sw_help explains them in detail.
Configuration (environment variables)
Troubleshooting
Migrating from the Python SolidWorks MCP server
- Remove the old registration:
claude mcp remove solidworks -s user, and its Claude Desktop entry. Never register both servers. - Remove or rename any skill written for the old server.
- The old server's exports could change system options: check Tools > Options > Export (the STEP application protocol) and Input dimension value.
Development
See CONTRIBUTING.md for the build and test commands and the rules every tool follows. The design and
its rationale are in docs/DESIGN.md.
License
MIT; see LICENSE. The build embeds type information from your own SOLIDWORKS installation's interop assemblies; no Dassault Systèmes binaries are included in this repository.