CAD-MCP Server (CAD Model Control Protocol Server)

by daobataotie

442 stars
2k downloads
Not rated
GitHub

About

Control CAD software with natural language instructions to perform drawing operations.

Details

Author
daobataotie
GitHub stars
442
Downloads
1,998
Categories
Other, AI, Developer Tools, Design

- Supports AutoCAD, GstarCAD (GCAD), and ZWCAD
- Basic drawing functions: line, circle, arc, rectangle, polyline, text, hatch, dimension
- Layer management: create and switch layers
- Save drawings as DWG files
- Natural language command parsing with color and shape keyword mapping

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name CAD-MCP Server (CAD Model Control Protocol Server)
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the required Python dependencies (pywin32, mcp, pydantic, typing) and configure the src/config.json file specifying the CAD software type, startup wait time, and command delay. Start the service with python src/server.py. Integrate with Claude Desktop, Windsurf, or Cursor by adding the server to their MCP configuration, or test with MCP Inspector using the provided npx command. The server exposes API functions such as draw_line, draw_circle, draw_text, and save_drawing.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "cad-mcp server (cad model control protocol server)": {
            "CAD-MCP": {
                "command": "npx",
                "args": [
                    "-y",
                    "@modelcontextprotocol/inspector",
                    "python",
                    "C:\\cad-mcp\\src\\server.py"
                ]
            }
        }
    }
}

McpServers

{
    "CAD-MCP": {
        "command": "npx",
        "args": [
            "-y",
            "@modelcontextprotocol/inspector",
            "python",
            "C:\\cad-mcp\\src\\server.py"
        ]
    }
}

CAD-MCP Server (CAD Model Context Protocol Server)

English | 中文

Project Introduction

CAD-MCP is an innovative CAD control service that allows controlling CAD software for drawing operations through natural language instructions. This project combines natural language processing and CAD automation technology, enabling users to create and modify CAD drawings through simple text commands without manually operating the CAD interface.

Features

CAD Control Functions

- Multiple CAD Software Support: Supports mainstream CAD software including AutoCAD, GstarCAD (GCAD) and ZWCAD
- Basic Drawing Functions:
- Line drawing
- Circle drawing
- Arc drawing
- Rectangle drawing
- Polyline drawing
- Text addition
- Pattern filling
- Dimension annotation
- Layer Management: Create and switch layers
- Drawing Save: Save the current drawing as a DWG file

Natural Language Processing Functions

- Command Parsing: Parse natural language instructions into CAD operation parameters
- Color Recognition: Extract color information from text and apply it to drawing objects
- Shape Keyword Mapping: Support recognition of various shape description words
- Action Keyword Mapping: Recognize various drawing and editing actions

Demo

The following is the demo video.

Demo

Installation Requirements

Dependencies

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

System Requirements

- Windows operating system
- Installed CAD software (AutoCAD, GstarCAD, or ZWCAD)

Configuration

The configuration file is located at src/config.json and contains the following main settings:

{
    "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: Server name and version information
- cad:
- type: CAD software type (AutoCAD, GCAD, GstarCAD, or ZWCAD)
- startup_wait_time: CAD startup waiting time (seconds)
- command_delay: Command execution delay (seconds)
- output: Output file settings

Usage

Starting the Service

python src/server.py

Claude Desktop & Windsurf

# 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"
            ]
        }
    }
}

Cursor

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

Note:The new version of cursor has also been changed to JSON configuration, please refer to the previous section

MCP Inspector

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

Service API

The server provides the following main API functions:

- draw_line: Draw a line
- draw_circle: Draw a circle
- draw_arc: Draw an arc
- draw_polyline: Draw a polyline
- draw_rectangle: Draw a rectangle
- draw_text: Add text
- draw_hatch: Draw a hatch pattern
- add_dimension: Add linear dimension
- save_drawing: Save the drawing
- process_command: Process natural language commands

Project Structure

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

License

MIT License

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.