cadmcp
Languages: English · 简体中文 · Deutsch · 日本語
CAD MCP server: one process, a dedicated STA executor, and an offline-testable Fake backend — SolidWorks backend first.
Not affiliated with Dassault Systèmes. SolidWorks® is a trademark of Dassault Systèmes or its subsidiaries. This project is an independent community MCP server.
Requirements
| Mode | Needs |
|---|---|
| Fake backend (default for CI) | Python 3.11+, Windows/macOS/Linux |
| SolidWorks backend | Windows + SolidWorks 2025 (ProgID SldWorks.Application / SOLIDWORKS_2025) + pywin32 |
The full offline test suite runs against FakeBackend — you do not need SolidWorks installed to develop or verify locally.
Install
pip install pycadmcp
For development (editable + test tools):
git clone https://github.com/shiyang19822000/cad-mcp.git
cd cad-mcp
python -m venv .venv
# Windows PowerShell:
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
CLI entry point: cadmcp.
Quick start
Health check (Fake):
cadmcp doctor --backend fake
Replay a design recipe from the workspace (Fake):
# Copy examples/box_recipe.json into your workspace, then via MCP tool:
# replay_recipe(path="box_recipe.json")
# Or drive the same tools interactively through an MCP client.
Install into a local MCP client (writes server key solidworks):
cadmcp install --client opencode --dry-run
cadmcp install --client opencode
Stdio serve (typical for editors):
cadmcp serve --transport stdio --backend fake --profile part
For real SolidWorks, use --backend solidworks on Windows with SolidWorks running.
Capability matrix
134 tools across 9 toolsets (see docs/TOOL_INVENTORY.md):
| Toolset | Count | Focus |
|---|---|---|
| core | 45 | Documents, sketches, basic features, queries |
| features_adv | 25 | Thread, helix, sweep, surfaces, feature ops |
| assembly | 20 | Insert, mates, component ops |
| drawing | 16 | Views, annotations, DrawingSpec |
| sketch_adv | 12 | Splines, offset/trim, constraints, dims |
| sheetmetal | 7 | Base/flange/hem, flat pattern |
| selection | 6 | Face/edge pick helpers |
| view | 2 | Orientations / screenshots |
| export | 1 | STEP/STL/PDF/DXF |
Skills (solidworks-modeling, solidworks-assembly, solidworks-recovery)
ship as cadmcp://skill/... resources.
Architecture (summary)
- Protocol layer shared by Fake and SolidWorks backends.
- SolidWorks COM runs only on a dedicated STA thread; business code never creates COM connections itself.
- Tool results use a typed OpResult envelope (
ok/error.code/delta/state_version).
Details: ARCHITECTURE.md. Naming history: docs/naming.md.
Testing
Offline (default):
ruff check .
pytest -q
python scripts/tool_inventory.py --check
Real SolidWorks (destructive):
# WARNING: closes all open SolidWorks documents WITHOUT saving.
set CADMCP_REAL_SW=1
pytest -q -m sw
Only run real-SW tests on disposable sessions.
Known limitations
| Limitation | Notes |
|---|---|
| Mold Core/Cavity | Blocked pending reliable parting-surface / license context — #1 |
| Native InsertThread API | Helix + sweep cut path is used instead — #2 |
| SolidWorks Toolbox | Not integrated — #3 |
Part in-context edit (EditPart2) |
Not supported; subassembly edit is — #4 |
| Axial screw-in / feed mate motion | Not supported |
License
MIT — Copyright (c) 2026 shiyang19822000.
Not affiliated with Dassault Systèmes. SolidWorks® is a trademark of Dassault Systèmes or its subsidiaries.
Metadata
Release files for pycadmcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycadmcp-0.1.0.tar.gz | 491.0 kB | Without provenance | Details for pycadmcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycadmcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pycadmcp-0.1.0-py3-none-any.whl |
Total release size: 895.0 kB
Release files / pycadmcp-0.1.0.tar.gz
| Download URL | pycadmcp-0.1.0.tar.gz |
|---|---|
| Size | 491.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b3886e5eff0792d6d510cced8912b6d5421427d82124c0065e5f73d25ccfc5e
|
|
BLAKE2b-256 checksum How to use checksums |
689f1b9f8ecc11c06b1d0cd4a45b43fe309eca5e3d82e7e9b5435eecf57dca03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / pycadmcp-0.1.0-py3-none-any.whl
| Download URL | pycadmcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 404.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f72a9a85fdde39c809b39bf8dc6277565335d95cda09ac6d988a2f2d617bce9
|
|
BLAKE2b-256 checksum How to use checksums |
16c5f07bc6ebe5e2ab138d4a4a260f8bbd1aa5c5b66157044245e764b6818aa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Security for pycadmcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.