Get the FREE Ultimate OpenClaw Setup Guide →

CAD

CAD MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio daobataotie-cad-mcp python src/server.py

How to use

The CAD-MCP Server provides a natural-language driven interface to control supported CAD software (AutoCAD, GCAD, and ZWCAD) through the MCP (Model Context Protocol) framework. It parses NL instructions into CAD operation parameters and executes drawing actions such as lines, circles, arcs, rectangles, polylines, text, hatch patterns, and dimensions. It also handles layer management and can save the current drawing to a DWG file. The server exposes a set of API actions like draw_line, draw_circle, draw_arc, draw_polyline, draw_rectangle, draw_text, draw_hatch, add_dimension, save_drawing, and process_command for natural language instructions. You can connect via an MCP client (e.g., Claude Desktop or MCP Inspector) by configuring the CAD MCP server under your mcpServers section and pointing the client to run the server script (src/server.py) with Python.

To use, start the service and issue commands either programmatically through the MCP protocol or via the MCP Inspector tooling. For example, you can call draw_line with start and end coordinates, or use process_command to provide a natural language request like “draw a blue line from (0,0) to (100,50) on Layer1” and the server will interpret and execute it on the active CAD session. The server also supports extracting color information and shape keywords from text to influence the resulting drawing.

How to install

Prerequisites:

  • Python 3.8+ installed on Windows (as the README specifies Windows-oriented COM interface, but Python itself is cross-platform).
  • CAD software installed (AutoCAD, GCAD, or ZWCAD) and accessible via COM/automation.
  • Internet access to install Python packages if needed.
  1. Create or clone the CAD-MCP repository and navigate to the project root.

  2. Install required Python packages listed in the project dependencies. If a requirements.txt exists, run:

pip install -r requirements.txt
  1. Ensure your CAD software is installed and accessible for automation. Open the CAD application manually at least once to complete any first-run setup (license initialization, COM registration).

  2. Optional: customize the configuration. The configuration file is located at src/config.json. You may adjust the CAD type (AutoCAD, GCAD, GstarCAD, or ZWCAD), startup wait time, command delay, and output settings as needed.

  3. Start the MCP server:

python src/server.py
  1. Connect with an MCP client. For Claude Desktop, configure the mcpServers entry to point to the Python server script, for example:
{
  "mcpServers": {
    "CAD": {
      "command": "python",
      "args": [
        "src/server.py"
      ]
    }
  }
}
  1. Use the MCP API functions (draw_line, draw_circle, draw_arc, draw_polyline, draw_rectangle, draw_text, draw_hatch, add_dimension, save_drawing, process_command) to interact with the CAD software via natural language or explicit CAD parameters.

Additional notes

Tips and notes:

  • The CONFIG options under cad.type allow choosing AutoCAD, GCAD, GstarCAD, or ZWCAD. Ensure the selected CAD is installed and compatible with COM automation.
  • The startup_wait_time and command_delay in src/config.json help manage timing for CAD startup and command execution; adjust if you experience timing issues on slower machines.
  • If using the MCP Inspector or Claude Desktop, follow the examples in the README for configuring the mcpServers block to point to your Python server script.
  • When saving drawings, ensure the output directory exists or the server has permission to create it. The default filename is cad_drawing.dwg as shown in the configuration.
  • If you encounter COM-related errors on Windows, verify that your user account has appropriate permissions and that the CAD application is registered for automation (you may need to run a repair install or re-register the COM components).
  • Color recognition and shape keyword mapping are supported to translate natural language inputs into drawing attributes; provide explicit color terms and shapes to improve accuracy.

Related MCP Servers

Sponsor this space

Reach thousands of developers