UC

u-c4n/autocad-mcp

Developer tools
397 stars 97 forks Quality 88 Trend 36MIT

Live through COM on Windows, or headless through ezdxf anywhere — one typed contract, two engines.

Overview

Live through COM on Windows, or headless through ezdxf anywhere — one typed contract, two engines.

README

v1.8 release snapshot: 257 tools · 13 resources · 5 prompt templates · 7583 collected tests. 257 is the registered count. Since 1.8.0 a default install lists six over tools/list (DISCOVERY_MODE=search: search_tools, describe_tool, call_tool and the three DISCOVERY_PINNED tools), and every tool the profile and packs allow stays callable by name; DISCOVERY_MODE=off lists 253: the 252 a default profile enables (ENABLE_3D unset hides the five solids) plus describe_tool. system_about is the runtime authority.

What’s new in 1.8

1.7 made what the server draws provable. 1.8.0 makes it remember, finish a job in one call and measure itself honestly (design). The new tools are entity_modify_where, layer_rename, layer_merge, checkpoint_create, checkpoint_list, checkpoint_restore, drawing_history, mech_part_revise and pid_project, and the new resources autocad://critique/focuses and autocad://pid/project/last; the counts are in the release snapshot above, and system_about is the authority.

What 1.8.0 adds
It remembers The operation journal is durable by default (sqlite in ACADMCP_STATE_DIR): a reopened file continues its document_id and revision, a client operation id replays after a restart, and headless drawing_undo steps back to the newest checkpoint, also after a restart. checkpoint_create / checkpoint_list / checkpoint_restore keep stored states; live, mode="in_place" is refused with capability checkpoint_restore_in_place and new_document opens the checkpoint instead. drawing_history finds the value a drawing had in round 2 in two calls after a restart. Every headless DXF write is atomic, and drawing_open(path, recover=True) reads a damaged DXF into a new lineage whose source is protected (recovered_source_protected)
One call, not hundreds entity_modify_where is QSELECT + CHPROP with a dry run, layer_rename renames every reference, layer_merge is LAYMRG, and dimension_auto(selector=...) dimensions a whole part. Measured task cells: a layer clean-up in 2 calls (1.7.0: 124) and a plate’s dimensions in 2 (1.7.0: 89). A cad_batch that writes is all or nothing by default, and a literal handle that names no entity refuses the whole batch before anything runs (unknown_handle)
Six tools listed, every tool callable DISCOVERY_MODE=search is the default: search_tools, describe_tool, call_tool and the pinned cad_batch, drawing_info and entity_list cost 1,026 prompt tokens idle, against 59,138 for the full DISCOVERY_MODE=off list. A description over 800 characters is listed short, with Details: describe_tool.; the whole text is one call away (table below)
One error envelope Every error on every route is {ok: false, kind, category, retryable, hint, operation_id, ...}, typed by exception class and never by message text; the text content is what a 1.7 client read. A missing handle, path, command or file has its own kind (not_found, unknown_handle, file_not_found, …). A failed drawing_finalize returns its score, blocking rows and qa_coverage, so no second QA read is needed
QA that names what it did not check Every critique lane writes checked or not_checked with a reason, and qa_coverage carries them into finalize, delivery and the manifest. The dimension_truth focus judges a dimension by the text the sheet really shows (dim_override_disagrees, dim_render_stale, dim_value_hidden, …), and property_override reports entities that override their layer. A lineweight of -3 is Default, never ByLayer. With summary=True a 500-issue critique is answered in 735 characters
Parts revised, P&IDs as projects mech_part_revise changes a drawn part by its parameters and rebuilds its views in place, keeping its handles; a hand edit refuses it (hand_edited_tagged_entity), and a part drawn before 1.8.0 is model_drift until overwrite=True. pid_line_draw(route="avoid") goes round the symbols between its ports (no_route, routing_budget_exceeded), checked by the new pid_line_through_symbol focus. pid_project checks off-page links, cross-sheet tags and line continuity over a set of sheet files without modifying any; a .dwg sheet is read only on the live engine and refused headlessly with capability dwg
DWG opens headlessly drawing_open on a .dwg converts it through the ODA File Converter, then AutoCAD’s accoreconsole. With neither it is a typed capability refusal (dwg_read); when every route fails it is dwg_conversion_failed with its attempts[]. A save onto the .dwg is still refused (dwg): save it as .dxf
Narrowed on request READ_ONLY, TOOL_ALLOWLIST / TOOL_DENYLIST and MAX_TOOL_COST refuse a call before anything runs (policy_refused). A writer takes only its own extensions and never a name AutoCAD or Windows loads (path_refused). The HTTP transport refuses an unknown Origin (403), a foreign Host (421) and a body over 8 MiB (413). system_run_lisp runs an AutoLISP read tier under LISP_POLICY=read (COM only: the headless engine has no LISP)
The live engine draws where it means to A live seat draws in model space until layout_set_current names a sheet; the tab the operator clicks no longer moves it. system_run_command and live undo / redo wait for the command and can fail command_incomplete. One display refresh per COM job, and entity_batch_create / entity_delete_many run as STA jobs sliced at a quarter of COM_CALL_TIMEOUT. All fourteen live smokes passed for this release (AutoCAD 2026, 1.8.0) at da2d7f6, the tree before the four tracker fixes below, whose live checks are partial: see Live evidence in the changelog
Four tracker reports, fixed the same day view_screenshot captures the whole AutoCAD window at any display scaling, not the top-left 2/3 at 150 % (#17); page_setup_apply takes the device’s full-bleed and expanded media, ISO_full_bleed_A3_(420.00_x_297.00_MM) or bleed="full_bleed" (#18); CAD_LAUNCH=never keeps the live engine to the session you opened, and a launch that never accepts Visible is quit, not left windowless (#19); a live entity_get on a DIMENSION / HATCH reuses one Document.Export for COM_SNAPSHOT_TTL seconds instead of exporting the drawing per call (#20). Issues fixed from the tracker in the changelog says what each one measured
Evidence Correctness suite 83 / 83 against v1.7.0’s 61 / 83, 22 fixed and 0 regressed (ab-v1.7.0-vs-v1.8.0.json). Matrix v9: 47 / 47 attempted tasks of 49 (lisp_read_tier environment_blocked, std_tables_b40 not_run). The full headless suite: 7582 passed, 1 xfailed. The headless performance gate against v1.7.0: ok: true, ratios 0.96 to 1.06 (perf-v1.7.0-vs-v1.8.0.json; the 1.06 is the durable journal, measured). The token budget gate exits 0 (evidence)

One call where 1.7 needed hundreds

drawing_open(path)                                 the journal continues the file's id and revision
entity_modify_where(where, set, dry_run=True)      count, would_change and a preview
cad_batch(steps, expected_revision=...)            all or nothing; a missing handle refuses the batch
dimension_auto(selector={"layer": "GEOMETRY"})     a part dimensioned in one call
drawing_critique(focus=None, summary=True)         compact; qa_coverage names every lane not checked
drawing_history(handle=..., detail="args")         what a value was in round 2, after a restart
checkpoint_restore("cp-3", mode="new_document")    back to a stored state, as its own document

Several defaults changed. Each has a switch back to 1.7.0’s behaviour where one exists (DISCOVERY_MODE=off, cad_batch(on_error="stop"), JOURNAL_DURABLE=off, LISP_POLICY=denylist, strict_critique=False, COM_REFRESH_MODE=regen, …), and the changelog’s Breaking at a glance lists every one. Not in 1.8.0: no B40 feature-table row is transcribed (every size is still refused by name), and the native .NET worker is deferred to 1.9.0 by a rule fixed before any measurement (docs/adr/0001-native-worker.md).

Earlier releases, 1.7 and 1.6 included, are in the changelog.

What it draws

Why this exists

Install

pip install autocad-mcp-pro     # or: uvx autocad-mcp-pro
autocad-mcp                     # stdio MCP server, backend auto-selected
AUTOCAD_MCP_BACKEND=ezdxf autocad-mcp    # portable DXF engine, no AutoCAD needed
AUTOCAD_MCP_BACKEND=com   autocad-mcp    # live AutoCAD (needs the [com] extra)
Extra Pulls in For
(none) fastmcp, ezdxf, pydantic Headless DXF on any OS — no rendering
[com] pywin32, Pillow Live AutoCAD control + window capture
[pdf] matplotlib PDF export and headless PNG, any platform
[office] openpyxl XLSX workbooks (takeoffs, data_extract); CSV is always written
[full] everything above Development and CI

[!NOTE] The bare install cannot draw pixels — ezdxf.addons.drawing imports Pillow unconditionally, so every render path needs it. Add [pdf] for images on Linux or macOS.

As a Claude Code plugin

The server and the premium skill install together. The skill teaches the measured workflow: requirements → geometry → verified on the CAD → saved → reopened → delivered.

claude plugin marketplace add U-C4N/Autocad-MCP
claude plugin install autocad-mcp-pro@autocad-mcp

The plugin runs uvx --from "autocad-mcp-pro[com,pdf,office]==1.8.0" autocad-mcp, which is this release at exactly the plugin’s version, so it needs uv. Set AUTOCAD_MCP_SOURCE to a checkout (C:/path/to/Autocad-MCP[com,pdf,office]) to run that code instead. The plugin starts the server in search mode (DISCOVERY_MODE=${AUTOCAD_MCP_DISCOVERY:-search}); set AUTOCAD_MCP_DISCOVERY=off for the full catalog. Already running the server yourself? Keep one: turn the plugin’s server off in /mcp, or copy .claude/skills/autocad-mcp-premium/ into your .claude/skills/ instead. plugin/README.md has the details.

What you get

Area What it does
Drawing lifecycle create, open (a damaged DXF with drawing_open(recover=True), which reports every fix and protects the source; a DWG headlessly through the ODA File Converter or AutoCAD’s accoreconsole), save (atomic headlessly: a checked temporary file renamed over the target), export DXF/PDF, audit (repairs), purge, undo/redo (reporting verified). A reopened file continues its document id and revision; a file changed outside the server says external_change, and one the server ended before saving says lost_since_save
Durability & history headless, every save, open, new drawing, rollback batch and checkpoint_create(label) keeps a gzip checkpoint in ACADMCP_STATE_DIR; live AutoCAD keeps one only at checkpoint_create, at each transaction_begin and before entity_delete_many / drawing_purge / text_find_replace - not at a save, an open or a new drawing. The headless drawing_undo steps back to it after a restart too (granularity save / batch / label). checkpoint_list / checkpoint_restore(mode="in_place"|"new_document") (an in-place restore is itself undoable; live AutoCAD restores as a new document). drawing_history(label=, handle=, query=, detail=) reads what was done to the drawing, with which arguments, across restarts: label a round with _meta.label or cad_batch(label=), then read its value back in two calls. drawing_diff(old_checkpoint=, new_checkpoint=) compares checkpoints, with feature-payload and dimension-measurement changes
Geometry lines, arcs, polylines (with bulges), splines, hatches, trim/extend/fillet/chamfer, handle-preserving edits: entity_edit_geometry moves circle, line and arc geometry, rewrites a polyline’s points / bulges (the vertex count may change) and moves a TEXT/MTEXT by x / y; entity_edit_text edits content, height, rotation and position
Set-based edits entity_modify_where(where, set) restyles every entity a filter matches in one call (QSELECT + CHPROP: layer globs, type, colour, linetype, lineweight, region, block); dry_run returns the count, the first 20 handles and a preview, and an expect_count the drawing no longer matches is refused stale_revision. layer_rename renames a layer and every reference to it; layer_merge (LAYMRG) moves the sources’ entities in model space, every sheet and every block definition onto a target and names the block definitions it touched. Entities on locked layers are skipped and reported
Annotation ISO 129 toleranced dimensions, ISO 286 fits (fit="H7", interference shafts r/s/t/u included), TABLE, MLEADER, GD&T frames and datums (ISO 1101). dimension_auto(selector={"layer": "GEOMETRY"}) dimensions a whole part in one call - polyline edges per side, hole diameters, arc radii, the overall size - with include, group_equal (6× Ø11), skip_existing (on by default: a rerun draws nothing) and dry_run; whatever it cannot dimension is listed in omitted with its reason. A headless dimstyle_modify redraws the dimensions using the style (rerender=False leaves them stale, as 1.7 did)
Engineering generators involute gears (front + section A-A), DIN 6885 keyed bores, ISO A3 title block
Mechanical parts one part model (segments or outline + typed features) and one view engine: front / side / top / section / detail with hidden lines, ISO 128-50 cut faces and ISO 129 dimensions. ISO 4014/4017/4032/7089/4762 fasteners and ISO 15 bearings insert as real blocks with attributes. mech_part_revise(part_id, changes) changes a drawn part’s parameters by path ({"features.bore.diameter": 24}) and rebuilds its views in place, keeping the handles of the lines, circles and arcs it edits; a hand-edited tagged entity or a part drawn before 1.8.0 is refused unless overwrite=True, and each revision joins a model history that travels with the file (mech_part_inspect(history=True, param=...), drift=True for what no longer matches the model). DIN 471/472, DIN 509, DIN 332 and ISO 3601-2 features have their drawing code and, since 1.8.0, a double-entry transcription pipeline, but their tables still ship empty (see limits). Also ISO 21920-1 surface texture, ISO 2553 welds and ISO 128-40 section lines
Sheet & delivery ISO 5457 frames A4-A0 with zones and trim marks, ISO 7200 title blocks for every size, revision blocks with clouds, ISO 7573 parts lists with ISO 6433 balloons linked by XDATA, CSV/XLSX extraction, xrefs and images on both engines, real .dwg on a live seat
Architecture one plan model (walls with hosted doors and windows) and one engine that resolves L / T / X junctions, cuts openings and draws poché by material. Room areas are measured from the faces the walls enclose, never typed, and rooms are read back from any plan with a confidence. Door / window / room schedules are real TABLEs. Also a furniture and sanitary catalogue at nominal sizes, a structural grid, north arrow, section / level / elevation marks, exterior dimension chains, and English or Turkish labels (lang="tr", decimal comma)
Understanding & takeoffs drawing_understand reads a drawing somebody else made in one call: declared vs inferred units, robust extents and the outlier behind them, plan copies, each layer’s discipline and service in five languages, tags, rooms. drawing_scale_check says whether a P&ID is to scale against its layout. pipe_takeoff / cable_takeoff take the topology from the P&ID and the lengths from the layout (rectilinear MST, statuses A/B/C, power never invented) into a Turkish / English / Russian workbook. drawing_diff compares revisions; drawing_topology_check finds dangling ends, near misses and crossings
P&ID catalogue blocks with ports and tags (ISO 10628-2 / ISA-5.1), port-to-port lines with ISA-5.1 classes and line numbers, pid_graph reads any P&ID back with confidence, instrument index / line list / equipment list, pid_from_spec one-call sheets. An avoid line (pid_line_draw(route="avoid", clearance=, keep_out=), pid_from_spec’s sheet.routing: "avoid") goes round the vessels between its ports, and obstacle_hits / the pid_line_through_symbol focus say when a line does not. pid_project checks a project of several sheet files without modifying any: off-page links matched across files, cross-sheet duplicate tags, line-number continuity, and the three lists merged with a sheet column (last result: autocad://pid/project/last)
Styles & standards ISO-25 / ANSI dimension styles, ISOCP / ROMANS text styles, ISO / ANSI leader styles from authored presets; drawing_apply_standard("iso") sets all of it plus units and the mech layers in one call; changed reports only what moved
Discovery the default since 1.8.0 (DISCOVERY_MODE=search): a client lists search_tools, describe_tool, call_tool and the DISCOVERY_PINNED tools (cad_batch, drawing_info, entity_list), and can still call every tool by name. search_tools is ranked over an AutoCAD command and synonym corpus — FILLET, BPOLY, QSELECT, WBLOCK, OVERKILL, CHSPACE each rank #1 among the 252 tools a default install searches (the v9 tool_discovery task); describe_tool returns one hit’s full input schema, risk, pack and its docstring’s own examples, or up to 25 with names=[...]. The server instructions name only the tools the client can see and teach batching first
Batching cad_batch runs a step list in one round trip and, since 1.8.0, is all or nothing by default (on_error="auto": a batch that writes is rolled back on a failure; on_error="stop" keeps the steps before it). A literal handle that names no entity refuses the whole batch before anything runs (unknown_handle); the result carries changes {added, deleted, counts} and label= names it in the history. entity_delete_many deletes all of its handles or none. fields= projects 11 result-heavy tools
Paper space tab lifecycle, viewports, entity_change_space (CHSPACE), drawing_export_pdf(layout=…)
Page setup & templates ISO 216 / ANSI Y14.1 sheets, ctb catalog, page_setup_apply on both engines (paper also takes a canonical media name exactly as AutoCAD spells it, e.g. ISO_full_bleed_A3_(420.00_x_297.00_MM), or a catalogue paper with bleed="full_bleed" / "expand"; the name’s numbers fix the sheet size and orientation, a contradicting orientation is refused, and on a live seat a media the device does not list in GetCanonicalMediaNames() is refused with its three closest names, #18), and batch_plot with every sheet size read back from its PDF’s /MediaBox. Five bundled templates, built by the server’s own tools and pinned reproducible: drawing_new(template="iso_a3_mech"), iso_a1_arch, iso_a3_pid, ansi_b_mech, ansi_d_arch. Save any drawing as a template (.dwt on live AutoCAD; dwt_write refused headlessly)
Environment several open documents headlessly, portable layer states (ACADMCP_LAYERSTATES XRECORDs — in the file, not in AutoCAD’s Layer States Manager), named views, UCS (tool coordinates stay WCS), a system-variable catalog with ranges, document properties. On a live seat: launch/attach, preferences, and an operator prompt / pick / select, where ESC is cancelled, not an error
Selection window vs crossing stated back to the caller; a polygon tested against its own shape, not its bounding box
Boundaries boundary_trace (BOUNDARY/BPOLY) chains loose edges into one closed polyline, arcs kept as bulges (headless)
Measurement analysis_measure_entity measures what is in the drawing, by handle
Hatch depth gradients, in-place edits, typed edge boundaries (headless), island styles
Annotation objects WIPEOUT, REVCLOUD, MTEXT background masks (headless), text find/replace
3D solids solid_box/cylinder/extrude/revolve/boolean on live AutoCAD (ENABLE_3D=true)
Quality loop drawing_preflight → drawing_plan → drawing_critique → drawing_refine → drawing_finalize (0–100 score); the general focuses (iso128, layer_color, dim_overlap, untrimmed_corner, duplicate_entities, construction_left, property_override (an entity on an engineering layer that overrides the layer’s lineweight, colour or linetype; drawing_refine sets it back to ByLayer), dimension_truth (a DIMENSION whose override, DIMLFAC, rendered block, group 42, prefix or visibility disagrees with its geometry or its style; drawing_refine redraws a stale block and leaves the lies to a person), gdt) plus 20 domain critique focuses (P&ID 7 - with pid_line_through_symbol, a line through a symbol that is not its end - mechanical 7 - with model_drift, a drawn part whose tagged entities or views no longer match its stored model - architecture 3, topology 3), each silent on a drawing outside its domain; autocad://critique/focuses lists every one with what it reports. Every check reads every entity of every space, and a check that fails says so. Every check also says what it looked at: drawing_critique(report=True) returns the coverage per layout, and drawing_finalize / drawing_deliver carry qa_coverage, naming each lane that was not checked and why (no_viewport_scale, engine_live_document_template, …); strict_critique=True fails on those. drawing_critique, validation_check and drawing_topology_check take summary / limit and answer {total, by_focus, by_severity, issues[:limit]}, total always complete. A failed drawing_finalize returns its score and blocking rows (detail="full" for all of them)
Verification drawing_verify_requirements binds typed source requirements to the real features (handle, feature tag, geometry or DIMENSION) and measures them on the drawing or on a saved file: distance, radius, diameter, angle, concentric, parallel, perpendicular, tangent, counts and absence, each pass / fail / unknown / unsupported / ambiguous with its evidence, as JSON or Markdown. The set can be stored in the drawing itself
Delivery drawing_deliver: DXF/PDF/PNG + SHA-256 manifest, reopen parity against a second export over every space and block definition (its scope says what that can and cannot see), and with requirements= every requirement measured again on the reopened file; the open document is never re-pointed at the export
Safe edits documents carry an id and a content revision; cad_batch / drawing_refine / text_find_replace / pid_from_spec preview exactly and apply only against an unchanged revision; a client operation id replays a retried call instead of repeating it, also after a restart (the journal is durable, in ACADMCP_STATE_DIR)
Errors every failure on every route is one typed envelope: {ok: false, kind, category, retryable, hint, tool, backend, operation_id, message} beside the unchanged sentence. retryable is true only when nothing was written; a refused raw command lists the typed tools that do the same job (alternatives)
Security READ_ONLY, TOOL_ALLOWLIST / TOOL_DENYLIST and MAX_TOOL_COST narrow what a client may reach: a refused tool is not advertised, and a call to it - direct, through call_tool, or as a cad_batch step - is refused policy_refused before anything runs (system_status.policy says what is in force). Every writer accepts only its own extensions and none writes a file AutoCAD or Windows loads (acad*.lsp, .fas, .scr, .dll, acad.pgp, …), even inside ALLOWED_PATHS. Over HTTP, an unknown Origin is 403, a foreign Host 421, a body over 8 MiB 413, tokens are compared in constant time, and MCP_AUTH_TOKEN_READONLY issues a read-only token. system_run_lisp runs the AutoLISP read tier (vla-get-*, entget, mapcar over a lambda, …) under LISP_POLICY=read, and refuses the rest with symbol, line, column and the typed alternatives
Session metrics system_status(metrics=True) reports this connection’s calls, by_tool, result_bytes, errors_by_kind and p50 / p95 ms, and on a live seat each COM job’s queue / guard / work / refresh / counter ms; off by default. system_status.operations is a short summary ({count, last, unknown_commit}); drawing_history lists the calls
Live speed the live engine refreshes the display once per COM job (Update() of the entity for a single create, one Regen otherwise; COM_REFRESH_MODE=regen for a seat where Update() does not paint), entity_batch_create / entity_delete_many run as one STA job sliced inside COM_CALL_TIMEOUT, and the corner operations read only the target block’s new entities. benchmarks/perf_com.py measures it against v1.7.0 on a live seat: on AutoCAD 2026 three of its four targets are missed (see What this release is bad at)

257 tools in 28 groups. TOOL_PACKS=core hides these from a client that needs none of them: the ten pid_* tools, the 22 environment tools, the 15 mechanical tools, the 12 architectural tools and the two plant takeoffs. TOOL_PACKS=core,mech keeps the mechanical ones, TOOL_PACKS=core,arch the architectural ones, and TOOL_PACKS=core,plant the takeoffs. There are also 13 resources that cost nothing in the tool budget (autocad://drawing/info, layers, blocks, entities/stats, entities/{layer_name}, system/status, pid/symbols, pid/project/last, standards/isa51, standards/coverage, critique/focuses, and the task recipes recipes/index and recipes/{recipe_id} - seven recipes, among them layer_cleanup and dimension_part, each one cad_batch) and 5 prompt templates.

Three rules worth knowing.

  • Every coordinate in and out of a tool is WCS on both engines. The one exception is TEXT rotation, which stays in the entity frame: a mirrored TEXT is mirror-imaged, and no scalar angle expresses that.
  • Never read vertices back and shoelace them. That silently loses 28.2% of the area on a semicircular edge. analysis_measure_entity(handle) reads the real geometry and states its own accuracy.
  • A lineweight of -3 is Default (the LWDEFAULT setting), not ByLayer: ByLayer is -1 and ByBlock -2. Every lineweight input also takes the names "ByLayer", "ByBlock" and "Default", a layer refuses ByLayer and ByBlock by name, and entity rows carry lineweight_name.

The two engines

One contract across 23 modules in backends/contracts/. @capability(key, reason=…) supplies a default that refuses, and a test holds both backends’ capability key sets equal. There are 45 capability keys. Read system_capabilities at runtime rather than trusting the table: several depend on what the machine has installed (matplotlib, openpyxl, the ODA File Converter).

Capability COM (live AutoCAD) ezdxf (headless)
Live document control ✅ —
Cross-platform, no AutoCAD — ✅
Transactions and rollback ✅ ✅
Paper-space layouts + viewports ✅ ✅
Viewport model-content rendering ✅ ✅ ᵐ (no borders)
Selection window / crossing / polygon ✅ ✅
Entity area by handle ActiveX .Area Analytic, bulges included
HATCH filled area (islands subtracted) AutoCAD’s own number Loops walked, hatch_style reported
HATCH loops and DIMENSION fields in entity_get ✅ read from a Document.Export snapshot, which costs about as much as drawing_understand on a large drawing and is reused for COM_SNAPSHOT_TTL seconds (default 5) while the document’s revision and operator-edit count stand still, so N reads of an unchanged drawing cost one export; an entity missing from the reused export is read from a fresh one; system_status.snapshot_reuse counts exports and reuses (#20) ✅
A session bound to its document ✅ an active-tab switch is refused, view_screenshot included; a restarted AutoCAD is a new document (application_changed); the operator’s object edits move the revision — only the server switches documents
Where new geometry goes model space until layout_set_current names a sheet; the layout tab the operator clicks never moves it model space until layout_set_current
Raw commands system_run_command waits for the command (COMMAND_DEADLINE_S) and reports created entities and last_prompt; a command left at a prompt is command_incomplete — refused by name
REGION / 3DSOLID area ✅ — ACIS is opaque to ezdxf
3D solids ✅ with ENABLE_3D=true —
DWG read ✅ native drawing_open converts it through the ODA File Converter, then AutoCAD’s accoreconsole (ACCORECONSOLE_PATH), if installed; otherwise refused dwg_read. The opened drawing is saved as .dxf
DWG write ✅ SaveAs via the ODA File Converter, if installed
.dwt templates ✅ DXF only — dwt_write refuses
Reading a foreign drawing (drawing_understand, takeoffs) ✅ one Document.Export snapshot; the document is never renamed ✅
XLSX workbooks ✅ ᵒ ✅ ᵒ
Preferences · launch · operator prompts ✅ — refused by name
WIPEOUT · MTEXT background colour — verified absent, AutoCAD 2026 ✅
REVCLOUD · BPOLY · typed hatch edges — no ActiveX member ✅
CHSPACE — unverified on a live seat ✅ ᶜ
Undo history ✅ AutoCAD’s own; a checkpoint restores as a new document (checkpoint_restore_in_place refused) durable checkpoints, also after a restart; per-call steps opt-in with EZDXF_UNDO_DEPTH
TABLE and MLEADER Native Portable composite
Screenshots and PDF Window capture, DPI-aware: the server makes itself DPI-aware before reading AutoCAD’s window rectangle, so the whole window is captured at any Windows display scaling, and the report states dpi, capture (physical pixels) and window_minimized (#17) Matplotlib ᵐ
A region screenshot (view_screenshot(region=[x0, y0, x1, y1], max_px=)) ✅ the Document.Export snapshot drawn by the headless renderer (source: "export_snapshot") ✅ ᵐ

ᵐ Needs matplotlib ([pdf]/[full]). Without it, png, pdf, viewport_render and handle_overlay report unsupported headlessly. ᵒ Needs openpyxl ([office]/[full]). Without it, XLSX is refused with xlsx_write and CSV is still written. ᶜ Headless CHSPACE has four restrictions, named in its capability reason: top-view untwisted viewports only; dimensions refused unless frozen; ACIS, proxy and table entities refused; viewport clipping reported rather than applied.

[!IMPORTANT] The COM paths run against a live AutoCAD 2026 through eight asserting smoke scripts (scripts/smoke_*_com.py) on one harness (scripts/live/harness.py: attach only, its own documents, an active-document guard). The 1.7.0 runs passed 129 / 129 checks on the close-out commit 13499fe; their JSON is committed under benchmarks/results/live/. These runs catch what no headless test can: ActiveX refuses entity.Layer on a missing layer where ezdxf quietly creates it, calls a block reference BLOCKREFERENCE rather than INSERT, and, once pywin32’s type-library cache exists, hands every listed entity back as a bare IAcadEntity with no endpoints. Each of those broke a tool that passed every headless test.

The verification workflow

drawing_preflight(intent, requirements)        typed items: id, quantity, target + unit, feature, source
drawing_plan(..., persist_requirements=True)   the set travels inside the DWG/DXF
mech_part_draw(spec)                           every entity tagged with its feature
drawing_verify_requirements(use_stored=True)   measured on the document: pass / fail / unknown / ambiguous
drawing_critique(focus=None)                   drafting checks over every entity of every space
drawing_deliver(..., requirements=...)         exported, reopened, measured again on the file
drawing_verify_requirements(manifest_path=)    later: has anything in the delivery changed since?

A drafting score is not an acceptance. drawing_finalize still returns its 0–100 score, but with requirements= a requirement that does not pass blocks it (failed_acceptance), whatever the score.

Evidence

Every number here is produced by a script under benchmarks/ and published as JSON under benchmarks/results/published/; benchmarks/README.md explains each lane and keeps the full tables.

83 deterministic headless checks run against the previous tag and the current tree, each in its own subprocess:

Version Checks passing Pass rate Fixed Regressed
v1.7.0 (baseline) 61 / 83 73.5 % — —
v1.8.0 (this release) 83 / 83 100 % 22 0

The task matrix v9 (49 tasks, each one able to fail) passes 47 / 47 of the tasks the headless engine attempts (lanes-v9/); the headless performance gate against v1.7.0 is ok: true with ratios 0.96 to 1.06, the 1.06 being the durable journal’s one commit per mutating call (perf-v1.7.0-vs-v1.8.0.json); the token budget gate exits 0 (token-cost.json); and all fourteen live smokes passed on AutoCAD 2026 for this release at da2d7f6, before the four tracker fixes (matrix.json). What was measured and found wanting is in the changelog’s Live evidence and under the limits below.

What this release is bad at

A page that only lists strengths is a page that has not been measured.

Configuration

Nothing loads a .env file — export these, or set them in your MCP client’s env block.

Architecture

The diagram under The two engines is the call path; the typed contract is 23 modules under backends/contracts/ with 45 capability keys held equal on both engines.

Development

uv sync --locked --all-extras
uv run pytest
uv run ruff check . && uv run ruff format --check .

uv.lock pins the whole transitive graph, so this reproduces CI exactly. CI runs Linux (3.11 / 3.12) and Windows (mocked COM), plus package, Docker and MCP-registry jobs. It also runs claude plugin validate --strict on the marketplace and the plugin, the generated-file gates (build_plugin.py --check, generate_tool_inventory.py --check, check_doc_numbers.py), the token-budget job (python -m benchmarks.token_suite --lanes idle,task --budget benchmarks/token_budget.json and python -m benchmarks.call_budget: a ci-gated ceiling breached, an idle row grown more than 5 % over the published report or a scripted job not done fails the PR) and a contents check of the built wheel and sdist: the wheel holds the server and nothing else, and the sdist holds only what git tracks. The release gate runs the same three test lanes, plus a headless lane that runs the correctness suite against the previous tag with --fail-on-regression, before anything reaches PyPI. Releases are tag-driven: git tag vX.Y.Z && git push origin vX.Y.Z.

The live COM paths are checked on a running AutoCAD, never in CI: python scripts/smoke_verify_com.py --json out/verify.json (and the twelve other scripts/smoke_*_com.py) attaches to the open seat, works only in documents it creates, and closes them. python scripts/live/run_all.py runs all fourteen, each in its own process, and writes one matrix per release. For 1.8.0 every one passed in one run of one committed tree, with scripts/smoke_accore.py (the headless DWG read through accoreconsole) among them (AutoCAD 2026, 1.8.0): matrix.json. That run passed the five smokes written for 1.8.0, smoke_space_com.py, smoke_edit_com.py, smoke_render_com.py, smoke_lisp_com.py (the AutoLISP read tier) and smoke_durability_com.py (checkpoints, the refused in-place restore, a new_document restore), and the stages 1.8.0 added to older ones: set edits, dimension truth and dimension auto in smoke_settings_com.py, the revise stage in smoke_mech_com.py, and the avoid and project stages in smoke_pid_com.py (AutoCAD 2026, 1.8.0). The B40 stage of smoke_mech_com.py ran in the same run (AutoCAD 2026, 1.8.0) and skipped all eight feature tables, which ship with no rows.

Roadmap

Star History

Author

Umutcan Edizsalan · Mechanical engineering work at Anka-Makine · GitHub @U-C4N

Built from production drawing work, then made model-agnostic through MCP.

License

MIT

mcp-name: io.github.u-c4n/autocad-mcp

View the full README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →

Configuration

{ "mcpServers": { "autocad": { "command": "autocad-mcp", "env": { "AUTOCAD_MCP_BACKEND": "auto", "ALLOWED_PATHS": "C:\\Users\\you\\Documents\\AutoCAD", "TOOL_PROFILE": "full", "TOOL_PACKS": "all", "DISCOVERY_MODE": "search" } } } }