
MCP server for AutoCAD LT v3.1: freehand AutoLISP execution, 8 consolidated tools, File IPC + ezdxf
MCP server for AutoCAD LT v3.1: freehand AutoLISP execution, 8 consolidated tools, File IPC + ezdxf backends, focus-free dispatch, undo/redo, P&ID symbols, and robust IPC with ESC prefix and UTF-8 fallback. Companion agent skill: puran-water/autocad-drafting
MCP server for AutoCAD LT automation and headless DXF generation.
Two backends, one API:
| Backend | Runtime | Requires AutoCAD? | Screenshot |
|---|---|---|---|
| File IPC | Windows Python | Yes — AutoCAD LT 2024+ (Windows) | Win32 PrintWindow |
| ezdxf | Any platform | No (headless) | matplotlib render |
The server exposes 8 consolidated tools (drawing, entity, layer, block, annotation, pid, view, system) over the MCP stdio transport. An MCP client (Claude Desktop, Claude Code, etc.) connects and drives AutoCAD through natural-language requests.
The ezdxf headless backend works on any platform (Linux, macOS, WSL) for offline DXF generation without AutoCAD installed.
git clone https://github.com/puran-water/autocad-mcp.git
cd autocad-mcp
uv syncOpen AutoCAD LT and load mcp_dispatch.lsp using APPLOAD:
APPLOAD in the AutoCAD command line<repo>/lisp-code/mcp_dispatch.lsp=== MCP Dispatch v3.1 loaded === and Ready for commands via (c:mcp-dispatch)Tip: Add the file to your AutoCAD Startup Suite (in the APPLOAD dialog) so it loads automatically with every drawing.
Add to your MCP client configuration (e.g. Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"autocad-mcp": {
"command": "C:\\path\\to\\autocad-mcp\\.venv\\Scripts\\python.exe",
"args": ["-m", "autocad_mcp"],
"env": { "AUTOCAD_MCP_BACKEND": "auto" }
}
}
}Key points:
command must point to the Windows Python inside the project venv (not WSL python).AUTOCAD_MCP_BACKEND can be auto (default — tries File IPC, falls back to ezdxf), file_ipc (requires AutoCAD), or ezdxf (headless only).If your MCP client runs in WSL (e.g. Claude Code), launch the server through cmd.exe so it runs as a native Windows process:
{
"mcpServers": {
"autocad-mcp": {
"type": "stdio",
"command": "cmd.exe",
"args": ["/d", "/s", "/c", "cd /d C:\\path\\to\\autocad-mcp && .venv\\Scripts\\python.exe -m autocad_mcp"],
"env": { "AUTOCAD_MCP_BACKEND": "auto" }
}
}
}From your MCP client, call:
system(operation="status")You should see backend: "file_ipc" if AutoCAD is running, or backend: "ezdxf" for headless mode.
drawing — File/drawing management| Operation | Description | File IPC | ezdxf |
|---|---|---|---|
create | Reset to clean drawing (erase all + purge) | Yes | Yes |
open | Open an existing drawing | Yes | Yes (DXF) |
info | Get entity count and layers | Yes | Yes |
save | Save current drawing (to path if given) | Yes | Yes |
save_as_dxf | Export as DXF | Yes | Yes |
plot_pdf | Plot to PDF | Yes | No |
purge | Purge unused objects | Yes | Yes |
get_variables | Get system variables by name | Yes | Yes |
undo | Undo last operation | Yes | No |
redo | Redo last undone operation | Yes | No |
entity — Entity CRUD + modificationCreate: create_line, create_circle, create_polyline, create_rectangle, create_arc, create_ellipse, create_mtext, create_hatch
Read: list, count, get
Modify: copy, move, rotate, scale, mirror, offset*, array, fillet*, chamfer*, erase
*
offset,fillet,chamferare File IPC only (not supported in ezdxf headless backend).
layer — Layer managementlist, create, set_current, set_properties, freeze, thaw, lock, unlock
block — Block operations| Operation | File IPC | ezdxf |
|---|---|---|
list | Yes | Yes |
insert | Yes | Yes |
insert_with_attributes | Yes | Yes |
get_attributes | Yes | Yes |
update_attribute | Yes | Yes |
define | No | Yes |
annotation — Text, dimensions, leaderscreate_text, create_dimension_linear, create_dimension_aligned, create_dimension_angular, create_dimension_radius, create_leader
pid — P&ID operations (CTO symbol library)setup_layers, insert_symbol, list_symbols, draw_process_line, connect_equipment, add_flow_arrow, add_equipment_tag, add_line_number, insert_valve, insert_instrument, insert_pump, insert_tank
P&ID symbol insertion requires the CAD Tools Online (CTO) P&ID Symbol Library installed at
C:\PIDv4-CTO\. The ezdxf backend has built-in CTO library support. For the File IPC backend, some P&ID operations require additional LISP helpers — see the P&ID section in the wiki for setup details.
view — Viewport and screenshot| Operation | Description |
|---|---|
zoom_extents | Zoom to show all entities |
zoom_window | Zoom to a specified window |
get_screenshot | Capture current AutoCAD view as PNG |
Screenshots use PrintWindow (Win32) for the File IPC backend — works even when AutoCAD is minimized or in the background. The ezdxf backend renders via matplotlib.
system — Server managementstatus, health, get_backend, runtime, init, execute_lisp
execute_lispruns arbitrary AutoLISP code (File IPC only). Passdata: {code: "(+ 1 2)"}. This turns the server into an extensible automation platform — any valid AutoLISP expression can be executed.
MCP Client (Claude)
│ stdio (JSON-RPC)
▼
Python MCP Server (autocad_mcp)
│
├── File IPC Backend ──► C:/temp/*.json ──► mcp_dispatch.lsp (AutoCAD LT)
│ PostMessageW(WM_CHAR) to MDIClient — no focus steal
│
└── ezdxf Backend ──► in-memory DXF (headless, no AutoCAD needed)The File IPC backend sends keystrokes to AutoCAD's MDIClient window via PostMessageW(WM_CHAR), triggering the (c:mcp-dispatch) AutoLISP command. This approach does not steal window focus — you can continue working in other applications while automation runs.
| Variable | Default | Description |
|---|---|---|
AUTOCAD_MCP_BACKEND | auto | Backend selection: auto, file_ipc, ezdxf |
AUTOCAD_MCP_IPC_DIR | C:/temp | Directory for IPC command/result JSON files (must match on both Python and LISP sides) |
AUTOCAD_MCP_IPC_TIMEOUT | 10.0 | IPC command timeout in seconds (1-300) |
AUTOCAD_MCP_ONLY_TEXT | false | Disable screenshot capture (text feedback only) |
Note: If you change
AUTOCAD_MCP_IPC_DIR, you must also update the*mcp-ipc-dir*variable inmcp_dispatch.lspto match.
uv sync
uv run pytest tests/ -vAutoLISP was added to AutoCAD LT in the 2024 release (Windows only). AutoCAD LT for Mac does not support AutoLISP.
| Supported (LT 2024+ Windows) | Not Supported |
|---|---|
.lsp / .fas / .vlx / .dcl | VLIDE (Visual LISP IDE) |
All vl-* utility functions | vlax-* (ActiveX/COM) |
File I/O (open, read-line, etc.) | Express Tools |
Entity access (entget, entmod, etc.) | 3D operations |
| Selection sets | AutoLISP on Mac |
The mcp_dispatch.lsp dispatcher is fully compatible with LT 2024+.
execute_lisp — Run arbitrary AutoLISP code via temp file pattern. Turns the server from a fixed command set into an extensible automation platform.drawing tool..dwg files programmatically (FILEDIA suppressed)._.NEW, preserving the LISP dispatcher namespace.save with a path parameter uses SAVEAS; without path uses QSAVE.get_variables fix — Respects the names parameter; returns requested variables with proper type handling.AUTOCAD_MCP_IPC_TIMEOUT env var (1–300 seconds, default 10).asyncio.Lock prevents parallel initialization races.MIT
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add autocad-mcp -- C:\path\to\autocad-mcp\.venv\Scripts\python.exe -m autocad_mcp{
"mcpServers": {
"autocad-mcp": {
"env": {
"AUTOCAD_MCP_BACKEND": ""
},
"args": [
"-m",
"autocad_mcp"
],
"command": "C:\\path\\to\\autocad-mcp\\.venv\\Scripts\\python.exe"
}
}
}code --add-mcp '{"name":"autocad-mcp","env":{"AUTOCAD_MCP_BACKEND":""},"args":["-m","autocad_mcp"],"command":"C:\\path\\to\\autocad-mcp\\.venv\\Scripts\\python.exe"}'[mcp_servers.autocad-mcp]
command = "C:\\path\\to\\autocad-mcp\\.venv\\Scripts\\python.exe"
args = ["-m", "autocad_mcp"]Runs locally on your device. Your client starts the server itself, so nothing has to be hosted.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/autocad-mcp-server to learn what the "AutoCAD MCP Server" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
This server runs locally, so we can't read its tool list over the web yet.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/autocad-mcp-server)Nothing comparable is listed yet.
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "autocad-mcp-server" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.