loading…
Search for a command to run...
loading…
Production-grade AutoCAD automation server enabling real-time CAD control via COM and headless DXF operations through 87 tools, including drawing creation, enti
Production-grade AutoCAD automation server enabling real-time CAD control via COM and headless DXF operations through 87 tools, including drawing creation, entity modification, layer management, and batch processing, designed for AI agent integration via the Model Context Protocol.
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
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
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:
Dual Engine Architecture
AUTOCAD_MCP_BACKEND.87 Tools, 11 Categories
drawing_new, drawing_open, drawing_save, drawing_save_as, drawing_export_dxf, drawing_export_pdf, drawing_purge, drawing_audit, drawing_undo, drawing_redo, drawing_closeProduction-Grade Plumbing
drawing_open, exports, batch ops)Security-First Defaults
vla-SendCommand, acet-*, alias tricks, funcall indirection, c: custom commands, error-handler hijacks)system_run_commandMAX_DXF_BYTES) blocks decompression-bomb-style attacksCOM_CALL_TIMEOUT) prevents a hung AutoCAD from freezing the serverAutoCAD 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 |
git clone https://github.com/U-C4N/autocad-mcp.git
cd autocad-mcp
pip install -e ".[full]"
python server.py
That 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.py
For HTTP transport (local-only by default — see Security Model):
fastmcp run server.py:mcp --transport http --port 8000
pip install -e .
pip install -e ".[com]"
pip install -e ".[pdf]"
pip install -e ".[full]"
pip install -e ".[full]"
pip install pytest pytest-asyncio pytest-cov ruff
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"
}
}
}
}
Settings → MCP → Add new server and point at python /path/to/server.py.
All standard MCP command + args configuration; same shape as Claude Desktop.
AUTOCAD_MCP_BACKEND |
Behavior |
|---|---|
auto (default) |
Try COM first on Windows, fall back to ezdxf if AutoCAD is not reachable. |
com |
Force COM. Fails fast if AutoCAD is not running. |
ezdxf |
Force headless ezdxf. Works on Linux, macOS, Windows with no AutoCAD. |
Copy .env.example to .env and edit:
| Variable | Default | Purpose |
|---|---|---|
AUTOCAD_MCP_BACKEND |
auto |
Backend selection (auto, com, ezdxf). |
LOG_LEVEL |
INFO |
Standard Python logging level. |
ALLOWED_PATHS |
(empty) | Comma-separated absolute paths the server may read/write. |
MAX_UNDO_STACK |
5 |
Maximum number of in-flight transaction snapshots. |
MAX_DXF_BYTES |
52428800 (50 MB) |
Reject DXF files larger than this on drawing_open. 0 to disable. |
MAX_LIST_LIMIT |
5000 |
Hard cap for entity_list and analysis_select_* responses. |
COM_CALL_TIMEOUT |
60 (seconds) |
Per-call timeout for COM operations. Prevents a hung AutoCAD blocking the server. |
DANGEROUS_COMMANDS_ENABLED |
false |
Disable command and AutoLISP sanitization. Loud warning at startup. |
ALLOW_REMOTE_HTTP |
false |
Permit HTTP transport on non-loopback hosts. |
MCP_AUTH_TOKEN |
(empty) | Required when ALLOW_REMOTE_HTTP=true. Bearer token for HTTP clients. |
| Group | Count | Sample tools |
|---|---|---|
| Drawing | 11 | drawing_new, drawing_open, drawing_save, drawing_export_pdf, drawing_purge, drawing_close |
| Entity Creation | 13 | entity_create_line, entity_create_polyline, entity_create_hatch, entity_create_block_ref |
| Dimensions | 5 | dimension_linear, dimension_aligned, dimension_angular, dimension_radius, dimension_diameter |
| Entity Modification | 10 | entity_move, entity_rotate, entity_array_polar, entity_offset, entity_array_rectangular |
| Entity Query | 3 | entity_get, entity_list, entity_delete_many |
| Layer Management | 12 | layer_create, layer_freeze, layer_isolate, layer_modify |
| Block Operations | 7 | block_insert, block_explode, block_create_from_entities, block_find_references |
| Analysis | 8 | analysis_entity_stats, analysis_bounding_box, analysis_select_by_layer, analysis_layer_stats |
| View | 4 | view_zoom_extents, view_screenshot, view_zoom_and_screenshot |
| Transactions | 3 | transaction_begin, transaction_commit, transaction_rollback |
| System | 6 | system_status, system_run_command, system_run_lisp, system_about |
| Batch / Templates | 5 | entity_batch_create, entity_batch_modify, template_apply_layers, validation_check |
system_about returns the live tool inventory — the count above is illustrative; the runtime number is authoritative.
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 cleanup
The 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.
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.
security.py blocks 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.ERASE, PURGE, SHELL, SCRIPT, APPLOAD, NETLOAD, VBARUN, …) are rejected unless DANGEROUS_COMMANDS_ENABLED=true is set, in which case the server logs a loud WARNING at startup and surfaces an unsafe_mode flag in system_status and system_about.validate_path(), which blocks traversal patterns, system directories, and constrains writes to a configurable ALLOWED_PATHS list.127.0.0.1. To bind a non-loopback host you must opt in via ALLOW_REMOTE_HTTP=true and set MCP_AUTH_TOKEN.MAX_DXF_BYTES rejects oversize input, MAX_LIST_LIMIT caps response sizes, transaction snapshots persist to disk so memory stays bounded, and COM_CALL_TIMEOUT keeps 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.
A reproducible benchmark suite is in active development. Targets:
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.
pytest -v
pytest --cov=. --cov-report=term-missing
ruff check .
ruff format --check .
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.yml
benchmarks/ with reproducible runner)capabilities() map and per-tool enablement (e.g. hide system_run_command automatically on ezdxf)server.py and a clean services/ orchestration layerpywin32 306+, AutoCAD 2020 or newerPillow 10.0+matplotlib 3.8+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.
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.
MIT — see LICENSE.
Copyright © 2026 Umutcan Edizsalan.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"autocad-mcp-pro": {
"command": "npx",
"args": []
}
}
}Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also