mcp server
autocad-mac-mcp
MCP server for AutoCAD for Mac. Claude reads and writes the open drawing: AutoLISP, entities, files, KML. No Windows needed.
Set up
Runs on your computer. Pick your agent and operating system.
This project does not publish an install method we can turn into a config. Follow the README instead.
README
synced Oct 21, 2026The AutoCAD MCP servers I could find all assume Windows. They reach AutoCAD through COM, a .NET plugin or Win32 window messages, and none of those exist on a Mac. This server takes the one route the Mac build leaves open: it types into AutoCAD's own command line and reads the answer back from a file. A call takes about a second, there is no plugin to install, and the whole AutoLISP API is available.
# example session (numbers are illustrative)
you > what layers are in this drawing, and how many pipes are on PIPES-MAIN?
claude > autocad_drawing_info() -> 42 layers, 2731 entities, units = metres
claude > autocad_entities(layer="PIPES-MAIN", types="LWPOLYLINE") -> 184 polylines, 3218 m in total
Quick start
You need macOS, AutoCAD for Mac 2024 or newer (the full version; AutoCAD LT has no AutoLISP), uv, and Accessibility permission for the terminal or app that will run the server (System Settings, Privacy & Security, Accessibility).
git clone https://github.com/medjbilou/autocad-mac-mcp && cd autocad-mac-mcp
uv run --script server.py --setup # once: lets AutoCAD load scripts from ~/.acmcp without asking
uv run --script server.py --selftest # with a drawing open in AutoCAD; prints "selftest OK in 1.0s"
claude mcp add --scope user autocad -- uv run --script "$PWD/server.py"
Open a drawing in AutoCAD, then ask Claude things like:
List the layers and count the entities on each. Move everything on layer TEMP to layer DEMO and colour it red. Export the IRRIGATION* layers to a KML I can open in Google Earth.
Claude Desktop and Cursor take the same command in their MCP config:
{ "mcpServers": { "autocad": { "command": "uv", "args": ["run", "--script", "/path/to/autocad-mac-mcp/server.py"] } } }
What Claude can do
| Tool | What it does | |
|---|---|---|
| Target | autocad_target | point everything at one .dwg: launches AutoCAD if it is closed, opens the file if it is not open, answers missing-font dialogs, switches to it, remembers it. Call it first |
| Read | autocad_drawing_info | name, path, units, extents, layer list, entity count |
autocad_entities | entities by layer or type wildcard as TSV: handles, coordinates to 3 decimals, polyline vertices with bulges, radii, arc angles. to_file= exports without a limit | |
autocad_drawings, autocad_switch_drawing | list the open drawings, activate one by name | |
autocad_screenshot | PNG of the AutoCAD window | |
| Write | autocad_draw | polylines, lines, circles, text and block inserts. Creates layers as needed; one undo step per call |
autocad_modify | by handle: erase, move, change layer, set colour | |
autocad_lisp | run any AutoLISP and get the last value back. Everything else is built on this | |
autocad_command | any native command sequence, for example ZOOM E or _.LAYER _M NEW | |
| Files and geo | autocad_file | open, save, save as, close, export DXF, export PDF. Dialogs are handled |
autocad_kml_export, autocad_kml_import | layers to KML and back, with an offset from drawing units to a projected CRS and an EPSG code (anything pyproj knows) | |
| UI | autocad_dialog | read the modal alert AutoCAD is showing (text and buttons) and press one by name |
autocad_gui | key, type or click, then return a screenshot |
How it works
AutoCAD for Mac has no accoreconsole, no AppleScript dictionary and no COM. It does have a command line that accepts (load "file.lsp"), so each tool call does three things:
- Writes
~/.acmcp/run.lsp. Your code is wrapped invl-catch-all-apply, the result is printed to~/.acmcp/out.txt, and adonemarker is written afterwards. - Brings AutoCAD to the front, checks that it really is frontmost, presses Esc twice and types the load command through macOS System Events.
- Polls for
doneand returns the contents of the file.
If a dialog blocks the command line, the server sees it through the Accessibility API and reports it instead of hanging, so Claude can answer it with autocad_dialog.
Limits
Read these before you depend on it.
- It works by typing. One call at a time (the server holds a lock; do not let your client run tool calls in parallel). AutoCAD comes to the front for the keystroke, then your previous app gets focus back (set
ACMCP_KEEP_FOCUS=1to leave AutoCAD in front). Don't type in AutoCAD while Claude is working. - AutoLISP only.
vla-*andvlax-*(ActiveX) do not exist in the Mac build.entget,entmake,entmod,ssget,tblnextandcommandall work. - No headless mode, but no clicking either:
autocad_target(path)launches AutoCAD and opens the drawing itself (about 40 s cold, 5 s warm). Every later call re-checks that this drawing is the active one and refuses to type into the Start tab. Only a "Save changes?" dialog stops it — that one is yours to answer withautocad_dialog. - Precision.
autocad_lispprints reals with 6 significant digits, which is the AutoLISP default.autocad_entitiesusesrtosand is exact to 3 decimals, so use it for coordinates. export_pdfassumes theDWG To PDF.pc3plotter and an ISO A1 sheet. Change it inserver.pyif your setup differs.
Troubleshooting
| Symptom | What to do |
|---|---|
AutoCAD is not running / no drawing is open (Start tab) | Call autocad_target("/path/to/file.dwg"). |
blocked by a dialog ['Save', "Don't Save", 'Cancel'] | Your call: autocad_dialog(press="Save") or "Don't Save". The server never decides this for you. |
AutoCAD did not respond in 30s | No dialog and a drawing open? Then the terminal probably lacks Accessibility permission. |
AutoCAD is not frontmost ... refusing to type | Something took focus during the call. Retry; the server re-activates AutoCAD on each attempt. |
| The first call shows a "Load this file?" prompt | Run --setup again. It adds ~/.acmcp to TRUSTEDPATHS. |
ModuleNotFoundError: mcp.server.fastmcp | You have mcp 2.x installed. The script pins mcp<2; run it with uv run --script. |
| A different AutoCAD version | ACMCP_BUNDLE_ID=com.autodesk.AutoCAD2026 uv run --script server.py |
Why this exists
I needed Claude to read irrigation plans out of AutoCAD on a Mac, and every MCP I found assumed Windows. The server is a single file (server.py, about 450 lines) so it is easy to read and adapt. The same pattern works for any Mac app that has a command line or a scripting console but no API.
MIT, Mohammed Jbilou