Skip to content
Conduit

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.

medjbilou/autocad-mac-mcpcommunitylistedunreviewed

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, 2026

The 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

ToolWhat it does
Targetautocad_targetpoint 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
Readautocad_drawing_infoname, path, units, extents, layer list, entity count
autocad_entitiesentities 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_drawinglist the open drawings, activate one by name
autocad_screenshotPNG of the AutoCAD window
Writeautocad_drawpolylines, lines, circles, text and block inserts. Creates layers as needed; one undo step per call
autocad_modifyby handle: erase, move, change layer, set colour
autocad_lisprun any AutoLISP and get the last value back. Everything else is built on this
autocad_commandany native command sequence, for example ZOOM E or _.LAYER _M NEW
Files and geoautocad_fileopen, save, save as, close, export DXF, export PDF. Dialogs are handled
autocad_kml_export, autocad_kml_importlayers to KML and back, with an offset from drawing units to a projected CRS and an EPSG code (anything pyproj knows)
UIautocad_dialogread the modal alert AutoCAD is showing (text and buttons) and press one by name
autocad_guikey, 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:

  1. Writes ~/.acmcp/run.lsp. Your code is wrapped in vl-catch-all-apply, the result is printed to ~/.acmcp/out.txt, and a done marker is written afterwards.
  2. Brings AutoCAD to the front, checks that it really is frontmost, presses Esc twice and types the load command through macOS System Events.
  3. Polls for done and 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=1 to leave AutoCAD in front). Don't type in AutoCAD while Claude is working.
  • AutoLISP only. vla-* and vlax-* (ActiveX) do not exist in the Mac build. entget, entmake, entmod, ssget, tblnext and command all 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 with autocad_dialog.
  • Precision. autocad_lisp prints reals with 6 significant digits, which is the AutoLISP default. autocad_entities uses rtos and is exact to 3 decimals, so use it for coordinates.
  • export_pdf assumes the DWG To PDF.pc3 plotter and an ISO A1 sheet. Change it in server.py if your setup differs.

Troubleshooting

SymptomWhat 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 30sNo dialog and a drawing open? Then the terminal probably lacks Accessibility permission.
AutoCAD is not frontmost ... refusing to typeSomething took focus during the call. Retry; the server re-activates AutoCAD on each attempt.
The first call shows a "Load this file?" promptRun --setup again. It adds ~/.acmcp to TRUSTEDPATHS.
ModuleNotFoundError: mcp.server.fastmcpYou have mcp 2.x installed. The script pins mcp<2; run it with uv run --script.
A different AutoCAD versionACMCP_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

↑↓ navigate openesc close