AI Personal Learning
and practical guidance
CyberKnife Drawing Mirror

CAD-MCP: MCP services for controlling CAD software through natural language commands

General Introduction

CAD-MCP is an open source project that allows users to control CAD software drawing operations through natural language commands. It combines natural language processing and CAD automation technology , so that users do not need to manually operate the CAD interface , just enter simple text commands to create and modify drawings . The project supports many major CAD software such as AutoCAD, GstarCAD and ZWCAD, which is suitable for engineering design and architectural drawing fields.CAD-MCP runs in Python environment and interacts with CAD software through Model Control Protocol (MCP). Users can start the server and send commands to quickly complete the drawing tasks, simplifying the operation process and improving efficiency.

CAD-MCP: MCP services for controlling CAD software through natural language commands-1


 

Function List

  • Supports natural language commands, parsing user input and translating it into CAD commands.
  • Compatible with a wide range of CAD software including AutoCAD, GstarCAD and ZWCAD.
  • Provides basic drawing functions such as drawing lines, circles, arcs, rectangles and polylines.
  • Supports layer management, allowing users to create, modify and switch layers.
  • Automatically saves the drawing file to the specified directory, the default format is .dwgThe
  • Support color recognition, users can set the graphic color by text description.
  • Provides a voice command function that allows control of the drawing via voice input.
  • Simplified CAD operation for users unfamiliar with the CAD interface.

 

Using Help

Installation process

CAD-MCP needs to run under Python environment, Python 3.7 or above is recommended. The following are the detailed installation steps:

  1. Cloning Project Warehouse
    Run the following command in the terminal to download the CAD-MCP source code:

    git clone https://github.com/daobataotie/CAD-MCP.git
    cd CAD-MCP
  1. Creating a Virtual Environment
    To avoid dependency conflicts, it is recommended to create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # Linux/macOS
    venv\Scripts\activate     # Windows
    
  2. Installation of dependencies
    Project dependencies include pywin32,mcp,pydantic etc., run the following command to install it:

    pip install -r requirements.txt
    

    assure requirements.txt The dependency versions listed in the pywin32>=228 cap (a poem) mcp>=0.1.0The

  3. Configuring CAD Software
    Ensure that supported CAD software (such as AutoCAD) is installed. In the src/config.json Configure the CAD type and parameters in the

    {
    "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"
    }
    }
    
    • type: Set the CAD software type, e.g. AutoCAD,GstarCAD maybe ZWCADThe
    • startup_wait_time: CAD software startup wait time in seconds.
    • command_delay: Command execution interval (seconds).
    • directory cap (a poem) default_filename: Sets the output file path and default file name.
  4. Start the server
    go into src directory, run the server script:

    python server.py
    

    When the server starts, it listens for natural language commands.

Usage

  1. Send natural language commands
    Once the server is running, users can use the MCP client (e.g., the Claude Desktop or Cursor) to send commands. For example:

    • Entering "Draw a rectangle" creates a rectangle in the CAD software.
    • Entering "Switch Layer to Layer1" changes the current layer.
    • Entering "Save Drawing" will save the drawing to the configured output directory.
  2. voice control
    CAD-MCP supports voice input. Make sure the device has a microphone, and when the voice function is enabled, the user can say "draw a circle" or "set the color to red", which will be parsed and executed by the server.
  3. Managing layers and colors
    Layers can be managed with commands such as "Create a new layer called FloorPlan" or "Switch to FloorPlan layer". Color settings support descriptive commands such as "Set rectangle color to blue".
  4. Save and Export
    When the drawing is finished, the command "Save Drawing" will automatically save the file as .dwg format to a specified directory. Users can specify the format in the config.json Modify the output path in the

Featured Function Operation

  • natural language parsing (NLP): CAD-MCP uses NLP technology to parse commands. Users do not need to learn CAD commands, they just need to describe their needs in everyday language. For example, "Draw a straight line 10 meters long" is automatically converted into a CAD command.
  • Multi-software support: The project is compatible with a wide range of CAD software and the user only needs to switch between the profiles. type It can be adapted to different software.
  • automated drawing: Execute drawing tasks in batches with commands. For example, "Draw 5 equally spaced circles" generates multiple shapes quickly.

Integration into other tools

CAD-MCP can be integrated with MCP compatible tools such as Claude Desktop. Editing Profiles claude_desktop_config.json::

{
"mcpServers": {
"CAD": {
"command": "python",
"args": ["path/to/CAD-MCP/src/server.py"]
}
}
}

interchangeability path/to is the actual path. Once saved, Claude Desktop can send the command directly to the CAD-MCP server.

caveat

  • Ensure that the CAD software is properly installed and operational.
  • The first time you start the server may be delayed due to slow loading of the CAD software, it is recommended to set a reasonable startup_wait_timeThe
  • The voice function requires a stable network and microphone equipment.
  • probe config.json in the path and parameters to avoid file saving or software call errors.

 

application scenario

  1. Architectural Design Rapid Prototyping
    Architects can quickly create floor plans using natural language commands. For example, typing "draw a 5x10 meter rectangular room and add 4 windows" generates a sketch that is suitable for initial design verification.
  2. Engineering drawing automation
    Mechanical engineers can use CAD-MCP to draw parts in batches. For example, the command "Draw 10 circles 5 cm in diameter at 2 cm intervals" quickly generates repetitive drawings.
  3. CAD Teaching Aids
    Students can learn CAD operations through voice or text commands, reducing the learning curve. For example, typing "draw a triangle" visualizes the drawing process.
  4. Designed for non-professional users
    Users unfamiliar with the CAD interface can complete their drawings with simple commands. For example, a home designer can type "draw a living room layout" to generate a basic drawing.

 

QA

  1. What CAD software does CAD-MCP support?
    Support for AutoCAD, GstarCAD and ZWCAD. config.json Configure the software type in the
  2. How do I use the voice feature?
    Ensure that the microphone is working properly, start the server and enable voice mode. Speak commands directly, such as "Draw a square", and the server will parse them automatically.
  3. What if the installation fails?
    Check that the Python version (3.7+ recommended), dependencies are fully installed, and that the config.json in the path is correct. Refer to the TROUBLESHOOTING.mdThe
  4. Can I customize the output file format?
    The default is saved as .dwg Formats. Users can modify CAD software settings or script code to support other formats.
May not be reproduced without permission:Chief AI Sharing Circle " CAD-MCP: MCP services for controlling CAD software through natural language commands
en_USEnglish