Skip to main content
Glama
DongZiJie1

SolidWorks MCP Server

by DongZiJie1

SolidWorks MCP Server

通过 MCP 协议连接 Claude Code 和 SolidWorks,实现自然语言控制 SolidWorks 画图。

工作原理

用户自然语言 → Claude Code → MCP Server → SolidWorks COM API → 3D 模型

Related MCP server: SolidWorks MCP Server

环境要求

  • Windows 10/11

  • SolidWorks 2020 或更高版本

  • Python 3.10+

  • Claude Code CLI

安装步骤

1. 克隆项目

git clone <your-repo-url>
cd solidworks-mcp

2. 安装依赖

pip install -r requirements.txt

3. 配置 Claude Code

在项目根目录创建 .claude/settings.json

{
  "mcpServers": {
    "solidworks": {
      "command": "python",
      "args": ["-m", "server.mcp_server"],
      "cwd": "<项目绝对路径>"
    }
  }
}

或者在全局配置 ~/.claude/settings.json 中添加同样的配置。

使用方法

1. 启动 SolidWorks

确保 SolidWorks 已经打开。

2. 启动 Claude Code

claude

3. 开始对话

直接用自然语言描述你要画什么:

基础操作:

  • "帮我创建一个新零件"

  • "在前视基准面画一个 100x50 的矩形"

  • "拉伸 30mm"

  • "保存到 D:\models\test.sldprt"

进阶操作:

  • "画一个直径 50 高 80 的圆柱"

  • "在顶面开一个直径 10 的通孔"

  • "对所有边做半径 5 的圆角"

  • "把这个特征镜像到右边"

复合操作:

  • "画一个 100x50x30 的长方体,在顶面中心开一个直径 8 的通孔,然后对所有边做圆角"

支持的 MCP Tools

Tool

功能

sw.new_part

创建新零件

sw.new_assembly

创建新装配体

sw.new_drawing

创建新工程图

sw.open

打开现有文档

sw.save

保存文档

sw.export_step

导出 STEP

sw.close

关闭文档

sw.new_sketch

创建草图

sw.draw_line

画线段

sw.draw_circle

画圆

sw.draw_arc

画弧

sw.draw_rectangle

画矩形

sw.draw_center_rectangle

画中心矩形

sw.draw_polygon

画正多边形

sw.exit_sketch

退出草图

sw.extrude

拉伸凸台

sw.cut_extrude

拉伸切除

sw.revolve

旋转

sw.fillet

圆角

sw.chamfer

倒角

sw.shell

抽壳

sw.mirror

镜像

sw.linear_pattern

线性阵列

sw.circular_pattern

圆周阵列

sw.add_plane

创建基准面

sw.add_axis

创建基准轴

sw.delete_feature

删除特征

sw.undo

撤销

sw.add_dimension

尺寸标注

sw.zoom_to_fit

缩放至适合

sw.rebuild

重建模型

sw.get_model_info

获取模型信息

sw.list_features

列出特征

故障排除

无法连接 SolidWorks

  1. 确保 SolidWorks 已启动

  2. 检查 SolidWorks 版本是否支持 COM 自动化

  3. 以管理员权限运行 Python

MCP Server 启动失败

  1. 检查 Python 版本:python --version

  2. 检查依赖是否安装:pip list | grep mcp

  3. 检查 cwd 路径是否正确

操作执行失败

  1. 检查草图是否封闭

  2. 检查尺寸参数是否合理

  3. 使用 sw.get_model_info 查看当前状态

开发

项目结构

solidworks-mcp/
├── .claude/skills/solidworks.md   # Skill 定义
├── server/
│   ├── __init__.py
│   ├── mcp_server.py              # MCP Server 入口
│   └── sw_api.py                  # SolidWorks COM 封装
├── requirements.txt
├── pyproject.toml
└── README.md

扩展新功能

  1. sw_api.py 中添加新的 API 方法

  2. mcp_server.py 中注册对应的 MCP tool

  3. .claude/skills/solidworks.md 中更新操作指南

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    Connect Claude AI to Dassault Systemes CATIA V5 via the Model Context Protocol (MCP). Drive CATIA V5 CAD modeling from Claude Desktop or Claude Code using natural language.
    62
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    Enables Claude to create and manipulate SolidWorks CAD models through natural language commands, automating part creation, sketching, and extrusion.
    8
  • A
    license
    -
    quality
    C
    maintenance
    Enables AI (e.g., Claude) to control SolidWorks via natural language, automating part creation, sketching, and feature operations through the Model Context Protocol.
    1
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    Enables connecting MCP clients to local SolidWorks for automated 3D part creation, template generation, file export, and basic review via natural language.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

  • Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DongZiJie1/solidworks-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server