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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。