SolidWorks MCP Server
by hayward2007
README.md
# SolidWorks MCP Server ๐ง
**Claude์์ ์์ฐ์ด๋ก SolidWorks๋ฅผ ์กฐ์ํ๋ MCP ์๋ฒ**
**Control SolidWorks from Claude with natural language (Model Context Protocol)**
[](LICENSE)
[](https://www.python.org/downloads/)
[](https://www.solidworks.com/)
[](https://modelcontextprotocol.io/)
**[ํ๊ตญ์ด](#ํ๊ตญ์ด) ยท [English](#english)**
> ์ด ์ ์ฅ์๋ [alisamsam/Solidworks-MCP](https://github.com/alisamsam/Solidworks-MCP) (MIT, Samsaam Ali Baig)๋ฅผ ๋ฐํ์ผ๋ก Windows ์ํด๋ฆญ ์ค์น, SolidWorks 2025 COM ํธํ์ฑ ์์ , ํ๊ตญ์ด SolidWorks ์ง์์ ๋ํ ๋ฒ์ ์
๋๋ค.
>
> Based on [alisamsam/Solidworks-MCP](https://github.com/alisamsam/Solidworks-MCP) (MIT, Samsaam Ali Baig), with a one-click Windows installer, SolidWorks 2025 COM fixes and support for localized (e.g. Korean) SolidWorks.
## Design Studio: ์ญ์ค๊ณ ยท ๊ทผ๊ฑฐ DB ยท ์ฌ์ฉ์ ๊ฒํ ยท ์ค๊ณ ๊ฐ์
CLI์ Claude/Codex์์ **์กฐ์ฌ โ ์ฆ๊ฑฐ โ ๊ตฌ์ฒด์ ํ์ยท์น์ โ ๋์ ๋น๊ต โ ์ ๋ยท์ธํ ๊ฒํ โ ๊ฐ์ **์
์งํํฉ๋๋ค. ํ์ง ์ฐ์ RAG, SQLite ์ฆ๊ฑฐ/์ค๊ณ ์ด๋ ฅ, ๊ณ์ฐ ์ฌ๊ฒ์ฆ, ์ฌ์ฉ์ ๊ฒํ ํจํท์ ์ถ๊ฐํ์ต๋๋ค.
๊ธฐ์กด CADยท๊ฒ์ฆ ๋๊ตฌ 35๊ฐ(ํ์ค ๊ฒ์ฆ ๋ฐฐํฐ๋ฆฌ `verify_model` ํฌํจ)๋ฅผ ์ ์งํ๊ณ Windows ์๋ฒ์ Design Studio ๋๊ตฌ 17๊ฐ๋ฅผ ๋ํ์ต๋๋ค.
๋
๋ฆฝ ์๋ฒ์ 16๊ฐ ๋๊ตฌ๋ macOS/Linux์์๋ ์คํ๋๋ฉฐ, ์ค์ CAD ์กฐ์ยทnative capture๋ Windows์์ ํฉ๋๋ค.
```sh
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
sw-design doctor --mcp
sw-design demo --output ./sensor-front-example
sw-design connect --client codex --apply
sw-design start sensor-front-demo --agent codex
```
Windows์์๋ `.venv\Scripts\python.exe -m pip install -e ".[cad]"`์
`.venv\Scripts\sw-design.exe`๋ฅผ ์ฌ์ฉํฉ๋๋ค. `connect --client claude-code --apply`๋ ์ง์ํฉ๋๋ค.
์์ ๋ ๊ฐ์ ๊ธฐ๋ฐ์ ์ค์ ๊ณ์ฐ ๋ฐ๋ณต์ด๋ฉฐ ์ ํ ์ค์ธกยทํด์ยท์น์ธ ๊ฒฐ๊ณผ๊ฐ ์๋๋๋ค.
**[์ ์ฒด ์ฌ์ฉ๋ฒยท์์ ยท๊ฒํ ๊ณผ์ ](docs/design-studio/README.md)** ยท
[๊ตฌํ ๊ณํ](docs/design-studio/IMPLEMENTATION_PLAN.md) ยท
[ํ์ง ์ ์ฑ
](knowledge/product-design-policy.md) ยท [ํ์ค ์ ์ฉ ๋ฒ์](knowledge/standards-registry.md)
## ์ค์น: Claude์๊ฒ ํ ๋ง๋ ยท Install: just ask Claude
> **"https://github.com/hayward2007/solidworks-mcp ์ค์นํด์ค"** ยท *"Install https://github.com/hayward2007/solidworks-mcp"*
Claude Code(Windows)๋ ๋ฐ๋ก ์ค์นํ๊ณ , Claude Desktop(Cowork)์ ๋๋ธํด๋ฆญํ ์ค์น ํ์ผ์ ์ฃผ๊ณ ์ค๊ณ ์คํฌ ์ ์ฅ ์นด๋๋ฅผ ๋์์. ์ง์ ํ๋ ค๋ฉด PowerShell์ ์ด ํ ์ค์ ๋ถ์ฌ ๋ฃ์ผ์ธ์.<br>
Claude Code on Windows installs it right away; Claude Desktop (Cowork) gives you an installer to double-click and offers the design skill to save. To do it yourself, paste this line into PowerShell:
```powershell
irm https://raw.githubusercontent.com/hayward2007/solidworks-mcp/main/install.ps1 | iex
```
๋๋๋ฉด SolidWorks๋ฅผ ์ด๊ณ , Claude Desktop์ ํธ๋ ์ด ์์ด์ฝ โ ์ข
๋ฃ(Quit)๋ก ์์ ํ ๋ ๋ค ๋ค์ ์ผ์ธ์.<br>
Then open SolidWorks, fully quit Claude Desktop (tray icon โ Quit) and start it again.
<details>
<summary><b>For Claude: how to install this repository</b></summary>
The server has to run on the user's Windows PC next to SolidWorks; never install it inside a Linux VM or a cloud container.
1. **If you can run commands on that PC** (Claude Code on Windows; from WSL call `powershell.exe`), run:
```
powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/hayward2007/solidworks-mcp/main/install.ps1 | iex"
```
It puts the code in `%USERPROFILE%\solidworks-mcp` (or updates it), creates `.venv`, installs the requirements, self-tests the server (52 tools, including Design Studio), registers `solidworks` in Claude Desktop and in Claude Code (`claude mcp add --scope user`) and copies the skill to `~/.claude/skills/solidworks-design`. The first run takes a few minutes; success ends with `All set`.
- If it reports `Python 3.10 or newer (64-bit) was not found`, ask the user, then install Python 3.13 with winget and continue:
`powershell -NoProfile -ExecutionPolicy Bypass -Command "& ([scriptblock]::Create((irm https://raw.githubusercontent.com/hayward2007/solidworks-mcp/main/install.ps1))) -InstallPython"`
- Other options go in the same place: `-InstallDir <path>`, `-NoClaudeDesktop`, `-NoClaudeCode`, `-NoSkill`, `-Uninstall`.
2. **If you cannot run Windows programs** (Claude Desktop / Cowork, where your shell is a Linux VM or a cloud container):
- Download `https://raw.githubusercontent.com/hayward2007/solidworks-mcp/main/setup_windows.bat`, save it into a folder the user connected (or send it as a file) and ask them to double-click it. It runs the same installer and asks before installing Python. Pasting the PowerShell line above works too.
- Offer the design skill: propose the contents of `skills/solidworks-design/SKILL.md` as a new skill named `solidworks-design` for the user to save. Cowork does not pass MCP server instructions to the model; this skill brings in the working rules.
3. **Afterwards** ask the user to open SolidWorks and to fully quit Claude Desktop (tray icon โ Quit) and start it again; in Claude Code a new session is enough. The `solidworks` tools should then be available (`knowledge_get("agent-guide")` is a quick check). If they are not, read `setup_mcp.log` in the install folder and run the installer again while Claude Desktop is closed.
</details>
---
## ํ๊ตญ์ด
### ๋ชฉ์ฐจ
1. [์๊ฐ](#์๊ฐ)
2. [์๋ณธ ๋๋น ๋ณ๊ฒฝ ์ฌํญ](#์๋ณธ-๋๋น-๋ณ๊ฒฝ-์ฌํญ)
3. [์๊ตฌ ์ฌํญ](#์๊ตฌ-์ฌํญ)
4. [๋น ๋ฅธ ์์](#๋น ๋ฅธ-์์)
5. [์ค์น ์คํฌ๋ฆฝํธ๊ฐ ํ๋ ์ผ](#์ค์น-์คํฌ๋ฆฝํธ๊ฐ-ํ๋-์ผ)
6. [์๋ ์ค์ ](#์๋-์ค์ )
7. [์ฌ์ฉ ๋ฐฉ๋ฒ](#์ฌ์ฉ-๋ฐฉ๋ฒ)
8. [Text-to-CAD ์์
ํ๋ฆ](#text-to-cad-์์
-ํ๋ฆ)
9. [๋๊ตฌ ๋ชฉ๋ก](#๋๊ตฌ-๋ชฉ๋ก)
10. [execute_python ๊ณ ๊ธ ์ฌ์ฉ](#execute_python-๊ณ ๊ธ-์ฌ์ฉ)
11. [์ค๊ณ ์ง์ ๋ฒ ์ด์ค](#์ค๊ณ-์ง์-๋ฒ ์ด์ค)
12. [๊ธฐ์ด ์์ฑ๊ธฐ](#๊ธฐ์ด-์์ฑ๊ธฐ)
13. [ํ ํด๋ก์ง ์ต์ ํ](#ํ ํด๋ก์ง-์ต์ ํ)
14. [์ค์ ํ์ผ config.json](#์ค์ -ํ์ผ-configjson)
15. [๋ฌธ์ ํด๊ฒฐ](#๋ฌธ์ -ํด๊ฒฐ)
16. [์
๋ฐ์ดํธ์ ์ ๊ฑฐ](#์
๋ฐ์ดํธ์-์ ๊ฑฐ)
17. [๋ก๋๋งต](#๋ก๋๋งต)
18. [ํ๋ก์ ํธ ๊ตฌ์กฐ](#ํ๋ก์ ํธ-๊ตฌ์กฐ)
19. [๋ผ์ด์ ์ค์ ํฌ๋ ๋ง](#๋ผ์ด์ ์ค์-ํฌ๋ ๋ง)
### ์๊ฐ
SolidWorks MCP Server๋ Claude ๊ฐ์ AI ์์ด์ ํธ๊ฐ SolidWorks๋ฅผ ์ง์ ์กฐ์ํ๊ฒ ํด ์ฃผ๋ [Model Context Protocol](https://modelcontextprotocol.io/) ์๋ฒ์์. ๋ฉ๋ด๋ฅผ ํด๋ฆญํ๋ ๋์ ๋ง๋ค๊ณ ์ถ์ ํ์์ ๋ง๋ก ์ค๋ช
ํ๋ฉด, Claude๊ฐ SolidWorks COM API๋ก ํํธ๋ฅผ ๋ง๋ค๊ณ ์ค์ผ์น๋ฅผ ๊ทธ๋ฆฌ๊ณ ํผ์ฒ๋ฅผ ์ถ๊ฐํด์.
- ๋๊ตฌ 52๊ฐ (CADยท๊ฒ์ฆ 35 + Design Studio 17): ์ฐ๊ฒฐ, ๋ฌธ์, ์ค์ผ์น, ํผ์ฒ, ์ ํธ๋ฆฌํฐ, SolidWorks API๋ฅผ ์ง์ ์คํํ๋ `execute_python`, ๊ฒ์ฆ(Text-to-CAD), ์ค๊ณ ์ง์ ๊ฒ์, ๊ธฐ์ด ์์ฑ, ํ ํด๋ก์ง ์ต์ ํ
- ์์ด์ ํธ์ฉ ์์
๊ท์น(ํ ํฐ ์ ์ฝ, ์ค๊ณ ๊ทผ๊ฑฐ)์ด ๋งค ์ธ์
์๋ ์ ์ฉ๋ผ์
- SolidWorks 2023โ2025 ์ง์, ์ค์น ๊ฒฝ๋ก ์๋ ํ์ง(๋ ์ง์คํธ๋ฆฌ)
- ๋จ์: mm, cm, m, inch, ft (๊ธฐ๋ณธ mm)
- ๋์ ๋ก๊ทธ: `solidworks_mcp/solidworks_mcp.log`
### ์๋ณธ ๋๋น ๋ณ๊ฒฝ ์ฌํญ
| ๊ตฌ๋ถ | ๋ด์ฉ |
|---|---|
| ์ค์น ์ค๋ฅ ์์ | `requirements.txt`์์ PyPI์ ์๋ `asyncio-compat`๋ฅผ ๋บ์ด์. ์ด ์ค ๋๋ฌธ์ `pip install -r requirements.txt`๊ฐ ํญ์ ์คํจํ์ด์. |
| ์์ ์ค๋ฅ ์์ | `mcp>=1.0.0,<2`๋ก ๊ณ ์ ํ์ด์. mcp 2.x๋ ์๋ฒ๊ฐ ์ฐ๋ `Server.list_tools()` / `call_tool()` ๋ฐ์ฝ๋ ์ดํฐ๋ฅผ ์์ ์, ์ค์น๋๋ฉด ์๋ฒ๊ฐ `AttributeError`๋ก ๋ฐ๋ก ๊บผ์ ธ์. |
| ํ ์ค ์ค์น | `install.ps1`(PowerShell ํ ์ค, ๋๋ `setup_windows.bat` ๋๋ธํด๋ฆญ) + `setup_mcp.py`: ์ฝ๋ ๋ฐ๊ธฐ, Python ์ฐพ๊ธฐ(์์ผ๋ฉด winget ์ค์น ์ ์), ๊ฐ์ํ๊ฒฝ, ํจํค์ง, ์๋ฒ ์๊ฐ ์ง๋จ, Claude DesktopยทClaude Code ๋ฑ๋ก, ์ค๊ณ ์คํฌ ์ค์น๊น์ง ํ ๋ฒ์ ํด์. Claude์๊ฒ "์ค์นํด์ค"๋ผ๊ณ ํ๋ฉด ๋์ ์คํํด์. |
| SolidWorks 2025 COM ํธํ์ฑ | `automation/base.py`์ `_com_value()`๋ฅผ ์ถ๊ฐํด์ ๋ค์์ ๊ณ ์ณค์ด์. `list_open_documents`("๊ตฌ์ฑ์์ด ์์ต๋๋ค" ์ค๋ฅ), `get_document_info`(`'int' object is not callable` ์ค๋ฅ), `list_features`(์ฒซ ํผ์ฒ 1๊ฐ๋ง ๋์ค๊ณ ์ต์ ์ํ๊ฐ ํญ์ false). |
| ํ๊ตญ์ด SolidWorks ์ง์ | `create_sketch`๊ฐ "Front Plane"๋ง ์ฐพ์์ ํ๊ตญ์ด UI(์ ๋ฉด/์๋ฉด/์ฐ์ธก๋ฉด)์์ ์คํจํ๋ ๋ฌธ์ ๋ฅผ ๊ณ ์ณค์ด์. ์ด๋ฆ์ผ๋ก ๋ชป ์ฐพ์ผ๋ฉด ๊ธฐ๋ณธ ํ๋ฉด ์์๋ก ์ค์ ์ด๋ฆ์ ์ฐพ์์. |
| ์ ์ฅ์ ์ ๋ฆฌ | `.env` ์ ์ธ(์๋ณธ์๋ API ํค๊ฐ ๋ค์ด ์์๊ณ , ์๋ฒ๋ ์ด ํ์ผ์ ์ฐ์ง ์์์), `.venv/` ๋ฌด์, `.bat` ํ์ผ ์ค๋ฐ๊ฟ(CRLF) ๊ณ ์ . |
| Text-to-CAD ๊ฒ์ฆ ๋๊ตฌ | `model_report`, `render_views`, `export_model`, `check_interference`๋ฅผ ์ถ๊ฐํ๊ณ , `execute_python`์ ๋์ฐ๋ฏธ ์ฃผ์
๊ณผ `report` ์ต์
์ ๋ฃ์์ด์. |
| ์ค๊ณ ์ง์ ๋ฒ ์ด์ค | `knowledge/` ๋
ธํธ 12๊ฐ์ `knowledge_search`, `knowledge_get` ๋๊ตฌ. |
| ๊ธฐ์ด ์์ฑ๊ธฐ | `gear_design`, `create_gear`: ์คํผยทํฌ๋ฆฌ์ปฌยทํค๋ง๋ณธยท๋ด์ ยท๋ยท์ง์ /์คํ์ด๋ด ๋ฒ ๋ฒจยท์ยท์ํ ์ ๊ท๊ฒฉ ๊ณต์์ผ๋ก ๋ง๋ค๊ณ ๋ถํผ์ ๋ฌผ๋ฆผ ๊ฐ์ญ์ผ๋ก ์ค์ค๋ก ๊ฒ์ฆํด์. |
| ํ ํด๋ก์ง ์ต์ ํ | `topology_optimize`: ToPy๋ฅผ Python 3๋ก ์ฎ๊ธด 2D/3D ๊ฐ์ฑยท๋ฉ์ปค๋์ฆ ์ต์ ํ์ ์ด์ ๋(+๋๋ฅ ๊ฒฝ๊ณ)์ ๋ณตํฉ ๋ชจ๋๋ฅผ ๋ํ์ด์. ํ์คยท์ด์ ์ต๋๊ฐ์ผ๋ก ๋ฐ๊ณ 2๋ฐฐ(์์ ๊ณ์ 2 ์ด์)๋ก ์ค๊ณํ๋ฉฐ, ๋ณผํธยทํญยทํยทํจ๋ ์ฒด๊ฒฐ๋ถ๋ ๊ท๊ฒฉ ๊ตฌ๋ฉ๊ณผ ๋ณด์กด ๋ง์ ๋ง๋ค๊ณ ์ฒด๊ฒฐ๋ถ๋ณ๋ก ๊ฒํ ํด์. ๊ฒฐ๊ณผ๋ฅผ SolidWorks ํํธ๋ก ๋ง๋ค์ด์. |
| ์์ด์ ํธ ๊ฐ์ด๋ | ์์
ํ๋ฆ, ํ ํฐ ์ ์ฝ, ๊ทผ๊ฑฐ ๊ท์น์ ์๋ฒ instructions๋ก ๋งค ์ธ์
์๋ ์ ์ฉํด์. |
| ์ค๊ณ ์คํฌ | `skills/solidworks-design`: Cowork์ฒ๋ผ ์๋ฒ instructions๋ฅผ ๋๊ธฐ์ง ์๋ ํด๋ผ์ด์ธํธ์์๋ ๊ฐ์ ์์
๊ท์น์ ๋ถ๋ฌ์ค๋ Claude ์คํฌ์ด์์. ๋๊ตฌ ์ค๋ช
์๋ `knowledge_get("agent-guide")` ์๋ด๋ฅผ ๋ฃ์์ด์. |
| ์ถ๋ ฅ ํ ํฐ ์ ๊ฐ | `execute_python` ๊ฒฐ๊ณผ ์ค๋ณต ์ ๊ฑฐ, JSON ์์ถ ์ถ๋ ฅ(ํ๊ธ์ `\u` ์ด์ค์ผ์ดํ ์์ด), ํธ๋ ์ด์ค๋ฐฑ์ ์คํฌ๋ฆฝํธ ๋ถ๋ถ๋ง ๋จ๊ฒจ์. |
### ์๊ตฌ ์ฌํญ
- Windows 10 / 11 (64๋นํธ)
- SolidWorks 2023โ2025 (์ค์น ๋ฐ ๋ผ์ด์ ์ค ํ์)
- Python 3.10 ์ด์(64๋นํธ): python.org ์ค์นํ ๋๋ Python Install Manager(`py`) ๋ชจ๋ ๋ผ์. ์์ผ๋ฉด ์ค์น ์คํฌ๋ฆฝํธ๊ฐ winget์ผ๋ก Python 3.13์ ์ค์นํด ์ค ์ ์์ด์
- Claude Desktop ๋๋ Claude Code
- ์ฒ์ ์ค์นํ ๋ ์ธํฐ๋ท ์ฐ๊ฒฐ (pip ํจํค์ง ๋ค์ด๋ก๋, ํ ํด๋ก์ง ์ต์ ํ์ฉ numpyยทscipy ํฌํจ ์ฝ 60 MB)
๊ฒ์ฆ ํ๊ฒฝ: SolidWorks 2025 (revision 33.5.0, ํ๊ตญ์ด UI), Python 3.14.7, Claude Desktop (Windows, Microsoft Store/MSIX ์ค์นํ).
### ๋น ๋ฅธ ์์
๊ฐ์ฅ ์ฌ์ด ๋ฐฉ๋ฒ์ ๋งจ ์์ฒ๋ผ Claude์๊ฒ ์ค์นํด ๋ฌ๋ผ๊ณ ํ๋ ๊ฑฐ์์. ์ง์ ํ๋ ค๋ฉด:
1. **์ค์น ์คํฌ๋ฆฝํธ ์คํ**: PowerShell์ ํ ์ค์ ๋ถ์ฌ ๋ฃ์ผ์ธ์.
```powershell
irm https://raw.githubusercontent.com/hayward2007/solidworks-mcp/main/install.ps1 | iex
```
์ฝ๋๋ `%USERPROFILE%\solidworks-mcp`์ ๋ฐ์์. ์ ์ฅ์๋ฅผ ์ง์ ๋ฐ์๋ค๋ฉด(`git clone https://github.com/hayward2007/solidworks-mcp.git` ๋๋ ZIP) ๊ทธ ํด๋์ **`setup_windows.bat`์ ๋๋ธํด๋ฆญ**ํด๋ ๋ผ์. ๋ง์ง๋ง์ `All set`์ด ๋์ค๋ฉด ๋์ด์์. ํด๋ ๊ฒฝ๋ก๊ฐ Claude ์ค์ ์ ๊ธฐ๋ก๋๋๊น, ๋์ค์ ํด๋๋ฅผ ์ฎ๊ธฐ๋ฉด ๋ค์ ์คํํ์ธ์.
2. **Claude Desktop ์์ ํ ์ข
๋ฃ ํ ๋ค์ ์คํ**: ์์
ํ์์ค ์ค๋ฅธ์ชฝ ์๋ ํธ๋ ์ด(**^** ์์ชฝ์ผ ์ ์์)์ Claude ์์ด์ฝ์ ์ฐํด๋ฆญํด์ **์ข
๋ฃ(Quit)** ๋ฅผ ๋๋ฅด๊ณ ๋ค์ ์ผ์ธ์. ์ฐฝ๋ง ๋ซ์ผ๋ฉด ๋ฐฑ๊ทธ๋ผ์ด๋์์ ๊ณ์ ๋์๊ฐ์ ์ ์ค์ ์ ์ฝ์ง ์์์. Claude Code๋ ์ ์ธ์
์ ์์ํ๋ฉด ๋ผ์.
3. **SolidWorks๋ฅผ ์ด๊ณ ** Claude์๊ฒ "SolidWorks์ ์ฐ๊ฒฐํด์ค"๋ผ๊ณ ๋งํ์ธ์.
Claude์ ์ค์ (Settings) โ ๊ฐ๋ฐ์(Developer)์์ `solidworks` ์๋ฒ๊ฐ running์ผ๋ก ๋ณด์ด๋ฉด ์ ์์ด์์.
**Cowork๋ฅผ ์ด๋ค๋ฉด ์ค๊ณ ์คํฌ๋ ์ ์ฅํ์ธ์.** Cowork๋ ์๋ฒ instructions(์์
๊ท์น)๋ฅผ ๋ชจ๋ธ์ ๋๊ธฐ์ง ์์์, `solidworks-design` ์คํฌ์ด ๊ทธ ๊ท์น์ ๋ถ๋ฌ์์. Cowork์์ Claude์๊ฒ "https://github.com/hayward2007/solidworks-mcp ์ solidworks-design ์คํฌ ์ ์ฅํด์ค"๋ผ๊ณ ํ๋ฉด ์ ์ฅ ์นด๋๊ฐ ๋ ์. claude.ai์์๋ ์ค์น ์คํฌ๋ฆฝํธ๊ฐ ๋ง๋ `dist\solidworks-design.zip`์ ์ค์ โ Capabilities โ Skills์์ ์ฌ๋ ค๋ ๋ผ์. Claude Code์๋ ์ค์น ์คํฌ๋ฆฝํธ๊ฐ `~/.claude/skills`์ ๋ฃ์ด ์ค์.
### ์ค์น ์คํฌ๋ฆฝํธ๊ฐ ํ๋ ์ผ
1. ์ฝ๋๋ฅผ ๋ฐ์์: `%USERPROFILE%\solidworks-mcp`์ `git clone`(git์ด ์์ผ๋ฉด GitHub ZIP)ํ๊ณ , ์ด๋ฏธ ์์ผ๋ฉด ์
๋ฐ์ดํธํด์. ์ ์ฅ์ ์์ `setup_windows.bat`์ผ๋ก ์คํํ๋ฉด ๊ทธ ํด๋๋ฅผ ๊ทธ๋๋ก ์จ์.
2. 64๋นํธ Python 3.10 ์ด์์ ์ฐพ์์: `py -0p` ๋ชฉ๋ก โ `py -3` โ PATH์ `python` โ `%LOCALAPPDATA%\Python\pythoncore-3.*`, `%LOCALAPPDATA%\Programs\Python\Python3*`, `%ProgramFiles%\Python3*` ์์์์. numpyยทscipyยทpywin32 ํ ์ด ์๋ 3.10โ3.14 ์ค ๊ฐ์ฅ ์ ๋ฒ์ ์ ๊ณจ๋ผ์. ์์ผ๋ฉด winget์ผ๋ก Python 3.13์ ์ค์นํ ์ง ๋ฌผ์ด๋ด์(`-InstallPython`์ด๋ฉด ๋ฌป์ง ์๊ณ ์ค์น).
3. ํ๋ก์ ํธ ํด๋์ ๊ฐ์ํ๊ฒฝ `.venv`๋ฅผ ๋ง๋ค์ด์ (์ด๋ฏธ ์์ผ๋ฉด ๋ค์ ์จ์).
4. `requirements.txt`๋ฅผ ์ค์นํด์ (`mcp` 1.x, `pywin32`, `python-dotenv`, `Pillow`, `numpy`, `scipy`).
5. ์๋ฒ ์๊ฐ ์ง๋จ: Claude Desktop๊ณผ ๊ฐ์ ๋ฐฉ์(stdio)์ผ๋ก ์๋ฒ๋ฅผ ๋์์ MCP ์ด๊ธฐํ์ ๋๊ตฌ ๋ชฉ๋ก(51๊ฐ)์ ํ์ธํด์.
6. Claude Desktop ์ค์ ํ์ผ์ `solidworks` ์๋ฒ๋ฅผ ๋ฑ๋กํด์. ๋ค๋ฅธ ์๋ฒ์ ์ค์ ์ ๊ทธ๋๋ก ๋๊ณ , ๋ฐ๊พธ๊ธฐ ์ ์ `claude_desktop_config.json.bak-๋ ์ง-์๊ฐ` ๋ฐฑ์
์ ๋ง๋ค์ด์. Microsoft Store(MSIX) ์ค์นํ์ ์ค์ ์์น๋ ํจ๊ป ๊ฐฑ์ ํด์.
7. Claude Code(`claude` CLI)๊ฐ ์์ผ๋ฉด `claude mcp add --scope user`๋ก ๋ฑ๋กํ๊ณ ์ค๊ณ ์คํฌ์ `~/.claude/skills/solidworks-design`์ ๋ณต์ฌํด์. Claude Desktopยทclaude.ai์ ์ฌ๋ฆด `dist\solidworks-design.zip`๋ ๋ง๋ค์ด์.
8. ํ๋ฉด์ ๋์จ ๋ด์ฉ์ `setup_mcp.log`์ ์ ์ฅํด์.
์ฌ๋ฌ ๋ฒ ์คํํด๋ ์์ ํด์. ์ด๋ฏธ ๋ฑ๋ก๋ผ ์์ผ๋ฉด `already up to date`๊ฐ ๋์์. ์ต์
: `-InstallDir ๊ฒฝ๋ก`, `-InstallPython`, `-NoClaudeDesktop`, `-NoClaudeCode`, `-NoSkill`, `-Uninstall`. `setup_windows.bat`์๋ ๊ทธ๋๋ก ๋๊ธธ ์ ์์ด์(์: `setup_windows.bat -Uninstall`).
### ์๋ ์ค์
#### 1) ํจํค์ง ์ค์น
```powershell
cd C:\๊ฒฝ๋ก\Solidworks-MCP
py -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txt
```
#### 2) Claude Desktop
Claude โ ์ค์ โ ๊ฐ๋ฐ์ โ **์ค์ ํธ์ง(Edit Config)** ์ผ๋ก ์ด๋ฆฌ๋ `claude_desktop_config.json`์ `mcpServers`์ ์ถ๊ฐํ์ธ์.
```json
{
"mcpServers": {
"solidworks": {
"command": "C:\\๊ฒฝ๋ก\\Solidworks-MCP\\.venv\\Scripts\\python.exe",
"args": ["C:\\๊ฒฝ๋ก\\Solidworks-MCP\\solidworks_mcp_server.py"]
}
}
}
```
์ค์ ํ์ผ ์์น:
- ์ผ๋ฐ ์ค์น: `%APPDATA%\Claude\claude_desktop_config.json`
- Microsoft Store/MSIX ์ค์น: `%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json`
`"command": "python"` ๋์ `.venv` ์์ `python.exe` ์ ์ฒด ๊ฒฝ๋ก๋ฅผ ์ฐ๋ ์ด์ : PATH์ `python`์ด Microsoft Store ๋ณ์นญ์ด๊ฑฐ๋ ํจํค์ง๊ฐ ์๋ ๋ค๋ฅธ ๋ฒ์ ์ผ ์ ์์ด์์์. ์ ์ฅํ ๋ค์๋ Claude๋ฅผ ํธ๋ ์ด์์ ์์ ํ ์ข
๋ฃํ๊ณ ๋ค์ ์คํํ์ธ์.
#### 3) Claude Code
```powershell
claude mcp add --scope user solidworks -- "C:\๊ฒฝ๋ก\Solidworks-MCP\.venv\Scripts\python.exe" "C:\๊ฒฝ๋ก\Solidworks-MCP\solidworks_mcp_server.py"
claude mcp list
```
### ์ฌ์ฉ ๋ฐฉ๋ฒ
1. SolidWorks๋ฅผ ๋จผ์ ์ด์ด ๋์ธ์. ๊บผ์ ธ ์์ผ๋ฉด `connect_solidworks`๊ฐ ์ง์ ์คํํ๊ณ ์ต๋ 120์ด ๊ธฐ๋ค๋ ค์.
2. Claude์๊ฒ ํ์ ๋งํฌ๋ก ์์ฒญํ์ธ์. ๊ธธ์ด๋ ๋ฐ๋ก ๋งํ์ง ์์ผ๋ฉด mm์์.
์์:
- "SolidWorks์ ์ฐ๊ฒฐํด์ค"
- "์ ํํธ๋ฅผ ๋ง๋ค๊ณ , ์๋ฉด์ ๋ฐ์ง๋ฆ 30mm ์์ ๊ทธ๋ ค์ 15mm ๋์ถํด์ค"
- "์ ๋ฉด์ 100ร50mm ์ฌ๊ฐํ์ ๊ทธ๋ฆฌ๊ณ 20mm ๋์ถํ ๋ค์, ๊ฐ์ด๋ฐ์ ์ง๋ฆ 10mm ๊ตฌ๋ฉ์ ๊ดํต ์ปทํด์ค"
- "ํผ์ฒ ๋ชฉ๋ก ๋ณด์ฌ์ค" / "์ด๋ฆฐ ๋ฌธ์ ๋ชฉ๋ก ๋ณด์ฌ์ค" / "ํ์ฌ ๋ฌธ์ ์ ๋ณด ์๋ ค์ค"
- "C:\์์
\bracket.SLDPRT๋ก ์ ์ฅํด์ค"
- "execute_python์ผ๋ก ํ์ฌ ํํธ์ ๋ถํผ์ ์ง๋์ ๊ณ์ฐํด์ค"
Claude๋ ๋ณดํต `create_sketch` โ `draw_*` โ `close_sketch` โ `extrude_sketch` ์์๋ก ๋๊ตฌ๋ฅผ ์จ์. ์ค์ผ์น๊ฐ ์ด๋ฆฐ ์ฑ๋ก ๋จ์ผ๋ฉด `get_sketch_status`๋ก ์ํ๋ฅผ ํ์ธํ ์ ์์ด์.
### Text-to-CAD ์์
ํ๋ฆ
์งง๊ฑฐ๋ ๋ชจํธํ ์์ฒญ๋ ์์ด์ ํธ๊ฐ ์ฌ์์ผ๋ก ์ ๋ฆฌํ๊ณ , ๋ชจ๋ธ์ ์ง์ ๋ณด๊ณ ์ฌ๋ฉด์ ๋น ๋ฅด๊ฒ ๋ฐ๋ณตํ๊ฒ ํ๋ ํ๋ฆ์ด์์. ์๋ฒ instructions(`solidworks_mcp/instructions.md`)๋ก ๋งค ์ธ์
์๋ ์ ์ฉ๋ผ์(Cowork๋ `solidworks-design` ์คํฌ๋ก).
1. **์ฌ์ ์ ๋ฆฌ**: ๋ชฉ์ , ๊ธฐ์ค ์ขํ๊ณ, ๋ณดํธ ์ธํฐํ์ด์ค, ํฌ๊ธฐ, ์ฐ๊ฒฐ๋ถ, ํ์คยท๋์, ๊ณต์ ยท์ฌ๋ฃ๋ฅผ ์ถฉ๋ถํ ๊ตฌ์ฒดํํด์. ๊ธธ์ด ์ ํ์ ์์ด์. ๋ชจ๋ ์์น์ ๊ทผ๊ฑฐ๋ฅผ ๋ถ์ฌ์. ์์๋ [req] ์๊ตฌ ์ฌํญยท๊ธฐ์กด ํ์ > [std] ๊ท๊ฒฉ > [calc] ๊ณ์ฐ > [cat] ์นดํ๋ก๊ทธยทํ์ธ๋ ๋ฏธ์ค๋ฏธ ํ๋ฒ > [dfm] ๊ณต์ ๊ท์น > [heur] ๊ฒฝํ์น > [neutral] ๊ทผ๊ฑฐ๊ฐ ์์ ๋์ ์ค๋ฆฝ๊ฐ(๋์นญ, 1:1, ๊ฐ์ ๊ฐ๊ฒฉ, R10 ํ์ค์, ์ ์ mm)์ด์์.
2. **ํ์ํ ์ง์๋ง ์กฐํ**: `design_context(mode="quality")`๋ก ์ ์ฑ
๊ณผ ๊ด๋ จ ๊ทผ๊ฑฐ๋ฅผ ์ฝ์ด์. ๊ธฐ์กด `knowledge_search`/`knowledge_get`๋ ์ฌ์ฉํ ์ ์์ด์.
3. **๋จ๊ณ๋ณ ๋ชจ๋ธ๋ง**: ๋จ๊ณ๋ง๋ค `execute_python` ํ ๋ฒ, ํ๋ผ๋ฏธํฐ๋ ์คํฌ๋ฆฝํธ ๋งจ ์์ ๋ฌ์.
4. **๋งค ๋จ๊ณ ๊ฒ์ฆ**: `model_report`(์ค๋ฅยท๋ฐ๋ยท์น์ยท์ง๋). ํ์ยท์ธํ ํ๋จ์ ์ถฉ๋ถํ `render_views`์ ๋จ๋ฉด์ ํ๋ณดํด์. ์ด์
๋ธ๋ฆฌ๋ `check_interference`.
5. **ํ์ง ๊ฒ์ดํธ**: ์ฌ์์ฑ ์ค๋ฅ ์์, ์๋ํ ๋ฐ๋ ์, ์ฌ์ ์น์ ์ผ์น, ์๋์น ์์ ๊ฐ์ญ ์์, ๊ณต์ ๊ท์น ์ถฉ์กฑ. ํต๊ณผํด์ผ ๋ค์ ๋จ๊ณ๋ก ๋์ด๊ฐ์.
6. **์งง์ ๋ณด๊ณ **: ํต์ฌ ์น์์ ๊ทผ๊ฑฐ, ๊ฒ์ฆ ์์น, ๋ค์ ์ ํ์ง ์ต๋ 3๊ฐ.
ํ์ง ์ฐ์ : ์น์ยท๊ทผ๊ฑฐยท๊ฐ์ ยท์๊ฐ ์ฆ๊ฑฐ๋ฅผ ์ ์งํ๊ณ ๋ถํ์ํ ๋ฐ๋ณต๋ง ์ค์ฌ์. ์ ํ ๊ฐ์ ์ ๋์ 3๊ฐ, ์ ๋ยท์ธํ ํ๊ฐ, ๊ฒํ ํจํท๊ณผ ์ฌ์ฉ์ ๊ฒํ ๋ฅผ ๊ฑฐ์ณ์. ๊ธฐ์กด ๋
ธํธ์ ํ์ค ํ๊ทธ๋ ์๋ฌธ ํ์ธ์ ๋์ ํ์ง ์์์. ์์ธํ ๋ด์ฉ์ [knowledge/agent-guide.md](knowledge/agent-guide.md), ๊ทผ๊ฑฐ ๊ท์น์ [knowledge/design-policy.md](knowledge/design-policy.md)์ ์์ด์.
### ๋๊ตฌ ๋ชฉ๋ก
๊ธธ์ด ์ธ์๊ฐ ์๋ ๋๊ตฌ๋ ๋ชจ๋ ์ ํ ์ธ์ `unit`(mm, cm, m, inch, ft)์ ๋ฐ์์. ๋น์ฐ๋ฉด ๊ธฐ๋ณธ ๋จ์(๊ธฐ๋ณธ mm)๋ฅผ ์จ์.
| ๋ถ๋ฅ | ๋๊ตฌ | ํ๋ ์ผ | ์ฃผ์ ์ธ์ |
|---|---|---|---|
| ์ฐ๊ฒฐ | `connect_solidworks` | ์คํ ์ค์ธ SolidWorks์ ์ฐ๊ฒฐ (๊บผ์ ธ ์์ผ๋ฉด ์คํ) | - |
| ์ฐ๊ฒฐ | `get_solidworks_info` | ์ค์น ์ ๋ณด (๋ฒ์ , ๊ฒฝ๋ก, ํ
ํ๋ฆฟ) | - |
| ๋ฌธ์ | `create_new_part` | ์ ํํธ | - |
| ๋ฌธ์ | `create_new_assembly` | ์ ์ด์
๋ธ๋ฆฌ | - |
| ๋ฌธ์ | `open_document` | ํ์ผ ์ด๊ธฐ | `filepath` (ํ์) |
| ๋ฌธ์ | `save_document` | ์ ์ฅ (๊ฒฝ๋ก๋ฅผ ์ฃผ๋ฉด ๋ค๋ฅธ ์ด๋ฆ์ผ๋ก ์ ์ฅ) | `filepath` |
| ๋ฌธ์ | `close_document` | ํ์ฑ ๋ฌธ์ ๋ซ๊ธฐ | `save` (๊ธฐ๋ณธ false) |
| ๋ฌธ์ | `get_document_info` | ํ์ฑ ๋ฌธ์ ์ด๋ฆ, ๊ฒฝ๋ก, ์ข
๋ฅ | - |
| ๋ฌธ์ | `list_open_documents` | ์ด๋ฆฐ ๋ฌธ์ ๋ชฉ๋ก | - |
| ์ค์ผ์น | `create_sketch` | ๊ธฐ๋ณธ ํ๋ฉด์ ์ค์ผ์น ์์ | `plane`: Front / Top / Right (= ์ ๋ฉด / ์๋ฉด / ์ฐ์ธก๋ฉด) |
| ์ค์ผ์น | `create_sketch_on_face` | 3D ์ขํ๋ก ๊ณ ๋ฅธ ๋ฉด ์์ ์ค์ผ์น | `x`, `y`, `z` |
| ์ค์ผ์น | `draw_line` | ์ | `x1`, `y1`, `x2`, `y2` |
| ์ค์ผ์น | `draw_circle` | ์ | `x`, `y`, `radius` |
| ์ค์ผ์น | `draw_rectangle` | ๋ ๋ชจ์๋ฆฌ๋ก ์ฌ๊ฐํ | `x1`, `y1`, `x2`, `y2` |
| ์ค์ผ์น | `draw_arc` | ์ค์ฌยท๋ฐ์ง๋ฆยท์์/๋ ๊ฐ๋(ยฐ)๋ก ํธ | `cx`, `cy`, `radius`, `start_angle`, `end_angle` |
| ์ค์ผ์น | `draw_polygon` | ์ ๋ค๊ฐํ | `cx`, `cy`, `radius`, `sides` |
| ์ค์ผ์น | `close_sketch` | ์ค์ผ์น ์ข
๋ฃ | - |
| ์ค์ผ์น | `get_sketch_status` | ์ค์ผ์น ์ํ ์ง๋จ | - |
| ํผ์ฒ | `extrude_sketch` | ๋์ถ ๋ณด์ค | `depth`, `both_directions` |
| ํผ์ฒ | `cut_extrude` | ๋์ถ ์ปท | `depth`, `through_all`, `both_directions` |
| ํผ์ฒ | `fillet_edges` | ์ ํํ ๋ชจ์๋ฆฌ์ ํ๋ | `radius` |
| ํผ์ฒ | `chamfer_edges` | ์ ํํ ๋ชจ์๋ฆฌ์ ๋ชจ๋ฐ๊ธฐ | `distance`, `angle` |
| ํผ์ฒ | `list_features` | ํผ์ฒ ํธ๋ฆฌ ๋ชฉ๋ก (์ด๋ฆ, ์ข
๋ฅ, ์ต์ ์ฌ๋ถ) | - |
| ์ ํธ | `set_units` | ๊ธฐ๋ณธ ๋จ์ ๋ณ๊ฒฝ | `unit`: mm / cm / m / inch |
| ์ ํธ | `execute_python` | SolidWorks API๋ฅผ ์ฐ๋ Python ์ฝ๋ ์คํ (๋์ฐ๋ฏธ ์ฃผ์
) | `code`, `report` |
| ๊ฒ์ฆ | `model_report` | ํ์ฑ ๋ฌธ์ ์์ฝ: ์ฌ์์ฑ ์ค๋ฅ, ํผ์ฒ, ๋ฐ๋, ๊ฒฝ๊ณ ์์(mm), ๋ถํผ, ์ง๋, ์ฌ์ง | - |
| ๊ฒ์ฆ | `render_views` | ํ์ค ๋ทฐ๋ฅผ ์์ ๋ผ๋ฒจ ์ด๋ฏธ์ง ํ๋๋ก (์ค์ผ์นยทํ๋ฉด ์จ๊น, ์ฌ์ฉ์ ๋ทฐ ๋ณต์) | `views`, `size`(๊ธฐ๋ณธ 384), `hide_references` |
| ๊ฒ์ฆ | `export_model` | STEP, STL, 3MF, IGES, Parasolid ๋ฑ์ผ๋ก ์ฌ๋ณธ ์ ์ฅ | `format`(๊ธฐ๋ณธ step), `path` |
| ๊ฒ์ฆ | `check_interference` | ์ด์
๋ธ๋ฆฌ ๋ถํ ์ฌ์ด ๊ฐ์ญ ๋ถํผ(mmยณ) | - |
| ๊ฒ์ฆ | `verify_model` | ํ์ค ๊ฒ์ฆ ๋ฐฐํฐ๋ฆฌ(V1 ํํธ, V2 ์ด์
๋ธ๋ฆฌ): ๊ฐยท๋ถํ๋ยทํ๊ณยทํต๊ณผ ๊ณ ์ ํ, ๊ฐ์ญ ํ์ฉ์น, ์์ ยท๊ณผ๊ตฌ์ ๋ถํ, ๋ค๋ฅธ ์ด๋ฆฐ ์ฐฝ, ์ด์ ํ๋ณด | `targets`, `allow`, `parked` |
| ์ง์ | `knowledge_search` | ์ค๊ณ ์ง์ ๋ฒ ์ด์ค ๊ฒ์ (ํ๊ธยท์์ด ํค์๋) | `query`, `limit` |
| ์ง์ | `knowledge_get` | ์น์
ํ๋, ์ฃผ์ ์ ์ฒด, ๋๋ `index` | `id` |
| ๊ธฐ์ด | `gear_design` | ๊ธฐ์ด ์น์, ์ ์, ์ค์ฌ๊ฑฐ๋ฆฌ, ๋ฌผ๋ฆผ๋ฅ , ๊ฐ์ญ ๊ฒฝ๊ณ ๊ณ์ฐ (CAD ์์ด) | `kind`, `module`, `teeth` |
| ๊ธฐ์ด | `create_gear` | ๊ธฐ์ด๋ฅผ ๋ค์ดํฐ๋ธ ํผ์ฒ๋ก ๋ง๋ค๊ณ ์๊ฐ ๊ฒ์ฆ (์ง ๊ธฐ์ด์ ๋ฌผ๋ฆผ ๊ฒ์ฌ ์ ํ) | `type`, `module`, `teeth`, `build_mate` |
| ์ต์ ํ | `topology_optimize` | 2D/3D ์์ ์ต์ ํ(๊ฐ์ฑ, ์ด์ ๋+๋๋ฅ, ๋ณตํฉ) ์์ยทํ์ธ, ์ต๋ ํ์คยท์ด์ 2๋ฐฐ ์ค๊ณ์ ์ฒด๊ฒฐ๋ถ ๊ฒํ , ๊ฒฐ๊ณผ๋ก ํํธ ์์ฑ | `problem` ๋๋ `tpd`, `job`, `build` |
`fillet_edges`์ `chamfer_edges`๋ ๋ชจ์๋ฆฌ๊ฐ ๋จผ์ ์ ํ๋ผ ์์ด์ผ ํด์. SolidWorks์์ ์ง์ ๊ณ ๋ฅด๊ฑฐ๋ `execute_python`์ผ๋ก ์ ํํ์ธ์.
### execute_python ๊ณ ๊ธ ์ฌ์ฉ
๊ธฐ๋ณธ ๋๊ตฌ๋ก ์ ๋๋ ์์
(๋กํํธ, ํจํด, ์ด์
๋ธ๋ฆฌ ๋ฉ์ดํธ, ์ง๋ ํน์ฑ, ์ด๋ฏธ์ง ์ ์ฅ ๋ฑ)์ `execute_python`์ผ๋ก SolidWorks API๋ฅผ ์ง์ ์ธ ์ ์์ด์.
- ์ธ ์ ์๋ ๋ณ์: `sw`(SldWorks.Application), `doc`(ํ์ฑ ๋ฌธ์), `automation`(์๋ฒ์ SolidWorksAutomation ๊ฐ์ฒด), `win32com`, `pythoncom`, `math`, `os`, `json`
- ์ฃผ์
๋๋ ๋์ฐ๋ฏธ: `val`, `call`, `arr`, `strings`, `byref_int`, `byref_bool`, `select`(SelectByID2), `plane("front"/"top"/"right")`(ํ๊ตญ์ด ํ๋ฉด ์ด๋ฆ ์๋), `feats()`, `feat(์ด๋ฆ)`, `active()`, `report()`, `render(๋ทฐ)`, `store`(ํธ์ถ ์ฌ์ด์ ์ ์ง๋๋ dict), `mm`(0.001), `deg`(ฯ/180)
- `print()` ์ถ๋ ฅ๊ณผ `result` ๋ณ์ ๊ฐ์ด ๊ฒฐ๊ณผ๋ก ๋์์์. `report: true`๋ก ๋ถ๋ฅด๋ฉด ์คํ ๋ค ๋ชจ๋ธ ์์ฝ์ด ๋ถ๊ณ , `render()`๋ ์ด๋ฏธ์ง๋ฅผ ๊ฒฐ๊ณผ์ ๋ถ์ฌ์.
- ์ฝ๋๋ ์ด PC์์ ๊ทธ๋๋ก ์คํ๋๋๊น, ๋ฏฟ์ ์ ์๋ ์์ฒญ์๋ง ์ฐ์ธ์.
SolidWorks 2025๋ late binding์ผ๋ก ์ฐ๊ฒฐ๋ผ์ COM ํธ์ถ์ ์ฃผ์ํ ์ ์ด ์์ด์.
1. **์ธ์ ์๋ ๋ฉค๋ฒ๋ ์ ๊ทผํ๋ ์๊ฐ ์คํ๋ผ์.** `GetTitle`, `GetType`, `FirstFeature`, `GetNextFeature`, `GetFirstDocument` ๊ฐ์ ๋ฉค๋ฒ ๋ค์ `()`๋ฅผ ๋ถ์ด๋ฉด "๊ตฌ์ฑ์์ด ์์ต๋๋ค"(member not found)๋ `'int' object is not callable` ์ค๋ฅ๊ฐ ๋์.
2. **์ธ์ ์๋ ๋ฉ์๋๊ฐ ์๋ฑํ๊ฒ ์คํ๋๋ฉด** ํธ์ถ ์ ์ `obj._FlagAsMethod("๋ฉ์๋์ด๋ฆ")`์ ๋ถ๋ฅด์ธ์.
3. **์ซ์ ๋ฐฐ์ด ์ธ์**๋ `win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_R8, ๊ฐ๋ชฉ๋ก)`์ผ๋ก ๋๊ธฐ์ธ์.
4. **ํ๊ตญ์ด SolidWorks**์์๋ ๊ธฐ๋ณธ ํ๋ฉด๊ณผ ์์ ์ด๋ฆ์ด `์ ๋ฉด`, `์๋ฉด`, `์ฐ์ธก๋ฉด`, `์์ `์ด์์. ํ์ค ๋ทฐ๋ ์ด๋ฆ ๋์ ๋ฒํธ๋ฅผ ์ฐ์ธ์. ์: `doc.ShowNamedView2("", 7)` (๋ฑ๊ฐ ๋ณด๊ธฐ).
```python
P = dict(w=60.0, h=40.0, t=8.0) # w, h [req]; t [neutral, R10]
sm = doc.SketchManager
select(doc, plane("top"), "PLANE") # ํ๊ตญ์ด UI์์๋ "์๋ฉด"์ ์ฐพ์์
call(sm, "InsertSketch", True)
call(sm, "CreateCenterRectangle", 0, 0, 0, P["w"] / 2 * mm, P["h"] / 2 * mm, 0)
call(sm, "InsertSketch", True)
result = report() # ์ค๋ฅ, ๋ฐ๋, ๊ฒฝ๊ณ ์์, ์ง๋
```
### ์ค๊ณ ์ง์ ๋ฒ ์ด์ค
์์ด์ ํธ๊ฐ `knowledge/` ํด๋์ Markdown ๋
ธํธ๋ฅผ ๊ฒ์ํด์ ์จ์. ํ ํฐ์ ์๋ผ๋ ค๊ณ ๋ณธ๋ฌธ์ ์์ด๋ก ์ฐ๊ณ , ํ๊ธ ํค์๋๋ ํ๊ทธ์ ๊ฒ์ ์ฌ์ ์ผ๋ก ์ฐ๊ฒฐํ์ด์.
| ์ฃผ์ | ํ์ผ | ๋ด์ฉ |
|---|---|---|
| ์์ด์ ํธ ๊ฐ์ด๋ | `agent-guide.md` | ์์
ํ๋ฆ, ํ ํฐ ์ ์ฝ, ํ์ง ๊ฒ์ดํธ, ๋ณด๊ณ ํ์ |
| ์ค๊ณ ์ ์ฑ
| `design-policy.md` | ๊ทผ๊ฑฐ ์์, ์ค๋ฆฝ ๊ธฐ๋ณธ๊ฐ(๋์นญยท1:1ยทํ์ค์), ์์ ์จ, ํ์ ๊ธฐ๋ณธ๊ฐ |
| ๊ธฐ์ด | `gears.md` | ์ข
๋ฅ ์ ์ , ์คํผยทํฌ๋ฆฌ์ปฌยท๋ฒ ๋ฒจยท์คํ์ด๋ด ๋ฒ ๋ฒจยท์ยท์ ์ฑ ๊ณต์, ๊ฐ๋, ๊ฒ์ฆ๋ ๋ชจ๋ธ๋ง ๋ฐฉ๋ฒ |
| ๋ฒ ์ด๋ง | `bearings.md` | ์ข
๋ฅ, 68xxยท69xxยท60xxยท62xx ์น์, ์๋ช
, ๋ผ์๋ง์ถค, ์๋ |
| ์ฒด๊ฒฐ | `fasteners.md` | ํผ์นยทํญ ๋๋ฆด, ISO 273 ๊ตฌ๋ฉ, ์นด์ดํฐ๋ณด์ด, ์ฒด๊ฒฐ ๊ธธ์ด, ํ ํฌ, ํ |
| ๊ณต์ฐจ | `fits-tolerances.md` | ISO 286 ๋ผ์๋ง์ถค ๊ฐ, IT ๋ฑ๊ธ, ISO 2768, 3D ํ๋ฆฐํ
๊ณต์ฐจ |
| ์ถยทํค | `shafts-keys.md` | ์ถ ์ค๊ณ์, ํค ์น์, ์ค๋
๋ง ํ, D์ปท |
| ์ฌ๋ฃ | `materials.md` | ๊ธ์ยทํ๋ผ์คํฑยท3D ํ๋ฆฐํ
์ฌ๋ฃ ๋ฌผ์ฑ |
| DFM | `dfm.md` | ๊ฐ๊ณต, ํ๊ธ, ์ฌ์ถ, FDMยทSLAยทSLS ๊ท์น |
| ๊ธฐ์ด ์์ฑ๊ธฐ | `gear-generators.md` | create_gear ์ข
๋ฅ, ์ขํ๊ณ, ๊ธฐ๋ณธ๊ฐ ๊ทผ๊ฑฐ, ์๊ฐ ๊ฒ์ฆ, ์ด์
๋ธ๋ฆฌ ๋ฐฐ์น |
| ํ ํด๋ก์ง ์ต์ ํ | `topology-optimization.md` | ๋ฌธ์ ์ ์(mm), ์ดยท๋ณตํฉ ๋ชจ๋, ์ฒด๊ฒฐ๋ถยท์ค์ ํ์ ์์ ๊ณ์ 2, ์๋ ๋ถํผ์จ, ๊ฒฐ๊ณผ ํด์, ํํธ๋ก ๋ง๋ค๊ธฐ, ๊ฐ๊ณต ๋ชจ๋ ๊ณํ |
| API ๋ ์ํผ | `solidworks-api.md` | ๊ฒ์ฆ๋ SolidWorks API ํธ์ถ (์ค์ผ์น, ๋กํํธ, ์ค์, ํจํด, ๊ตฌ์ฑ, ๋ฉ์ดํธ, ๊ฒ์ฌ, STL ๋ถ๋ฌ์ค๊ธฐ) |
| ์ด์
๋ธ๋ฆฌ ๊ฐ์ด๋ | `assembly-guide.md` | ์กฐ๋ฆฝ ์ ์ฐจ A0โA8, ๋ฉ์ดํธยท๊ธฐ์คยท์์ธ ๊ท์น, ๊ธฐ๊ตฌ ๊ฒ์ฆ(์๋ฒ/๊ธฐํ ์์ธ), ํํน, ์ฐฝ ๋ซ๊ธฐ, ํจ์ ํ |
| ์ค๊ณ ์ํฌํ๋ก | `design-workflow.md` | ์ค๊ณโ๋ชจ๋ธ๋งโ๊ฒ์ฆโ์ด์ ๋ถ๋ฅ ํ๋ผ์ดํ , ๊ฒ์ฆ ๋ฐฐํฐ๋ฆฌ V1โV6, ์๊ฐ ์ ํ, ๋ฃจํ ๋ณด๊ณ ํ์ |
๋
ธํธ๋ฅผ ์ถ๊ฐํ๋ ค๋ฉด ๊ฐ์ ํ์(๋งจ ์ `title`, `tags`, `summary`์ `## ` ์น์
)์ผ๋ก `knowledge/`์ `.md` ํ์ผ์ ๋ฃ๊ณ Claude๋ฅผ ๋ค์ ์์ํ์ธ์. ์์น๋ฅผ ๋ฃ์ ๋๋ ์ถ์ฒ(๊ท๊ฒฉ ๋ฒํธ, ์นดํ๋ก๊ทธ)๋ฅผ ํจ๊ป ์ ์ด ์ฃผ์ธ์.
### ๊ธฐ์ด ์์ฑ๊ธฐ
`gear_design`(๊ณ์ฐ๋ง)๊ณผ `create_gear`(SolidWorks ๋ค์ดํฐ๋ธ ํผ์ฒ)๋ก ์ผ๋ฐ์ ์ธ ๊ธฐ์ด๋ฅผ ๋ง๋ค์ด์. ๊ธฐ์ด ์ข
๋ฅ๋ OpenSCAD ๋ผ์ด๋ธ๋ฌ๋ฆฌ [chrisspen/gears](https://github.com/chrisspen/gears)์ ๋ง์ท์ง๋ง(ํค๋ง๋ณธ ๋ฒ ๋ฒจ๊ณผ ์ฒด๊ฒฐ ๊ตฌ๋ฉ ์๋ ๋์ ์ ์ธ, ์ ์ฑ๊ธฐ์ด๋ `gear_design`์ผ๋ก ๊ณ์ฐํ ๋ค ๋ถํ๋ณ๋ก ์์ฑ), ๊ทธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ CC BY-NC-SA 3.0(๋น์์
ยท๋์ผ์กฐ๊ฑด)์ด๋ผ ์ฝ๋๋ ์ฐ์ง ์๊ณ ๊ท๊ฒฉ(ISO 21771, ISO 53, Gleason/AGMA 2005, DIN 3975) ๊ณต์์ผ๋ก ์ง์ ๊ตฌํํ์ด์. ์ฌ์ดํด๋ก์ด๋์ ํ๋ชจ๋ ๋๋ผ์ด๋ธ๋ ์์ ํ ๊ตฌ๋งค๋ฅผ ๊ถํด์ ์์ฑ ๋์์์ ๋บ์ด์.
| type | ํ์ | ๋ฐฉ์ |
|---|---|---|
| `spur`, `helical`, `herringbone` | ์ธ์ ์คํผยทํฌ๋ฆฌ์ปฌยทํค๋ง๋ณธ | ISO 53 ๋์ผ๋ก ์ฐฝ์ฑํ ์ธ๋ณผ๋ฅํธ์ ํธ๋ก์ฝ์ด๋ ์ด๋ฟ๋ฆฌ, ์ธ๋์ปท ์๋ ๋ฐ์ |
| `internal` | ๋ด์ (๋ง) ๊ธฐ์ด | ์ธ๋ณผ๋ฅํธ์ ์ํธ ์ด๋ฟ๋ฆฌ ํ๋ |
| `rack` | ์คํผยทํฌ๋ฆฌ์ปฌ ๋ | ISO 53 ๊ธฐ์ค ๋, ํฌ๋ฆฌ์ปฌ ๋๋ ๋๋จ ์ง๊ฐ |
| `bevel`, `spiral_bevel` | ์ง์ ยท์คํ์ด๋ด ๋ฒ ๋ฒจ | Tredgold ๋ฑ๊ฐ ๋จ๋ฉด ๋กํํธ์ ๊ฐ์ด๋ ์ปค๋ธ, Gleason ์นํ ๋น์จ |
| `worm`, `worm_wheel`, `worm_set` | ZA ์, ์ํ | ์์ ํฌ๋ฆญ์ค ์ค์, ์ํ ์ ๋ชฉ(throat)์ด ์๋ ํฌ๋ฆฌ์ปฌ ๊ทผ์ฌ |
- ๊ธฐ๋ณธ๊ฐ๊ณผ ๊ทผ๊ฑฐ: ์๋ ฅ๊ฐ 20ยฐ์ ISO 53 A [std], ๋ฐฑ๋์ 0.04 m [heur], ์นํญ 10 m [heur], ์์ ํผ๋์ธ์ ์ธ๋์ปท ํ๊ณ ์ ์ x_min๊ณผ V-zero ์ง [std], ๋ง๊ธฐ์ด ๋ฆผ d_f + 6 m [heur]. ๊ฒฐ๊ณผ์ ๊ทผ๊ฑฐ ํ๊ทธ๊ฐ ํจ๊ป ๋์์.
- ์๊ฐ ๊ฒ์ฆ: SolidWorks ๋ถํผ๋ฅผ ์ ํํ ์นํ ๋จ๋ฉด์ ร ์นํญ๊ณผ ๋น๊ต(๋ณดํต 0.1 % ์ด๋ด), ๋ฐ๋ 1๊ฐ, ์ฌ์์ฑ ์ค๋ฅ ์์, ํฌ๋ฆฌ์ปฌ์ ์ฌ์ง ํ์นจ์ผ๋ก ๋์ ๋ฐฉํฅ๊น์ง ํ์ธํด์.
- `build_mate: true`: ์ง ๊ธฐ์ด(์ธ์ ์ ๋ฐ๋ ๋ฐฉํฅ, ๋ด์ ์ ๊ฐ์ ๋ฐฉํฅ)๋ ๋ง๋ค๊ณ ํ ํผ์น ๊ตด๋ฆฌ๋ฉด์ ์์ ๋ฐ๋๋ก ๊ฐ์ญ์ ์ฌ์. ์ธก์ ๊ฐ: ์คํผยทํฌ๋ฆฌ์ปฌยทํค๋ง๋ณธยท๋ด์ ยท๋ 0 mmยณ, ์คํ์ด๋ด ๋ฒ ๋ฒจ 0.03โ0.09 mmยณ(Tredgold ๊ทผ์ฌ), ๊ฐ์ ๋ฐฉํฅ ํฌ๋ฆฌ์ปฌ ์์ 162 mmยณ๋ก ์๋ชป๋ ์กฐํฉ์ ์ก์๋ด์.
- ์ขํ๊ณ: ์ถ +Z, z = 0 ๋ฉด์ด ์ ๋ฉด, ์ดํ ํ๋๊ฐ +X ์ค์ฌ. ์ง ๋ฐฐ์น์ ์์์ ๊ฒฐ๊ณผ์ `phase_deg`๋ฅผ ์ฐ๊ณ , ์์ธํ ๋ด์ฉ์ ์ง์ ๋ฒ ์ด์ค `gear-generators`์ ์์ด์.
์: "๋ชจ๋ 1.5, 18:36 ์คํผ ๊ธฐ์ด ํ ์, ๋ณด์ด 8์ ํคํ" โ `create_gear {"type": "spur", "module": 1.5, "teeth": 18, "mate_teeth": 36, "build_mate": true, "bore": 8, "keyway": true}`
### ํ ํด๋ก์ง ์ต์ ํ
`topology_optimize`๋ [ToPy](https://github.com/williamhunter/topy)(MIT)๋ฅผ Python 3 + scipy๋ก ์ฎ๊ธด SIMP ์ต์ ํ์์. ์ต์ ์ปดํ๋ผ์ด์ธ์ค(๊ฐ์ฑ ์ต๋), ์ปดํ๋ผ์ด์ธํธ ๋ฉ์ปค๋์ฆ, ์ ์ ์ด์ ๋(๋๋ฅ๋ ๋ง ๊ณ์๋ก), ๊ฐ์ฑ+์ด ๋ณตํฉ์ 2D ํ์ฌ์ 3D๋ก ํ์ด์. ์ ๋ CFD๋ ๋ฃ์ง ์์์ด์.
- **์์ ๊ณ์ 2 ๊ท์น**: ํ์ค(`loads`, ์ฒด๊ฒฐ๋ถ `force`)๊ณผ ์ด(`power_W`, `heat_W`)์ ์ต๋ ์ฌ์ฉ๊ฐ์ผ๋ก ๋ฃ๊ณ , ํด์ยท๋ฏธ๋ฆฌ๋ณด๊ธฐยท๋ชจ๋ ๊ฒํ ๋ ๊ทธ 2๋ฐฐ(`safety_factor`, 2 ๋ฏธ๋ง์ ์ค๋ฅ)๋ก ํด์.
- **์ฒด๊ฒฐ๋ถ(`interfaces`)**: ๋ณผํธ(ISO 273 ํต๊ณผ ๊ตฌ๋ฉ), ํญ(ISO 2306 ํญ ๋๋ฆด), ํ, ํจ๋. ๊ตฌ๋ฉ์ ๋น์ฐ๊ณ ๋ฐ์ง๋ฆ max(1.5 d, ์์
์๋ฆฌ + ์์ 1๊ฐ)์ ๋ง์ ๋ณด์กดํด์. ๊ตฌ๋ฉ ๋ฒฝ ์ ์ ์ด ์ง์งยทํ์คยท์ด์ยท๋ฐฉ์ด(๊ธฐ์ค ์จ๋) ์ญํ ์ ํด์. ๊ฒฐ๊ณผ์ ์ฒด๊ฒฐ๋ถ๋ณ ๋ณผํธ ์ ๋จยท์ธ์ฅ, ์ง์, ๋๋จ ์ฐข๊น, ํญ ์ฒด๊ฒฐ ๊ธธ์ด(๋ณผํธ ํญ๋ณต ์ ๋์ฌ์ฐ ํ์ ๋ฐฉ์ง) ์ด์ฉ๋ฅ ์ด ๋์์.
- **์ค์ ํ์(`critical`)**: ๋ฒ ์ด๋ง ์๋ฆฌ, ์ค๋ง ๋ฉด ๋ฑ์ ํญ์ ๋จ๊ฒจ์.
- **๊ฒํ **: ์ค๊ณ ํ์ค์์ ์๋ ฅ ์คํฌ๋ฆฌ๋(๋ฐ๋ 0.5 ์ด์, ์ฒด๊ฒฐ๋ถ ์ ์ธ)์ด ํญ๋ณต ์ดํ, ์ค๊ณ ์ด์์ ์ต๊ณ ์จ๋๊ฐ `max_temperature_C` ์ดํ์ธ์ง ๋ด์. ์ต์ข
CAD๋ SOLIDWORKS Simulation์ผ๋ก ์ค๊ณ ํ์ค์์ ๋ค์ ํ์ธํด์.
- **`volume_fraction: "auto"`**: ์๋ ฅยท์จ๋ ๊ฒํ ๋ฅผ ํต๊ณผํ๋ ๊ฐ์ฅ ๊ฐ๋ฒผ์ด ๋ถํผ์จ์ ์ด๋ถ ํ์ํด์.
- ๊ฒ์ฆ: ์์ ๊ฐ์ฑ ํ๋ ฌ์ด ToPy์ SymPy ์ ์์ ๊ธฐ๊ณ ์ ๋ฐ๋๋ก ๊ฐ๊ณ , MBB ๋ณด ๊ณ์ฐ์ด Sigmund 99์ค ์ฝ๋์ ๊ฐ์ ๊ฐ์ ๋ด์(์ฒซ ๋ฐ๋ณต 1e-11, 8ํ ๋ฐ๋ณต 1e-9).
- ๋ฌธ์ ๋ mm๋ก ์ ์ํด์: `size`, `element_size`, `thickness`, `volume_fraction`, `supports`, `loads`, `keep_out`/`keep_in`(๋ณผํธ ๊ตฌ๋ฉ ์ฃผ๋ณ์ ๋ณด์กด, ์์ง์ด๋ ๋ถํ ์๋ฆฌ๋ ์ ์ธ), `material`. ToPy `.tpd` ํ์ผ๋ ๊ทธ๋๋ก ๋ฐ์์.
- ๋ฐฑ๊ทธ๋ผ์ด๋ ์์
์ผ๋ก ๋๊ณ ์ด ํธ์ถ์ ์ต๋ `wait`์ด ๊ธฐ๋ค๋ ค์. ๋ ๋๋ฌ์ผ๋ฉด `job`์ผ๋ก ๋ค์ ํ์ธํด์. ๊ฒฐ๊ณผ์๋ ๋ฐ๋ณต ์, ๋ถํผ์จ, ์ปดํ๋ผ์ด์ธ์ค, ํ์ค์ ๋ณ์(mm), ์ง๋, ๋ฏธ๋ฆฌ๋ณด๊ธฐ ์ด๋ฏธ์ง๊ฐ ๋ค์ด ์์ด์.
- `build: true`: 2D ๊ฒฐ๊ณผ๋ ๋ฐ๋ 0.5 ๋ฑ๊ณ ์ ์ ์คํ๋ผ์ธ์ผ๋ก ๊ทธ๋ ค ๋๊ป๋งํผ ๋์ถํด์(๋ถํผ ์ค์ฐจ 0.02 %). 3D ๊ฒฐ๊ณผ๋ STL์ ๋ฉ์ ์๋ฆฌ๋ ๋ฐ๋๋ก ๋ถ๋ฌ์์(๋ค์ ๋ชจ๋ธ๋งํ ๋ ์ฐธ๊ณ ์ฉ).
- ์๋(์ธก์ ): 2D 120 ร 60 ์์ ์ฝ 4์ด, 3D 40 ร 20 ร 10 ์์ ๋ฐ๋ณต๋น ์ฝ 0.7์ด.
์: ์ผ์ชฝ ๊ณ ์ , ์ค๋ฅธ์ชฝ ๋ ์ค์์ 1000 N, ๋ถํผ 40 %, ๋๊ป 6 mm ์๋ฃจ๋ฏธ๋ ๋ธ๋ํท โ
`{"problem": {"size": [120, 60], "element_size": 1, "thickness": 6, "volume_fraction": 0.4, "supports": [{"edge": "left"}], "loads": [{"at": [120, 30], "force": [0, -1000]}], "material": {"E": 70000, "density": 2.7}}, "build": true}`
### ์ค์ ํ์ผ config.json
`solidworks_mcp/config.json`์ ๊ณ ์น๋ฉด ์ฝ๋๋ฅผ ๊ฑด๋๋ฆฌ์ง ์๊ณ ๋์์ ๋ฐ๊ฟ ์ ์์ด์. ๋ฐ๊พผ ๋ค์๋ Claude๋ฅผ ๋ค์ ์์ํ์ธ์.
| ํค | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช
|
|---|---|---|
| `exe_path` | `"auto"` | `SLDWORKS.exe` ๊ฒฝ๋ก, `auto`๋ฉด ๋ ์ง์คํธ๋ฆฌ์์ ์ฐพ์ |
| `part_template`, `assembly_template`, `drawing_template` | `"auto"` | ์ ๋ฌธ์ ํ
ํ๋ฆฟ ๊ฒฝ๋ก |
| `startup_timeout` | `120` | SolidWorks ์คํ์ ๊ธฐ๋ค๋ฆฌ๋ ์๊ฐ(์ด) |
| `connection_retry_interval` | `5` | ์ฐ๊ฒฐ ์ฌ์๋ ๊ฐ๊ฒฉ(์ด) |
| `max_retries` | `3` | ์ฐ๊ฒฐ ์ฌ์๋ ํ์ |
| `default_unit` | `"mm"` | ๊ธฐ๋ณธ ๊ธธ์ด ๋จ์ |
| `log_level` | `"INFO"` | ๋ก๊ทธ ์์ค (DEBUG, INFO, WARNING, ERROR) |
| `log_file` | `"solidworks_mcp.log"` | ๋ก๊ทธ ํ์ผ ์ด๋ฆ (`solidworks_mcp` ํด๋ ์) |
| `default_extrude_depth`, `default_fillet_radius`, `default_chamfer_distance`, `default_circle_radius` | `10`, `2`, `2`, `25` | ์ธ์๋ฅผ ์๋ตํ์ ๋ ์ฐ๋ ๊ฐ(mm) |
### ๋ฌธ์ ํด๊ฒฐ
**Claude์ SolidWorks ๋๊ตฌ๊ฐ ์ ๋ณด์ฌ์**
1. Claude๋ฅผ ํธ๋ ์ด ์์ด์ฝ โ ์ข
๋ฃ(Quit)๋ก ์์ ํ ๋๊ณ ๋ค์ ์คํํ์ธ์.
2. ์ค์ โ ๊ฐ๋ฐ์์์ `solidworks` ์ํ๋ฅผ ํ์ธํ์ธ์.
3. `setup_mcp.log`์์ `could not update` ๊ฐ์ ๋ฉ์์ง๊ฐ ์๋์ง ๋ณด์ธ์.
4. Claude๋ฅผ ๋ ์ํ์์ ์ค์น๋ฅผ ํ ๋ฒ ๋ ์คํํด ๋ณด์ธ์.
5. Claude์ MCP ๋ก๊ทธ๋ฅผ ๋ณด์ธ์: `%APPDATA%\Claude\logs\mcp-server-solidworks.log` (MSIX ์ค์นํ์ `%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\logs\`).
**`pip install -r requirements.txt`๊ฐ ์คํจํด์**: ์ด ์ ์ฅ์์ `requirements.txt`๋ฅผ ์ฐ๊ณ ์๋์ง ํ์ธํ์ธ์ (`asyncio-compat` ์์, `mcp<2`).
**์๋ฒ๊ฐ ๋ฐ๋ก ๊บผ์ง๊ณ ๋ก๊ทธ์ `'Server' object has no attribute 'list_tools'`๊ฐ ์์ด์**: mcp 2.x๊ฐ ์ค์น๋ ๊ฑฐ์์. `.venv\Scripts\python.exe -m pip install "mcp>=1,<2"`
**"๊ตฌ์ฑ์์ด ์์ต๋๋ค"(Member not found) ์ค๋ฅ**: ์ [execute_python ๊ณ ๊ธ ์ฌ์ฉ](#execute_python-๊ณ ๊ธ-์ฌ์ฉ)์ COM ๊ท์น์ ๋ณด์ธ์. ์ด ์ ์ฅ์์ ๊ธฐ๋ณธ ๋๊ตฌ๋ ์์ ๋ผ ์์ด์.
**์ฐ๊ฒฐ์ด ์ ๋ผ์**: SolidWorks๊ฐ ์คํ ์ค์ธ์ง, ๋ผ์ด์ ์ค๋ ์์ ๋ํ์์๊ฐ ๋ ์์ง ์์์ง ํ์ธํ์ธ์. `get_solidworks_info`๋ก ์ค์น๊ฐ ํ์ง๋๋์ง ๋ณด๊ณ , ์ ๋๋ฉด `config.json`์ `exe_path`์ ๊ฒฝ๋ก๋ฅผ ์ง์ ๋ฃ์ผ์ธ์.
**ํด๋๋ฅผ ์ฎ๊ฒผ์ด์**: `setup_windows.bat`์ ๋ค์ ์คํํ๋ฉด ๊ฒฝ๋ก๊ฐ ๊ฐฑ์ ๋ผ์.
### ์
๋ฐ์ดํธ์ ์ ๊ฑฐ
- ์
๋ฐ์ดํธ: ์ค์นํ ๋์ PowerShell ํ ์ค์ ๋ค์ ์คํํ๊ฑฐ๋, ์ ์ฅ์์์ `git pull` ํ `setup_windows.bat`์ ์คํํ์ธ์ (์ ํจํค์ง๊ฐ ์ค์น๋ผ์).
- ์ ๊ฑฐ: ๋ช
๋ น ํ๋กฌํํธ์์ `setup_windows.bat -Uninstall`(๋๋ `install.ps1 -Uninstall`)์ ์คํํ๋ฉด Claude DesktopยทClaude Code ๋ฑ๋ก๊ณผ ์คํฌ์ ์ง์์. ๊ทธ๋ค์ ํด๋๋ฅผ ์ญ์ ํ์ธ์. ์ค์น ์ ์ค์ ์ `claude_desktop_config.json.bak-*` ๋ฐฑ์
์ ์์ด์. Claude ๊ณ์ ์ ์ ์ฅํ ์คํฌ์ Claude ์ค์ ์์ ์ง์ฐ์ธ์.
### ๋ก๋๋งต
SolidWorks ์ง์์ ๊ฐ์ฅ ๋จผ์ ํด์. ์งํ ์์:
- [x] **Text-to-CAD ๊ฒ์ฆ ๋ฃจํ**: `model_report`, `render_views`, `export_model`, `check_interference`, execute_python ๋์ฐ๋ฏธ
- [x] **์์ด์ ํธ ๊ฐ์ด๋**: ํ ํฐ ์ ์ฝ ๊ท์น๊ณผ ์ค๊ณ ๊ทผ๊ฑฐ ๊ท์น (์๋ฒ instructions)
- [x] **์ค๊ณ ์ง์ ๋ฒ ์ด์ค 1์ฐจ**: ์ค๊ณ ์ ์ฑ
, ๊ธฐ์ด, ๋ฒ ์ด๋ง, ์ฒด๊ฒฐ, ๊ณต์ฐจ, ์ถยทํค, ์ฌ๋ฃ, DFM, API ๋ ์ํผ
- [ ] **๋ถํ DB**: KS/ISO ํ์ค ๋ถํ ์น์ ํ์, ์ฌ์ฉ์๊ฐ ํ์ธํ ํ๊ตญ ๋ฏธ์ค๋ฏธ ํ๋ฒ ๋ฑ๋กยท๊ฒ์ (๋ฏธ์ค๋ฏธ ์ฌ์ดํธ๋ robots.txt์ ์ฝ๊ด์ด ์๋ ์์ง์ ๋ง์์ ํฌ๋กค๋งํ์ง ์์์)
- [x] **๊ธฐ์ด ์์ฑ๊ธฐ**: ์คํผ, ํฌ๋ฆฌ์ปฌ, ํค๋ง๋ณธ, ๋ด์ , ๋, ์ง์ ยท์คํ์ด๋ด ๋ฒ ๋ฒจ, ์ยท์ํ (๊ท๊ฒฉ ๊ณต์, ๋ถํผยท๋ฌผ๋ฆผ ์๊ฐ ๊ฒ์ฆ)
- [x] **ํ ํด๋ก์ง ์ต์ ํ**: 2D/3D ๊ฐ์ฑยท์ปดํ๋ผ์ด์ธํธ ๋ฉ์ปค๋์ฆ (ToPy ํฌํ
), 2D ๊ฒฐ๊ณผ๋ ๋์ถ ํํธ๋ก
- [x] **์ดยท๋ณตํฉ ์์ ์ต์ ํ**: ์ด์ ๋ + ๋๋ฅ ๊ฒฝ๊ณ, ์ต๋ ํ์คยท์ด์ 2๋ฐฐ ์ค๊ณ, ์ฒด๊ฒฐ๋ถ ์๋ ์ฒ๋ฆฌ์ ๊ฒํ , ์๋ ๋ถํผ์จ
- [x] **ํ์ค ๊ฒ์ฆ๊ณผ ์ํฌํ๋ก**: `verify_model`(V1 ํํธ, V2 ์ด์
๋ธ๋ฆฌ), ์ด์
๋ธ๋ฆฌ ๊ฐ์ด๋, ์ค๊ณ-๋ชจ๋ธ๋ง-๊ฒ์ฆ ํ๋ผ์ดํ
- [ ] **๊ฐ๊ณต ์ต์ ํ ๋ชจ๋**: 2.5D ๋ฐ๋งยท๊ณต๊ตฌ ๋ฐ๊ฒฝยท๋ฒฝ/๋ฐ๋ฅ ๋๊ป ์ ์ฝ (์กฐ์ฌ ์๋ฃ, `topology-optimization.md`์ ๊ณํ ์ฐธ๊ณ )
- [ ] **์ ์ฑ๊ธฐ์ด ์ด์
๋ธ๋ฆฌ ์๋ ๋ฐฐ์น**์ 3D ์ต์ ํ ๊ฒฐ๊ณผ์ ๋ฆฌ๋ชจ๋ธ๋ง ๋ณด์กฐ
์ด์ ๋(๋๋ฅ๋ ๋ง ๊ณ์)๋ ์์ฒด FE๋ก ๋ฃ์์ด์. ์ ๋ CFD(SOLIDWORKS Flow Simulation ์ฐ๋)๋ ๊ฒฐ๊ณผ ์ ๋ขฐ์ฑ ๋ฌธ์ ๋ก ๊ณ์ ๋ณด๋ฅํด์.
### ํ๋ก์ ํธ ๊ตฌ์กฐ
```
Solidworks-MCP/
โโโ install.ps1 # ํ ์ค ์ค์น (irm ... | iex): ์ฝ๋ ๋ฐ๊ธฐ, Python ์ฐพ๊ธฐ, setup_mcp.py ์คํ
โโโ setup_windows.bat # ์ํด๋ฆญ ์ค์น (๋๋ธํด๋ฆญํ๋ฉด install.ps1 ์คํ)
โโโ setup_mcp.py # ์ค์น ๋ก์ง: .venv, ํจํค์ง, ์๊ฐ ์ง๋จ, Claude DesktopยทClaude Code ๋ฑ๋ก, ์คํฌ
โโโ skills/solidworks-design/ # Claude ์คํฌ: ์ค๊ณ ์์
๊ท์น (์๋ฒ instructions๋ฅผ ์ ๋๊ธฐ๋ Cowork ๊ฐ์ ํด๋ผ์ด์ธํธ์ฉ)
โโโ solidworks_mcp_server.py # MCP ์๋ฒ ์ง์
์
โโโ requirements.txt
โโโ knowledge/ # ์ค๊ณ ์ง์ ๋ฒ ์ด์ค (Markdown ๋
ธํธ)
โโโ solidworks_mcp/
โ โโโ server.py # MCP ๋๊ตฌ ์ ์์ ์ฒ๋ฆฌ
โ โโโ instructions.md # ๋งค ์ธ์
์์ด์ ํธ์๊ฒ ์ฃผ๋ ์์
๊ท์น
โ โโโ verification.py # model_report, render_views, export_model, check_interference
โ โโโ knowledge.py # ์ง์ ๋ฒ ์ด์ค ๊ฒ์
โ โโโ com.py # late binding COM ๋์ฐ๋ฏธ (val, call, arr, plane ...)
โ โโโ gears/ # ๊ธฐ์ด: geometry(์ธ๋ณผ๋ฅํธ), bevel, build(SolidWorks), api(๋๊ตฌ ์ธ์)
โ โโโ topopt/ # ํ ํด๋ก์ง ์ต์ ํ (ToPy ํฌํ
+ ์ด): problem, topology, physics(์ดยท์๋ ฅยท์ฒด๊ฒฐ๋ถ), export, run, cad
โ โโโ tests/ # ๊ธฐ์ดยท์ต์ ํยท์ค์น ๋จ์ ํ
์คํธ (python -m unittest solidworks_mcp.tests.test_gears ...)
โ โโโ config.py, config.json # ์ค์
โ โโโ constants.py # SolidWorks ์์
โ โโโ automation/ # base(์ฐ๊ฒฐ), documents, sketches, features
โ โโโ utils/ # ๋จ์ ๋ณํ, SolidWorks ์ค์น ํ์ง
โโโ scripts/ # ์๋ณธ ํ๋ก์ ํธ์ VBS ์์
โโโ solidworks_com.py, solidworks_simulation.py # ์๋ณธ ํ๋ก์ ํธ์ ์ด์ ๋ฒ์ ์คํฌ๋ฆฝํธ
โโโ DEVELOPMENT_ROADMAP.md # ์๋ณธ ํ๋ก์ ํธ์ ๊ฐ๋ฐ ๊ณํ
```
### ๋ผ์ด์ ์ค์ ํฌ๋ ๋ง
MIT ๋ผ์ด์ ์ค์์ ([LICENSE](LICENSE)). ์๋ณธ ํ๋ก์ ํธ: [alisamsam/Solidworks-MCP](https://github.com/alisamsam/Solidworks-MCP), Samsaam Ali Baig. ์๋ณธ ์ ์๊ถ ํ์์ ๋ผ์ด์ ์ค ๋ฌธ๊ตฌ๋ฅผ ์ ์งํด ์ฃผ์ธ์.
ํ ํด๋ก์ง ์ต์ ํ ์ฝ๋(`solidworks_mcp/topopt/`)๋ William Hunter์ [ToPy](https://github.com/williamhunter/topy)(MIT)๋ฅผ ์ฎ๊ธด ๊ฒ์ด๊ณ , ๋ผ์ด์ ์ค ์ ๋ฌธ์ `solidworks_mcp/topopt/LICENSE_TOPY.md`์ ์์ด์. ToPy์ 2D ๋ถ๋ถ์ Ole Sigmund์ 99์ค ์ฝ๋๋ฅผ ๋ฐํ์ผ๋ก ํด์. ๊ธฐ์ด ์์ฑ๊ธฐ๋ chrisspen/gears(CC BY-NC-SA 3.0)์ ์ฝ๋๋ฅผ ์ฐ์ง ์์์ด์.
---
## English
### Contents
1. [Overview](#overview)
2. [Changes from the original](#changes-from-the-original)
3. [Requirements](#requirements)
4. [Quick start](#quick-start)
5. [What the installer does](#what-the-installer-does)
6. [Manual setup](#manual-setup)
7. [Usage](#usage)
8. [Text-to-CAD workflow](#text-to-cad-workflow)
9. [Tool reference](#tool-reference)
10. [Advanced: execute_python](#advanced-execute_python)
11. [Design knowledge base](#design-knowledge-base)
12. [Gear generators](#gear-generators)
13. [Topology optimization](#topology-optimization)
14. [Configuration (config.json)](#configuration-configjson)
15. [Troubleshooting](#troubleshooting)
16. [Updating and uninstalling](#updating-and-uninstalling)
17. [Roadmap](#roadmap)
18. [Project structure](#project-structure)
19. [License and credits](#license-and-credits)
### Overview
SolidWorks MCP Server is a [Model Context Protocol](https://modelcontextprotocol.io/) server that lets an AI agent such as Claude drive SolidWorks. Instead of clicking through menus, you describe the geometry you want and Claude builds it through the SolidWorks COM API: parts, sketches and features.
- 52 tools (35 CAD and verification + 17 Design Studio): connection, documents, sketches, features, utilities, `execute_python` for direct SolidWorks API access, verification (text-to-CAD), design-knowledge search, gear generation and topology optimization
- Agent working rules (token budget, design rationale) are applied automatically in every session
- SolidWorks 2023โ2025, installation auto-detected from the registry
- Units: mm, cm, m, inch, ft (default mm)
- Activity log: `solidworks_mcp/solidworks_mcp.log`
### Changes from the original
| Area | Change |
|---|---|
| Install fix | Removed `asyncio-compat` from `requirements.txt`. It does not exist on PyPI, so `pip install -r requirements.txt` always failed. |
| Startup fix | Pinned `mcp>=1.0.0,<2`. mcp 2.x removed the `Server.list_tools()` / `call_tool()` decorators this server uses, so the server crashed on startup with `AttributeError`. |
| One-line install | `install.ps1` (one PowerShell line, or double-click `setup_windows.bat`) + `setup_mcp.py` get the code, find Python (or offer to install it with winget), create the virtual environment, install packages, self-test the server, register it with Claude Desktop and Claude Code and install the design skill. Ask Claude to install the repository and it runs this for you. |
| SolidWorks 2025 COM | Added `_com_value()` in `automation/base.py` and fixed `list_open_documents` ("Member not found"), `get_document_info` (`'int' object is not callable`) and `list_features` (returned only the first feature; suppression state was always false). |
| Localized SolidWorks | `create_sketch` only looked for "Front Plane", so it failed in non-English UIs (Korean: ์ ๋ฉด/์๋ฉด/์ฐ์ธก๋ฉด). It now falls back to the default planes' actual names. |
| Repository cleanup | `.env` removed (the original contained an API key; the server does not use it), `.venv/` ignored, CRLF line endings enforced for `.bat` files. |
| Text-to-CAD verification | Added `model_report`, `render_views`, `export_model`, `check_interference`; `execute_python` gets injected helpers and a `report` option. |
| Design knowledge base | 12 notes in `knowledge/` with `knowledge_search` and `knowledge_get`. |
| Gear generators | `gear_design`, `create_gear`: spur, helical, herringbone, internal, rack, straight/spiral bevel, worm and worm wheel from the standards' formulas, self-checked by volume and mesh interference. |
| Topology optimization | `topology_optimize`: ToPy ported to Python 3 for 2D/3D stiffness and compliant-mechanism problems, plus heat conduction with convection films and a combined mode. Loads and heat are maximum values designed at 2 x (safety factor at least 2); bolt, tapped-hole, pin and pad joints get standard holes, keep-in rings and per-joint checks. Results are turned into SolidWorks parts. |
| Agent guide | Workflow, token rules and rationale policy are sent as MCP server instructions in every session. |
| Design skill | `skills/solidworks-design`: a Claude skill that brings the same working rules to clients that do not pass server instructions on, such as Cowork. The tool descriptions also point to `knowledge_get("agent-guide")`. |
| Fewer output tokens | No duplicated `execute_python` output, compact JSON without `\u` escapes, tracebacks trimmed to the script frames. |
### Requirements
- Windows 10 / 11 (64-bit)
- SolidWorks 2023โ2025, installed and licensed
- Python 3.10 or newer (64-bit): the python.org installer or the Python Install Manager (`py`). Without one, the installer can install Python 3.13 with winget
- Claude Desktop or Claude Code
- Internet access for the first install (pip packages, about 60 MB including numpy and scipy for topology optimization)
Tested with SolidWorks 2025 (revision 33.5.0, Korean UI), Python 3.14.7 and Claude Desktop for Windows (Microsoft Store/MSIX build).
### Quick start
The easiest way is to ask Claude to install it, as shown at the top. To do it yourself:
1. **Run the installer**: paste this line into PowerShell.
```powershell
irm https://raw.githubusercontent.com/hayward2007/solidworks-mcp/main/install.ps1 | iex
```
The code goes to `%USERPROFILE%\solidworks-mcp`. If you downloaded the repository yourself (`git clone https://github.com/hayward2007/solidworks-mcp.git` or a ZIP), you can **double-click `setup_windows.bat`** in it instead. You are done when it prints `All set`. The folder path is written into Claude's config, so run it again if you move the folder later.
2. **Quit Claude Desktop completely and start it again**: right-click the Claude icon in the system tray (bottom-right, possibly under the **^** arrow), choose **Quit**, then start Claude again. Closing the window leaves it running in the background, and it will not read the new config. In Claude Code, start a new session.
3. **Open SolidWorks** and ask Claude: "Connect to SolidWorks".
In Claude, Settings โ Developer should show the `solidworks` server as running.
**Using Cowork? Save the design skill too.** Cowork does not pass the server instructions (working rules) to the model; the `solidworks-design` skill brings them in. In Cowork, ask Claude to "save the solidworks-design skill from https://github.com/hayward2007/solidworks-mcp" and save the card it shows. On claude.ai you can upload the `dist\solidworks-design.zip` the installer writes under Settings โ Capabilities โ Skills. For Claude Code the installer puts the skill into `~/.claude/skills`.
### What the installer does
1. Gets the code: `git clone` into `%USERPROFILE%\solidworks-mcp` (the GitHub ZIP when git is missing), or updates an existing copy. Started from `setup_windows.bat` inside a copy of the repository, it uses that folder as it is.
2. Finds a 64-bit Python 3.10+: the `py -0p` list, `py -3`, `python` on PATH, then `%LOCALAPPDATA%\Python\pythoncore-3.*`, `%LOCALAPPDATA%\Programs\Python\Python3*` and `%ProgramFiles%\Python3*`. It picks the newest of 3.10โ3.14, which numpy, scipy and pywin32 ship wheels for. Without one it offers to install Python 3.13 with winget (`-InstallPython` installs it without asking).
3. Creates a virtual environment in `.venv` inside the project folder (reuses a working one).
4. Installs `requirements.txt` (`mcp` 1.x, `pywin32`, `python-dotenv`, `Pillow`, `numpy`, `scipy`).
5. Self-test: starts the server over stdio, exactly like Claude Desktop does, and checks the MCP handshake and the tool list (52 tools).
6. Registers the `solidworks` server in Claude Desktop's config. Other servers and settings are kept, and a `claude_desktop_config.json.bak-date-time` backup is written before any change. The Microsoft Store (MSIX) config location is updated too.
7. If Claude Code (the `claude` CLI) is installed, registers the server with `claude mcp add --scope user` and copies the design skill to `~/.claude/skills/solidworks-design`. It also writes `dist\solidworks-design.zip` for uploading the skill to Claude Desktop / claude.ai.
8. Saves everything it printed to `setup_mcp.log`.
It is safe to run again; an existing registration shows `already up to date`. Options: `-InstallDir <path>`, `-InstallPython`, `-NoClaudeDesktop`, `-NoClaudeCode`, `-NoSkill`, `-Uninstall`; `setup_windows.bat` passes them on (e.g. `setup_windows.bat -Uninstall`).
### Manual setup
#### 1) Install the packages
```powershell
cd C:\path\to\Solidworks-MCP
py -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txt
```
#### 2) Claude Desktop
Open Claude โ Settings โ Developer โ **Edit Config** and add this under `mcpServers` in `claude_desktop_config.json`:
```json
{
"mcpServers": {
"solidworks": {
"command": "C:\\path\\to\\Solidworks-MCP\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\Solidworks-MCP\\solidworks_mcp_server.py"]
}
}
}
```
Config file locations:
- Standard install: `%APPDATA%\Claude\claude_desktop_config.json`
- Microsoft Store/MSIX install: `%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json`
Use the full path to the `.venv` interpreter rather than `"command": "python"`: `python` on PATH may be the Microsoft Store alias or a different Python without the packages. After saving, quit Claude from the tray and start it again.
#### 3) Claude Code
```powershell
claude mcp add --scope user solidworks -- "C:\path\to\Solidworks-MCP\.venv\Scripts\python.exe" "C:\path\to\Solidworks-MCP\solidworks_mcp_server.py"
claude mcp list
```
### Usage
1. Open SolidWorks first. If it is not running, `connect_solidworks` starts it and waits up to 120 seconds.
2. Ask Claude in plain language. Lengths are in mm unless you say otherwise.
Examples:
- "Connect to SolidWorks"
- "Create a new part, draw a 30 mm radius circle on the Top plane and extrude it 15 mm"
- "Draw a 100 ร 50 mm rectangle on the Front plane, extrude it 20 mm, then cut a 10 mm hole through the center"
- "List the features" / "List open documents" / "Show the active document info"
- "Save it as C:\work\bracket.SLDPRT"
- "Use execute_python to compute the volume and mass of this part"
Claude typically chains `create_sketch` โ `draw_*` โ `close_sketch` โ `extrude_sketch`. If a sketch is left open, `get_sketch_status` shows its state.
### Text-to-CAD workflow
A loop that lets the agent turn short or vague requests into a spec, then build, look and measure, and iterate quickly. It is sent to the agent in every session as the server instructions (`solidworks_mcp/instructions.md`); in Cowork the `solidworks-design` skill brings it in.
1. **Spec**: purpose, datums, protected interfaces, envelope, loads/motion, process and material in sufficient detail; no length cap. Every number gets a basis, in this order: [req] requirement or existing geometry > [std] standard > [calc] calculation > [cat] catalogue or user-verified MISUMI part > [dfm] process rule > [heur] rule of thumb > [neutral] a neutral value when nothing else applies (symmetry, 1:1, equal spacing, R10 preferred numbers, whole mm).
2. **Retrieve justified context**: `design_context(mode="quality")`; legacy search/get remain available.
3. **Build in stages**: one `execute_python` call per stage, parameters at the top of the script.
4. **Verify every stage**: `model_report` (errors, bodies, box, mass), sufficient orthographic/section/material `render_views`, `check_interference` for assemblies.
5. **Quality gate**: no rebuild errors, intended body count, dimensions match the spec, no unintended interference, process rules met, before moving on.
6. **Short report**: key dimensions with their basis, check numbers, at most 3 next options.
Quality before compression: retain numerical and visual evidence, sources and assumptions. Product improvement includes three alternatives, quantitative and aesthetic assessment, a review export and explicit user review. A legacy standard tag is not source verification. Details: [knowledge/agent-guide.md](knowledge/agent-guide.md); rationale rules: [knowledge/design-policy.md](knowledge/design-policy.md).
### Tool reference
Every tool that takes lengths also accepts an optional `unit` (mm, cm, m, inch, ft); when omitted, the default unit (mm) is used.
| Category | Tool | What it does | Main arguments |
|---|---|---|---|
| Connection | `connect_solidworks` | Connect to the running SolidWorks (starts it if needed) | - |
| Connection | `get_solidworks_info` | Installation info (version, path, templates) | - |
| Documents | `create_new_part` | New part | - |
| Documents | `create_new_assembly` | New assembly | - |
| Documents | `open_document` | Open a file | `filepath` (required) |
| Documents | `save_document` | Save (Save As when a path is given) | `filepath` |
| Documents | `close_document` | Close the active document | `save` (default false) |
| Documents | `get_document_info` | Active document name, path and type | - |
| Documents | `list_open_documents` | Open documents | - |
| Sketches | `create_sketch` | Start a sketch on a default plane | `plane`: Front / Top / Right |
| Sketches | `create_sketch_on_face` | Sketch on the face found at a 3D point | `x`, `y`, `z` |
| Sketches | `draw_line` | Line | `x1`, `y1`, `x2`, `y2` |
| Sketches | `draw_circle` | Circle | `x`, `y`, `radius` |
| Sketches | `draw_rectangle` | Rectangle from two corners | `x1`, `y1`, `x2`, `y2` |
| Sketches | `draw_arc` | Arc from center, radius and start/end angles (ยฐ) | `cx`, `cy`, `radius`, `start_angle`, `end_angle` |
| Sketches | `draw_polygon` | Regular polygon | `cx`, `cy`, `radius`, `sides` |
| Sketches | `close_sketch` | Exit the active sketch | - |
| Sketches | `get_sketch_status` | Sketch diagnostics | - |
| Features | `extrude_sketch` | Boss-extrude | `depth`, `both_directions` |
| Features | `cut_extrude` | Cut-extrude | `depth`, `through_all`, `both_directions` |
| Features | `fillet_edges` | Fillet the selected edges | `radius` |
| Features | `chamfer_edges` | Chamfer the selected edges | `distance`, `angle` |
| Features | `list_features` | Feature tree (name, type, suppressed) | - |
| Utilities | `set_units` | Change the default unit | `unit`: mm / cm / m / inch |
| Utilities | `execute_python` | Run Python with SolidWorks API access (helpers injected) | `code`, `report` |
| Verification | `model_report` | Active document summary: rebuild errors, features, bodies, bounding box (mm), volume, mass, material | - |
| Verification | `render_views` | One small labelled image of standard views (sketches/planes hidden, user's view restored) | `views`, `size` (default 384), `hide_references` |
| Verification | `export_model` | Save a copy as STEP, STL, 3MF, IGES, Parasolid, ... | `format` (default step), `path` |
| Verification | `check_interference` | Interference volumes (mmยณ) between assembly components | - |
| Verification | `verify_model` | Standard verification battery (V1 part, V2 assembly): fixed rows value/uncertainty/limit/pass, interference allowances, free and over-constrained components, other open windows, issue candidates | `targets`, `allow`, `parked` |
| Knowledge | `knowledge_search` | Search the design knowledge base (Korean or English keywords) | `query`, `limit` |
| Knowledge | `knowledge_get` | One section, a whole topic, or `index` | `id` |
| Gears | `gear_design` | Gear dimensions, profile shifts, centre distance, contact ratio, interference warnings (no CAD) | `kind`, `module`, `teeth` |
| Gears | `create_gear` | Build a gear as native features and check it (optionally with its mate and a mesh check) | `type`, `module`, `teeth`, `build_mate` |
| Optimization | `topology_optimize` | Start / poll a 2D or 3D topology optimization (stiffness, heat conduction with convection, combined) designed at 2 x maximum force and heat with joint checks, build the part from the result | `problem` or `tpd`, `job`, `build` |
`fillet_edges` and `chamfer_edges` work on edges that are already selected; select them in SolidWorks or with `execute_python`.
### Advanced: execute_python
For anything the basic tools do not cover (lofts, patterns, assembly mates, mass properties, image export, ...) use `execute_python` to call the SolidWorks API directly.
- Available names: `sw` (SldWorks.Application), `doc` (active document), `automation` (the server's SolidWorksAutomation object), `win32com`, `pythoncom`, `math`, `os`, `json`
- Injected helpers: `val`, `call`, `arr`, `strings`, `byref_int`, `byref_bool`, `select` (SelectByID2), `plane("front"/"top"/"right")` (localized plane names), `feats()`, `feat(name)`, `active()`, `report()`, `render(views)`, `store` (a dict kept between calls), `mm` (0.001), `deg` (ฯ/180)
- Whatever you `print()` and the value of `result` are returned. With `report: true` the model report is appended; `render()` attaches an image.
- The code runs as-is on this PC, so only use it with requests you trust.
SolidWorks 2025 is reached through late binding, which has a few COM pitfalls:
1. **Zero-argument members run as soon as you access them.** Adding `()` after members such as `GetTitle`, `GetType`, `FirstFeature`, `GetNextFeature` or `GetFirstDocument` raises "Member not found" or `'int' object is not callable`.
2. **If a method that takes arguments misbehaves**, call `obj._FlagAsMethod("MethodName")` before calling it.
3. **Pass numeric arrays** as `win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_R8, values)`.
4. **Localized SolidWorks** uses localized names for the default planes and origin (Korean: `์ ๋ฉด`, `์๋ฉด`, `์ฐ์ธก๋ฉด`, `์์ `). Use view IDs instead of view names, for example `doc.ShowNamedView2("", 7)` for isometric.
```python
P = dict(w=60.0, h=40.0, t=8.0) # w, h [req]; t [neutral, R10]
sm = doc.SketchManager
select(doc, plane("top"), "PLANE") # also finds the localized Top plane
call(sm, "InsertSketch", True)
call(sm, "CreateCenterRectangle", 0, 0, 0, P["w"] / 2 * mm, P["h"] / 2 * mm, 0)
call(sm, "InsertSketch", True)
result = report() # errors, bodies, box, mass
```
### Design knowledge base
The agent searches the Markdown notes in `knowledge/`. Notes are written in English to save tokens; Korean keywords are linked through tags and a search dictionary.
| Topic | File | Contents |
|---|---|---|
| Agent guide | `agent-guide.md` | workflow, token rules, quality gate, report format |
| Design policy | `design-policy.md` | basis ladder, neutral defaults (symmetry, 1:1, preferred numbers), safety factors, geometry defaults |
| Gears | `gears.md` | type selection; spur, helical, bevel, spiral bevel, worm, planetary formulas; strength; verified modeling recipe |
| Bearings | `bearings.md` | types, 68xx/69xx/60xx/62xx dimensions, life, fits, shoulders |
| Fasteners | `fasteners.md` | pitches and tap drills, ISO 273 holes, counterbores, engagement, torque, pins |
| Fits and tolerances | `fits-tolerances.md` | ISO 286 fit values, IT grades, ISO 2768, 3D printing allowances |
| Shafts and keys | `shafts-keys.md` | shaft sizing, key dimensions, retaining ring grooves, D-cuts |
| Materials | `materials.md` | metals, plastics and 3D printing materials |
| DFM | `dfm.md` | machining, sheet metal, injection moulding, FDM/SLA/SLS rules |
| Gear generators | `gear-generators.md` | create_gear types, frames, defaults and their basis, self-checks, assembly placement |
| Topology optimization | `topology-optimization.md` | problem spec in mm, thermal and combined modes, safety factor 2 on joints and critical features, automatic volume fraction, reading results, turning them into parts, machining-mode plan |
| API recipes | `solidworks-api.md` | verified SolidWorks API calls (sketches, lofts, sweeps, patterns, configurations, mates, checks, STL import) |
| Assembly guide | `assembly-guide.md` | assembly procedure A0-A8, mate/datum/pose rules, motion checks (solver or geometric poses), parking, closing windows, pitfall table |
| Design workflow | `design-workflow.md` | design-model-verify-triage flywheel, verification batteries V1-V6, time boxes, loop report format |
To add a note, put a `.md` file in `knowledge/` with the same layout (`title`, `tags`, `summary` at the top, `## ` sections) and restart Claude. Give a source (standard number, catalogue) for every value.
### Gear generators
`gear_design` (numbers only) and `create_gear` (native SolidWorks features) cover the common gear types. The type list follows the OpenSCAD library [chrisspen/gears](https://github.com/chrisspen/gears) (except herringbone bevels and racks with screw holes; planetary sets are computed with `gear_design` and built part by part), but that library is CC BY-NC-SA 3.0 (non-commercial, share-alike), so none of its code is used: everything is implemented from the standards (ISO 21771, ISO 53, Gleason/AGMA 2005, DIN 3975). Cycloidal and strain-wave drives are left out (buy them as units).
| type | Geometry | Method |
|---|---|---|
| `spur`, `helical`, `herringbone` | external spur, helical, herringbone | involute and trochoidal root generated by the ISO 53 rack, undercut included |
| `internal` | internal (ring) gear | involute with a circular root fillet |
| `rack` | spur or helical rack | ISO 53 basic rack, square ends also for helical racks |
| `bevel`, `spiral_bevel` | straight or spiral bevel | Tredgold section loft with guide curves, Gleason proportions |
| `worm`, `worm_wheel`, `worm_set` | ZA worm, worm wheel | helix sweep; wheel = throated helical approximation |
- Defaults and basis: 20 deg and ISO 53 A [std], backlash 0.04 m [heur], face width 10 m [heur], small pinions get the undercut limit x_min with a V-zero mate [std], ring rim d_f + 6 m [heur]. Results carry the basis tags.
- Self-checks: SolidWorks volume against the exact tooth-section area x face width (normally within 0.1 %), one body, no rebuild errors, helix hand confirmed by probing the material.
- `build_mate: true` builds the mating gear (opposite hand external, same hand internal) and rolls the pair through one pitch with temporary bodies. Measured: spur, helical, herringbone, internal and rack pairs 0 mmยณ; spiral bevel 0.03-0.09 mmยณ (Tredgold approximation); a same-hand helical pair shows 162 mmยณ, so wrong combinations are caught.
- Frames: axis +Z, z = 0 face on the Front plane, a tooth space centred on +X. Use `phase_deg` from the result to place pairs; details in the knowledge note `gear-generators`.
Example: "module 1.5, 18:36 spur pair, 8 mm bore with keyway" -> `create_gear {"type": "spur", "module": 1.5, "teeth": 18, "mate_teeth": 36, "build_mate": true, "bore": 8, "keyway": true}`
### Topology optimization
`topology_optimize` is a SIMP optimizer ported from [ToPy](https://github.com/williamhunter/topy) (MIT) to Python 3 + scipy: minimum compliance (maximum stiffness), compliant mechanisms, steady heat conduction (convection as film coefficients) and stiffness plus heat together, 2D plates and 3D. Fluid CFD is not included.
- **Safety factor 2**: loads (`loads`, joint `force`) and heat (`power_W`, `heat_W`) are maximum service values; analysis, preview and every check use 2 x (`safety_factor`, below 2 is an error).
- **Joints (`interfaces`)**: bolt (ISO 273 clearance), tapped hole (ISO 2306 tap drill), pin and pad. The hole is void, a ring of radius max(1.5 d, washer seat + one element) stays solid, and the hole-wall nodes act as support, load, heat source or sink. Results list per-joint utilisation: bolt shear and tension, bearing, tear-out, tapped-hole engagement (thread must not strip before the bolt yields).
- **Critical features (`critical`)** such as bearing seats and sealing faces always stay solid.
- **Checks**: stress screening (density >= 0.5, joints excluded) at the design load against yield, and peak temperature at the design heat against `max_temperature_C`. Verify the final CAD in SOLIDWORKS Simulation at the design loads.
- **`volume_fraction: "auto"`** bisects for the lightest volume fraction that passes the stress and temperature checks.
- Verification: the element matrices equal ToPy's SymPy definitions to machine precision, and the MBB beam reproduces Sigmund's 99-line code (first iteration to 1e-11, eight iterations to 1e-9).
- Problems are given in mm: `size`, `element_size`, `thickness`, `volume_fraction`, `supports`, `loads`, `keep_out` / `keep_in` (keep material around bolt holes, clear space for moving parts), `material`. ToPy `.tpd` files are accepted as they are.
- Runs as a background job; the call waits up to `wait` s, then poll with `job`. Results include iterations, volume fraction, compliance, load-point displacement (mm), mass and a preview image.
- `build: true`: a 2D result becomes splines along the 0.5-density contour extruded by the thickness (volume error 0.02 %); a 3D result is imported from STL as a mesh solid body (reference for remodelling).
- Speed (measured): 2D 120 x 60 elements about 4 s; 3D 40 x 20 x 10 elements about 0.7 s per iteration.
Example: left edge fixed, 1000 N at the middle of the right end, 40 % volume, 6 mm aluminium bracket ->
`{"problem": {"size": [120, 60], "element_size": 1, "thickness": 6, "volume_fraction": 0.4, "supports": [{"edge": "left"}], "loads": [{"at": [120, 30], "force": [0, -1000]}], "material": {"E": 70000, "density": 2.7}}, "build": true}`
### Configuration (config.json)
Edit `solidworks_mcp/config.json` to change behavior without touching code, then restart Claude.
| Key | Default | Description |
|---|---|---|
| `exe_path` | `"auto"` | Path to `SLDWORKS.exe`; `auto` reads the registry |
| `part_template`, `assembly_template`, `drawing_template` | `"auto"` | Templates for new documents |
| `startup_timeout` | `120` | Seconds to wait for SolidWorks to start |
| `connection_retry_interval` | `5` | Seconds between connection retries |
| `max_retries` | `3` | Connection retries |
| `default_unit` | `"mm"` | Default length unit |
| `log_level` | `"INFO"` | DEBUG, INFO, WARNING or ERROR |
| `log_file` | `"solidworks_mcp.log"` | Log file name (inside `solidworks_mcp`) |
| `default_extrude_depth`, `default_fillet_radius`, `default_chamfer_distance`, `default_circle_radius` | `10`, `2`, `2`, `25` | Values used when an argument is omitted (mm) |
### Troubleshooting
**The SolidWorks tools don't show up in Claude**
1. Quit Claude from the tray icon (Quit) and start it again.
2. Check the `solidworks` server under Settings โ Developer.
3. Look for `could not update` messages in `setup_mcp.log`.
4. Run the installer once more while Claude is closed.
5. Read Claude's MCP log: `%APPDATA%\Claude\logs\mcp-server-solidworks.log` (MSIX build: `%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\logs\`).
**`pip install -r requirements.txt` fails**: make sure you are using this repository's `requirements.txt` (no `asyncio-compat`, `mcp<2`).
**The server exits immediately and the log shows `'Server' object has no attribute 'list_tools'`**: mcp 2.x got installed. Run `.venv\Scripts\python.exe -m pip install "mcp>=1,<2"`.
**"Member not found" errors**: see the COM rules in [Advanced: execute_python](#advanced-execute_python). The built-in tools in this repository are already fixed.
**It can't connect**: check that SolidWorks is running and that no license or startup dialog is open. Run `get_solidworks_info` to see whether the installation is detected; if not, set `exe_path` in `config.json`.
**You moved the folder**: run `setup_windows.bat` again to update the paths.
### Updating and uninstalling
- Update: run the PowerShell line again, or `git pull` in your copy and run `setup_windows.bat` (installs new packages).
- Uninstall: run `setup_windows.bat -Uninstall` (or `install.ps1 -Uninstall`) in a command prompt; it removes the Claude Desktop and Claude Code registrations and the skill. Then delete the folder. Your pre-install config is in the `claude_desktop_config.json.bak-*` backup. A skill saved in your Claude account is removed in Claude's settings.
### Roadmap
SolidWorks support comes first. Order of work:
- [x] **Text-to-CAD verification loop**: `model_report`, `render_views`, `export_model`, `check_interference`, execute_python helpers
- [x] **Agent guide**: token rules and design-rationale rules (server instructions)
- [x] **Design knowledge base v1**: design policy, gears, bearings, fasteners, fits, shafts and keys, materials, DFM, API recipes
- [ ] **Parts database**: KS/ISO standard part tables plus MISUMI Korea part numbers registered by the user (the MISUMI site's robots.txt and terms forbid automated collection, so it is not crawled)
- [x] **Gear generators**: spur, helical, herringbone, internal, rack, straight and spiral bevel, worm and worm wheel (standard formulas, self-checked volume and mesh)
- [x] **Topology optimization**: 2D/3D stiffness and compliant mechanisms (ToPy port), 2D results as extruded parts
- [x] **Thermal and combined topology optimization**: heat conduction with convection films, design at 2 x maximum force and heat, automatic joint handling and checks, automatic volume fraction
- [x] **Standard verification and workflow**: `verify_model` (V1 part, V2 assembly), assembly guide, design-model-verify flywheel
- [ ] **Machining optimization mode**: 2.5D milling, tool radius, wall and floor thickness constraints (survey done; plan in `topology-optimization.md`)
- [ ] **Planetary assembly placement** and help with remodelling 3D optimization results
Heat conduction (convection as film coefficients) is now built in with its own FE. Fluid CFD (SOLIDWORKS Flow Simulation) stays out of scope because its results were not trusted enough.
### Project structure
```
Solidworks-MCP/
โโโ install.ps1 # one-line installer (irm ... | iex): gets the code, finds Python, runs setup_mcp.py
โโโ setup_windows.bat # one-click installer (double-click; runs install.ps1)
โโโ setup_mcp.py # installer logic: .venv, packages, self-test, Claude Desktop and Claude Code registration, skill
โโโ skills/solidworks-design/ # Claude skill: design working rules (for clients such as Cowork that do not pass server instructions on)
โโโ solidworks_mcp_server.py # MCP server entry point
โโโ requirements.txt
โโโ knowledge/ # design knowledge base (Markdown notes)
โโโ solidworks_mcp/
โ โโโ server.py # MCP tool definitions and handlers
โ โโโ instructions.md # working rules sent to the agent in every session
โ โโโ verification.py # model_report, render_views, export_model, check_interference
โ โโโ knowledge.py # knowledge base search
โ โโโ com.py # late-binding COM helpers (val, call, arr, plane, ...)
โ โโโ gears/ # gears: geometry (involute), bevel, build (SolidWorks), api (tool arguments)
โ โโโ topopt/ # topology optimization (ToPy port + heat): problem, topology, physics (heat, stress, joints), export, run, cad
โ โโโ tests/ # gear, optimizer and installer unit tests (python -m unittest solidworks_mcp.tests.test_gears ...)
โ โโโ config.py, config.json # configuration
โ โโโ constants.py # SolidWorks constants
โ โโโ automation/ # base (connection), documents, sketches, features
โ โโโ utils/ # unit conversion, SolidWorks detection
โโโ scripts/ # VBS examples from the original project
โโโ solidworks_com.py, solidworks_simulation.py # earlier scripts from the original project
โโโ DEVELOPMENT_ROADMAP.md # the original project's development plan
```
### License and credits
MIT License ([LICENSE](LICENSE)). Original project: [alisamsam/Solidworks-MCP](https://github.com/alisamsam/Solidworks-MCP) by Samsaam Ali Baig. Please keep the original copyright notice and license text.
The topology optimization code (`solidworks_mcp/topopt/`) is a port of [ToPy](https://github.com/williamhunter/topy) by William Hunter (MIT); the full license is in `solidworks_mcp/topopt/LICENSE_TOPY.md`. ToPy's 2D part is based on Ole Sigmund's 99-line code. The gear generators do not use code from chrisspen/gears (CC BY-NC-SA 3.0).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues