io.github.C48H74/autocad-mcp
Provides live integration with AutoCAD and AutoCAD Plant 3D through COM, allowing AI assistants to inspect and control open drawings, manage layers and entities, insert blocks, read and update block attributes, export and import attribute data via Excel, add native dimensions, plot to PDF, and store or retrieve project metadata. It also supports an offline DXF workflow for creating, editing, querying, auditing, and exporting drawings.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
AutoCAD MCP for Piping & Pipe Supports
Connect an AI assistant to AutoCAD / Plant 3D, live through COM or headless through ezdxf. One typed contract, two engines, 50 tools.
Install · Showcase · Tools · Engines · Limits · Config · Changelog

Not a mockup. Every line on this A1 sheet was drawn by the tools this server exposes (layers, ISA 5.1 instrument balloons, valves, tag lines, stream table, title block), then rendered headlessly. Rebuild it with python examples/showcase/pid.py docs/images. All data is fictional.
v0.3.1. 188 automated tests (simulated AutoCAD, offline DXF engine, real stdio subprocess) plus 7 opt-in live tests that passed on AutoCAD Plant 3D 2021 only. Other versions and native Plant 3D objects are not certified. See validation notes.
Showcase
Three complete A1 sheets, each one generated by a script in examples/showcase/ that calls the same engine the MCP tools use. Every sheet is saved as .dxf (opens in AutoCAD) and .png.
Sheet | What it shows | Rebuild |
P&ID | Tank TK-101 with nozzles N1-N8, parallel pumps P-101A/B, flow loop FT/FIC/FCV with bypass, heat exchanger E-101 with temperature control and steam trap, thermal relief PSV, battery limit, stream table, legend, notes, equipment list, title block |
|
Tank with nozzles and foundation | 50 m3 vertical tank, elevation and plan 1:30, Detail A (anchorage) and Detail B (nozzle N2 8" 150# RFWN) 1:5, chain dimensions, nozzle schedule, design data, bill of materials |
|
General arrangement (plot plan) | Plot plan 1:250 with roads, dike, tanks, pump pad, pipe rack, exchanger skid, buildings, fire water, coordinate grid, computed distance table, sections A-A and B-B 1:50 |
|

Tank sheet: dimensioned elevation and plan, anchorage and nozzle details, nozzle schedule.

Plot plan 1:250: the distance table is computed from the equipment coordinates, not typed.
Smaller examples from examples/gallery.py:
|
|
|
|
The images are an approximate ezdxf/matplotlib render, not an AutoCAD capture. The showcase is also a test: tests/test_showcase.py runs all three scripts and checks doc.audit() for errors.
Related MCP server: AutoCAD MCP Pro
What's new in 0.3
Track | What it adds |
Headless DXF engine |
|
Live AutoCAD additions |
|
Scaled drawings |
|
Safer by default | File I/O limited to |
Fixed | Layer color/linetype now applied by the DXF engine; queries no longer leave an empty undo step |
Workflow: ask for a DXF copy of the drawing, let the assistant edit, dimension and export it offline, or work live in the open drawing. A DWG cannot be read without AutoCAD.
Why this exists
Built by a piping and pipe-supports engineer, so the focus is on what that work needs: block attributes (TAG / TIPO / LINHA), layers, coordinates, support registers that can be audited and compared by TAG across revisions, and Excel round-trips. It is not a general CAD toolbox; it is a narrow tool with its limits written down.
flowchart LR
A["AI assistant / MCP client"] <-->|stdio| B["MCP server<br/>50 tools, profiles lean/core/full"]
B --> G["Guards: allowed folders, read-only,<br/>confirm/dry_run, audit log"]
G --> L["Live engine: single COM worker"]
G --> H["Headless engine: ezdxf"]
G --> Q["Support QA: snapshot, audit, compare"]
L <--> D["AutoCAD / Plant 3D<br/>open drawing"]
L --> P1["PDF from the real plotter"]
L <--> X["Excel .xlsx keyed by TAG"]
H <--> F["DXF files"]
H --> P2["PDF / PNG / SVG<br/>matplotlib render"]
Q -.-> L
Q -.-> HInstall
git clone https://github.com/C48H74/autocad-mcp.git
cd autocad-mcp
py -3 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]" # installs ezdxf and matplotlib too
Copy-Item config.example.toml config.toml
.\.venv\Scripts\python.exe -m pytest -m "not autocad"Or uv sync and uv run python -m pytest -m "not autocad". The project uses MCP SDK 1.x (mcp<2).
Requirements: Python 3.11+ (64-bit, same architecture as AutoCAD). Live COM needs Windows with a licensed AutoCAD desktop (or the Plant 3D environment) running with a test drawing open, under the same user and privilege level as the MCP client. The headless DXF engine runs on any OS.
Wire it to Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json (Settings, Developer, Edit Config) with absolute paths:
{
"mcpServers": {
"autocad": {
"command": "C:\\path\\to\\autocad-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "autocad_mcp"],
"env": { "AUTOCAD_MCP_CONFIG": "C:\\path\\to\\autocad-mcp\\config.toml" }
}
}
}Fully quit and reopen Claude Desktop; the autocad server should list 50 tools. Start with status and verify the active drawing and units. Any local stdio client can use the same command, args and environment variable. Internal tool descriptions and diagnostics are currently in Portuguese.
Tools
50 tools in 11 groups. Signatures and defaults: docs/tools.md.
Group | Tools |
Session |
|
Layers |
|
Query |
|
Drawing |
|
Blocks |
|
Excel |
|
Dimensions / plot / project data (live) |
|
DXF read (offline) |
|
DXF write (offline) |
|
Support QA |
|
Advanced |
|
Support register quality. Capture a complete support register, find duplicate TAGs and missing attributes, reconcile project-provided expected tags, and compare revisions by TAG even when CAD handles change. Audit and comparison run offline on captured snapshots. They do not validate structural loads or native Plant 3D data. Workflow and limits.
Example prompts
"Read the attributes of every SUP-TEST block and give me a table with TAG, TIPO, LINHA and X/Y."
"Import suportes.xlsx (block SUP-TEST, key TAG). Do a dry run first and tell me how many insert and how many update."
"Change TIPO to ANCORA on all blocks of line 10-P-1001. Show a preview and apply only after I confirm."
"Create an A1 sheet at 1:30 with a tank elevation, dimension the nozzles and export a PDF."
The two engines
Capability | COM (live AutoCAD) | ezdxf (headless) |
Live document control | yes | no |
Runs without AutoCAD, any OS | no | yes |
Native DIMENSION | yes | yes ( |
Paper layouts and viewports | via drawing | yes |
PDF plot | real plotter ( | matplotlib render (approximate) |
Block attributes read/write | yes | yes |
Excel round-trip keyed by TAG | yes | via DXF read |
Read-only SQL over entities | no | yes ( |
DWG read/write | yes | no (DXF only) |
3D solids | not exposed | not copied (ezdxf cannot import 3DSOLID) |
Grouped drawing edits use StartUndoMark/EndUndoMark; one-step undo was verified live on Plant 3D 2021 (100-block import undone with one Ctrl+Z). This is not automatic rollback and does not cover file writes or run_lisp. Selected destructive actions need confirm=true; batch tools support dry_run. The flag is not independent human authorization.
Limits
Plant 3D. Generic AutoCAD objects only, through COM. No Plant 3D .NET SDK, DataLinksManager, project database, spec-driven routing or native isometrics. Proxy objects may expose only generic properties and bounding boxes.
Certification. Live tests passed on AutoCAD Plant 3D 2021 only. Rotated UCS has not been validated.
Model space only; block definitions must already exist. Constant attributes need care.
Renders are approximate. PNG/PDF from the headless engine come from ezdxf + matplotlib. Hatch patterns at small scale (for example AR-CONC) can look speckled.
DWG needs AutoCAD. The headless engine reads and writes DXF.
run_lispis off by default; its filtering is partial protection, not a sandbox.Showcase sheets are fictional and use a made-up drawing standard; they are not for construction.
Configuration
Copy config.example.toml to config.toml or set AUTOCAD_MCP_CONFIG to its absolute path.
Setting | Default | Meaning |
| false | Optional AutoLISP execution |
| false | Allow starting AutoCAD |
| AutoCAD.Application | Registered COM application |
| 120 | Wait limit; does not cancel blocked COM calls |
| full |
|
| false | JSONL trail in |
| 500 | Maximum results per page |
| 2000 | Maximum Excel rows per call |
| 3000 | Up to this many entities, queries scan directly (no empty undo step) |
| [] | Folders for all file I/O (DXF, PDF, PNG, Excel). Empty = only |
| false | Opt in to unrestricted file paths |
Environment overrides: AUTOCAD_MCP_CONFIG, AUTOCAD_MCP_READ_ONLY=1, AUTOCAD_MCP_ALLOWED_DIRS, AUTOCAD_MCP_WORKSPACE. Logs go to stderr and rotating logs/server.log; stdout is reserved for MCP. Review logs before sharing.
Troubleshooting
Symptom | Check |
| Open AutoCAD; check COM registration and matching user/privileges |
| Finish commands and close dialogs (a command waiting for ENTER blocks COM) |
COM timeout | A modal dialog may be blocking COM; the call may still be running |
Tools missing | Absolute paths, valid JSON, correct Python environment, client restart |
Excel write failure | Close the workbook; check permissions and allowed directories |
Development
.\.venv\Scripts\python.exe -m pytest -m "not autocad" # 188 tests
.\.venv\Scripts\python.exe examples\gallery.py # small gallery -> docs/images
.\.venv\Scripts\python.exe examples\showcase\pid.py docs\imagesCI runs the same suite on Linux and Windows (simulated COM). More: CONTRIBUTING.md, SUPPORT.md, SECURITY.md, CODE_OF_CONDUCT.md, source comparison.
Safety
This server can modify and save drawings. Work on copies, keep backups, review previews before confirming, and do not open confidential client drawings with an assistant unless your company policy allows it.
Author
Daniel de Souza Paixão, piping stress and pipe-supports engineer. Built from day-to-day drawing work, then exposed through MCP.
License
MIT © 2026 Daniel de Souza Paixão. Third-party inspirations: see NOTICE.
AutoCAD is a trademark of Autodesk, Inc. This project is independent and not affiliated with or endorsed by Autodesk.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
DXF and PDF/X-4 for AI agents: structured facts, PNG renders, an interactive in-chat viewer.
AI Hub for AEC — 50+ 3D formats, clash detection, ACC integration via Autodesk Platform Services.
Headless CAD engine & MCP server for 2D/3D drafting, solids, DXF/SVG export, and automation.
Convert Revit files to XKT, IFC, or DWG and query BIM data via natural language.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to draft, edit, read, and validate CAD drawings either by driving a live AutoCAD session over COM or headlessly through ezdxf on any platform, spanning mechanical parts, architectural plans, P&IDs, ISO-compliant dimensioning and GD&T, and quantity takeoffs into spreadsheets.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to drive production-grade CAD automation either live through COM on Windows or headlessly via ezdxf on any platform, using one typed contract across both engines. It covers drawing creation, P&ID, mechanical and architectural drafting, ISO GD&T and dimension-tolerance validation, takeoffs, and drawing understanding.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to drive AutoCAD automation through one typed contract over two engines — live COM on Windows or headless ezdxf anywhere — to draft, edit and read drawings, including mechanical parts and sheets, architectural plans with measured room areas, and P&ID diagrams. It also critiques existing drawings, checks scales and topology, and produces takeoff workbooks.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to automate AutoCAD drafting, drawing understanding, and quantity takeoffs either through a live COM connection on Windows or headlessly via ezdxf on any platform. It covers P&ID, mechanical, and architectural workflows with ISO/ANSI standards — symbols, dimensions, layers, frames, title blocks, parts lists, schedules, and validation of drawings made by others.-



