
andrewbartels1/solidworksmcp-python
Developer toolsPython MCP server for SolidWorks automation with 159 tools, plus an optional agent/prompt-testing layer for AI-assisted workflows.
Overview
Python MCP server for SolidWorks automation with 159 tools, plus an optional agent/prompt-testing layer for AI-assisted workflows.
README
SolidWorks CAD Assistant & MCP Server
Python MCP server for SolidWorks automation with 159 tools, plus an optional agent/prompt-testing layer for AI-assisted workflows.
Generated from the code; click it for every tool, its level and why, filterable by level and family.
Two tools in one
-
A Python interface for scripting SolidWorks. The adapters wrap SolidWorks’ COM API in plain
asyncPython calls, so you can automate it from your own scripts without an AI in the loop:from solidworks_mcp.adapters.base import ExtrusionParameters from solidworks_mcp.adapters.pywin32_adapter import PyWin32Adapter adapter = PyWin32Adapter({}) await adapter.connect() await adapter.create_part() await adapter.create_sketch("Top") await adapter.add_rectangle(-20, -10, 20, 10) # mm await adapter.exit_sketch() await adapter.create_extrusion(ExtrusionParameters(depth=10)) -
An MCP tool server on top of it. The same calls, exposed as 123 MCP tools, so an agent such as Claude Code can build parts, assemblies and drawings from a description. Each tool carries a support level (stable, beta, experimental, planned or deprecated), so the agent knows how far to trust it.
See it work
A whole mechanism from a description
I took SolidWorks’ own U-Joint sample, read every part, sketch, feature and mate, and wrote it up as a plain-English prompt: eight parts, a crank sub-assembly, and a main assembly that has to move like a real joint. Then Claude Code (Opus 5.5, medium effort) built it from that prompt alone.
Six of the eight parts match the sample’s volume within 0.2 %, and all eight within 1 %. The mates leave the mechanism free to turn. The recording replays the session’s 294 calls (sped up 80 times). The walkthrough has the prompt, the part-by-part comparison, and what the agent couldn’t do. The same prompt run with and without the agent skill made the same parts, which is why I want skills that improve results (#207).
A drawing package from one prompt
Make a 100 x 50 x 10 mm AISI 1020 mounting plate with four M5 clearance holes, 10 mm in from each edge, and draw it fully dimensioned. Stack two of them 10 mm apart, check the result, and draw the assembly with a BOM.
The 58 tool calls an agent made from that prompt, run against SolidWorks 2026 through the same MCP tools a client calls, and recorded (sped up five times). Each result is checked against a hand calculation: the plate’s volume and mass, the 10 mm gap and the BOM quantity. This is a replay of the calls, not a recorded model session.
Note: the demo is not perfect, and is not the most efficient way to get this result. The run pauses after each call so it can be read, and the calls are chosen to show what the tools can do: every sketch dimension is added one at a time, and the mate distance is stepped down only so the plates are seen coming together.
The walkthrough in the docs has the agent’s plan and every call with its arguments. Run it yourself with the README demo; the calls are also in plate_stack_calls.json.
Overview
Tried it? Tell us what worked and what didn’t in a feedback issue. Reports from real setups decide what gets fixed next.
This project focuses on practical SolidWorks automation with an AI-friendly loop:
- describe intent
- generate a plan
- execute MCP tools
- inspect results
- iterate
It includes:
- core MCP runtime for SolidWorks tool execution
- COM/VBA routing and adapter safety wrappers
- tool coverage across modeling, sketching, drawing, analysis, export, automation, templates, and macros
- optional agent orchestration/testing utilities under
src/solidworks_mcp/agents/
Demos
Each GIF is a live test driving SolidWorks 2026 through the MCP tools, with the call and its result captioned beneath. Click one to see what it checks, a prompt that asks for it, and its tool calls.
See every demo in the docs: what each one shows, its prompt, every tool call with its arguments (all 58 for the demo at the top), and how to run them yourself.
Supported Today
- Windows + SolidWorks COM automation for the main CAD lifecycle.
- Tested on SolidWorks 2026. Earlier versions may work but are untested. To check yours, run
uvx solidworks-mcp-python selftestwith SolidWorks open, then send the result with the compatibility report form. The compatibility page lists the releases checked so far. - Modeling, sketching, drawing, analysis, export, file and engineering-data tools, plus VBA generation and running macros.
- Every tool’s support level, and the reason a tool isn’t stable yet, is on the progress page.
- Any SolidWorks licence works, Makers included: no tool needs Professional, Premium or an add-in. 20 tools work without SolidWorks running (which ones).
Not Yet / Simulated
- Mock adapter output is simulated and should not be treated as engineering truth.
- Live 3D viewport streaming in a UI.
- Checkpoint-level interference validation.
- Simple simulation and fluid workflows
- Simple Topology Optimization via SimulationXpress etc.
Install
You need Windows 10 or 11 and SolidWorks (opened at least once). In PowerShell, install uv, then open a new PowerShell window and run setup:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
uvx solidworks-mcp-python setup
uv fetches Python 3.13 and the server from PyPI by itself; nothing to clone. The guided setup then:
- finds your SolidWorks version and the MCP clients on your PC: Claude Desktop, Claude Code, VS Code, Cursor and LM Studio;
- lets you pick which clients to connect;
- starts the server once to check that it lists its tools (in mock mode, so SolidWorks isn’t touched);
- adds a
solidworksentry to each client you picked, then tells you what to restart.
Nothing needs a login or an API key, and the server runs only on your PC. Setup changes only the solidworks entry in each client’s config. It backs the file up first and never shows or changes your other servers. Other entries that start this server the old way (run-mcp.ps1 and the like) are offered for removal, so tools don’t load twice.
To check it worked: open SolidWorks, restart your client, and ask “What model is open in SolidWorks?”
The package is solidworks-mcp-python. uvx solidworks-mcp installs a different project. To work on the server itself, install from a clone. More fixes are in Troubleshooting.
Connect your client
Run setup again whenever you want to add a client:
uvx solidworks-mcp-python setup
| Option | What it does |
|---|---|
--client claude-desktop |
Configure one client without the list. Repeat it for several (claude-code, vscode, cursor, lmstudio). |
--dry-run |
Show what would change, and change nothing. |
--yes |
Don’t ask: configure every client found. |
--remove |
Take the solidworks entry out again. |
--replace-old |
Remove older entries for this server without asking. |
--mock |
Configure mock mode, which answers without SolidWorks (for trying the tools). |
--year 2026 |
The SolidWorks release to start the server with. Default: the newest installed. |
To set up a client by hand instead, each one runs uvx solidworks-mcp-python --year 2026, with your SolidWorks year. --year names your installed SolidWorks release and is required for real SolidWorks; setup fills it in for you. It picks which SolidWorks API the lookup tools answer for. Without it, the server logs a warning and uses the newest installed release. If a client can’t find uvx, use its full path, from (Get-Command uvx).Source.
For mock mode, which needs no SolidWorks, use "args": ["solidworks-mcp-python", "--mock"]. Linux and WSL work for the docs, the tests and mock mode, but not for driving SolidWorks.
A shorter tool list
All 159 tools cost about 65,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.
Teach your agent the workflow
Each tool’s description says what that tool does. The solidworks-mcp skill covers what spans tools: the order to build in (sketch, close it, then the feature), which inputs take millimetres and which take metres, how to pick faces and edges, checking the result with verify_model, recovering from errors, and the tools that don’t work yet. Install it into Claude Code with:
uvx solidworks-mcp-python skill install
That writes ~/.claude/skills/solidworks-mcp/. Add --project for the current project’s .claude/skills, or --dir for another agent’s skills folder. It writes only that folder and needs no login. Re-run it after an upgrade.
Clients that read MCP resources don’t need the install: the server serves the same skill at skill://solidworks-mcp/SKILL.md, and points to it in the instructions it sends when a client connects. More: Agent skill.
Contributing
install.ps1 gives you an editable install, so code changes take effect the next time a client starts the server. For the development tools, install the extras:
.\.venv\Scripts\python.exe -m pip install -e ".[dev,test,docs]"
.\dev-commands.ps1 lists the common workflows:
dev-install: install or update the local dev environmentdev-test: run the standard test suite (the CI-safe subset)dev-test-full: run the full suite, including smoke and integration pathsdev-lintanddev-format: lint checks and formattingdev-docs-build,dev-docs-strictanddev-docs-audit: build the docs, build them failing on warnings, or write an audit report to.generated/docs
To mirror GitHub Actions CI locally (Ubuntu, the conda env from solidworks_mcp.yml, and make test), run .\scripts\run-ci-local.ps1. The first run builds the image; add -NoBuild to re-run tests without rebuilding.
Docs
- Main docs site:
- Home/overview: docs/index.md
Key docs sections:
- Getting Started: docs/getting-started
- MCP Server Guide: docs/user-guide
- Tool Catalog: docs/user-guide/tool-catalog
- Agents and Skills: docs/agents
- Planning/Roadmap: docs/planning
Direct links:
- Installation
- Quick Start
- Tutorial: U-Joint Assembly Build
- Tutorial Tracks
- VS Code MCP Setup
- Architecture
- Agents and Prompt Testing
- PydanticAI and Schemas
License
MIT License. See LICENSE.
Install
uvx solidworks-mcp-python --year 2026Configuration
{
"mcpServers": {
"solidworks": {
"command": "uvx",
"args": ["solidworks-mcp-python", "--year", "2026"]
}
}
}