Get running quickly with the verified Windows setup.
- Windows 10/11.
- SolidWorks installed (for real automation).
Install uv, open a new PowerShell window, and run setup:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
uvx solidworks-mcp-python setupuv fetches Python and the server from PyPI. Setup:
- finds your SolidWorks and your MCP clients (Claude Desktop, Claude Code, VS Code, Cursor, LM Studio);
- lets you pick which to connect;
- checks that the server starts;
- adds a
solidworksentry to each client you picked.
Run uvx solidworks-mcp-python setup again any time to add a client. To work on the server itself, install from source. The Installation guide covers each step and the options.
Open SolidWorks, restart your client as setup told you, and ask "What model is open in SolidWorks?". The server's log includes:
SolidWorks COM interface is availableRegistered 155 SolidWorks tools(the count grows as tools are added)Connected to SolidWorks
If it says Could not connect to SolidWorks, SolidWorks wasn't open when the server started. Open it and restart the server from your client.
To set a client up by hand instead, every client runs the same command, 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. The README's Connect your client section has the config for each.
Clients start the server themselves. To watch its log in a terminal instead, open SolidWorks and run:
uvx solidworks-mcp-python --year 2026It waits for an MCP client on stdin; stop it with Ctrl+C.
The adapter methods are awaited because the PyWin32 adapter exposes its SolidWorks operations as async coroutines. If you call these methods without await, Python only creates a coroutine object and the COM operation never actually runs, which leads to warnings like coroutine was never awaited.
asyncio.run(main()) starts an event loop so the awaited adapter calls can execute in order.
import asyncio
from solidworks_mcp.adapters.pywin32_adapter import PyWin32Adapter
from solidworks_mcp.config import load_config
async def main() -> None:
config = load_config()
adapter = PyWin32Adapter(config)
await adapter.connect()
print(f"Connected: {adapter.is_connected()}")
asyncio.run(main())Every SolidWorks operation below is awaited for the same reason: each call is an async adapter method that performs COM work against the running SolidWorks instance. Using await ensures each step finishes before the next one starts, which is important for ordered CAD operations like sketch -> exit sketch -> extrude.
import asyncio
from solidworks_mcp.adapters.base import ExtrusionParameters
from solidworks_mcp.adapters.pywin32_adapter import PyWin32Adapter
from solidworks_mcp.config import load_config
async def main() -> None:
config = load_config()
adapter = PyWin32Adapter(config)
await adapter.connect()
# New part
part_result = await adapter.create_part()
if not part_result.is_success:
raise RuntimeError(f"Failed to create part: {part_result.error}")
# Base sketch
await adapter.create_sketch("Front Plane")
await adapter.add_rectangle(0, 0, 50, 30)
await adapter.exit_sketch()
# Extrude base
await adapter.create_extrusion(ExtrusionParameters(depth=10))
# Add two holes
await adapter.create_sketch("Top Plane")
await adapter.add_circle(10, 10, 2.5)
await adapter.add_circle(40, 10, 2.5)
await adapter.exit_sketch()
await adapter.create_cut_extrude(ExtrusionParameters(depth=10))
print("Bracket created")
await adapter.disconnect()
asyncio.run(main())Reinstall Python from python.org and ensure PATH option is enabled.
.\.venv\Scripts\python.exe -m pip install -e ..\.venv\Scripts\python.exe -m pip install -e .The server is in mock mode. Ensure --real --year 2026 appears in your
mcp.json args after the script path, then restart the server.
- Open SolidWorks before starting the MCP server.
- Confirm
--realis in the server args (see above). - Confirm you are on Windows (COM does not work in WSL).
- Check COM availability:
.\.venv\Scripts\python.exe -c "import win32com.client; print('win32com OK')"