AutoCAD MCP Server
by Porta048
README.md
<div align="center">
<img src="img/claude-logo.png" alt="Claude" width="64">
# AutoCAD MCP Server
**Draw in AutoCAD by typing plain English into Claude Desktop.**
</div>
---
## What it does
You type *"draw a red circle at (100, 100) with radius 50"* in Claude Desktop, and the circle appears in AutoCAD. No scripting, no LISP, no macros.
<div align="center">
<img src="img/schema.png" alt="Claude Desktop talks to the MCP server, which drives AutoCAD through the COM interface" width="420">
</div>
Claude Desktop sends your request to this server, which translates it into AutoCAD commands over the Windows COM interface.
## Before you start
You need all three:
- **Windows** — the server talks to AutoCAD through COM, which only exists on Windows
- **Python 3.10 or newer**
- **AutoCAD**, GstarCAD, or ZWCAD installed
## Setup
**1. Install the server**
```bash
git clone https://github.com/Porta048/autocad-mcp.git
cd autocad-mcp
pip install -e .
```
**2. Tell Claude Desktop about it**
Open `%APPDATA%\Claude\claude_desktop_config.json` and add:
```json
{
"mcpServers": {
"autocad": {
"command": "autocad-mcp"
}
}
}
```
**3. Restart Claude Desktop**
That's it. Claude starts the server automatically — you don't run it yourself.
## Using it
Open AutoCAD, then just talk to Claude:
```
Draw a red circle at (100, 100) with radius 50
Create a rectangle from (0, 0) to (200, 100)
Add text "Hello" at (50, 50)
Draw a line from (0, 0) to (100, 100)
Save the drawing to C:/drawings/test.dwg
```
If AutoCAD isn't already open, the server launches it and waits about 20 seconds for it to load.
Commands also work in Italian and Chinese — *"disegna un cerchio rosso"* does the same thing.
## What you can draw
| Tool | What it makes |
|------|---------------|
| `draw_line` | A line between two points |
| `draw_circle` | A circle from a center point and radius |
| `draw_arc` | An arc, with start and end angles |
| `draw_ellipse` | An ellipse, optionally rotated |
| `draw_rectangle` | A rectangle from two opposite corners |
| `draw_polyline` | A connected path through several points |
| `draw_text` | Text at a position |
| `draw_hatch` | A pattern fill inside a boundary |
| `add_dimension` | A dimension annotation |
| `save_drawing` | Saves to a `.dwg` file |
| `process_command` | Handles free-form natural language |
You don't call these by name — Claude picks the right one from what you ask.
## Colors
Name a color in your request and it gets applied:
| | | | | | | |
|---|---|---|---|---|---|---|
| `1` Red | `2` Yellow | `3` Green | `4` Cyan | `5` Blue | `6` Magenta | `7` White |
Also available: gray, black, orange, brown, purple, and pink. You can use the number directly if you prefer.
## Coordinates
- Written as `(x, y)` or `(x, y, z)` — z defaults to 0
- X goes right, Y goes up
- Angles are in degrees, counter-clockwise from the X axis
## Using a different CAD program
Edit `src/autocad_mcp/config.json` and set `cad.type` to `AUTOCAD`, `GCAD`, or `ZWCAD`:
```json
{
"cad": {
"type": "AUTOCAD",
"startup_wait_time": 20
}
}
```
Raise `startup_wait_time` if your CAD program is slow to open.
## If something goes wrong
**Nothing happens when you ask Claude to draw**
Check that Claude Desktop was restarted after editing the config file.
**"CAD not initialized"**
Open AutoCAD manually first, then try again.
**The server isn't listed in Claude**
Confirm `autocad-mcp` runs from your terminal. If the command isn't found, `pip install -e .` didn't finish — run it again and watch for errors.
Errors are logged to `autocad_mcp.log` in the folder the server started from.
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues