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)¶
{
"servers": {
"solidworks-mcp-server": {
"type": "stdio",
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-File",
"C:\\path\\to\\SolidworksMCP-python\\run-mcp.ps1"
]
}
}
}
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, start server solidworks-mcp-server in VS Code and check logs.
Healthy logs should include:
Platform: WindowsSolidWorks COM interface is availableRegistered 109 SolidWorks toolsConnected to SolidWorks
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.
Server starts but tool actions fail¶
- Start SolidWorks first.
- Ensure server is running on Windows, not WSL, for COM actions.