Installation Guide¶
This page is beginner-focused and platform-specific.
Core Rule¶
SolidWorks COM automation only runs on Windows.
- Windows host: required for real SolidWorks control.
- Linux/WSL/container: great for development, docs, tests, and remote-client usage.
Choose Your Setup Path¶
- Windows only: full local SolidWorks automation.
- Linux/WSL only: mock-mode development and docs.
- WSL/Linux + Windows host: remote control of SolidWorks from Linux/WSL.
What You Need¶
- Python 3.11+
- One environment manager:
conda,mamba, ormicromamba make(recommended for Linux/WSL workflows)- SolidWorks installed and opened at least once (Windows only)
1. Install Prerequisites¶
Python and PATH¶
In PowerShell, verify your Python installation:
If python is not found, reinstall Python and enable "Add python.exe to PATH".
Conda (Environment Manager)¶
Install Conda using one of these options:
- Miniforge (recommended, conda-forge default): https://github.com/conda-forge/miniforge
- Miniconda (official Anaconda): https://www.anaconda.com/docs/getting-started/miniconda/install/windows-cli-install#powershell
After installation, close and reopen PowerShell, then verify:
If conda is not found, initialize PowerShell and restart:
SolidWorks (Windows only)¶
- Install SolidWorks and find a valid license. Maker details are available at SolidWorks Makers.
- Maker licenses are generally non-commercial/personal and commonly described as limited to $2,000 USD annual profit. Always verify the current official terms before use.
- Launch SolidWorks once manually.
- Keep this Windows machine as the host for real automation.
2. Clone the Repository¶
3. Create Environment and Install Dependencies¶
Option A: Windows (Conda + PowerShell)¶
# Create environment
conda create -n solidworks_mcp python=3.11
# Activate environment
conda activate solidworks_mcp
# Install package and dependencies
pip install -e ".[dev,test,docs]"
If activation fails in a new PowerShell session, initialize conda first:
Option B: Linux / WSL (Make)¶
4. Run Tests¶
Tests default to mock mode.
5. Start the MCP Server¶
Local stdio mode (default)¶
Mock mode (for testing without SolidWorks)¶
Remote HTTP mode (for remote clients)¶
Run on the Windows host:
Remote clients can then connect to http://<windows-host-ip>:8000.
For Linux/WSL clients, continue running tests/docs locally while targeting the Windows host for real SolidWorks operations.
6. Verify SolidWorks Connectivity¶
Verify the COM bridge on Windows:
If this fails, ensure SolidWorks is installed and the pywin32 module is properly configured.
From Linux/WSL, verify the Windows host port is reachable:
python - <<'PY'
import socket
host, port = "<windows-host-ip>", 8000
s = socket.socket()
s.settimeout(3)
s.connect((host, port))
print(f"Connected to {host}:{port}")
s.close()
PY
7. Optional: .env Configuration¶
Create a .env file from .env.example and set values for your machine.
Useful environment variables:
SOLIDWORKS_MCP_DEPLOYMENT_MODE(local,remote,hybrid)SOLIDWORKS_MCP_HOST(default127.0.0.1)SOLIDWORKS_MCP_PORT(default8000)SOLIDWORKS_MCP_MOCK_SOLIDWORKS(trueorfalse)SOLIDWORKS_MCP_LOG_LEVEL(DEBUG,INFO,WARNING,ERROR)
Troubleshooting¶
Conda environment not found¶
Ensure conda is initialized and the environment is created:
make install fails on Linux/WSL¶
- Confirm
makeis installed (sudo apt install makeon Debian/Ubuntu). - Confirm one of
conda,mamba, ormicromambais on PATH. - Re-run with shell init loaded, then run
make installagain.
SolidWorks does not connect¶
- Ensure SolidWorks is installed and has been launched at least once.
- You must be on Windows with SolidWorks COM available.
- Re-run COM check:
python -c "import win32com.client". - If pywin32 is not working, reinstall it:
pip install --force-reinstall pywin32.
Import errors or missing dependencies¶
Reinforce the full environment reinstall:
conda env remove -n solidworks_mcp
conda create -n solidworks_mcp python=3.11
conda activate solidworks_mcp
pip install -e ".[dev,test,docs]"
Linux/WSL cannot reach Windows host¶
- Start server on Windows with
--mode remote --host 0.0.0.0 --port 8000. - Confirm Windows firewall allows inbound traffic on port 8000.
- Use Windows host IP address instead of
localhostwhen required by your network setup.