daobataotie_cad_mcp

daobataotie_cad_mcp

by daobataotie
A server that enables CAD software control through natural language commands, supporting AutoCAD, GstarCAD, and ZWCAD.

CAD Model Control Protocol Server: Automating CAD with Natural Language

Overview

The CAD Model Control Protocol (CAD-MCP) Server is an innovative tool that bridges the gap between natural language processing and CAD automation. It enables users to control CAD software for drawing operations through simple text commands, eliminating the need for manual interface interactions. This project supports popular CAD software like AutoCAD, GstarCAD, and ZWCAD, making it a versatile solution for CAD automation.

Key Features

CAD Control Functions

  • Multi-CAD Support: Compatible with AutoCAD, GstarCAD, and ZWCAD.
  • Drawing Operations:
  • Line, circle, arc, rectangle, and polyline drawing.
  • Text addition, pattern filling, and dimension annotation.
  • Layer Management: Create and switch layers effortlessly.
  • Drawing Save: Save drawings as DWG files.

Natural Language Processing

  • Command Parsing: Converts natural language instructions into CAD operation parameters.
  • Color Recognition: Extracts and applies color information from text.
  • Shape & Action Mapping: Recognizes various shape descriptions and drawing actions.

Demo

Watch the demo video to see CAD-MCP in action:
Demo

Installation

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 (src/config.json) includes the following 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"
    }
}

Usage

Starting the Service

python src/server.py

Integration with Claude Desktop & Windsurf

Add the following to claude_desktop_config.json:

{
    "mcpServers": {
        "CAD": {
            "command": "python",
            "args": ["~/server.py"]
        }
    }
}

Cursor Integration

Configure Cursor MCP as shown:
Cursor config

MCP Inspector

npx -y @modelcontextprotocol/inspector python C:\\cad-mcp\\src\\server.py

API Functions

The server provides APIs for various operations, including:
- draw_line, draw_circle, draw_arc, draw_polyline, draw_rectangle.
- draw_text, draw_hatch, add_dimension, save_drawing, process_command.

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

This project is licensed under the MIT License.

About

CAD-MCP Server combines AI, CAD, and natural language processing to revolutionize CAD automation. Explore its capabilities and integrate it into your workflow today!

Features & Capabilities

Categories
mcp_server model_context_protocol python cad natural_language_processing api_integration automation

Implementation Details

Stats

0 Views
9 GitHub Stars

Repository Info

daobataotie Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300