CAD-MCP Server
Enables controlling AutoCAD through natural language instructions to perform drawing operations including line, circle, arc, rectangle, polyline drawing, text addition, pattern filling, dimension annotation, layer management, and saving drawings as DWG files.
Uses Pydantic for data validation when processing natural language commands and CAD operation parameters.
Runs as a Python-based server that can be configured to work with various CAD applications, processing natural language commands into CAD operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CAD-MCP Serverdraw a circle with radius 5 at coordinates 10,10"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CAD-MCP Server (CAD Model Context Protocol Server)
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.
Version 2.0 is fully upgraded based on the latest MCP specification (FastMCP, structured output, tool annotations, progress notifications, Streamable HTTP), and adds 35 tools in total covering querying, editing, layers, drawing management, blocks, and command passthrough — forming a complete "draw → inspect → correct" feedback loop.
Related MCP server: CAD-MCP
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
Ellipse drawing
Rectangle drawing
Polyline drawing
Text addition
Pattern filling
Dimension annotation
Query Functions (the AI can see the actual drawing content):
List all layers
List entities in model space (returns editable entity handles)
Query detailed entity properties by handle (coordinates/radius/text content, etc.)
Screenshot of the CAD window for preview
Editing Functions: erase, move, rotate, scale, copy, mirror, offset, array (linear/polar), undo/redo
Layer Management: Create and switch layers, query layer states
Drawing Management: New / open / close / save drawings (DWG/DXF)
Block Operations: Create, insert, and list blocks
Command Passthrough: Execute any CAD command via
send_command(an escape hatch for everything else)
MCP Protocol Features
Structured Output: All tools return
structuredContentwith anoutputSchemathat clients can parse directlyTool Annotations: Query tools are marked
readOnlyHint; destructive operations are markeddestructiveHintfor client confirmation policiesProgress Notifications: Long-running operations (CAD startup, saving) send message notifications to the client
Dual Transport Modes:
stdio(local, single client) andstreamable-http(remote / multiple clients sharing one CAD instance)Error Semantics: Input validation errors are returned as tool errors, enabling model self-correction
Natural Language Processing Functions (legacy interface)
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.

Installation Requirements
Dependencies
pywin32>=306 # Windows COM interface support
mcp>=1.12,<2 # MCP Python SDK (FastMCP, structured output, Streamable HTTP)
pydantic>=2.0.0 # Data validation
Pillow>=10.0.0 # PNG encoding for screenshot previewsSystem Requirements
Windows operating system
Installed CAD software (AutoCAD, GstarCAD, or ZWCAD)
Python 3.10+
Configuration
The configuration file is located at src/config.json and contains the following main settings:
{
"server": {
"name": "CAD MCP 服务器",
"version": "2.0.0",
"transport": "stdio",
"host": "127.0.0.1",
"port": 8000
},
"cad": {
"type": "AUTOCAD",
"startup_wait_time": 20,
"command_delay": 0.5
},
"output": {
"directory": "./output",
"default_filename": "cad_drawing.dwg"
}
}server: Server name, version, and transport settings
transport: Transport mode,stdio(default, local single client) orstreamable-http(remote / multi-client)host/port: Listen address and port for Streamable HTTP mode (can also be overridden via--host/--portcommand-line arguments)
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
# Option 1: Run directly (fully compatible with existing Claude/Cursor configs)
python src/server.py
# Option 2: Install as a CLI tool
pip install -e .
cad-mcp
# Option 3: Run with Streamable HTTP transport (remote / multi-client sharing one CAD instance)
python src/server.py --transport streamable-http --port 8000
# Clients connect to http://127.0.0.1:8000/mcpConnect from an MCP Client
The server uses stdio transport by default, so the same JSON config works for any MCP client (Claude Desktop, Cursor, Windsurf, TRAE, etc.). Add it to your client's MCP server config file (e.g. claude_desktop_config.json, Cursor's mcp.json), replacing the path with your own:
{
"mcpServers": {
"CAD": {
"command": "python",
"args": [
# Your actual path, such as:"C:\\cad-mcp\\src\\server.py"
]
}
}
}For Streamable HTTP mode, point the client to http://127.0.0.1:8000/mcp instead.
MCP Inspector
# Note: use your path
npx -y @modelcontextprotocol/inspector python C:\\cad-mcp\\src\\server.pyService API
The server provides the following tools (35 in total):
Basic drawing:
draw_line: Draw a linedraw_circle: Draw a circledraw_arc: Draw an arcdraw_ellipse: Draw an ellipsedraw_polyline: Draw a polylinedraw_rectangle: Draw a rectangledraw_text: Add textdraw_hatch: Draw a hatch patternadd_dimension: Add linear dimension
Query:
list_layers: List all layerslist_entities: List entities in model space (returns editable handles)get_entity_properties: Query detailed entity properties by handlescreenshot: Capture the CAD window to confirm drawing results
Editing:
erase_entity/move_entity/rotate_entity/scale_entity: Erase / move / rotate / scale entitiescopy_entity/mirror_entity/offset_entity: Copy / mirror / offset entitiesarray_linear_entity/array_polar_entity: Linear / polar arraysundo/redo: Undo / redo
Layer & drawing management:
create_layer/set_current_layer: Layer managementnew_drawing/open_drawing/close_drawing/save_drawing: Drawing managementcreate_block/insert_block/list_blocks: Block operationssend_command: Execute any CAD command via the command line
Legacy:
process_command: Process natural language commands
Project Structure
CAD-MCP/
├── imgs/ # Images and video resources
│ └── CAD-mcp.mp4 # Demo video
├── pyproject.toml # Packaging config (pip install -e .)
├── requirements.txt # Project dependencies
└── src/ # Source code
├── __init__.py # Package initialization
├── cad_controller.py # CAD controller (COM layer: drawing/query/editing/drawings/blocks)
├── config.py # Config singleton loader
├── config.json # Configuration file
├── models.py # Structured output models (outputSchema)
├── nlp_processor.py # Natural language processor
└── server.py # Server implementation (FastMCP)License
MIT License
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert Revit files to XKT, IFC, or DWG and query BIM data via natural language.
DXF and PDF/X-4 for AI agents: structured facts, PNG renders, an interactive in-chat viewer.
- OwlCADOAuthcom.owlcad
Parametric 3D CAD for AI agents: build print-ready parts, check them, export STL, 3MF or STEP.
AI Hub for AEC — 50+ 3D formats, clash detection, ACC integration via Autodesk Platform Services.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables natural language control of AutoCAD LT through AutoLISP code generation and execution, allowing users to create engineering drawings with conversational prompts.8540MIT
- FlicenseNot gradedqualityDmaintenanceEnables users to control CAD software like AutoCAD, GstarCAD, and ZWCAD through natural language instructions via the Model Context Protocol. It supports automated drawing of shapes, layer management, and saving designs to DWG files without manual interface interaction.2-
- AlicenseAqualityDmaintenanceEnables automated CAD operations via natural language, supporting both AutoCAD LT on Windows and headless DXF generation on any platform.8MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI clients to drive ZWCAD drawing, modification, query, and plotting via natural language.3MIT