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.
Watch the demo video to see CAD-MCP in action:
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
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"
}
}
python src/server.py
Add the following to claude_desktop_config.json
:
{
"mcpServers": {
"CAD": {
"command": "python",
"args": ["~/server.py"]
}
}
}
Configure Cursor MCP as shown:
npx -y @modelcontextprotocol/inspector python C:\\cad-mcp\\src\\server.py
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
.
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
This project is licensed under the MIT License.
CAD-MCP Server combines AI, CAD, and natural language processing to revolutionize CAD automation. Explore its capabilities and integrate it into your workflow today!