solidworks-mcp
An MCP server that drives SolidWorks 2023+ on Windows, exposing CAD operations like sketching, extrusions, assemblies, and exports through tools for AI assistants like Kimi and Claude.
README
SolidWorks MCP Server
A self-contained Model Context Protocol (MCP) server that exposes SolidWorks 2023+ to Kimi, Claude, Codex, and other MCP clients on Windows. It drives SolidWorks through the COM API, marshalling all calls onto a single STA thread so the application stays alive and responsive.
This package includes the original MCP server, the local solidworks_automation COM helper modules, and setup scripts to register the server with Kimi and Claude clients.
Prerequisites
- Windows 10/11 (SolidWorks COM automation requires a Windows desktop session).
- SolidWorks 2023 or later (license and installation required).
- Python 3.8+.
mcppackage (>=1.0.0).pywin32package (>=305) for COM interop.
Quick Install
-
Open PowerShell in the package directory.
-
Run the install script:
.\setup.ps1
The script will install Python dependencies and register the server in:
C:\Users\<you>\.kimi\mcp.jsonC:\Users\<you>\.claude\settings.json
Existing settings in those files are preserved (merged, not overwritten).
Manual Install / MCP Config Snippet
If you prefer to register the server manually, add this block under the mcpServers key of your client config:
{
"mcpServers": {
"solidworks": {
"command": "python",
"args": [
"<repo>\\solidworks-mcp\\server.py"
],
"cwd": "<repo>\\solidworks-mcp",
"env": {
"PYTHONIOENCODING": "utf-8",
"SW_HIDE_WINDOW": "1"
}
}
}
}
Then install dependencies from the package root:
pip install -r requirements.txt
# or install in editable mode
pip install -e .
Tool Overview
| Category | Tools | What they do |
|---|---|---|
| Connection / Docs | sw_connect, sw_get_status, sw_new_part, sw_new_assembly, sw_new_drawing, sw_open_document, sw_close_document, sw_save_document, sw_list_open_documents |
Connect to SolidWorks, create/open/close documents, save. |
| Sketch | sw_start_sketch, sw_exit_sketch, sw_sketch_line, sw_sketch_circle, sw_sketch_rectangle, sw_sketch_corner_rectangle, sw_sketch_arc, sw_sketch_polygon, sw_sketch_spline, sw_sketch_slot, sw_add_dimension |
Start/exit sketches and draw 2D geometry on a selected plane. |
| Features | sw_extrude, sw_cut_extrude, sw_extrude_midplane, sw_revolve, sw_fillet, sw_chamfer, sw_shell, sw_linear_pattern, sw_circular_pattern, sw_mirror, sw_rib, sw_list_features |
Build 3D features from sketches and list the feature tree. |
| Assembly | sw_add_component, sw_add_mate, sw_list_components, sw_exploded_view |
Add components, apply mates, and create exploded views. |
| Drawing | sw_create_standard_views, sw_add_view, sw_insert_dimensions, sw_add_note, sw_insert_bom, sw_export_pdf |
Generate drawing views, annotations, BOMs, and PDF export. |
| Export | sw_export_file |
Export to STEP, STL, IGES, DXF/DWG, Parasolid, PDF, and native formats. |
| Analysis / Properties | sw_get_mass_properties, sw_check_interference, sw_get_model_info, sw_set_material, sw_get_sketches, sw_run_analysis |
Mass properties, interference checks, model metadata, and material assignment. |
| Custom Properties / Configurations | sw_get_custom_properties, sw_set_custom_property, sw_get_configurations, sw_activate_configuration, sw_get_active_configuration |
Read/write custom file properties and switch between model configurations. |
Example Usage Prompts
- “Connect to SolidWorks and create a new 100 mm × 60 mm × 20 mm box.”
- “Draw a 30 mm radius circle on the Front Plane and extrude it to 10 mm.”
- “Add the part
C:\\Models\\bracket.sldprtto the active assembly at the origin.” - “Create a coincident mate between the
topface ofbracket-1and thebottomface ofplate-1.” - “Export the current drawing to
C:\\Output\\drawing.pdf.” - “Set the custom property
PartNumbertoA-1001and activate theDefaultconfiguration.”
Boundaries and Limitations
- Not truly headless. The server still requires a Windows desktop session with SolidWorks installed.
SW_HIDE_WINDOW=1only hides a newly launched SolidWorks instance; it does not remove the need for SolidWorks or for a Windows session. - Single-threaded COM. All SolidWorks COM calls are serialized on one STA thread. Very long-running operations can block subsequent tool calls until they complete.
- No Simulation/FEA. The server does not drive SolidWorks Simulation (COSMOS) or run finite-element analysis. It is limited to geometry, assemblies, drawings, and basic mass/interference checks.
- Entity selection is name-based. Tools that select faces, edges, or planes rely on the English feature names (
FACE,EDGE,PLANE) and named features in the SolidWorks feature tree. On non-English SolidWorks installations or models with renamed/special characters, selection may be brittle or fail. - Attaches to existing windows. If a SolidWorks window is already running when the server connects, it may attach to that instance instead of creating a new hidden one. That can produce surprising results if the active document is not what you expect.
- Model/drawing must be saved for some exports. Some export routines behave best when the source document has already been saved to disk.
- Error handling. COM errors are caught and returned as JSON error messages, but they do not always map to an obvious root cause. When SolidWorks shows a modal dialog, the call may hang until the dialog is dismissed.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.