VS

vespo92/solidworksmcp-ts

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

258 stars 51 forks 质量 82 趋势 9MIT

vespo92/solidworksmcp-ts 是从 https://github.com/vespo92/solidworksmcp-ts. 导入的 MCP 服务器候选

概览

vespo92/solidworksmcp-ts 是从 https://github.com/vespo92/solidworksmcp-ts. 导入的 MCP 服务器候选

概述(AI 翻译)

一个Node.js MCP服务器,通过COM互操作实现SolidWorks自动化。将AI助手(如Claude Desktop等)连接到SolidWorks,用于CAD自动化任务。

项目状态:Alpha / 实验

该项目正在积极开发中。虽然架构已建成,基本操作(草图平面、简单拉伸)已演示,大多数工具尚未在实时SolidWorks实例中进行验证。预计会出现粗糙的边缘、COM的怪癖和功能不完整。非常欢迎贡献和测试报告。

工作原理

服务器将SolidWorks操作作为stdio上的MCP工具暴露。智能路由层解决了Node.js COM桥梁的一个关键限制:参数为13+的方法常因直接COM调用而失败。

  • 简单操作(12参数或更少)- 通过winax进行直接COM调用。
  • 复杂操作(13+参数) - 由SolidWorks执行的自动生成VBA宏
  • 操作失败 - 带有错误上下文的自动退回

先修条件

  • Windows 10/11(必备 - COM 互操作仅限 Windows)
  • SolidWorks 2021-2025(授权,已安装)
  • Node.js 20+
  • 一个兼容MCP的客户端(如Claude Desktop等)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

SolidWorks MCP Server

A Node.js MCP server for automating SolidWorks via COM interop. Connects AI assistants (Claude Desktop, etc.) to SolidWorks for CAD automation tasks.

Project Status: Alpha / Experimental

This project is under active development. While the architecture is in place and basic operations (sketch planes, simple extrusions) have been demonstrated, most tools have not been validated against a live SolidWorks instance. Expect rough edges, COM quirks, and incomplete functionality. Contributions and testing reports are very welcome.

How It Works

The server exposes SolidWorks operations as MCP tools over stdio. An intelligent routing layer handles a key limitation of Node.js COM bridges: methods with 13+ parameters often fail via direct COM calls.

  • Simple operations (12 params or fewer) - Direct COM call via winax
  • Complex operations (13+ params) - Auto-generated VBA macro executed by SolidWorks
  • Failed operations - Automatic fallback with error context

Prerequisites

  • Windows 10/11 (required - COM interop is Windows-only)
  • SolidWorks 2021-2025 (licensed, installed)
  • Node.js 20+
  • An MCP-compatible client (Claude Desktop, etc.)

Installation

git clone https://github.com/vespo92/SolidworksMCP-TS.git
cd SolidworksMCP-TS

# Install dependencies (compiles winax native module for your system)
npm install

# Build TypeScript
npm run build

Note: The winax native module must be compiled locally on each Windows machine. Global npm installation does not work.

Configure Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "solidworks": {
      "command": "node",
      "args": ["C:/path/to/SolidworksMCP-TS/dist/index.js"],
      "env": {
        "SOLIDWORKS_PATH": "C:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS",
        "ADAPTER_TYPE": "winax-enhanced"
      }
    }
  }
}

Available Tools

The server registers tools across these categories:

Category Tools Status
Modeling create_part, create_extrusion, create_revolve, create_sweep, create_loft, create_fillet, create_chamfer, etc. Partially tested
Sketch create_sketch, add_line, add_circle, add_rectangle, add_arc, add_constraints, dimension_sketch Basic ops verified
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "solidworks": { "command": "node", "args": ["C:/path/to/SolidworksMCP-TS/dist/index.js"], "env": { "SOLIDWORKS_PATH": "C:\\Program Files\\SOLIDWORKS Corp\\SOLIDWORKS", "ADAPTER_TYPE": "winax-enhanced" } } } }