VS Code MCP Setup¶
This page reflects the verified Windows setup that works with Python from python.org.
Before You Start¶
- Python installed from python.org.
- PATH enabled for
python. - Project installed in
.venvwithpip install -e .. - SolidWorks installed if you want real COM automation.
Open MCP Config¶
- In VS Code, open Command Palette (
Ctrl+Shift+P). - Run
MCP: Open User Configuration. - Edit
%APPDATA%\Code\User\mcp.json.
Recommended Configuration (Windows, verified)¶
Always pass --real — omitting it silently runs in mock mode
Without --real, the server starts in mock mode: every tool call returns
simulated data and nothing touches SolidWorks at all. Images are blank,
mass properties are nonsense, and no part is created.
Open SolidWorks before restarting the MCP server. The adapter connects
to an already-running SLDWORKS.exe at startup; it will not launch
SolidWorks for you.
{
"servers": {
"solidworks-mcp-server": {
"type": "stdio",
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-File",
"C:\\path\\to\\SolidworksMCP-python\\run-mcp.ps1",
"--real",
"--year",
"2026"
]
}
}
}
Replace C:\\path\\to\\SolidworksMCP-python with your local repository path.
Change 2026 to match your installed SolidWorks year if different.
This avoids environment activation issues by using the project script that launches .venv\Scripts\python.exe directly.
Alternative: direct venv python command
Alternative: Linux/WSL mock mode only
Use this for docs/tests or mock-mode development only (not real SolidWorks COM control).Validate Startup¶
After saving mcp.json, open SolidWorks first, then restart the MCP server in VS Code and check logs.
Healthy logs should include:
Platform: WindowsSolidWorks COM interface is availableRegistered 109 SolidWorks toolsConnected to SolidWorksAdapter Mode: Real SolidWorks(confirms--realwas picked up)
Troubleshooting¶
ModuleNotFoundError: solidworks_mcp¶
ModuleNotFoundError: fastmcp¶
python points to Microsoft Store alias¶
- Disable App execution alias for Python in Windows settings.
- Reinstall Python from python.org and enable PATH.
Tools return blank images or nonsense mass properties¶
The server is running in mock mode. Add --real --year 2026 to the
args list in your mcp.json (after the script path) and restart the server.
Server starts but tool actions fail¶
- Open SolidWorks before restarting the MCP server.
- Confirm
--realis present in themcp.jsonargs — without it the server silently serves mock data. - Ensure server is running on Windows, not WSL, for COM actions.