Skip to main content
Glama

CAD-MCP Server

CAD-MCP服务器(CAD模型控制协议服务器)

English |中文

项目介绍

CAD-MCP 是一项创新的 CAD 控制服务,允许通过自然语言指令控制 CAD 软件进行绘图操作。该项目结合了自然语言处理和 CAD 自动化技术,使用户能够通过简单的文本命令创建和修改 CAD 图纸,而无需手动操作 CAD 界面。

特征

CAD 控制功能

  • 支持多种CAD软件:支持主流CAD软件,包括AutoCAD、GstarCAD(GCAD)、ZWCAD
  • 基本绘图功能
    • 线条画
    • 圆形绘图
    • 圆弧绘制
    • 矩形绘制
    • 折线绘制
    • 文本添加
    • 图案填充
    • 尺寸标注
  • 图层管理:创建和切换图层
  • 图形保存:将当前图形保存为 DWG 文件

自然语言处理功能

  • 命令解析:将自然语言指令解析为CAD操作参数
  • 颜色识别:从文本中提取颜色信息并将其应用于绘图对象
  • 形状关键词映射:支持各种形状描述词的识别
  • 动作关键字映射:识别各种绘图和编辑动作

演示

以下是演示视频。

演示

安装要求

依赖项

pywin32>=228 # Windows COM interface support mcp>=0.1.0 # Model Control Protocol library pydantic>=2.0.0 # Data validation typing>=3.7.4.3 # Type annotation support

系统要求

  • Windows操作系统
  • 已安装的 CAD 软件(AutoCAD、GstarCAD 或 ZWCAD)

配置

配置文件位于src/config.json ,包含以下主要设置:

{ "server": { "name": "CAD MCP Server", "version": "1.0.0" }, "cad": { "type": "AutoCAD", "startup_wait_time": 20, "command_delay": 0.5 }, "output": { "directory": "./output", "default_filename": "cad_drawing.dwg" } }
  • server :服务器名称和版本信息
  • 计算机辅助设计
    • type :CAD 软件类型(AutoCAD、GCAD、GstarCAD 或 ZWCAD)
    • startup_wait_time :CAD启动等待时间(秒)
    • command_delay :命令执行延迟(秒)
  • 输出:输出文件设置

用法

启动服务

python src/server.py

克劳德桌面和风帆冲浪

# add to claude_desktop_config.json. Note: use your path { "mcpServers": { "CAD": { "command": "python", "args": [ # your path, e.g.: "C:\\cad-mcp\\src\\server.py" "~/server.py" ] } } }

光标

# Add according to the following diagram Cursor MCP. Note: use your path

光标配置

注:新版cursor也改为JSON配置,请参考上一节

MCP 检查器

# Note: use your path npx -y @modelcontextprotocol/inspector python C:\\cad-mcp\\src\\server.py

服务 API

服务端提供的主要API函数如下:

  • draw_line :画一条线
  • draw_circle :画一个圆圈
  • draw_arc :绘制圆弧
  • draw_polyline :绘制折线
  • draw_rectangle :绘制矩形
  • draw_text :添加文本
  • draw_hatch :绘制阴影图案
  • add_dimension :添加线性维度
  • save_drawing :保存绘图
  • process_command :处理自然语言命令

项目结构

CAD-MCP/ ├── imgs/ # Images and video resources │ └── CAD-mcp.mp4 # Demo video ├── requirements.txt # Project dependencies └── src/ # Source code ├── __init__.py # Package initialization ├── cad_controller.py # CAD controller ├── config.json # Configuration file ├── nlp_processor.py # Natural language processor └── server.py # Server implementation

执照

MIT 许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

实现通过自然语言指令控制CAD软件(AutoCAD、GstarCAD、ZWCAD),用户无需手动操作CAD界面即可创建和修改图纸。

  1. 项目介绍
    1. 特征
      1. CAD 控制功能
      2. 自然语言处理功能
    2. 演示
      1. 安装要求
        1. 依赖项
        2. 系统要求
      2. 配置
        1. 用法
          1. 启动服务
          2. 克劳德桌面和风帆冲浪
          3. 光标
          4. MCP 检查器
          5. 服务 API
        2. 项目结构
          1. 执照

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              This repository is a FreeCAD MCP that allows you to control FreeCAD from Claude Desktop.
              Last updated -
              10
              148
              Python
              MIT License
              • Apple
              • Linux
            • -
              security
              F
              license
              -
              quality
              A server that enables natural language interaction with AutoCAD through large language models like Claude, allowing users to create and modify drawings using conversational commands.
              Last updated -
              19
              Python
              • Apple
            • -
              security
              F
              license
              -
              quality
              Allows interaction with Sketchfab's 3D model platform through Claude or Cursor, enabling users to search, view details, and download 3D models directly from the AI interface.
              Last updated -
              13
              14
              JavaScript
            • A
              security
              A
              license
              A
              quality
              Integration that connects Sketchup to Claude AI through the Model Context Protocol, allowing Claude to directly interact with and control Sketchup for prompt-assisted 3D modeling, scene creation, and manipulation.
              Last updated -
              10
              4
              MIT License
              • Apple

            View all related MCP servers

            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/daobataotie/CAD-MCP'

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