AutoCAD MCP Pro
Provides comprehensive tools for automating AutoCAD, including drawing management, entity creation and modification, layer management, block operations, dimensioning, analysis, view control, transactions, and headless DXF file operations via COM or ezdxf backends.
Click on "Install 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., "@AutoCAD MCP ProCreate a new drawing with a circle at origin radius 5"
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.
AutoCAD MCP Pro
Production-grade AutoCAD automation for the Model Context Protocol. Dual-engine. Battle-tested. Model-agnostic.
87 tools · 6 resources · 5 prompt templates · COM + ezdxf backends · Python 3.11+ · MIT
From the Author
I built AutoCAD MCP Pro because I needed it.
My day job at Anka-Makine revolves around intensive AutoCAD work — production drawings, parametric assemblies, strict layer standards across dozens of templates, dimensioning and block work under tight schedules, repeated audits, exports, and screenshots for design reviews. The repetitive parts of that workflow add up fast.
After months of leaning on this server inside my own daily workflow — and watching it shave hours off my week without a single misstep on critical drawings — I decided it deserved a public release. It works. It is fast. It stays out of the way.
The model on the other end of the wire does not matter. The Model Context Protocol is the contract; AutoCAD MCP Pro is one well-typed implementation of that contract. Any MCP-aware client — and the LLM behind it — sees the same 87 tools.
I will keep this repository actively maintained as my own use of it evolves, and a public benchmark suite is on the way — I want to give you numbers, not adjectives.
— Umutcan Edizsalan · Anka-Makine
Table of Contents
Why This Exists
Most CAD-automation tooling falls into two camps: heavyweight enterprise plug-ins that lock you into a single vendor, or one-off Python scripts that solve a single drawing and rot a week later. Neither plays well with the modern AI workflow, where the agent — not the engineer — is the one driving the tool.
AutoCAD MCP Pro takes a different stance:
One protocol, two engines. A live COM backend talks to a running AutoCAD instance for in-app, real-time control. A headless ezdxf backend reads and writes DXF files anywhere — Linux, macOS, CI runners — with no AutoCAD installation required. Same tool surface, same response shapes, two execution modes.
Built for agents. Every tool has a typed schema, a deterministic error contract, and structured progress updates. No string-parsing tricks; no positional-argument guessing. Pydantic on the way in, dataclasses on the way out.
Hardened by default. Path traversal, command injection, AutoLISP escape, transaction-driven memory blowups, COM hangs — all addressed in the default configuration. You opt in to risk, never out.
Highlights
Dual Engine Architecture
COM backend: live AutoCAD control via the Win32 COM API, routed through a single-thread STA executor with a per-call timeout so an unresponsive AutoCAD never hangs the server.
ezdxf backend: headless DXF file operations powered by ezdxf. Works on every platform, ideal for batch workloads and CI pipelines.
Automatic backend selection, with a clean override via
AUTOCAD_MCP_BACKEND.
87 Tools, 11 Categories
Drawing management —
drawing_new,drawing_open,drawing_save,drawing_save_as,drawing_export_dxf,drawing_export_pdf,drawing_purge,drawing_audit,drawing_undo,drawing_redo,drawing_closeEntity creation — line, circle, arc, polyline, rectangle, text, mtext, hatch, spline, ellipse, point, block reference, batch create
Dimensions — linear, aligned, angular, radius, diameter
Entity modification — move, copy, rotate, scale, mirror, offset, delete, rectangular array, polar array, batch modify, set properties
Layer management — full lifecycle: create, delete, modify, freeze/thaw, lock/unlock, hide/show, isolate, set current
Block operations — list, insert, explode, attribute get/set, create-from-entities, find references
Analysis — entity stats, region select, distance/area measurement, bounding box, select by type/layer, layer statistics
View control — zoom extents, zoom window, screenshot, combined zoom-and-screenshot
Transactions — begin, commit, rollback, with disk-backed snapshots
System — status, get/set variables, run command, run AutoLISP, about
Templates and validation — apply standard layer templates, validate drawings against rule sets
Production-Grade Plumbing
FastMCP 3.0 lifespan-managed backend singleton
Middleware stack: error handling, audit logging, timing, request logging
Structured progress reports for long-running operations (
drawing_open, exports, batch ops)104 tests across drawing, entity, dimension, layer, block, analysis, batch/template, security suites
Ruff-clean codebase, GitHub Actions CI
Security-First Defaults
Path traversal & system-directory protection
AutoLISP allowlist with regression tests for known bypass patterns (
vla-SendCommand,acet-*, alias tricks,funcallindirection,c:custom commands, error-handler hijacks)Command sanitization for
system_run_commandHTTP transport refuses non-loopback bind without an explicit opt-in and a configured auth token
Configurable file size limit on DXF input (
MAX_DXF_BYTES) blocks decompression-bomb-style attacksPer-call COM timeout (
COM_CALL_TIMEOUT) prevents a hung AutoCAD from freezing the server
AI Client Compatibility
AutoCAD MCP Pro implements the Model Context Protocol. If a host can speak MCP, it can drive this server. No model-specific code, no per-vendor patches — the contract is the tool schema, and any MCP-aware client (and any LLM behind it) inherits the full 87-tool surface for free.
Host | Status | Notes |
Claude Desktop | Verified | Native MCP support |
Cursor | Verified | Native MCP support |
Cline / Roo Code (VS Code) | Verified | Native MCP support |
Continue | Verified | MCP via configuration |
Goose | Verified | MCP via configuration |
Custom MCP clients | Supported | STDIO and HTTP transports |
Quickstart
git clone https://github.com/U-C4N/autocad-mcp.git
cd autocad-mcp
pip install -e ".[full]"
python server.pyThat is it. The server starts in STDIO mode and your MCP client will discover all 87 tools.
For headless / CI workflows:
AUTOCAD_MCP_BACKEND=ezdxf python server.pyFor HTTP transport (local-only by default — see Security Model):
fastmcp run server.py:mcp --transport http --port 8000Installation
Core (ezdxf backend only — works everywhere)
pip install -e .With live AutoCAD control (Windows + AutoCAD)
pip install -e ".[com]"With PDF export and matplotlib-based screenshots
pip install -e ".[pdf]"Everything
pip install -e ".[full]"Development
pip install -e ".[full]"
pip install pytest pytest-asyncio pytest-cov ruffMCP Client Configuration
Claude Desktop
Edit claude_desktop_config.json:
{
"mcpServers": {
"autocad": {
"command": "python",
"args": ["C:/path/to/autocad-mcp/server.py"],
"env": {
"AUTOCAD_MCP_BACKEND": "auto",
"ALLOWED_PATHS": "C:/Users/you/Documents/AutoCAD"
}
}
}
}Cursor
Settings → MCP → Add new server and point at python /path/to/server.py.
Cline / Continue / Goose
All standard MCP command + args configuration; same shape as Claude Desktop.
Backend Selection
| Behavior |
| Try COM first on Windows, fall back to ezdxf if AutoCAD is not reachable. |
| Force COM. Fails fast if AutoCAD is not running. |
| Force headless ezdxf. Works on Linux, macOS, Windows with no AutoCAD. |
Configuration Reference
Copy .env.example to .env and edit:
Variable | Default | Purpose |
|
| Backend selection ( |
|
| Standard Python logging level. |
| (empty) | Comma-separated absolute paths the server may read/write. |
|
| Maximum number of in-flight transaction snapshots. |
|
| Reject DXF files larger than this on |
|
| Hard cap for |
|
| Per-call timeout for COM operations. Prevents a hung AutoCAD blocking the server. |
|
| Disable command and AutoLISP sanitization. Loud warning at startup. |
|
| Permit HTTP transport on non-loopback hosts. |
| (empty) | Required when |
Tool Catalog
Group | Count | Sample tools |
Drawing | 11 |
|
Entity Creation | 13 |
|
Dimensions | 5 |
|
Entity Modification | 10 |
|
Entity Query | 3 |
|
Layer Management | 12 |
|
Block Operations | 7 |
|
Analysis | 8 |
|
View | 4 |
|
Transactions | 3 |
|
System | 6 |
|
Batch / Templates | 5 |
|
system_about returns the live tool inventory — the count above is illustrative; the runtime number is authoritative.
Architecture
server.py FastMCP 3.0 server (lifespan, middleware, tools)
│
├── config.py Centralized environment-driven configuration
├── security.py Path validation, command + LISP sanitization
│
└── backends/
├── base.py AutoCADBackend ABC + shared dataclasses
│ (EntityInfo, LayerInfo, BlockInfo, DrawingInfo, CommandResult)
├── ezdxf_backend.py Headless DXF/DWG via ezdxf
│ sync calls wrapped in asyncio.to_thread
│ transaction snapshots persisted to temp files
└── com_backend.py Live AutoCAD via pywin32
single-thread STA executor with per-call timeout
UUID-named selection sets, leak-free cleanupThe server boots once, the backend is initialized in the FastMCP lifespan, and every tool call is dispatched through the middleware stack:
ErrorHandlingMiddleware → AuditMiddleware → TimingMiddleware → LoggingMiddleware → tool
Tool returns are flowed back through _dc(), which converts dataclasses to JSON-serializable dicts and preserves the typed contract on the wire.
Security Model
AutoCAD MCP Pro assumes a hostile-input threat model: the MCP client may be untrusted, the model behind it may be jailbroken, and the inputs to every tool may be adversarial.
AutoLISP allowlist —
security.pyblocks the full ActiveX/COM family (vla-*,vlax-*,vlr-*), Express Tools (acet-*), command channels (command,command-s,vl-cmdf), file I/O, code loading, indirection vectors (funcall,function,apply,eval), custom command invocation (c:*), and error-handler hijacks. Every known bypass is covered by a regression test.Command sanitization — destructive AutoCAD verbs (
ERASE,PURGE,SHELL,SCRIPT,APPLOAD,NETLOAD,VBARUN, …) are rejected unlessDANGEROUS_COMMANDS_ENABLED=trueis set, in which case the server logs a loudWARNINGat startup and surfaces anunsafe_modeflag insystem_statusandsystem_about.Path validation — every tool that takes a path runs through
validate_path(), which blocks traversal patterns, system directories, and constrains writes to a configurableALLOWED_PATHSlist.HTTP transport guard — by default the server refuses to bind anything other than
127.0.0.1. To bind a non-loopback host you must opt in viaALLOW_REMOTE_HTTP=trueand setMCP_AUTH_TOKEN.Resource exhaustion guards —
MAX_DXF_BYTESrejects oversize input,MAX_LIST_LIMITcaps response sizes, transaction snapshots persist to disk so memory stays bounded, andCOM_CALL_TIMEOUTkeeps a hung AutoCAD from taking the server with it.
If you find a security issue, please open a private contact rather than a public issue.
Benchmarks
A reproducible benchmark suite is in active development. Targets:
Drawing scale — 1k / 10k / 100k entity workloads
Workload classes — bulk creation, mass-modify, region select, render-and-screenshot, end-to-end design pass
Backend variants — ezdxf on CPython 3.11/3.12, COM against AutoCAD 2024+
Model compatibility — tool-call success rate and prompt token usage by model, on a fixed set of canonical CAD prompts
Numbers will land in benchmarks/ with a one-command runner and a hardware footprint. The table below will be updated as new models and AutoCAD versions release.
Workload | ezdxf (3.12) | COM (AutoCAD 2025) | Notes |
Open + audit 10k-entity DXF | coming | coming | |
Bulk-create 5k LINE entities | coming | coming | |
Region select on 100k drawing | coming | coming | |
End-to-end "design pass" prompt | coming | coming | by model family |
Have a workload you want included? Open an issue.
Development
Run tests
pytest -vCoverage report
pytest --cov=. --cov-report=term-missingLint and format
ruff check .
ruff format --check .Project structure
autocad-mcp/
├── server.py
├── config.py
├── security.py
├── backends/
│ ├── base.py
│ ├── ezdxf_backend.py
│ └── com_backend.py
├── tests/
│ ├── test_drawing.py
│ ├── test_entity_creation.py
│ ├── test_dimensions.py
│ ├── test_layer_block.py
│ ├── test_analysis.py
│ ├── test_batch_template.py
│ ├── test_ezdxf_backend.py
│ └── test_security.py
├── pyproject.toml
├── Dockerfile
└── .github/workflows/ci.ymlRoadmap
1.0 — Initial public release
1.1 — Security hardening (LISP allowlist, transaction snapshots on disk, COM timeouts, HTTP bind guard, dynamic tool count)
1.2 — Public benchmark suite (
benchmarks/with reproducible runner)1.3 — Backend
capabilities()map and per-tool enablement (e.g. hidesystem_run_commandautomatically on ezdxf)1.4 — Module split for
server.pyand a cleanservices/orchestration layer1.5 — Windows CI matrix with mocked COM backend; full coverage report
2.0 — Multi-document context, xref-aware tools, layout/paper-space first-class support
2.x — Native Linux/macOS support for live control via ODA File Converter for round-trip DWG
Requirements
Python 3.11+
FastMCP 3.0+
ezdxf 1.3+
(optional, COM backend)
pywin32306+, AutoCAD 2020 or newer(optional, screenshots)
Pillow10.0+(optional, PDF export)
matplotlib3.8+
Contributing
Pull requests are welcome — especially around the COM backend (mocking, additional Windows tooling), benchmark suite contributions, and additional layer / dimension standards.
For non-trivial changes, please open an issue first to align on direction.
Author
Umutcan Edizsalan Mechanical / engineering work at Anka-Makine. Builds tools that survive contact with real production drawings.
GitHub: @U-C4N
This project exists because it earned its place in my own daily workflow. I will keep it maintained and aligned with my real usage.
License
MIT — see LICENSE.
Copyright © 2026 Umutcan Edizsalan.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/U-C4N/Autocad-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server