U-C4N/Autocad-MCP
AutoCAD MCP server for AI agents (Claude, Cursor, any MCP client): 240+ tools to draw, edit and read DWG/DXF drawings. Live AutoCAD via COM, or headless with ezdxf — no AutoCAD needed. Mechanical sheets with ISO GD&T and tolerances, P&ID (ISA-5.1), floor plans, pipe and cable takeoffs.
6f6a538255caautocad-mcp-pro1.8.0 in pyproject.tomlPaths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
How far the analysis went
The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.
- Some paths pass through more than 8 functions one inside another; the scanner stops there
- In 1,297 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
- 1 file reached by the taint walk exceeded the 524288 byte size limit and were read and parsed only up to it
- 1 file exceeded the 524288 byte size limit and were parsed only up to it
- 1 source file could be read only in part
- 4 of 234 tools, prompts and resources could not be followed through the code
- 5 tools, prompts and resources registered only in the repository's tests are not counted on this page
Top risks in plain words
- CRITICAL10 production dependencies have known vulnerabilities (worst: critical).
- MEDIUMTool
drawing_deliverreads or writes any file path by design: an agent steered by prompt injection can use it that way.
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Give it only the folder it needs
drawing_delivercan read or write any file path. Mount a single project folder, read-only where you can. - Turn off the tools you do not use
Most MCP clients let you disable single tools. If you do not need
drawing_deliver, switch them off. - Update its vulnerable packages
Use
authlib1.9.1 or later,certifi2026.10.18 or later,dnspython2.9.2 or later,fastmcp3.4.10 or later and 6 more. - Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 229 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
drawing_deliveranalysis_measure_area, cad_batch, centre_marks, drawing_deliver, drawing_finalize, drawing_open and 17 moreNo tool was seen to: connect to the internet or other hosts; read passwords, tokens or keys; read environment variables; touch sensitive locations.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
- None: no credential-like variable is read by the tools.
Text it brings in from outside
Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.
- files14 tools · cad_batch, centre_marks, drawing_deliver +11
Tool annotations
215 of 229 tools declare annotations. readOnlyHint 61, destructiveHint 20, idempotentHint 3.
Tools, prompts and resources (229: 229 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
drawing_delivertool Create a hashed, validated delivery bundle and verify DXF save/reopen parity.ProcessesFilesoutside textdestructive (declared)Reads/writes files
Create a hashed, validated delivery bundle and verify DXF save/reopen parity.
The result status is ``success``, ``failed_validation``, ``failed_export`` or
``failed_acceptance``. Failure intentionally keeps all generated artifacts for
diagnosis.
The open document is never re-pointed or saved: the DXF is a copy (live:
``Document.Export``), and the manifest records the document's id, revision, path
and saved flag, the DXF version, every sha256 and the build. Parity reads the
delivered DXF back and compares it with a fresh serialisation of the document over
every space: zero changed, added or removed entities, the same counts per space,
the same block definitions. Both sides are exports, so parity cannot see content
the export itself loses (`parity.scope` says so); with requirements,
`parity.content_check` is `acceptance`, the check that can.
With ``requirements`` every requirement is measured on the delivered DXF, read
fresh and re-bound from the document; the bundle gains ``acceptance.json`` and
``acceptance.md``, the result ``geometry_acceptance``, ``drafting_quality`` (the
unchanged score), ``artifact_integrity``, ``coverage`` and ``blocking``, and a
requirement that does not pass, stale evidence or a dimension that disagrees
with its geometry makes the status ``failed_acceptance`` whatever the score
(``failed_export`` and ``failed_validation`` are reported first). Refused before
any work: requirements that do not parse (invalid_args).
A ``failed_validation`` / ``failed_acceptance`` result carries ``gate_failure``,
drawing_finalize's gate payload (kind, score, blocking rows with handles,
blocking_count, qa_coverage). Every result and the manifest carry ``qa_coverage``:
the lanes the critique did not check, as drawing_finalize reports them.analysis_bounding_boxtool Get the bounding box (extents) of all entities in the drawing.read-only (declared)
Get the bounding box (extents) of all entities in the drawing.
analysis_entity_statstool Analyze the drawing and return entity counts grouped by type and by layer.read-only (declared)
Analyze the drawing and return entity counts grouped by type and by layer.
Returns: total_entities, by_type (sorted by count), by_layer (sorted by count).
This is unique to AutoCAD MCP Pro – no other MCP server provides this!analysis_find_in_regiontool Find all entities within a rectangular region (crossing selection).read-only (declared)
Find all entities within a rectangular region (crossing selection).
Uncapped: a window over a busy drawing returns every hit. Project with
`fields` and/or `compact` before widening the window.analysis_layer_statstool Return detailed statistics for each layer: entity count, types present.read-only (declared)
Return detailed statistics for each layer: entity count, types present.
analysis_list_propertiestool AutoCAD's LIST: the full DXF attribute set for one handle.read-only (declared)
AutoCAD's LIST: the full DXF attribute set for one handle.
`dxf_attributes` is the raw attribute set `entity_get` deliberately does
not carry. Coordinates in it are WCS, like everywhere else in this server,
and `extrusion` is reported so the entity's own frame is still visible.analysis_measure_areatool Area and perimeter of a polygon you supply the vertices for.Filesread-only (declared)
Area and perimeter of a polygon you supply the vertices for.
This measures the numbers in the call, NOT the drawing. To measure something
that exists, use `analysis_measure_entity(handle)` — it reads the real
geometry, including curvature this tool can only see if you pass it.
Straight-edged polygons are exact. Pass a third `bulge` element per vertex
for arc edges; omitting it on curved geometry under-reports (28% on a
semicircular edge), which is why `assumes` says what was taken on faith.analysis_measure_distancetool Measure the Euclidean distance between two points.read-only (declared)
Measure the Euclidean distance between two points.
analysis_measure_entitytool Measure something already in the drawing, by handle.read-only (declared)
Measure something already in the drawing, by handle.
Reads the real geometry, so polyline bulges (arc edges) are included —
reading vertices back and shoelacing them yourself loses 28% of the area on
a semicircular edge, silently.
Measurable: LWPOLYLINE, 2D POLYLINE, CIRCLE, ELLIPSE, SPLINE, HATCH, SOLID,
TRACE, 3DFACE. REGION and 3DSOLID need the live COM backend (their area is
in ACIS data ezdxf cannot evaluate) and refuse with
`capability: "measure_area_acis"`. LINE/TEXT/INSERT bound no area on any
engine and are a plain error, not a capability gap.
The payload states its own accuracy: `exact` is false when the shape had to
be flattened (then `flatten_tolerance` says how finely), `assumed_closed` is
true when an open boundary was closed the way AutoCAD's AREA does, and
`self_intersecting` warns when the shoelace cancelled crossed lobes — a
bowtie measures 0.0 and that number is worse than useless unflagged.analysis_select_by_layertool Get all entities on a specific layer. Returns entity list with handles.read-only (declared)
Get all entities on a specific layer. Returns entity list with handles.
Capped at MAX_LIST_LIMIT (default 5000). The plain list cannot say it was
capped — the warning goes to the log stream, which most clients never show
the model — so use `compact=True` when the count matters: its `total` is the
layer's real population and `truncated` states whether the cap fired.analysis_select_by_typetool Get all entities of a specific type. Returns entity list with handles.read-only (declared)
Get all entities of a specific type. Returns entity list with handles.
Capped at MAX_LIST_LIMIT (default 5000); as with analysis_select_by_layer,
`compact=True` is the only shape that reports `total` and `truncated`.batch_plottool AutoCAD's PUBLISH for a PDF set, through `drawing_export_pdf(layout=…)`.
AutoCAD's PUBLISH for a PDF set, through `drawing_export_pdf(layout=…)`.
One row per sheet: `path`, `bytes`, and `mediabox_mm` **parsed from the
PDF that was written** (`/MediaBox`, points → mm), with `paper` naming the
catalogue size it matches within 0.5 mm — so the sheet size is verified,
never assumed. Model space is included only when named.
Refused before any file is written: a format other than pdf, an empty
`layouts` list, a layout that does not exist, a `file_pattern` containing a
path separator or lacking `{layout}` when more than one sheet is plotted,
and any output path outside the allowed directories. A sheet whose PDF has
no readable MediaBox is reported with `mediabox_mm: null` and an `error`.block_create_from_entitiestool Create a new block definition from existing entities in the drawing.
Create a new block definition from existing entities in the drawing.
Works on both engines. The originals stay in model space — this defines a
reusable block from them rather than consuming them the way AutoCAD's BLOCK
command does; use `block_insert` to place copies, and delete the originals
yourself if you want the command's behaviour.
Handles that do not resolve are listed in `skipped` rather than silently
dropped, and a call where none resolve fails instead of leaving an empty
definition behind.block_definetool Create a block definition with attribute definitions from typed specs.
Create a block definition with attribute definitions from typed specs.
The whole request is validated before anything is written: one malformed
entry refuses the call and leaves no definition behind. Refusals: a
malformed primitive or ATTDEF (names `entities[i]`/`attdefs[i]` and the
key), a non-finite base point (names `base_x`/`base_y`), a name clash
without `overwrite`, an anonymous `*` name, and a primitive `layer` that
is not in the drawing's layer table (names the missing layers) unless
`create_layers=true`, which creates them and lists them in
`layers_created`. `overwrite=true` replaces the *contents* of an existing
block so its INSERTs keep pointing at the name and show the new geometry;
`replaced` reports it. Geometry inside the block is ByBlock so the
INSERT's layer supplies colour and lineweight. Insert with
`block_insert(attributes={TAG: value})`.block_explodetool Explode a block reference into its component entities, keeping itsdestructive (declared)
Explode a block reference into its component entities, keeping its
attribute text (the Express Tools BURST rule, on both engines).
Every attached ATTRIB becomes a TEXT with the same value, placement,
height, rotation and layer (an invisible attribute becomes an invisible
TEXT; a multi-line attribute becomes an MTEXT carrying every line), and
a constant attribute (which has no ATTRIB) becomes a TEXT of its value
too; AutoCAD's plain EXPLODE would keep only the tag-name placeholders
and drop the values. Everything lands in the layout that owns the
reference (model space or its paper-space sheet), whichever tab is
current. Returns `inserted_handles` (the geometry), `attribute_texts`
(one TEXT or MTEXT handle per attribute), `exploded_handle` and
`backend`. Refused, with nothing written: a handle that is not a block
reference, a reference nested inside a block definition (explode the
outer reference instead), an external reference (bind it first), a
MINSERT grid, and -- headless only, capability `explode_opaque_members`
-- a block holding a member ezdxf cannot transform (an OLE2FRAME logo, a
VIEWPORT, a proxy entity without proxy graphics), named by member; the
live engine hands those to AutoCAD. Not undoable except through
`drawing_undo` / a transaction.block_find_referencestool Find all insert references to a specific block definition.read-only (declared)
Find all insert references to a specific block definition.
Bounded by the backend's own default entity_list page (200 INSERTs scanned),
which is a pre-existing limit, not a new one: the compact envelope's `total`
counts the references found within that scan.block_get_attributestool Get all attribute values from a block reference as {TAG: value} dict.read-only (declared)
Get all attribute values from a block reference as {TAG: value} dict.
A multi-line attribute reports its whole content with `\\P` between the
lines (AutoCAD's `TextString`), on both engines.block_inserttool Insert a block and optionally set attribute values.
Insert a block and optionally set attribute values.
Refused before any write, on both engines: an undefined or layout block
name, and an attribute value that is not text — a string is written as
is (one line), an int or finite float as its plain digits (`101` →
`"101"`), while `null`, booleans, lists and objects are refused naming
the tag (they used to be written as their Python repr). Values for tags
the block does not define are ignored.block_listtool List all block definitions in the drawing (name, origin, attribute count, entity count).read-only (declared)
List all block definitions in the drawing (name, origin, attribute count, entity count).
Never truncated — the whole block table is returned — so a compact envelope
here always reports truncated=false.block_set_attributestool Update attribute values in a block reference.
Update attribute values in a block reference.
Same value rule as `block_insert`: strings and numbers are written,
`null` / booleans / lists / objects are refused naming the tag before
anything changes. `updated_tags` lists the tags that exist on the
reference and were written; unknown tags are ignored.
A multi-line attribute takes `Line1\\PLine2` and keeps every line; the
value written is the one `block_get_attributes` reads back and
`block_explode` bursts, on both engines.boundary_from_entitiestool Chain the given entities into one closed polyline.
Chain the given entities into one closed polyline.
The handles may arrive in any order — putting them in chain order is the
tool's job. A chain that does not close is refused, and the error names the
coordinates of the gap.boundary_tracetool AutoCAD's BOUNDARY/BPOLY: create a closed polyline around a seed point.
AutoCAD's BOUNDARY/BPOLY: create a closed polyline around a seed point.
Returns the *nearest enclosing* loop, so a seed inside an island gives the
island rather than the outer region. Straight edges are split where they
cross, so a line drawn across a shape divides it the way it looks like it
should. A seed with no enclosing loop is refused, and the error names the
gap when the edges nearly close.cad_batchtool Execute an ordered list of tool calls in ONE round trip.Filesoutside textdestructive (declared)
Execute an ordered list of tool calls in ONE round trip.
N calls collapse into one request/response pair, and `bind` lets a later
step reference an earlier step's result so handles never have to be echoed
back through the model.
steps=[
{"tool": "entity_create_line", "args": {...}, "bind": "edge"},
{"tool": "point_from_snap", "args": {"handle": "$edge", "snap": "mid"},
"bind": "mid"},
{"tool": "entity_create_circle","args": {"cx": "$mid.x", "cy": "$mid.y",
"radius": 4}},
]
Successful steps report only their handle; pass verbose=True for the full
result. Anything without a handle is returned whole.
VALIDATION runs first, always: an unknown tool, a schema-invalid argument or
a reference no earlier step binds refuses the whole batch before anything
executes. So does a LITERAL handle (in a handle parameter) that names no
entity: one fingerprint read checks them all, and a missing one refuses
the batch with kind unknown_handle, naming each step index and handle -
executed 0. A literal handle after a step that opens, switches or restores
a document (drawing_open, drawing_undo, ...) is checked when its step runs.
`on_error` governs run-time failures only. dry_run=True returns that
validation report and executes nothing.
ERRORS are typed, never text: each failed step carries error.kind - one of
unsupported (with the backend `capability`), invalid_args, refused, failed,
unknown_tool, unresolved_ref, denied, malformed_step, quarantined, busy,
active_document_changed (live engine: the operator switched documents),
stale_revision, scan_incomplete, timed_out, unknown_commit (a write that
outran its deadline while its worker ran), cancelled, operation_conflict,
unknown_handle - and its own `operation_id`.
PREVIEW AND APPLY. dry_run=True also returns `preview`: the document id and
content revision, the exact fingerprint of every LITERAL handle in a handle
parameter (a '$reference' resolves late and an entity a step creates has
none) and the planned steps. Pass its `revision` as expected_revision and
its `preconditions` back, and the batch runs only if nothing moved -
otherwise it is refused with kind stale_revision and no step runs. A
guarded batch reports `revision`: {checked, after, interleaved}; each step
is its own locked call, so a change another call made between two steps is
listed under `interleaved` (a rollback restores the checkpoint, that change
included).
OPERATIONS: the batch and each step are operations with their own ids
(drawing_history lists them). Pass `operation_id` (or the
request's `_meta.operation_id`) to make a retry safe: the same id with the
same steps replays the recorded result instead of drawing twice, also
after a restart (the journal is durable since 1.8.0).
ATOMICITY is reported, not assumed. The default on_error="auto" (since
1.8.0; 1.7 defaulted to "stop") makes a batch with at least one mutating
step all or nothing: on the headless backend a run-time failure restores a
full document snapshot; on live AutoCAD it sends an UNDO, judged by the
before/after fingerprints once AutoCAD is idle (CMDACTIVE 0). A read-only
batch opens no checkpoint, and neither does one with a transaction_begin /
transaction_commit / transaction_rollback step: it runs as "stop" (live
AutoCAD does not nest a transaction). Read the `atomicity` block: `mode` is what ran,
`default_applied` (auto only) whether auto's checkpoint was opened,
`verified` whether the rollback was evidenced. Pass on_error="stop" to
keep the steps that ran before a failure. Under an explicit
on_error="rollback", a checkpoint a step opens with transaction_begin is
closed with the batch's (`unwound`).
CHANGES: `changes` {added, deleted, counts, complete} sums the steps; a
failed batch reports `partial_changes`.
NOT CALLABLE from a batch: the raw command/LISP escape hatches, and
cad_batch itself. Call those directly. A step the server's tool policy
refuses (READ_ONLY, TOOL_ALLOWLIST / TOOL_DENYLIST, MAX_TOOL_COST) refuses
the whole batch before any step runs, kind policy_refused.
For a few hundred entities of the same kind, entity_batch_create is denser
still (no per-step tool name) - and it can be one step of a cad_batch.centre_markstool Centre marks on the CENTER layer, whose linetype carries ISO 128-23's dash pattern.Filesoutside text
Centre marks on the CENTER layer, whose linetype carries ISO 128-23's dash pattern.
Pass `handles` and the radii are read back with `entity_get` rather than
restated — a radius from memory is the classic silent wrong number.
Refusals, all before the first entity is written: neither `handles` nor
`centers` given (or both), a handle that is not a CIRCLE or ARC, a circle
in a plane tilted out of WCS XY (capability `ocs_tilted_plane`, so it has
no radius in this frame), a `style` outside mark/lines, a non-positive
`extension`, and `style='lines'` on a centre given without a radius.checkpoint_createtool Store the drawing as it is now as a durable checkpoint, optionally labelled.
Store the drawing as it is now as a durable checkpoint, optionally labelled.
Checkpoints live in the state folder (ACADMCP_STATE_DIR), gzip-compressed,
and survive a server restart: drawing_undo steps back to them and
checkpoint_restore brings one back. Saves, the open, a new drawing and every
rollback-mode cad_batch / transaction boundary take one by themselves; this
adds one where you want a named point (`granularity: "label"`). The drawing
is not changed. Returns `{cp, seq, tool, rev, kb, label}`.
Refused: `checkpoints` (unsupported) when there is no state folder
(JOURNAL_DURABLE=off, or a refused ACADMCP_STATE_DIR). Live: the document is
exported with Document.Export.checkpoint_listtool The active drawing's checkpoints, newest first, across restarts.read-only (declared)
The active drawing's checkpoints, newest first, across restarts.
Each row is `{cp, seq, tool, rev, kb, label, evicted}`: `rev` is the content
revision it holds (compare with system_status / drawing_info), `tool` what
took it (drawing_save, drawing_open, drawing_new, transaction_commit,
checkpoint_create, ...). A row the CHECKPOINT_KEEP / CHECKPOINT_BUDGET_MB /
CHECKPOINT_MAX_DOC_MB budget evicted stays listed with `evicted: true`; its
bytes are gone and restoring it is refused `checkpoint_evicted`.
Refused: `checkpoints` (unsupported) when there is no state folder.checkpoint_restoretool Restore a durable checkpoint (see checkpoint_list).destructive (declared)
Restore a durable checkpoint (see checkpoint_list).
`in_place` first stores the current drawing as a checkpoint
(`checkpoint_before`), so the restore is itself undoable: drawing_undo
returns to it. The result names `restored` and the new `revision`.
`new_document` leaves the active drawing alone and opens the checkpoint as
its own document, which becomes the bound/active one.
Refused by kind: `checkpoint_not_found` (no such id, seq or label - the
message names the newest ones), `checkpoint_evicted` (the budget dropped its
bytes), `stale_revision` (expected_revision no longer holds), and on live
AutoCAD `mode="in_place"` with capability `checkpoint_restore_in_place`
(ActiveX cannot replace an open drawing's database - use new_document).construction_cleartool Delete every entity on the CONSTRUCTION layer. Idempotent.destructive (declared)
Delete every entity on the CONSTRUCTION layer. Idempotent.
Must be called before `drawing_finalize` to satisfy `construction_left` critique.construction_xlinetool Create an infinite construction line on the CONSTRUCTION layer.
Create an infinite construction line on the CONSTRUCTION layer.
Use as scaffolding; call `construction_clear()` before finalize.datum_featuretool Place a datum feature symbol (filled triangle + boxed letter).
Place a datum feature symbol (filled triangle + boxed letter).
Establishes the datum so a feature control frame referencing this letter
passes the `gdt` critique focus.dimension_alignedtool Create an aligned dimension that measures the true distance between two points.
Create an aligned dimension that measures the true distance between two points.
dimension_angulartool Create an angular dimension measuring the angle between two lines from a vertex.
Create an angular dimension measuring the angle between two lines from a vertex.
dimension_autotool Dimension a part in one call: LINE runs, LWPOLYLINE edges per side, CIRCLE
Dimension a part in one call: LINE runs, LWPOLYLINE edges per side, CIRCLE
diameters, ARC radii, overall size; text outside the part. A rerun skips
what is dimensioned.
Returns {created, skipped_existing, omitted: [{handle, type, reason}],
dim_overlap}; ELLIPSE, SPLINE etc. are omitted, never dropped.
Refused by name: neither or both of handles / selector, an unknown selector
key, style or include kind.dimension_diametertool Create a diameter dimension for a circle, optionally toleranced (e.g. ⌀20 H7).
Create a diameter dimension for a circle, optionally toleranced (e.g. ⌀20 H7).
dimension_lineartool Create a linear dimension, optionally toleranced (ISO 129 or ISO 286 fit).
Create a linear dimension, optionally toleranced (ISO 129 or ISO 286 fit).
dimension_radiustool Create a radius dimension for a circle or arc, optionally toleranced.
Create a radius dimension for a circle or arc, optionally toleranced.
dimstyle_createtool Create a dimension style: preset values first, then `overrides`.
Create a dimension style: preset values first, then `overrides`.
Refuses, before anything is written: an unknown preset; an override key
outside the 33-variable whitelist (the 17 preset variables plus DIMTOL,
DIMTP, DIMTM, DIMTOLJ, DIMTFAC, DIMLFAC, DIMRND, DIMATFIT, DIMTMOVE,
DIMCLRD/E/T, DIMSAH, DIMBLK1/2, DIMCEN); a value outside its range
(DIMDEC 0-8, sizes > 0, DIMTAD 0-4, DIMDSEP one character, lineweights an
AutoCAD code); a name that already exists (use `dimstyle_modify`); a
user DIMBLK/DIMBLK1/DIMBLK2 naming a block the drawing does not define
(built-in arrowheads need none); a DIMTXSTY that is neither an existing
text style nor a bundled preset (ISOCP, ISOCPEUR, ARIAL, ROMANS — those
are created on both engines, `textstyle_created`; live, a preset whose
font file the seat lacks is refused the same way, nothing written). On
the live engine a write ActiveX still refuses after the style is added
is rolled back — previous style current, the half-made entry deleted.
With `set_current` the next dimension carries the style on both engines.dimstyle_listtool Every DIMSTYLE table entry with the seventeen preset variablesread-only (declared)
Every DIMSTYLE table entry with the seventeen preset variables
(DIMTXT, DIMASZ, DIMEXE, DIMEXO, DIMGAP, DIMTAD, DIMTIH, DIMTOH, DIMDEC,
DIMDSEP, DIMLUNIT, DIMZIN, DIMBLK, DIMTXSTY, DIMLWD, DIMLWE, DIMSCALE).
Headless, `values` is what the DXF stores (the schema default where an
entry omits a code). On the live engine ActiveX has no per-style getters,
so `values` is read for the *current* style only and the other rows carry
`values: null`, `values_available: false` — `dimstyle_set_current` a
style to read it. Never refuses on an open drawing.dimstyle_modifytool Change variables on an existing dimension style.
Change variables on an existing dimension style.
`changed` names only the variables that actually moved — re-setting a
value to itself is not a change. `dimensions_using_style` lists the
dimensions already drawn with it, and since 1.8.0 they are redrawn
(`rerendered`; live: Update() on each, confirmed by reading the *D text
back - one that did not change is in `stale`). A text its author placed
keeps its position (`text_kept`) unless `force`. `rerender_required: true`
means a dimension still shows the old style: `rerender=False`, or a live
redraw the read-back did not confirm. Refuses a missing style, an empty `overrides`, a key
outside the whitelist, a value outside its range, a DIMTXSTY that does
not exist, a user arrowhead block the drawing does not define — all
before any write. On the live engine, editing a non-current style makes
it current for the duration of the call and the previous style is
restored — also when a write fails midway (its unsaved overrides are
discarded, which is AutoCAD's own DIMSTYLE rule).dimstyle_set_currenttool Set `$DIMSTYLE` and load the style's variables as the current DIM*
Set `$DIMSTYLE` and load the style's variables as the current DIM*
settings — what a live seat's DIMSTYLE Restore does — so `dimension_*`
and `dimension_auto` draw with it on both engines. Per-dimension
tolerances, fits and text overrides still apply on top. Refuses a style
the drawing does not hold. Returns `previous` and `changed`.document_activatetool Make one open document the active one; reports `previous`.
Make one open document the active one; reports `previous`.
Matches the full path first, then the file name; an ambiguous name is
refused with the candidates, an unknown one with the list of open
documents. Headless, a document quarantined after an abandoned call cannot
be switched away from — `drawing_new`, `drawing_open` or closing it are
the ways out. Pack: settings · lean: no.document_closetool Close a document and report `saved`, `discarded_changes` and the new `active`.destructive (declared)
Close a document and report `saved`, `discarded_changes` and the new `active`.
Refusals, all before anything is closed: unsaved changes with neither
`save` nor `discard`; `save` on a document that has never been saved (no
path to write — live, `Close(True)` would open AutoCAD's Save dialog and
block the COM thread); `save` together with `discard`. Closing the last
document leaves the backend with none open, which every tool already
reports. `drawing_close` is the same operation for the active document
with its 1.4 contract kept. Pack: settings · lean: no.document_listtool Every open document with `name`, `path`, `active`, `saved` andread-only (declared)
Every open document with `name`, `path`, `active`, `saved` and
`entity_count`. Each row also carries the document's `document_id` and
content `revision` (None, live, for a document this session never bound).
Headless, the server keeps its own registry: `drawing_new` / `drawing_open`
add an entry (`untitled-N` or the file path) instead of replacing the only
one, and `document_activate` chooses which one every later tool targets.
Live, this is AutoCAD's `Documents` collection. No refusals: an empty
backend answers with an empty list. Pack: settings · lean: no.drawing_apply_iso_layerstool Bootstrap a full ISO-conformant layer set with correct colors and lineweights.
Bootstrap a full ISO-conformant layer set with correct colors and lineweights.
Idempotent — existing layers are not modified.
Refused by name: a standard that is not one of mech, pid, iso13567, arch.drawing_apply_standardtool One call for the common case: the standard's dimension style (created
One call for the common case: the standard's dimension style (created
if missing, then current), its text style (created if missing, then
current), the shared units, and with `layers` the `mech` layer set (ANSI
layer naming is company-specific, so both standards share it).
Every item reports `created` or already present; `settings.changed`
names only the variables that moved, so a second call reports nothing.
An existing ISO-25 / ANSI style is reused as it is, not reset — use
`dimstyle_modify` to change one. Refuses an unknown standard, or a units
variable it cannot read back, before any write; the underlying style
refusals (`dimstyle_create`, `textstyle_create`) apply unchanged. In the
`lean` profile (Task 13).drawing_audittool Audit the drawing: repair every fixable structural problem, and report it.
Audit the drawing: repair every fixable structural problem, and report it.
This mutates the drawing. `fixes` lists repairs that have ALREADY been
applied, so save afterwards to keep them; `errors` lists problems that could
not be repaired. On the live COM backend AutoCAD applies repairs but hands
back no counts, so they arrive as null with `detail: "unavailable"` rather
than as zero.drawing_closetool Close the active document. If save is True (default), the drawing isdestructive (declared)
Close the active document. If save is True (default), the drawing is
saved to its current path before closing; an untitled document is closed
and `warning` says its changes were discarded (headless) or the call is
refused (live, where the alternative is a modal Save dialog). The
active-document case of `document_close`; after the last document is
closed, call drawing_new or drawing_open before any other tool.drawing_critiquetool Run premium-quality checks. Returns zero issues for a clean drawing.read-only (declared)
Run premium-quality checks. Returns zero issues for a clean drawing.
Standard production gate: must return [] before `drawing_finalize`. The default
result is the bare list of issues; `report`, `summary` or `limit` return a dict
instead (a summary is a page, never the clean answer: read `total`).
The entity checks (construction_left, untrimmed_corner, duplicate_entities,
dim_overlap, property_override) read every entity of every space - model and every
paper layout - and compare pairs only within one space. property_override reports
one issue per layer and code (lineweight_not_bylayer - an explicit non-ISO 128 value
is an error; color_not_bylayer; linetype_not_bylayer) on the engineering layers and
the applied layer set, title block and block members exempt, other layers at info;
lineweight -3 is Default, not ByLayer. dimension_truth binds every DIMENSION to its
geometry and reports, per dimension, dim_override_disagrees (NTS: info),
dim_dimlfac_scaled, dim_render_stale (*D block text is not what the style formats;
drawing_refine redraws it), dim_group42_stale, dim_double_prefix, dim_value_hidden
and dim_unbound (info: not checked, never a pass). Refusals and failures are issues, never
silence: a check that raises returns an `error` issue of its focus with
detail.code `check_failed`; a read that could not cover the drawing (more than
MAX_QA_ENTITIES entities, default 2,000,000; or a live export whose per-layout
counts differ from AutoCAD's) returns detail.code `scan_incomplete`. Neither code
is a focus name. A quarantined document is refused.
Coverage: every check writes `checked` or `not_checked` rows; with report=True a
lane that did not run is named with its reason (no_viewport_scale for a paper layout
with no model viewport, engine_live_document_template for the live engine's
dimension-legibility lane, domain_absent for a focus whose domain the drawing lacks).drawing_export_dxftool Export the current drawing as a DXF copy.
Export the current drawing as a DXF copy.
The open document is never re-pointed: it keeps its name, path and saved flag
(drawing_save_as is the call that re-points). Live: `Document.Export`, renamed to
the name given; headless: a copy written by ezdxf. The result names the method
and the DXF version written. Refused: a name that is not .dxf (a .dwg headlessly
with capability `dwg`).drawing_export_pdftool Export the current drawing (or a paper-space layout) to PDF.
Export the current drawing (or a paper-space layout) to PDF.
drawing_finalizetool Premium completion gate: runs BOTH the 8-step validator AND the premium critique focusesFilesoutside textdestructive (declared)
Premium completion gate: runs BOTH the 8-step validator AND the premium critique focuses
(each named below), then saves to disk, exports a screenshot, and returns the DWG path.
The premium critique focuses
(iso128, layer_color, dim_overlap, untrimmed_corner, duplicate_entities, construction_left,
property_override, dimension_truth, gdt, plus the P&ID focuses pid_dangling_line,
pid_duplicate_tag, pid_incompatible_connection, pid_untagged_instrument, pid_illegal_tag,
pid_unconnected_equipment, pid_line_through_symbol — silent on a sheet with no P&ID symbols,
plus the
mechanical focuses mech_missing_centreline, mech_unhatched_section,
mech_view_misaligned, mech_duplicate_dimension, mech_thread_unrepresented,
mech_bom_balloon_mismatch — silent on a sheet with no mechanical part, plus the
architectural focuses arch_room_unlabelled, arch_wall_gap, arch_opening_clash —
silent on a sheet with no ACADMCP_ARCH record, plus the topology focuses
topo_dangling_endpoint, topo_near_miss, topo_interior_crossing — on network
layers no P&ID or architectural focus reads, silent on every sheet this server draws)
all run before the save.
The validator and the critique share one read of the drawing - every entity of
every space, model and paper, with no cap (one DXF export on the live engine). A
drawing over MAX_QA_ENTITIES (default 2,000,000; 0 disables) is not read in part:
the validator reports `scan_incomplete` and each entity check reports an issue with
detail.code `scan_incomplete`, so the gate fails. A check that raises is an `error`
issue with detail.code `check_failed`, never a clean result.
The payload's `qa_coverage` says what the critique did not check: {complete, records,
spaces, reason, not_checked: [{focus, layout, reason, lane}], domain_absent: [focus]}
(reasons: autocad://critique/focuses) - e.g. a paper layout without a model viewport is
`no_viewport_scale`, the live engine's dimension-legibility lane
`engine_live_document_template`.
Fails (error kind validation_failed / critique_gate_failed / failed_acceptance) if any
validator 'error' finding is present, or if critique reports an 'error' (or, with
strict_critique=True, any critique issue or any not_checked lane but domain_absent,
each a blocking row with code `not_checked`); the error carries what the gate computed -
score, blocking [{code, severity, handles, message}], blocking_count, qa_coverage - and
detail="full" adds every row and the whole report. Critique warnings are surfaced
under payload['critique'] without failing the gate by default. A quarantined document
is refused.
With `requirements` (the drawing_verify_requirements shape) every requirement is
measured on the CAD geometry after the save: the payload adds `geometry_acceptance`
(the full report), `drafting_quality` (the score, unchanged), `artifact_integrity`
(the saved file's sha256 and `reverified`: every requirement measured again on the
saved file, read fresh and re-bound by handle, feature tag, then geometry, with the
before / after comparison; a saved file that cannot be re-read - a .dwg AutoCAD
will not let us copy - fails the acceptance) and `coverage`, and a requirement
that does not pass,
stale evidence or a dimension that disagrees with its geometry raises
`failed_acceptance` - a high drafting score never offsets it. Requirements that do
not parse are refused before anything is saved (invalid_args).drawing_historytool The active drawing's mutating calls, newest first, from the durableread-only (declared)
The active drawing's mutating calls, newest first, from the durable
journal - across restarts (reopen the file first).
Rows: {seq, op, tool, state, rev, cp, label, t}. A value from an earlier
round: label its call (_meta.label, cad_batch(label=)), then
drawing_history(label=..., detail="args"); unlabelled, detail="changes"
diffs the checkpoints around it (feature values, dimension measurements).
Refused: an unknown label (invalid_args, naming the labels); no document.drawing_infotool Get comprehensive metadata for the current drawing.read-only (declared)
Get comprehensive metadata for the current drawing.
Returns: name, path, entity_count, layer_count, block_count,
extents (min/max), units, version, backend name, and the document's
`document_id` (a uuid4 hex minted when it was opened or created) and
`revision` (its content revision: moved by every content change, never by
a save, an export, a finalize or a delivery). On the live engine a call
made after the operator switched AutoCAD's active document is refused with
`kind: "active_document_changed"` (`bound`, `active`).drawing_newtool Create a new drawing, optionally from a template.
Create a new drawing, optionally from a template.
A bundled name resolves to `templates/<name>.dxf` headlessly and
`templates/<name>.dwt` on the live engine (falling back to the DXF with
`source: "bundled_dxf"` when no `.dwt` twin is committed); a path is used
as given. The result carries `template: {name|path, path, source}`.
On the live engine only a genuine `.dwt` reaches `Documents.Add` —
measured on AutoCAD 2026, `Add(<file.dxf>)` silently returns the default
drawing — so a `.dxf` template (bundled or a path) is first converted
through AutoCAD into a cached `.dwt` and `template.dwt` names it
(`template.dwt_cached` says whether the conversion was reused). The
drawing then really carries the template's layers, tabs and page setup.
Refused before anything is replaced: a bare name that is not in the
catalogue (the message lists the five), a template path that does not
exist, and a path outside the allowed directories. With `bootstrap=True`
(default) the standard engineering linetypes and layers are ensured
afterwards — idempotent on a template that already has them.drawing_opentool Open an existing DXF drawing file (DWG too, on the live COM backend).Files
Open an existing DXF drawing file (DWG too, on the live COM backend).
Headless, a .dwg is converted to DXF (ODA File Converter, then
accoreconsole); the result carries `dwg_read: {route, seconds, log}`. No
converter: refused `dwg_read`; a failed conversion: `dwg_conversion_failed`
with each route's log.
A file that does not parse is refused (`damaged_drawing`) and the open
document is kept; the refusal names `recover=True`. The result carries the
file's `lineage`: an unchanged file last saved by this server continues its
`document_id` and `revision` across restarts; a file changed outside it
reports `external_change: true` (one revision more, journalled as
`external_edit`). `save_recovery` lists a save of this path a dead process
left half done, resolved before the read.drawing_plantool Commit a PlanSpec before any geometry is created.
Commit a PlanSpec before any geometry is created.
The PlanSpec is stored on the backend and surfaced for reference during
the workflow (it is not replayed as a critique). Always call this FIRST
in a premium workflow. With typed `requirements.items` the plan carries
`requirement_digest`; `persist_requirements=True` also writes the set into
the drawing (`requirements_persisted: true`) - the server's own XRECORD,
shown nowhere in AutoCAD.
Refused: a `spec_hash` that does not match the latest ready preflight; a
malformed typed item, by its path (`items[2].target.nominal: must be
greater than zero, got -1.0.`); `persist_requirements=True` with neither
typed `items` nor a legacy `dimensions` object ("nothing to read"). A
refusal stores nothing and commits no plan.drawing_preflighttool Validate and normalize requirements before committing a drawing plan.read-only (declared)
Validate and normalize requirements before committing a drawing plan.
Typed requirements go under `requirements.items`: each is checked with its
path (`items[2].target.nominal: must be greater than zero, got -1.0.` comes
back as an INVALID_REQUIREMENT conflict) and its canonical form replaces
the input in `normalized_spec`, so `spec_hash` covers what will be
verified; `requirement_set` carries the canonical set and its digest. A
legacy `dimensions` object is still accepted, kept as given and listed
under `legacy` - it is never measured. Conflicting provenance is kept and
reported (CONFLICTING_PROVENANCE, CONFLICTING_REQUIREMENT), never
collapsed to one value. Typed items are validated once `units` is known
(a MISSING_UNITS question asks for it). Nothing is refused: every problem
is a question or a conflict, and `ready` stays False until none is left.drawing_properties_gettool The DWGPROPS dialog as data: `summary` (title, subject, author, keywords,read-only (declared)
The DWGPROPS dialog as data: `summary` (title, subject, author, keywords,
comments), `summary_available`, and `custom` ({key: value}).
On the live engine the summary comes from the document's SummaryInfo. The
headless engine cannot read that stream, so the five summary fields are
`null` with `summary_available: false` — not empty strings, which would
claim the drawing has no title. Custom properties (`$CUSTOMPROPERTYTAG` /
`$CUSTOMPROPERTY` header pairs) are read on both engines.drawing_properties_settool Write DWGPROPS fields. Only the arguments given are touched; returns
Write DWGPROPS fields. Only the arguments given are touched; returns
`summary_written`, `custom_written` and `custom_deleted` (a key that was
never there is not reported deleted).
Refusals, before anything is written: a summary field on the headless
engine (`capability: dwgprops` — SummaryInfo lives in the DWG, a DXF has
no slot for it; custom properties still work headlessly), a non-string
value (`TypeError` naming the field or key — nothing is coerced with
`str()`), an empty custom key, a custom key to *write* that AutoCAD's
AddCustomInfo would reject mid-write (measured on AutoCAD 2026: leading or
trailing whitespace, or any of the thirteen characters
`" * , / : ; < = > ? \\ ` |` anywhere in the key; internal spaces, tabs
and unicode are fine — `ValueError` naming the key, on both engines; a
delete is exempt because RemoveCustomByKey never validates syntax, so a
key that reached the drawing another way stays removable), two keys in
one request that AutoCAD would call the same key (its key compare is a
simple per-character case compare: `Project`/`PROJECT` and `Grün`/`GRÜN`
are one key, `Straße`/`STRASSE` are two), a line break in a custom key or
value (it corrupts the DXF on save), and headlessly a document older than
R2004 (`ValueError` — ezdxf only writes the custom-property header pairs
for AC1018+, so they would vanish at save; save as R2004 or newer first).
A key is matched to the drawing by that same rule on both engines and
keeps its stored spelling when updated. On the live engine an exact
spelling is changed with SetCustomByKey; otherwise AutoCAD decides —
AddCustomInfo, and on its 'Duplicate key' SetCustomByKey; a delete is
RemoveCustomByKey, and its 'Key not found' is reported as not deleted.drawing_purgetool Purge all unused objects (layers, blocks, linetypes, styles) from the drawing.
Purge all unused objects (layers, blocks, linetypes, styles) from the drawing.
Live AutoCAD stores a durable checkpoint first (checkpoint_list).drawing_redotool Reapply the operation you just undid.
Reapply the operation you just undid.
Same history as `drawing_undo`: headless, a checkpoint undo is redone from
the state it replaced (kept as a checkpoint), within the session. Anything
drawn after an undo discards the redo
branch — otherwise redo would restore a state that never existed, with
geometry you had removed reappearing beside geometry you drew afterwards.
Reports `verified` the same way `drawing_undo` does.drawing_refinetool Run a bounded, transaction-safe critique/repair/re-critique loop.destructive (declared)
Run a bounded, transaction-safe critique/repair/re-critique loop.
dry_run=True returns the plan with `preview` - the content revision and the
exact fingerprint of every handle a planned repair touches - also when the
score already meets min_score: `threshold_met` then says an apply at that
min_score would stop before repairing. Applied with the preview's
`revision` (expected_revision) and/or `preconditions`, the call is refused
with kind stale_revision and nothing changed when the document moved since;
the result then carries `revision` ({checked, after, interleaved}).drawing_savetool Save the current drawing. Optionally specify a new path.
Save the current drawing. Optionally specify a new path.
Headless, the write is atomic: a temporary file beside the target, checked,
then renamed over it - a killed save never leaves a half-written drawing.
A document opened with recover=True is refused onto its damaged source
(`recovered_source_protected`) unless overwrite_source=True.drawing_save_astool Save current drawing to a new path/format (DWG, DXF, or DWT template).
Save current drawing to a new path/format (DWG, DXF, or DWT template).
The on-disk format is derived from the file extension so the bytes always
match the name (N2) — e.g. 'part.dxf' writes DXF, not DWG. `format` overrides
only when the path has no recognised extension.drawing_settingstool Read or change common AutoCAD drawing settings by friendly name.
Read or change common AutoCAD drawing settings by friendly name.
A convenience facade over the system variables (INSUNITS, LUPREC, LTSCALE,
DIMSCALE, DIMTXT, DIMASZ, DIMDEC, DIMDSEP, DIMZIN, TEXTSIZE, OSMODE, LIMMIN/
LIMMAX, GRIDMODE/GRIDUNIT, SNAPMODE/SNAPUNIT, ORTHOMODE, AUTOSNAP/POLARANG,
PSLTSCALE, CANNOSCALE, LUNITS, AUNITS, DIMSTYLE, TEXTSTYLE) so the user can
say "set units to mm, limits to A3 and the grid on" without memorising
sysvar names. Call with no argument for a full snapshot; a write returns
`applied`, `changed` ({key: [old, new]} — only what moved) and `errors`.
`dim_text_height` / `dim_arrow_size` / `dim_decimals` / `decimal_separator`
/ `zero_suppression` shape the *dimension* — `text_size` is TEXTSIZE, the
height of a standalone TEXT entity, and does not touch dimensions.
Refusals, per key, nothing else rolled back: an unknown key; a value outside
its range (grid/snap spacing > 0, polar_angle 0–360, precision 0–8, …); a
malformed `limits` or `annotation_scale`; `osmode` / `polar` / `polar_angle`
on the headless engine (`capability: registry_sysvar` — AutoCAD keeps them in
the registry, a file cannot, and a headless snapshot reports them as `None`);
`dimstyle` / `textstyle` when the backend has no styles contract. On the
live engine `annotation_scale` must name a scale in the drawing's scale list
(SCALELISTEDIT) and AutoCAD refuses the write on a
paper-space layout with no active viewport; the headless engine adds the
scale, seeding AutoCAD's default list first when the drawing has none,
and refuses it on an R12 file (no OBJECTS section, so the value would
vanish at save — save as R2000 or newer first; limits/grid/ortho survive).
Headlessly, grid/snap are stored on the active VPORT and the annotation
scale in the variable dictionary — the places AutoCAD reads them from.drawing_template_listtool The templates `drawing_new(template=<name>)` can start from.read-only (declared)
The templates `drawing_new(template=<name>)` can start from.
Each row: `standard` (ISO/ANSI), `sheet`, `paper`, `layout` (the sheet tab's
name), `layer_set` (mech / pid / iso13567), `dimstyle` / `textstyle`
(ISO-25 / ISOCP or ANSI / ROMANS), `scale`, `title_block` (the ISO 5457 A3
frame, A3 sheets only), the `settings` applied, and `files.dxf` /
`files.dwt` with `present` flags — the `.dwt` twins exist only once built
on a live AutoCAD (`scripts/smoke_settings_com.py --build-dwt`). Never
refuses; it reads a catalogue.drawing_template_savetool AutoCAD's SAVEAS → Drawing Template, on both engines.
AutoCAD's SAVEAS → Drawing Template, on both engines.
Live AutoCAD writes a real `.dwt` (`SaveAs(path, ac2018_Template)`) and
puts `description` into the template's summary Comments; the active
document is rebound to the new file, as SAVEAS does. Headlessly a `.dxf`
template is written — `drawing_new(template=<path>)` opens it — and a
`.dwt` request is refused with capability `dwt_write` (the message names
the DXF route and the COM route); a description is reported
`description_written: false` because DXF has nowhere to keep it. Any other
suffix, and any path outside the allowed directories, is refused before
a byte is written.
Pack: core · lean: no (`drawing_save_as` is not lean either).drawing_undotool Undo the last drawing operation.
Undo the last drawing operation.
On the live COM backend this is AutoCAD's own undo. Headless (1.8.0), undo
steps back to the newest durable checkpoint below the current revision -
taken at every save, open, new drawing, rollback-mode cad_batch /
transaction and checkpoint_create - so it works after a server restart too,
and reports `granularity` ("save", "batch" or "label") and `checkpoint`.
For per-call steps set `EZDXF_UNDO_DEPTH` (a full DXF snapshot per call -
measured 37x on entity creation, 0.18 -> 6.65 ms); those are used first,
then the checkpoints. Without a state folder (JOURNAL_DURABLE=off) and
without EZDXF_UNDO_DEPTH it is refused with capability `undo_history`.
Drawing something after an undo discards the redo branch, as in AutoCAD.
`verified` says whether the drawing observably changed: always true for a
headless snapshot restore; live, true when the entity count over every
layout or the document's edit counter moved (`evidence` has both), false
for "no change seen". An undo left at a prompt is `command_incomplete`.entity_array_polartool Create a polar (circular) array of copies around a center point.
Create a polar (circular) array of copies around a center point.
`count` is unbounded, so the same result-shaping applies as for the
rectangular array: fields=["handle"] when the geometry is already known.entity_array_rectangulartool Create a rectangular array of copies. Returns info of all created copies.
Create a rectangular array of copies. Returns info of all created copies.
rows x cols is unbounded, so this is a result-heavy tool despite being a
create: a 40x40 grid hands back 1600 full records. fields=["handle"] is
usually all a caller needs from it.entity_batch_createtool Create multiple entities in a single call for better performance.
Create multiple entities in a single call for better performance.
Each entity dict must have a 'type' key and the parameters for that type.
Example: [{"type": "line", "x1": 0, "y1": 0, "x2": 100, "y2": 0}, {"type": "circle", "cx": 50, "cy": 50, "radius": 25}]
Denser than cad_batch for many entities of the same kind (no per-step tool
name), and usable as one step *of* a cad_batch. Use cad_batch when the calls
differ, must be ordered, or must feed each other.entity_batch_modifytool Apply multiple modifications in a single call.
Apply multiple modifications in a single call.
Example: [{"handle": "1A", "action": "move", "dx": 10, "dy": 20}, {"handle": "2B", "action": "delete"}]
Covers move/rotate/scale/delete/set_properties only. For anything else, for
ordering, or to feed one step's result into the next, use cad_batch.
Every handle is checked first, in one read: one that names no entity
refuses the whole call with kind unknown_handle (`missing` lists each
index and handle) and nothing is modified.entity_chamfertool Bevel a corner with a chamfer line. Returns info on the new chamfer LINE.
Bevel a corner with a chamfer line. Returns info on the new chamfer LINE.
V1 supports LINE+LINE only.entity_change_spacetool AutoCAD's CHSPACE: move entities across spaces, rescaled by the viewport.
AutoCAD's CHSPACE: move entities across spaces, rescaled by the viewport.
Geometry is transformed by the viewport's own matrix so it stays the same
size on screen — a move without that transform would leave a 100 mm feature
as 100 mm of paper inside a 1:2 viewport.
Refused per entity for dimensions (unless `freeze_dimensions`), ACIS solids,
tables and proxies, viewports, and entities already in the target space;
refused outright for a twisted or non-plan viewport. Entities that end up
outside the viewport or off the sheet are moved and flagged, not refused.entity_copytool Copy an entity and move the copy by (dx, dy, dz). Returns info of the new copy.
Copy an entity and move the copy by (dx, dy, dz). Returns info of the new copy.
entity_create_arctool Create a circular arc. Angles are in degrees, measured counter-clockwise from the positive X axis.
Create a circular arc. Angles are in degrees, measured counter-clockwise from the positive X axis.
entity_create_block_reftool Insert a block reference (instance of an existing block definition).
Insert a block reference (instance of an existing block definition).
Refused before any write, on both engines: a name that is not a block
definition in this drawing (`block 'X' is not defined` — check
`block_list`), a layout block (`*Model_Space` / `*Paper_Space`, a
reference cycle) and a non-string name. The same gate as `block_insert`;
this tool is the no-attributes form.entity_create_circletool Create a circle at (cx, cy) with given radius.
Create a circle at (cx, cy) with given radius.
entity_create_ellipsetool Create an ellipse. major_x/major_y define the major axis vector from the center.
Create an ellipse. major_x/major_y define the major axis vector from the center.
entity_create_hatchtool Create a hatch fill pattern inside a closed boundary polygon.
Create a hatch fill pattern inside a closed boundary polygon.
entity_create_linetool Create a line from (x1,y1) to (x2,y2). Returns entity info with handle.
Create a line from (x1,y1) to (x2,y2). Returns entity info with handle.
entity_create_mtexttool Create a multi-line text entity (MTEXT) with word-wrap at the specified width.
Create a multi-line text entity (MTEXT) with word-wrap at the specified width.
entity_create_pointtool Create a point marker entity at (x, y).
Create a point marker entity at (x, y).
entity_create_polylinetool Create a lightweight 2D polyline through the given points.
Create a lightweight 2D polyline through the given points.
Example: points=[[0,0],[100,0],[100,100],[0,100]], closed=true → rectangle
Example: points=[[0,0],[40,0]], bulges=[1, 0] → a semicircular arc edgeentity_create_rectangletool Create a closed rectangular polyline between two corner points.
Create a closed rectangular polyline between two corner points.
Convenience wrapper around entity_create_polyline.entity_create_revcloudtool Draw a revision cloud: a polyline whose every segment carries an arc.
Draw a revision cloud: a polyline whose every segment carries an arc.
A `segment_length` longer than the shortest edge is refused — the result
would carry no arcs at all and would be a plain polyline reported as a
cloud.entity_create_splinetool Create a NURBS spline curve passing through the specified fit points.
Create a NURBS spline curve passing through the specified fit points.
entity_create_tabletool Create a native COM table or an explicitly-labelled ezdxf composite table.
Create a native COM table or an explicitly-labelled ezdxf composite table.
entity_create_texttool Create a single-line text entity (DTEXT/TEXT).
Create a single-line text entity (DTEXT/TEXT).
entity_create_wipeouttool Create a WIPEOUT that hides drawing content behind its outline.
Create a WIPEOUT that hides drawing content behind its outline.
Refuses fewer than three points: a zero-area mask hides nothing while
reporting success.entity_deletetool Permanently delete an entity by its handle.destructive (declared)
Permanently delete an entity by its handle.
entity_delete_manytool Delete multiple entities in one call. Returns count of deleted entities.Filesoutside textdestructive (declared)
Delete multiple entities in one call. Returns count of deleted entities.
All or none (unknown_handle, rolled_back).entity_edit_geometrytool Edit the defining geometry of an existing entity in place (no delete/recreate).
Edit the defining geometry of an existing entity in place (no delete/recreate).
CIRCLE: cx/cy/radius · LINE: x1/y1/x2/y2 · ARC: cx/cy/radius/start_angle/end_angle ·
LWPOLYLINE: points/bulges · TEXT/MTEXT: x/y.
Any argument left out is unchanged; the handle, layer and XDATA are preserved.
An argument the entity's type does not take is refused by name, never ignored.
A linear or aligned DIMENSION takes x1/y1/x2/y2 - its two measured points - and
is redrawn, so its number follows them (1.8.0); any other dimension type is refused.
On the live engine, if AutoCAD will not take a vertex list of a different
length in place, the polyline is recreated with its layer, colour, linetype,
lineweight and XDATA and the result says so in ``properties.replaced``
``[{old, new}]`` — use the new handle from then on.entity_edit_texttool Edit an existing text label in place — change its content, height, rotation or position.
Edit an existing text label in place — change its content, height, rotation or position.
Use this to rename/relabel/move without deleting and recreating (which would
lose the handle and its XDATA). Works on both TEXT and MTEXT. ``x``/``y``
move the label so its reported ``insertion`` lands there; an aligned TEXT's
alignment point moves with it. A TEXT in a plane tilted out of WCS XY is
refused (capability ``ocs_tilted_plane``) — use ``entity_move``.entity_extendtool Extend `target` to meet `boundary`. If end_x/end_y is None, the target
Extend `target` to meet `boundary`. If end_x/end_y is None, the target
endpoint nearest the boundary is auto-selected.
V1 supports LINE+LINE only. Raises if the lines are parallel.entity_fillettool Round a corner with a tangent arc. Returns info on the new ARC entity
Round a corner with a tangent arc. Returns info on the new ARC entity
(or the first source line for radius=0). V1 supports LINE+LINE only.entity_gettool Get all properties of a specific entity by its handle.read-only (declared)
Get all properties of a specific entity by its handle.
Coordinates are WCS. A HATCH also reports every boundary loop: `loops`
(each with `kind`, `flags`, `depth`, `points` and the parallel `bulges`,
`edges` for an edge path, `exact` and its `area`), `hatch_style` and the
filled `area` - outer loops minus islands by the hatch's own island style,
the rule `analysis_measure_entity` applies; None when a loop has an ellipse
or spline edge. A DIMENSION also reports `dimension`: `dimtype`, the five
`defpoints`, its own `measurement` (before DIMLFAC), `text_override`,
`dimstyle`, `dimlfac` and `angle`. On the live engine those two are read
from a DXF export of the whole drawing (`detail_source` says so), which
costs about as much as drawing_understand; it 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. A member of a block definition reports `detail_unavailable`. An
entity in a plane tilted out of WCS XY reports `plane_normal` (or
`tilted`) and omits what xy cannot express. Refused: a handle the drawing
does not hold.entity_get_xdatatool Extended entity data as {app: [values]}. An app with no XDATA is simply absent.read-only (declared)
Extended entity data as {app: [values]}. An app with no XDATA is simply absent.entity_listtool List entities in the drawing with optional type and layer filters.read-only (declared)
List entities in the drawing with optional type and layer filters.
Returns handle, type, layer, color, and type-specific properties.
Use handles with entity_get, entity_move, entity_delete, etc.
This is the most expensive result on the server — the full record runs
~250 characters per entity, and `properties.bounding_box` alone is about a
third of it. When all you need is handles, say so::
entity_list(layer_filter="GEOMETRY", fields=["handle", "type"], compact=True)
Paging honesty: a plain list has nowhere to say that more entities followed
the page, so `compact=True` is the only mode that reports `total`,
`truncated` and `next_offset` — all measured against the same filters.entity_mirrortool Mirror an entity across a line defined by two points. Returns the mirrored copy.
Mirror an entity across a line defined by two points. Returns the mirrored copy.
entity_modify_wheretool AutoCAD's QSELECT + CHPROP: one call for a whole set, not one row per entity.destructive (declared)
AutoCAD's QSELECT + CHPROP: one call for a whole set, not one row per entity.
Example - every override on the old layers back to ByLayer, on the new layer::
entity_modify_where(where={"layer": ["WALL*", "Walls"]},
set={"layer": "A-WALL", "color": 256, "lineweight": "ByLayer"})
Entities on a locked layer are not written (AutoCAD's rule) and are reported in
`skipped_locked`, never counted as matched. `changed` counts only entities that
really changed: re-setting a value to itself is not a change. dry_run=True adds
`preview` (the document revision, plus the region fingerprint when `where` has a
region - of the current layout); send its `count` back as `expect_count`, or the
preview to `cad_batch(expected_revision=, preconditions=)`. Refused by name before
anything is written: an unknown or malformed `where` / `set` key (invalid_args),
a `set.layer` no layer may carry, an `expect_count` the drawing no longer matches
(stale_revision).entity_movetool Move an entity by the specified displacement vector (dx, dy, dz).
Move an entity by the specified displacement vector (dx, dy, dz).
entity_offsettool Create a parallel copy of a line, circle, or polyline at the given distance.
Create a parallel copy of a line, circle, or polyline at the given distance.
entity_rotatetool Rotate an entity around a base point by the specified angle.
Rotate an entity around a base point by the specified angle.
entity_scaletool Scale an entity uniformly from a base point.
Scale an entity uniformly from a base point.
entity_select_smarttool Select entities by semantic predicate instead of memorising handles.read-only (declared)
Select entities by semantic predicate instead of memorising handles.
Uncapped. The usual next step is dimension_auto(handles), so
fields=["handle"] is normally all this needs to return.entity_set_propertiestool Change one or more properties of an entity (layer, color, linetype, lineweight, visibility).
Change one or more properties of an entity (layer, color, linetype, lineweight, visibility).
entity_set_xdatatool Replace the named app's XDATA on one entity; an empty list removes it.
Replace the named app's XDATA on one entity; an empty list removes it.
Limits are AutoCAD's and are enforced before writing: 255 characters per
string and 16 KB per entity.entity_trimtool Trim `target` against `cutter`, keeping the segment containing (keep_x, keep_y).
Trim `target` against `cutter`, keeping the segment containing (keep_x, keep_y).
V1 supports LINE+LINE only. Cutter is treated as an infinite ray (AutoCAD's
default 'implied extend' trim mode). Raises if the lines are parallel.gd_frametool Draw an ISO 1101 feature control frame from LINE + TEXT primitives.
Draw an ISO 1101 feature control frame from LINE + TEXT primitives.
Renders identically on COM and ezdxf. Referenced datums are recorded so the
`gdt` critique focus flags any datum with no matching datum feature.gear_draw_helical_front_viewtool Deterministic helical gear front view: full involute outline (40 pts/flank),
Deterministic helical gear front view: full involute outline (40 pts/flank),
pitch/base/outer/root circles, helix symbol, optional bore + keyway.
Returns a handle bundle plus 'metadata' for downstream gear_draw_section_aa.gear_draw_section_aatool Deterministic side cross-section of a gear created by gear_draw_*_front_view.
Deterministic side cross-section of a gear created by gear_draw_*_front_view.
Includes top/bottom/left/right boundaries, bore lines, keyway notch, ANSI31 hatch.gear_draw_spur_front_viewtool Deterministic spur gear front view (no helix symbol).
Deterministic spur gear front view (no helix symbol).
hatch_add_boundarytool Add one boundary path built from typed edges - an island inside the hatch.
Add one boundary path built from typed edges - an island inside the hatch.
Typed edges exist because a boundary that only accepts vertex lists
silently straightens every curve it is given. Every edge is validated
before any is written, so a malformed list refuses instead of leaving a
half-built path. Both engines: headlessly the edges become an edge path;
on a live seat each becomes a temporary LINE, true ARC or ELLIPSE appended
as an inner loop and then deleted (a chain of lines becomes one polyline).
A loop that does not close is refused by AutoCAD and nothing is added.hatch_edittool Edit an existing hatch in place.
Edit an existing hatch in place.
Omitted parameters are left alone — a partial edit that resets the rest is
data loss. `changed` reports which attributes actually moved, so re-setting
a value to what it already was comes back as an empty list rather than a
false positive.hatch_materialtool Section-hatch a cut face with the pattern ISO 128-50 gives its material.
Section-hatch a cut face with the pattern ISO 128-50 gives its material.
Refusals: an unknown material (named, with the full list, before anything
is drawn), neither `boundary` nor `handles` (or both), a boundary with
fewer than three points, and a non-positive `scale`. With `handles` the
loop is chained by `boundary_from_entities`, which the COM engine refuses
(capability `boundary_trace`) - pass `boundary` on a live seat, or run
headlessly. The HATCH layer is created first when the drawing lacks it:
ActiveX refuses an entity on an absent layer and would otherwise leave the
hatch orphaned on layer 0.
The payload states its own accuracy, as `analysis_measure_entity` does:
`area` is the polygon actually hatched, `boundary_area` the exact area of
the chained loop, and `accuracy` is `"exact"` or `"flatten_tolerance"` -
an arc edge reaches `entity_create_hatch` as chords, so a curved cut face
is hatched to within `HATCH_FLATTEN_SAGITTA` of itself rather than being
replaced by its chord polygon. With `handles`, the outline
`boundary_from_entities` draws is scaffolding and is deleted; `traced`
reports its handle and whether the delete succeeded. A loop enclosing no
area is refused instead of writing a HATCH of area 0.0.hatch_set_gradienttool Fill a hatch with a gradient instead of a pattern.
Fill a hatch with a gradient instead of a pattern.
keyway_draw_keyed_boretool Bore + DIN 6885 keyway in front view. Auto-sizes keyway from bore if width/depth omitted.
Bore + DIN 6885 keyway in front view. Auto-sizes keyway from bore if width/depth omitted.
keyway_draw_sectiontool Side cross-section view of a keyed bore.
Side cross-section view of a keyed bore.
layer_createtool Create a new layer with specified properties.
Create a new layer with specified properties.
layer_deletetool Delete a layer. The layer must have no entities. Layer '0' cannot be deleted.destructive (declared)
Delete a layer. The layer must have no entities. Layer '0' cannot be deleted.
layer_freezetool Freeze a layer (makes it invisible and unselectable, faster regeneration).
Freeze a layer (makes it invisible and unselectable, faster regeneration).
layer_hidetool Turn off a layer (entities invisible but still processed in regeneration).
Turn off a layer (entities invisible but still processed in regeneration).
layer_isolatetool Hide all layers except the specified one (layer isolation).
Hide all layers except the specified one (layer isolation).
layer_listtool List all layers with their properties (color, linetype, frozen, locked, visibility).read-only (declared)
List all layers with their properties (color, linetype, frozen, locked, visibility).
Never truncated — a drawing's whole layer table is returned — so a compact
envelope here always reports truncated=false.layer_locktool Lock a layer (entities visible but cannot be selected or modified).
Lock a layer (entities visible but cannot be selected or modified).
layer_mergetool AutoCAD's LAYMRG: every entity on `sources` moves to `target`, then thedestructive (declared)
AutoCAD's LAYMRG: every entity on `sources` moves to `target`, then the
sources are deleted.
Reassigns in model space, every paper layout and every block definition
(attributes included); `by_space` counts per layout, `blocks_touched` names the
edited definitions - and `note` says so, because an edited definition changes
every INSERT of that block. The current layer moves to `target` when it was a
source; viewport freezes of a source are dropped with it. Live, a locked source
or target is unlocked for the move and the target relocked; a source AutoCAD
will not delete is listed in `layers_not_deleted` with its reason. Refused by
name, before anything changes: a missing source or target (layer_create the
target first), `0` / `DEFPOINTS` / an xref-dependent layer as a source, the
target among the sources.layer_modifytool Modify an existing layer's color, linetype, and/or lineweight.
Modify an existing layer's color, linetype, and/or lineweight.
layer_renametool AutoCAD's RENAME for a layer: the table entry and every reference to it.
AutoCAD's RENAME for a layer: the table entry and every reference to it.
Headless, every entity's layer in model space, every paper layout and every
block definition is rewritten (`entities`, `by_space`, `blocks_touched`), with
viewport frozen lists and the current layer; live, AutoCAD references a layer by
object id, so `AcadLayer.Name` renames it everywhere and no entity is rewritten
(`entities: null`). A layer state saved earlier keeps the old name. Refused by
name, before anything changes: `0`, `DEFPOINTS`, an xref-dependent layer, a
missing `old`, an existing `new` (use layer_merge), a case-only change.layer_set_currenttool Set the active/current layer for new entities.
Set the active/current layer for new entities.
layer_showtool Turn on a layer that was previously turned off.
Turn on a layer that was previously turned off.
layer_state_deletetool Remove the named state's XRECORD. Layers themselves are untouched.destructive (declared)
Remove the named state's XRECORD. Layers themselves are untouched.
Refusal: an unknown name (lists the saved ones). Pack: settings · lean: no.layer_state_listtool Every state under `ACADMCP_LAYERSTATES` with its description and layerread-only (declared)
Every state under `ACADMCP_LAYERSTATES` with its description and layer
count. These are the server's portable states, not AutoCAD Layer States
Manager entries. No refusals. Pack: settings · lean: no.layer_state_restoretool Apply a saved state to the layers that still exist.
Apply a saved state to the layers that still exist.
`missing_layers` (in the state, not in the drawing) are skipped, never
created; `new_layers` (in the drawing, not in the state) are untouched;
`applied` says how many layers and which properties moved. Refusals: an
unknown state name (lists the saved ones), a property outside the eight
(names the index). Live, a layer AutoCAD refuses to change (freezing the
active layer, making a frozen layer current) lands in `warnings` instead
of failing the call; the state's current layer is thawed before it is
made current when `frozen` is being restored, so save → freeze → restore
round-trips. Portable server states, not Layer States Manager entries.
Pack: settings · lean: no.layer_state_savetool Snapshot every layer's on/frozen/locked/color/linetype/lineweight/plot
Snapshot every layer's on/frozen/locked/color/linetype/lineweight/plot
flags plus the current layer as a named state stored in the drawing.
These are the server's own portable layer states: JSON chunks in an XRECORD
under the `ACADMCP_LAYERSTATES` dictionary. They live in the file and
travel with it, work on both engines, and do **not** appear in AutoCAD's
Layer States Manager (LAYERSTATE). Same name replaces (`replaced: true`).
Refusals: an empty or control-character name, a non-string description.
Pack: settings · lean: no.layer_thawtool Thaw a frozen layer, making it visible and selectable again.
Thaw a frozen layer, making it visible and selectable again.
layer_unlocktool Unlock a layer to allow entity selection and modification.
Unlock a layer to allow entity selection and modification.
layout_copytool Copy a paper-space layout: page setup, plot settings and all geometry.
Copy a paper-space layout: page setup, plot settings and all geometry.
`skipped` names any DXF types that could not be cloned — check it rather
than trusting `ok` alone. Associative hatch boundaries are re-pointed at the
cloned entities; `associativity_dropped` counts those that referenced
something outside the source layout and had to be cleared.layout_createtool Create a new paper-space layout tab.
Create a new paper-space layout tab.
layout_deletetool Delete a paper-space layout and every entity on it.destructive (declared)
Delete a paper-space layout and every entity on it.
Refuses model space, a blank name, and the last remaining sheet. If the
deleted tab was the current one, the returned `current` is where geometry
goes next — and handles from the deleted sheet stop resolving.layout_listtool List all layout tabs (Model + paper-space layouts) and the current one.read-only (declared)
List all layout tabs (Model + paper-space layouts) and the current one.
layout_renametool Rename a paper-space layout. Entity handles are unaffected.
Rename a paper-space layout. Entity handles are unaffected.
layout_set_currenttool Activate a layout tab and make it where new geometry goes.
Activate a layout tab and make it where new geometry goes.
Every document starts in model space (drawing_new, drawing_open and
document_activate reset it); only this tool moves the target. On a live
AutoCAD a tab the operator clicks afterwards does not move it - drawing on
a sheet takes this call, as headlessly. An entity created outside model
space reports `space` in its properties.leader_create_mleadertool Create a native COM MLeader or an explicitly-labelled ezdxf composite.
Create a native COM MLeader or an explicitly-labelled ezdxf composite.
linetype_listtool Return the names of all linetypes currently loaded in the active drawing.read-only (declared)
Return the names of all linetypes currently loaded in the active drawing.
linetype_loadtool Load a single linetype safely.
Load a single linetype safely.
Use this instead of `system_run_command('_-LINETYPE _LOAD ...')` — that
raw form deadlocks on the FILEDIA file-picker dialog and on the
-LINETYPE option-menu prompt (measured on AutoCAD 2026: it loads nothing
either way). This tool loads through the ActiveX `Linetypes.Load` member,
picks the right .lin file from MEASUREMENT, and verifies the linetype
actually loaded. Refuses a name that is not a valid symbol name, a file
outside the allowed paths, and reports a name the file does not carry
or a file AutoCAD cannot find as an error naming both.mech_dimension_parttool Every dimension the part and its features ask for, laid out without overlaps.Filesoutside text
Every dimension the part and its features ask for, laid out without overlaps.
Axial lengths are chained, stacked from a baseline or measured from an
origin; diameters stack outside the silhouette; fillets get a radius. Each
measurement appears once (ISO 129-1): every view record carries a
`dimensioned` flag, so after a `mech_part_draw` that dimensioned the front
view and a `mech_view_add`, this call dimensions only the new view, and
`views` naming a view already dimensioned is refused by name. `fits` resolves an ISO 286 code
against the measured nominal through the repository's authored tables and
appends the code to the dimension text; an explicit `tol` on a feature's own
intent does the same through the ISO 129 path.
Refused by name: a fit together with an explicit tolerance, a fit outside
the authored ISO 286 range (over 1 mm to 500 mm, IT4-IT11), a fit on an
intent with no measurable nominal, an unknown style, an unknown part_id, a
call when every view is already dimensioned (the message lists them), and
`part_id=None` on a drawing that holds more than one part. An angular intent
is reported in `skipped` rather than drawn, because a DimIntent carries no
vertex.mech_hole_patterntool A hole pattern on any drawing - the part model is not required.Filesoutside text
A hole pattern on any drawing - the part model is not required.
The same expansion `HolePattern` performs inside a part, exposed for a
drawing that was not built from the model.
Refused before anything is drawn: an unknown pattern, a count below 1 (below
2 for polar), a linear pattern with no spacing, a grid with more than one
column or row and no pitch for it, a polar pattern with no pitch-circle
diameter, and a non-finite or non-positive diameter.mech_part_drawtool One part model - a turned profile or a plate outline plus typed features - drawn as views.Filesoutside text
One part model - a turned profile or a plate outline plus typed features - drawn as views.
The model is written onto the drawing as `ACADMCP_MECH` XDATA on an anchor
POINT, so `mech_view_add` can add a section months later without the caller
re-describing the part, and `mech_part_inspect` reads it back.
Refused **before anything is drawn**, by path: a non-finite or non-positive
number (`segments[2].d_outer`), a bore that is not smaller than its outside,
an outline with fewer than three distinct vertices or one that crosses
itself, an unknown material, a feature whose placement is off the part, two
features that would remove the same material (both names given), a thread
outside the transcribed ISO 261 table, a keyway outside DIN 6885's bore
range, gear teeth whose tip diameter disagrees with their segment. A DIN 509
undercut, a DIN 471/472 groove, a DIN 332 centre hole and an ISO 3601-2
O-ring groove need explicit dimensions in this build: those tables are not
transcribed and the lookup refuses by name rather than interpolate. A
feature that cannot be projected into a requested view is listed in
`omitted`, never dropped.mech_part_from_spectool Several parts, their views and their dimensions, drawn inside one transaction.
Several parts, their views and their dimensions, drawn inside one transaction.
Every part is validated before the transaction opens, so a refusal leaves
the drawing untouched and names the offending path (`parts[1]:
segments[0].d_outer: ...`). If a draw fails or the request is cancelled
part-way, the transaction is rolled back under an anyio shield, so a
cancelled call cannot leave half a sheet inside an open transaction.
Refused by name: an empty `parts` list, any part refusal from
`mech_part_draw`, and a transaction that cannot be opened.mech_part_inspecttool The `ACADMCP_MECH` payload a drawn part carries, decoded.Filesoutside textread-only (declared)
The `ACADMCP_MECH` payload a drawn part carries, decoded.
Never modifies the drawing. Returns the part model exactly as
`mech_part_draw` accepts it (`part`), the views drawn so far with their
placements, and the payload version. `drift=True` adds `drift` (each
tagged entity that no longer matches the model: feature, view, expected,
measured, status) and `model_is_current`; `history=True` / `param` add
the revisions `mech_part_revise` stored in the drawing.
Refused by name: an unknown part_id, a handle that carries no
`ACADMCP_MECH` payload, a corrupt or foreign payload, and `part_id=None` on
a drawing that holds no part or more than one (the message lists the
handles).mech_part_revisetool Edit a drawn part's model by path and rebuild its views in place, in one transaction.Filesoutside textdestructive (declared)
Edit a drawn part's model by path and rebuild its views in place, in one transaction.
LINE/CIRCLE/ARC keep their handles; other changed entities are redrawn
(`handle_map`); dimensions are redrawn, so their handles change. Each
revision joins the part's model history.
Refused, nothing written: a bad path or a value the part refuses
(invalid_args); a tagged entity edited by hand (hand_edited_tagged_entity)
or a part drawn before 1.8.0 (model_drift) unless overwrite=True; a moved
preview (stale_revision); a detail view or a repeated view tag.mech_view_addtool Another view of a part already on the drawing, laid out on its projection axis.Filesoutside text
Another view of a part already on the drawing, laid out on its projection axis.
The part model comes back out of the drawing's `ACADMCP_MECH` XDATA, so the
caller never re-describes it, and the placement follows the projection angle
recorded when the part was drawn (first angle by default: the view from the
right goes to the left).
Refused by name: a section without a plane, or with a plane of zero length,
a plane that misses the part, or one that grazes an outline vertex so its
crossings cannot be paired; a half or offset section on the wrong kind of
plane (the message names the style that does apply); a detail without a
radius or with a scale of zero; an unknown part_id, and `part_id=None` on a
drawing that holds more than one part.mleaderstyle_createtool Create a multileader style: preset values first, then `overrides`.
Create a multileader style: preset values first, then `overrides`.
Headless it lands on `doc.mleader_styles`; live it is added through the
`ACAD_MLEADERSTYLE` dictionary (`AddObject(name, "AcDbMLeaderStyle")`)
and the object's properties are written. Refuses, before any write: an
unknown preset; an override key outside the four; `arrow_size` /
`text_height <= 0`, `landing_gap < 0`; a name that exists; a `text_style`
that is neither present nor a bundled preset (ISOCP, ISOCPEUR, ARIAL,
ROMANS — those are created on both engines, `textstyle_created`; live, a
preset whose font file the seat lacks is refused, nothing written).mleaderstyle_listtool Every MLEADERSTYLE with its four values on both enginesread-only (declared)
Every MLEADERSTYLE with its four values on both engines
(`values_available: true`). Headless they are read from the MLEADERSTYLE
object; live from the `AcadMLeaderStyle` objects the `ACAD_MLEADERSTYLE`
dictionary holds (ActiveX exposes no *collection* property for them, but
the dictionary items are full objects). `leader_create_mleader` can still
override any of them per leader.page_setup_applytool AutoCAD's PAGESETUP as one call, on both engines.
AutoCAD's PAGESETUP as one call, on both engines.
Paper sizes are ISO 216 / ANSI Y14.1; the media is written in AutoCAD's own
spelling (`ISO_A3_(420.00_x_297.00_MM)`). `changed` lists only the values
that moved — re-applying the same setup reports `{}`. An unknown ctb is
written and reported `plot_style_known: false` (a missing ctb only matters
at plot time). Viewports on the sheet are never touched.
Full-bleed and expanded media (issue #18): `paper` also takes any
canonical media name the device offers, e.g.
`ISO_full_bleed_A3_(420.00_x_297.00_MM)` or
`ISO_expand_A4_(210.00_x_297.00_MM)`; it is written unchanged, its numbers
are the sheet size, and they fix the orientation (reported in `applied`).
Or keep a catalogue paper and pass `bleed="full_bleed"` / `"expand"`,
which builds `ISO_full_bleed_A3_(…)` / `ISO_expand_A3_(…)`. The ISO
full-bleed and expand names were listed by `DWG To PDF.pc3` and
`AutoCAD PDF (High Quality Print).pc3` on AutoCAD 2026 (measured
2026-11-05); the ANSI ones (`ANSI_full_bleed_B_(…)`) follow the same
pattern unmeasured. The headless engine has no device and writes the name
as given; the live engine checks it against the device's
`GetCanonicalMediaNames()`.
Refused before anything is written: an unknown paper, orientation, scale,
plot_area or bleed, an orientation that contradicts a canonical media
name, `bleed` beside a canonical media name ("paper already names the
media"), an empty device or plot_style, margins that leave no printable
area, `Model`, an unknown layout. On the live engine `margins_mm` is
refused (the .pc3 owns them) and a media the device does not offer is
refused with the device's names for the same paper and its three closest
names.
The proof is the PDF: `batch_plot` reads each sheet's `/MediaBox` back.page_setup_listtool The page setup stored on each paper-space layout.read-only (declared)
The page setup stored on each paper-space layout.
`paper` is the catalogue name (ISO_A3, ANSI_B, …) when the stored size
matches one within 0.5 mm, otherwise the media name as stored; `size_mm`,
`orientation`, `plot_style` (ctb), `scale` ("fit", "1:50", or a custom
ratio), `plot_area`, `device`, `margins_mm` [top, bottom, left, right] and
`center` are read back from the LAYOUT object (headless) or the AutoCAD
Layout (live). Refuses an unknown layout name and `Model` (model space has
no sheet; plot it with `drawing_export_pdf(layout=None)`).pid_equipment_listtool Every equipment, valve and connector node with its ports and how many lines reach them.Files
Every equipment, valve and connector node with its ports and how many lines reach them.
Rows come from `pid_graph`; the drawing is not modified and `csv_path` is
the only file this tool writes, validated before the drawing is read.pid_from_spectool Equipment, valves, instruments and connectors placed, then every lineFiles
Equipment, valves, instruments and connectors placed, then every line
drawn port-to-port, inside one transaction: any bad item rolls the whole
sheet back and the error names it (`lines[2].to`); so does an interruption
(a client cancellation mid-run leaves no half-drawn sheet and no open
transaction on either engine — the live one goes back to the UNDO Mark
`transaction_begin` set, so it never waits at an AutoCAD prompt; should
that rollback itself fail, the failure is logged, the cancellation is what
the client sees, and the drawing must be checked before a retry).
A non-finite coordinate, rotation, scale or stub is refused
by path before anything is placed. The response carries the graph read
back from the drawing and the P&ID critique issues, so the caller sees
dangling ends or duplicate tags in the same round trip.
`dry_run` returns
the planned vertices and crossings without touching the drawing; crossings
are counted, on both runs, against the spec's own lines and the P&ID lines
already on the current layout (`crossings_scope`). The dry run also returns
the routing `region` and a `preview` whose precondition is the fingerprint
of every entity in that region. Applied with the preview's `revision`
(expected_revision) and/or `preconditions`, the run is refused with kind
stale_revision and nothing drawn when anything in the region (or the
revision) changed; a region precondition taken from another spec is
refused by path. A guarded run reports `revision` ({checked, after,
interleaved}).
`sheet.routing`: `auto` (default) or `avoid` (lines go round symbols;
no_route by path). Both runs report `obstacle_hits`.pid_graphtool Connectivity of the drawing as it *is*, not as it was drawn.Filesread-only (declared)
Connectivity of the drawing as it *is*, not as it was drawn.
Nodes: symbol INSERTs classified by catalogue name (confidence 1.0),
ACADMCP_PID payload (0.95), tag attributes / block-name keywords (0.6) or
a line touching an unknown INSERT (0.3); every node reports its `source`.
Ports come from the INSERT's real rotation, scale and mirror, measured
(a stretched bubble drops the node to 0.6 with a note). Edges: lines and
polylines; each end resolves to a port, a junction on another line, or
`dangling` with the nearest port as a hint — always within its own
space, so `scope="all"` never joins two sheets. `stats.confidence_min`
is the number to read before trusting a foreign drawing.
Returns nodes, edges, junctions, dangling, unclassified, offpage_links,
stats, tolerance, scope and backend:
- node: id, kind, block_name, family, symbol, tag, tag_parsed, tag_source,
x, y, rotation_deg, scale, y_scale, mirrored, layer, space, description
(its DESC attribute), source, confidence, notes, and ports
{name, x, y, direction_deg, kind, radius, inferred, edges};
- edge: id, line_class, class_source, line_number, number_source, size,
service, spec, insulation, from, to, length (plus length_approximate
when the engine measured none), layer, space, source; vertices and
bulges with include_geometry;
- junction: id, x, y, edges, space; dangling: edge, end, x, y, nearest.pid_instrument_indextool Every instrument bubble with its ISA-5.1 reading and what it connects to.Files
Every instrument bubble with its ISA-5.1 reading and what it connects to.
Rows come from `pid_graph`, never from typed-in lists; the drawing is not
modified. `csv_path` is the only file this tool writes (so it is not
annotated read-only); it is validated before the drawing is read, and an
empty path, a directory or a missing parent folder is refused.
`signal_lines` counts ISA-5.1 signal lines only; `connected_to` names a
tag, a handle, or the lines a junction on the instrument's line joins.pid_line_drawtool Connect two ports with one LWPOLYLINE on the class's layer.Files
Connect two ports with one LWPOLYLINE on the class's layer.
Ports come from `pid_symbol_insert`; a bubble's radial port is entered
without a name. `auto` picks the shortest orthogonal route that leaves each
port straight for `stub` mm; when none exists the call refuses and says so
— pass waypoints. `crossings` counts existing P&ID lines the new one cuts
(reported, never refused) and `port_reuse` names ports that already had a
line (branching is legal). Signal classes get ISA-5.1 markers (`//`, `X`,
`L`, `o`) as small blocks on segments >= 15 mm; electric is dashed by layer.
A signal line carries no pipe line number: it gets no auto-built number
and no label, and does not consume the process sequence — a verbatim
`line_number` is still written and labelled. With waypoints, a bubble's
exit leaves towards the first waypoint (and the entry arrives from the
last one); `crossings` follows existing arcs, not their chords.
`avoid` keeps `clearance` from every other symbol and `keep_out` box;
none possible: kind no_route naming the tags (or `on_blocked="cross"`).
Every route reports `obstacle_hits` and `label_hits` [{handle, tag}].pid_line_listtool Every P&ID line with its number, class, size/service/spec/insulation and endpoints.Files
Every P&ID line with its number, class, size/service/spec/insulation and endpoints.
Rows come from `pid_graph`; untagged lines sort last with `line_number: null`.
An end names a node's tag (its handle when untagged) and port, or — at a
junction — the line numbers (or handles) of the lines it joins.
The drawing is not modified; `csv_path` is the only file this tool writes,
validated before the drawing is read.pid_projecttool Read every sheet of a P&ID project with the pid_graph reader; nothing is modified.Files
Read every sheet of a P&ID project with the pid_graph reader; nothing is modified.
check: `links` per LINK id (matched / orphan / direction_mismatch /
duplicate, each connector with sheet + handle), cross-sheet
`duplicate_tags` (connectors never count), `line_continuity` of every
matched pair. index: instrument index, line list and equipment list
with a `sheet` column. Refused by name: over 50 sheets, a missing file,
a .dwg headless (`dwg`), .xlsx without openpyxl (`xlsx_write`).pid_symbol_inserttool Insert a catalogue symbol as a real block with TAG attributes and named ports.
Insert a catalogue symbol as a real block with TAG attributes and named ports.
Defines the block on first use (`defined`), creates a missing family layer
from the P&ID layer set (`layers_created`), writes an ACADMCP_PID payload
so readers without the catalogue still see the ports, and returns every
port in WCS — connect them with `pid_line_draw`. An invalid ISA-5.1 tag is
written and reported in `tag_warnings`; `drawing_critique` flags it.pid_symbol_listtool The symbols `pid_symbol_insert` can place, with their ports and variant options.read-only (declared)
The symbols `pid_symbol_insert` can place, with their ports and variant options.
Authored from ISO 10628-2 (equipment, valves) and ISA-5.1 (instrumentation);
each row's `source` names the figure. Symbol-local sizes are millimetres at
A3/A1 paper scale (bubble Ø10, valve 8×4); `scale` at insertion rescales.pid_tag_parsetool ISA-5.1-2009 Table 4.1 as a grammar: first letter, modifier, readout andread-only (declared)
ISA-5.1-2009 Table 4.1 as a grammar: first letter, modifier, readout and
output functions, trailing high/low, loop number and suffix — with the
standard's description ("Flow Indicating Controller") or the first
offending letter. Equipment prefixes are not standardised, so the default
map (P pump, V vessel, E exchanger, ...) can be replaced per call.plot_style_listtool The ctb files AutoCAD ships (`monochrome.ctb`, `acad.ctb`, `Grayscale.ctb`,read-only (declared)
The ctb files AutoCAD ships (`monochrome.ctb`, `acad.ctb`, `Grayscale.ctb`,
the Screening set, …) and, on the live engine, the files actually present
in `Preferences.Files.PrinterStyleSheetPath` (`source: "installed"`,
`installed: true/false` per row). Headlessly `installed` is `null`: there
is no installation to scan, and the catalogue is not evidence of one.
Never refuses; an unreadable Preferences object degrades to the catalogue.point_from_snaptool Compute a deterministic snap point on an entity. Use this INSTEAD OFread-only (declared)
Compute a deterministic snap point on an entity. Use this INSTEAD OF
guessing coordinates — eliminates the most common LLM drawing error.point_intersectiontool Compute the intersection of two geometry entities (LINE-LINE, LINE-CIRCLE,read-only (declared)
Compute the intersection of two geometry entities (LINE-LINE, LINE-CIRCLE,
CIRCLE-CIRCLE). When two candidates exist, ref_x/ref_y selects the nearest.
Returns {x, y, on_first, on_second, on_both, candidates}. A LINE is
intersected as the infinite line through it, so the point can lie beyond
a drawn end: `on_first` / `on_second` say whether it lies on each drawn
segment (a CIRCLE always holds its own intersection points) and `on_both`
whether on both - check it before using the point as a corner.
`candidates` is how many intersections existed. Refused, with the case
named: parallel or coincident lines, a line that misses the circle,
concentric circles, circles that do not meet, any other entity pair.point_tangenttool Compute the tangent point on a circle from an external point.read-only (declared)
Compute the tangent point on a circle from an external point.
Returns {x, y}. Raises if the from-point is inside the circle.section_linetool Draw the cutting-plane line and hand back the plane a section view consumes.Filesoutside text
Draw the cutting-plane line and hand back the plane a section view consumes.
Wide segments at the ends on GEOMETRY, the thin long-dash-dot middle on
CENTER, an arrow at each end whose head sits on the line end and points the
way the section is viewed, and the same letter beyond both arrows.
`payload["plane"]` is exactly `{p1, p2, label, direction, style}` — feed it
to the section view so the label on the plan and the label on the view
cannot disagree. Refusals, before any entity is written: `p1 == p2`, a zero
or parallel viewing direction, an empty `label`, a `style` outside
full/half/offset/revolved, and a non-positive `height`.selection_filtertool AutoCAD's QSELECT: filter the drawing by properties.read-only (declared)
AutoCAD's QSELECT: filter the drawing by properties.
Named parameters rather than a query string, deliberately — a mistyped
attribute name in a query language comes back as an empty result, which is
indistinguishable from "no matches". `filtered_by` reports which filters
actually ran.selection_gettool Read the entities the user pre-selected in the AutoCAD viewport (COM backend only).read-only (declared)
Read the entities the user pre-selected in the AutoCAD viewport (COM backend only).
Returns the implied "pickfirst" selection — the entities highlighted with
grips before invoking the AI — so work can be scoped to exactly those
entities instead of the whole drawing. Typical use::
sel = selection_get()
dimension_auto(sel["handles"], style="chain")
Result keys:
ok — True on the COM backend (even for an empty selection)
count — number of selected entities
handles — list of entity handles (hex strings) to act on
entities — full per-entity info (type, layer, color, ...)
pickfirst — state of the PICKFIRST sysvar (None if unknown)
message — guidance when nothing is selected
On the ezdxf headless backend there is no viewport, so this returns
ok=False with an empty handles list.
`fields` / `compact` shape the "entities" collection — this tool already
returns an object, so the columnar envelope lands *under* that key rather
than replacing the result. `handles` is unaffected, so a caller that only
wants handles can pass fields=["handle"] and still read `handles` directly.selection_polygontool Window or crossing selection against a polygon rather than a rectangle.read-only (declared)
Window or crossing selection against a polygon rather than a rectangle.
selection_windowtool AutoCAD's ssget window/crossing selection.read-only (declared)
AutoCAD's ssget window/crossing selection.
Corners may be given in any order. Selection is by *drawn* position, so an
entity in a mirrored frame is found where `entity_get` reports it. A
zero-area box is refused rather than answered with an empty list.sheet_frametool ISO 5457 drawing frame for A4-A0: a 20 mm filing margin, 10 mm on the
ISO 5457 drawing frame for A4-A0: a 20 mm filing margin, 10 mm on the
other three edges, the grid reference system and the centring/trimming marks.
Borders, rules and marks land on TITLEBLOCK; the zone lettering on TEXT.
Refusals, all before the first entity is drawn: a size outside A4-A0 is
refused by name and the five covered sizes are listed; an orientation that
is neither 'landscape' nor 'portrait'; a `layout` that does not exist. The
zone divisions drawn are equal -- ISO 5457's shorter corner fields are not
implemented -- while the division counts are the standard's.solid_booleantool Boolean-combine two native 3D solids (COM backend, opt-in).destructive (declared)
Boolean-combine two native 3D solids (COM backend, opt-in).
The tool solid is consumed; the target holds the result.solid_boxtool Create a native 3D solid box (COM backend, opt-in).
Create a native 3D solid box (COM backend, opt-in).
solid_cylindertool Create a native 3D solid cylinder (COM backend, opt-in).
Create a native 3D solid cylinder (COM backend, opt-in).
solid_extrudetool Extrude a closed profile into a native 3D solid (COM backend, opt-in).
Extrude a closed profile into a native 3D solid (COM backend, opt-in).
solid_revolvetool Revolve a closed profile around an axis into a native 3D solid (COM, opt-in).
Revolve a closed profile around an axis into a native 3D solid (COM, opt-in).
std_feature_drawtool Add a standard feature to geometry that already exists - a foreign drawing being finished.
Add a standard feature to geometry that already exists - a foreign drawing being finished.
Local frame: `(x, y)` is on the axis, +X runs along the axis in the
direction the feature extends and +Y is radially outward. The thread is the
ISO 6410 representation (minor diameter at 0.8 x major, thread-length limit
to the major) and its pitch comes from ISO 261 via `size` or from an
explicit `pitch` - it is never guessed. Every other kind takes its
dimensions from the registered standards table and is refused by name when
that table is absent, when the size is outside its coverage, or when the row
lacks a dimension the feature needs: no value is interpolated and no profile
is reconstructed. DIN 332 form R is refused - only forms A and B are drawn.std_part_inserttool Define the part's block once, insert it, and write its `std_part` XDATA.
Define the part's block once, insert it, and write its `std_part` XDATA.
The block carries DESIG / STD / SIZE / MAT attributes and an ACADMCP_MECH
payload, so a parts list is a read of the drawing rather than a naming
convention. Refusals, all before any write: a designation outside the
transcribed tables (named, with the nearest catalogue entries - nothing is
drawn approximately), a malformed designation, a missing or stray nominal
length, a view the family does not have, an attribute tag the block does
not carry, and a non-finite coordinate or rotation.std_part_listtool Catalogue rows with the dimensions a drawing needs, and their provenance.read-only (declared)
Catalogue rows with the dimensions a drawing needs, and their provenance.
Every row is transcribed from the named standard's own table and carries
its `source`. Coverage is deliberately narrow: ISO 261 first-choice sizes
only (M5-M36, M3-M24 for ISO 4762) and ISO 15 bore numbers 00-10 in the
600x / 620x / 630x series. A size outside a table is refused by name by
`std_part_insert` with the nearest entries, never interpolated and never
substituted. An unknown `standard` is refused with the list of catalogue
standards.
`coverage` is the standards coverage manifest (also the resource
`autocad://standards/coverage`): one record per registered table - the
fastener and bearing tables above, ISO 261 and the feature tables
`std_feature_draw` reads - with edition, table locator, implemented sizes,
range and source. DIN 509, DIN 471/472, DIN 332-1 and ISO 3601-2 report
"no rows transcribed"; transcriber and reviewer are null because the
repository records none.surface_texturetool Draw the 60° surface-texture vee with its annotation in the standard positions.Filesoutside text
Draw the 60° surface-texture vee with its annotation in the standard positions.
Refusals, all before the first entity reaches the drawing: a text height
outside the seven ISO 1302 rows (2.5/3.5/5/7/10/14/20 mm — never
interpolated), a `lay` that is not one of the seven ISO 1302 directions of
lay, a `machining` outside any/required/prohibited, and a `standard` other
than ISO 21920-1 or ISO 1302.system_abouttool Get detailed information about AutoCAD MCP Pro capabilities and available tools.read-only (declared)
Get detailed information about AutoCAD MCP Pro capabilities and available tools.
system_capabilitiestool Return machine-readable support modes for the active backend.read-only (declared)
Return machine-readable support modes for the active backend.
system_get_variabletool Get an AutoCAD system variable value.read-only (declared)
Get an AutoCAD system variable value.
system_launchtool Connect to the application named by `CAD_PROGID` (attach if running,
Connect to the application named by `CAD_PROGID` (attach if running,
launch otherwise) and report `launched`, `attached`, `version` and the
active `document`. Refusals: headless, `capability: "live_application"`
(there is no application to launch); with `CAD_LAUNCH=never` and nothing
running, `cad_not_running` (attach only, nothing started); an `open_path`
that fails path validation. Pack: settings · lean: no.system_preferences_gettool The whitelisted `Preferences.*` values, enum values as namesread-only (declared)
The whitelisted `Preferences.*` values, enum values as names
(`SaveAsType: "ac2018_dwg"`), with `read_only` naming the four `Files.*`
paths. Refusals: headless, `capability: "preferences"` (they live in the
running application, not in a file); a key outside the whitelist.
Pack: settings · lean: no.system_preferences_settool Write one preference and report `old`, `new` and `changed`.
Write one preference and report `old`, `new` and `changed`.
Refusals, all before any write: a read-only key (`Files.*`), an unknown
key, a value of the wrong type, an int outside the authored range
(`AutoSaveInterval` 0–600 min, `CursorSize` 1–100, `PickBoxSize` 0–50, …),
an unknown `SaveAsType` name; headless, `capability: "preferences"`.
Pack: settings · lean: no.system_prompt_messagetool `Utility.Prompt`: tell the operator something where they are looking.
`Utility.Prompt`: tell the operator something where they are looking.
Nothing in the drawing changes. Refusals: an empty message; headless,
`capability: "interactive_prompt"`. Pack: settings · lean: no.system_run_commandtool Execute an AutoCAD command string directly (COM backend only).
Execute an AutoCAD command string directly (COM backend only).
Append \\n for Enter. Example: '_LINE 0,0 100,0 \\n'.
IMPORTANT: commands that finish at an option menu (e.g. -LINETYPE, -LAYER,
-STYLE return to '[?/Create/Load/Set]:' after their action) need an EXTRA
blank line or '_X\\n' to exit, otherwise AutoCAD stays at a prompt and the
next COM call will deadlock. Example: '_-LINETYPE _LOAD CENTER acad.lin\\n\\n'.
A verb denylist refuses obviously destructive commands, but it is a guardrail
against issuing `ERASE ALL` by accident, NOT a security boundary — AutoCAD
accepts hundreds of commands and any loaded ARX/LISP adds more. Prefer the
typed tools (entity_delete, drawing_save_as, block_insert, drawing_purge):
they validate their arguments, which a free-text command string cannot.
A refused command is error kind `policy_refused` with `verbs` and
`alternatives` ([{tool, summary}], the typed tools for those verbs that the
active profile advertises); an allowed one that a typed tool also does
carries `typed_alternative` in the same shape.
The call waits for the command to finish (CMDACTIVE, `COMMAND_DEADLINE_S`,
default 8 s) and returns `{completed: true, created: [{handle, type, space}]
(first 50), created_count, last_prompt, target_space}`; a new entity
outside the target space (model space unless `layout_set_current` chose a
sheet) adds `warning: "created_outside_target_space"`. A command still at a
prompt is cancelled with ESC x3 and fails with kind `command_incomplete`
carrying AutoCAD's own `last_prompt`.system_run_lisptool Execute an AutoLISP expression (COM backend only).
Execute an AutoLISP expression (COM backend only).
Example: '(vla-get-Area (vlax-ename->vla-object (handent "2A")))'
LISP_POLICY=read (default) reads the expression and runs what passes the
read tier: arithmetic and geometry (angle, distance, polar, inters, trans),
lists and control (car/cdr, cons, list, mapcar, foreach, if, cond, progn,
lambda, setq), strings (strcat, substr, rtos, vl-string-*) and database
reads (entget, entnext, entlast, handent, tblsearch, getvar, dictsearch,
ssget with a literal "_X"/"_W"/"_C"/"_CP" mode, vlax-ename->vla-object,
vla-get-*, vlax-get-property, vlax-curve-get*). Never run, under any tier:
getpoint and the other interactive get*/entsel/ssget forms (they hold
AutoCAD's only COM thread), load/autoload/arxload, startapp, dos_*,
vl-file-*, read, a non-literal eval/apply, vlax-create-object,
vla-SendCommand, vlr-*, defun, c:*, and unreadable or unbalanced text.
Anything else (command, entmod, setvar, vla-put-* ...) goes to the 1.7
symbol denylist unchanged; LISP_POLICY=denylist is 1.7's behaviour. A
guardrail, NOT a security boundary. Prefer the typed tools.
A refused expression is error kind `policy_refused` with policy
`lisp_allowlist` (`lisp_denylist` under LISP_POLICY=denylist), `symbol`,
`line`, `column`, `tier_needed` (`write`, `none`, `unclassified`; `read`
when only LISP_POLICY=denylist refused it),
`reason`, `symbols`, `verbs` (the commands its `(command "...")` forms
name) and `alternatives` ([{tool, summary}], the typed tools for them).system_set_variabletool Set an AutoCAD system variable (e.g. DIMSCALE, LTSCALE, MEASUREMENT).
Set an AutoCAD system variable (e.g. DIMSCALE, LTSCALE, MEASUREMENT).
Refusals, before anything is written: a value outside the catalogued
range or enum of a known variable, or a write to a read-only variable
(DIMSTYLE, CANNOSCALEVALUE, DWGNAME, …), is refused with the catalogue's
message — `system_variable_describe(name)` shows the range. A variable the
catalogue does not know is passed through unchanged. The headless engine
additionally refuses registry-saved variables (`capability:
registry_sysvar`) because a file has nowhere to keep them, and names that
ezdxf has no header slot for (a `ValueError` naming the variable).system_statustool Get full status of the AutoCAD MCP Pro server and backend connection.read-only (declared)
Get full status of the AutoCAD MCP Pro server and backend connection.
Returns backend name, connection status, capabilities, document info, and
the document's `document_id` and content `revision` (headless: the active
registry entry; live: the bound document, plus `bound_document` and
`active_document_changed`). Live, the revision counts this server's writes
and the operator's object edits between two calls (an AutoLISP reactor;
`operator_edits` says whether it runs); without Visual LISP, this server's
writes only. Live, `snapshot_reuse` is `{ttl_s, exports, reused}`: the
COM_SNAPSHOT_TTL in force, and how many DIMENSION / HATCH detail reads
took a fresh export or reused one.
`operations` is `{count, last: {op, tool, state, rev}, unknown_commit}`;
drawing_history lists the calls.
`state_store` describes the durable journal (B13): `mode` (`durable`, or
`off` with JOURNAL_DURABLE=off), `path` (<ACADMCP_STATE_DIR>/journal.sqlite3),
`bytes`, `documents`, `operations`, `checkpoints`, `write_failures` and
`degraded` (false, or `{kind, reason}` when the file is unusable or
refused and records are kept in memory only - no call fails because of it).
A client id replays across restarts; a call still running when its server
died answers `requires_reconcile` with `error_kind: "process_exit"`.
`save_recovery` (only when there was one) lists the saves a dead process
left half done that this server resolved at startup: `completed`,
`finished` (the verified file put in place), `rolled_back` (the previous
file kept) per target.
`metrics` (only with metrics=True) counts this connection's earlier calls
(`session`: calls, by_tool, result_bytes, errors_by_kind, p50_ms, p95_ms)
and, live, `com_run`: each COM job's queue/guard/work/refresh/counter ms.system_variable_describetool What an AutoCAD system variable means, from an authored catalogue of 90.read-only (declared)
What an AutoCAD system variable means, from an authored catalogue of 90.
With `name`: `{known, name, type, range|enum, default, meaning, saved_in
(drawing|registry|not_saved), engines: {ezdxf, com}, friendly_key,
read_only}` plus `current` when the active backend can read it (omitted,
with `current_unavailable`, when it cannot — no document open, or a
registry variable headlessly). An unknown name is never an error: `known:
false` and the nearest catalogue names come back. With `search`: every row
whose name or meaning contains all the words. With neither: the index of
names. `friendly_key` names the `drawing_settings` key that wraps the
variable, which is the preferred way to set it; `engines.ezdxf: false`
means the headless engine refuses a write (registry-saved, or no header
slot in ezdxf).template_apply_layerstool Apply a standard layer set from a predefined template.
Apply a standard layer set from a predefined template.
Available templates: architectural, mechanical, electrical, piping.
Creates all layers defined in the template with standard colors and lineweights.template_listtool List all available layer templates and their contents.read-only (declared)
List all available layer templates and their contents.
text_find_replacetool Replace text in TEXT, MTEXT and block attributes (ATTRIB and ATTDEF).
Replace text in TEXT, MTEXT and block attributes (ATTRIB and ATTDEF).
Both engines search the same places (`searched_scope`): model space, every
paper layout, every named block definition - so the next insert does not
reintroduce the old text - and the attributes of every block reference in
any of them; an xref's block holds another file's text and is not searched.
`searched_types` is on the response because "no matches" and "that type was
never searched" are different answers. DIMENSION text is out of
scope: its text field holds the `<>` override placeholder rather than the
measurement, so editing it would break the association. Anonymous blocks
(`*D` - a dimension's rendered measurement - `*T`, `*U`, `*X`) are
renderings regenerated from their owner and are not searched either. A multi-line
attribute is matched and rewritten as the whole value (`Line1\\PLine2`),
the same value `block_get_attributes` reports and `block_explode` bursts.
dry_run=True adds `preview`: the document's content revision, the exact
fingerprint of every matched entity and the planned rows. Applied with that
`revision` (expected_revision) and/or its `preconditions`, the search runs
again first: an edited entity, a moved revision or a new match the preview
did not list refuses the call with kind stale_revision and nothing is
replaced. A guarded apply reports `revision` ({checked, after, interleaved}).text_set_backgroundtool Mask what is behind an MTEXT so it stays readable over hatch or geometry.
Mask what is behind an MTEXT so it stays readable over hatch or geometry.
MTEXT only: TEXT has no background-fill attribute, so setting one on it
would report success and change nothing.textstyle_createtool Create a text style.
Create a text style.
Headlessly a font nobody can find is *written* and reported
`font_resolved: false` (AutoCAD substitutes at open; the headless
renderer falls back), because a DXF stores only the name. The live
engine cannot do that: ActiveX refuses a font AutoCAD cannot open, so a
file that is neither on its support path nor in the Windows Fonts folder
is refused there before any write (the message names the folders and the
presets); a TrueType font is written by its typeface (`SetFont`, what the
STYLE dialog does — the record carries `arial.ttf`, never a machine
path), an SHX by the file name. Refuses, before any write on both
engines: a name that exists, an empty font, `width_factor <= 0`,
`height < 0`, an oblique angle outside ±85°.textstyle_listtool Every STYLE table entry and the one new TEXT/MTEXT will use.read-only (declared)
Every STYLE table entry and the one new TEXT/MTEXT will use.
textstyle_set_currenttool Set `$TEXTSTYLE`; `entity_create_text` / `entity_create_mtext` then
Set `$TEXTSTYLE`; `entity_create_text` / `entity_create_mtext` then
carry the style on both engines. Refuses a style the drawing does not
hold. Returns `previous` and `changed`.titleblock_applytool ISO 7200 title block, 180 mm wide, in the lower-right corner of any
ISO 7200 title block, 180 mm wide, in the lower-right corner of any
A4-A0 sheet. The title text is used verbatim.
Carries the ISO 128-30 projection-angle symbol: 'first' draws the cone on
the left and the concentric circles on the right, 'third' is its mirror.
Refusals, all before the first entity: an unknown size (the five covered
sizes are listed), an unknown orientation, a projection that is not
'first'/'third'/'', a `layout` that does not exist. `titleblock_apply_iso_a3`
is this tool with size='A3' and no symbol, kept so no caller breaks.titleblock_apply_iso_a3tool ISO 7200 / A3 (420x297 mm) title block. Title text is used verbatim.
ISO 7200 / A3 (420x297 mm) title block. Title text is used verbatim.
Pass `layout` to put the sheet on a paper-space layout, which is where a
title block belongs — the border frames the printed sheet, not the model.
Your current space is restored afterwards, so asking for a border does not
move you onto the sheet.transaction_begintool Begin a transaction (undo mark).
Begin a transaction (undo mark).
COM backend: Sets AutoCAD undo mark. All subsequent operations can be
rolled back to this point with transaction_rollback.
ezdxf backend: Saves a DXF snapshot. Rollback restores the full document
state to this point.
Always pair with transaction_commit or transaction_rollback.transaction_committool Commit the current transaction.
Commit the current transaction.
COM: Ends the undo mark (changes are permanent but still undoable via drawing_undo).
ezdxf: Discards the rollback snapshot (changes are kept).transaction_rollbacktool Rollback the current transaction to the point of transaction_begin.destructive (declared)
Rollback the current transaction to the point of transaction_begin.
COM: Undoes all operations back to the UNDO Mark transaction_begin set;
refused (`ok: false`) when no transaction is active.
ezdxf: Restores the document from the saved DXF snapshot.
WARNING: This is destructive – all changes since transaction_begin are lost.ucs_listtool The `world` row first, then every UCS table entry with origin and unitread-only (declared)
The `world` row first, then every UCS table entry with origin and unit
axes, `current` on the active one. `world` is current only when the frame
IS the WCS (WORLDUCS live, the `$UCS*` header headless) — an unnamed UCS
(`UCS Origin` / `3P` without saving) has an empty name too and is
reported as a trailing row with `name: null` and its origin/axes, so
`current` is `null` then and never `world`. Tool coordinates stay WCS on
both engines whatever is current. No refusals. Pack: settings · lean: no.ucs_restoretool Live: `ActiveUCS` for a named entry; `world` runs `UCS World`, which is
Live: `ActiveUCS` for a named entry; `world` runs `UCS World`, which is
refused while AutoCAD has an active command (CMDACTIVE — press ESC).
Headless: the `$UCSNAME/$UCSORG/$UCSXDIR/$UCSYDIR` header variables.
Refusal: an unknown name (lists the saved ones). Tool coordinates stay
WCS. Pack: settings · lean: no.ucs_settool Store a UCS table entry and make it current (AutoCAD's UCS command).
Store a UCS table entry and make it current (AutoCAD's UCS command).
Axes are normalised to unit vectors. **Every tool keeps taking and
returning WCS coordinates** — the repository rule; a UCS is for the
operator's own drafting, and no tool starts interpreting inputs in it.
Refusals, before any write: a name of `world` (reserved), a zero-length
axis, and non-perpendicular axes — the message carries the measured angle
(tolerance 0.001°). Pack: settings · lean: no.user_pick_pointtool `Utility.GetPoint`: returns the WCS `x`, `y` (`z`) the operator clicks.read-only (declared)
`Utility.GetPoint`: returns the WCS `x`, `y` (`z`) the operator clicks.
ESC is an answer, not an error: `cancelled: true` with AutoCAD's reason.
Waiting longer than `COM_CALL_TIMEOUT` returns `timed_out: true` (the
prompt is abandoned on AutoCAD's side; press ESC there). Refusals: an
empty prompt; headless, `capability: "interactive_prompt"` (no operator).
Pack: settings · lean: no.user_selecttool Returns `handles` the operator picked — one with `mode="single"` (plusread-only (declared)
Returns `handles` the operator picked — one with `mode="single"` (plus
the `picked` point `[x, y]` in **WCS** — AutoCAD reports it in the current
UCS and the tool translates, so a UCS made current by `ucs_set` never
shifts it), any number with `mode="multiple"` (Enter with nothing
selected is `count: 0`, not a cancel). ESC → `cancelled: true`; a wait
longer than `COM_CALL_TIMEOUT` → `timed_out: true`. Refusals: a mode
outside the two, an empty prompt; headless, `capability:
"interactive_prompt"`. Pack: settings · lean: no.validation_checktool Run quality checks on the current drawing.read-only (declared)
Run quality checks on the current drawing.
Available checks:
- empty_layers: Find layers with no entities
- zero_length: Find zero-length lines
- duplicate_entities: Find entities at the same position
With summary=True or a limit the result also carries total, by_focus (per check)
and by_severity over every issue, and `issues` keeps only the first `limit`.view_named_listtool Every VIEW table entry with centre, height and width. No refusals.read-only (declared)
Every VIEW table entry with centre, height and width. No refusals.
Pack: settings · lean: no.view_named_restoretool Live: zooms the active viewport to the saved window the way `-VIEW _R`
Live: zooms the active viewport to the saved window the way `-VIEW _R`
does — VIEWCTR becomes the saved centre and VIEWSIZE the saved height
(or width / display aspect when the window is wider than the display);
`applied: "zoom_window"` plus the read-back `viewctr` / `viewsize`.
Headless there is no display: the saved window is fitted into the
`*Active` VPORT — the view AutoCAD opens the file on — whose aspect ratio
is left as the file carries it (AutoCAD reconciles a changed aspect by the
viewport's lower-left corner, which shifts the centre); the result says
`applied: "header_only"` with the written `vport_height` and the kept
`aspect_ratio`, the same reported-no-op rule as `view_zoom_extents`.
Refusal: an unknown name (lists the saved views). Pack: settings · lean:
no.view_named_savetool Store a VIEW table entry (AutoCAD's VIEW command). Same name replaces
Store a VIEW table entry (AutoCAD's VIEW command). Same name replaces
(`replaced: true`). Refusals: `height`/`width` ≤ 0 or non-finite, a
malformed `center`, and headless an empty drawing with no `center`/`height`
(there are no extents to default to). Pack: settings · lean: no.view_screenshottool Capture a screenshot of the current drawing view.read-only (declared)
Capture a screenshot of the current drawing view.
COM backend: captures live AutoCAD window at current view.
ezdxf backend: renders via matplotlib to PNG.
With `region=[x0, y0, x1, y1]` only that window is drawn, on both engines:
headless it is the current space, live it is the bound document's
`Document.Export` snapshot drawn by the same renderer
(`source: "export_snapshot"`, seconds on a large drawing). Without a region
the headless engine frames the extents and the live one captures the
AutoCAD window (`source: "window"`). Beside the image comes a report:
`applied`, `framing`, `px` (read from the PNG), `region` (the window drawn —
the requested one widened by under a pixel so x and y share one scale),
`px_per_unit` (drawing point (x, y) is pixel ((x - x0)·ppu, (y1 - y)·ppu));
a window capture reports `region`/`px_per_unit` null, plus `dpi` (the
window's DPI), `dpi_awareness`, `capture` (the bitmap in physical pixels,
before `max_px`) and `window_minimized` - the server makes itself DPI-aware,
so the whole window is captured at any display scaling. A zero-width region or
a `max_px` outside 64-4096 is refused by name.
With `overlay_handles`, each entity is labelled with its handle at its own
centre — every modify tool takes a handle, and without the labels there is
nothing connecting "the circle at the top-left" to a hex string you can act
on. Crowded drawings are capped and the image says how many of how many were
labelled. Live AutoCAD captures its own window, so there is no render to
label there; it refuses with `capability: "handle_overlay"`.
Returns an Image content block with the PNG data, then the report as JSON.view_zoom_and_screenshottool Zoom to extents (or window if coordinates given), then capture a screenshot.read-only (declared)
Zoom to extents (or window if coordinates given), then capture a screenshot.
The most useful tool for visually inspecting drawing state.
The window is really applied on both engines: headless it is drawn as that
window (it used to be ignored), live AutoCAD zooms to it and the picture is
the bound document's export drawn at a stated scale
(`source: "export_snapshot"`). Without a window: extents (headless render;
live ZoomExtents + window capture). The report beside the image is the one
`view_screenshot` gives — `applied`, `px`, `region`, `px_per_unit`, and on a
live window capture `dpi`, `capture`, `window_minimized`. Give all
four corners or none: a partial window is refused, never silently widened
to the extents.view_zoom_extentstool Zoom to show all entities in the drawing (fit drawing in viewport).
Zoom to show all entities in the drawing (fit drawing in viewport).
view_zoom_windowtool Zoom to display the specified rectangular window region.
Zoom to display the specified rectangular window region.
viewport_createtool Place a scaled model-space viewport on a paper-space layout.
Place a scaled model-space viewport on a paper-space layout.
The viewport window shows the model region centered at
(view_center_x, view_center_y); view height = height / scale.viewport_deletetool Delete a viewport.destructive (declared)
Delete a viewport.
The layout's main viewport needs `force=true`; deleting it removes the tab's
own view state, and the layout's current-viewport pointer is repaired so the
file does not carry a dangling reference that only CAD would notice.viewport_listtool List paper-space viewports: handle, geometry, scale and lock state.read-only (declared)
List paper-space viewports: handle, geometry, scale and lock state.
The layout's own main viewport is included with `is_main: true` — it is the
tab's pan/zoom state rather than a drafting viewport, and it is what remains
after every drafting viewport is deleted. `scale` and `locked` are null on
documents that cannot store them (R12) rather than fabricated.viewport_locktool Lock or unlock a viewport's display scale.
Lock or unlock a viewport's display scale.
viewport_set_scaletool Rescale a viewport by adjusting its view height.
Rescale a viewport by adjusting its view height.
Geometric scale only: annotative text and dimensions do not resize with it.
Refuses the layout's main viewport, whose view height is the tab's own
pan/zoom state rather than a drafting scale.weld_symboltool Draw an ISO 2553 weld annotation: reference line, identification line, symbol, dimensions.Filesoutside text
Draw an ISO 2553 weld annotation: reference line, identification line, symbol, dimensions.
Refusals, all before the first entity reaches the drawing: a `kind` outside
the six elementary symbols transcribed here (square, v, bevel, u, j,
fillet — the rest of the ISO 2553 table is deliberately not shipped rather
than guessed), a `side` outside arrow/other/both, a non-positive `height`,
and a `pitch` given without a `length`.Text the model reads (229)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
analysis_measure_entity tool
Measure something already in the drawing, by handle.
Reads the real geometry, so polyline bulges (arc edges) are included —
reading vertices back and shoelacing them yourself loses 28% of the area on
a semicircular edge, silently.
Measurable: LWPOLYLINE, 2D POLYLINE, CIRCLE, ELLIPSE, SPLINE, HATCH, SOLID,
TRACE, 3DFACE. REGION and 3DSOLID need the live COM backend (their area is
in ACIS data ezdxf cannot evaluate) and refuse with
`capability: "measure_area_acis"`. LINE/TEXT/INSERT bound no area on any
engine and are a plain error, not a capability gap.
The payload states its own accuracy: `exact` is false when the shape had to
be flattened (then `flatten_tolerance` says how finely), `assumed_closed` is
true when an open boundary was closed the way AutoCAD's AREA does, and
`self_intersecting` warns when the shoelace cancelled crossed lobes — a
bowtie measures 0.0 and that number is worse than useless unflagged.entity_change_space tool
AutoCAD's CHSPACE: move entities across spaces, rescaled by the viewport.
Geometry is transformed by the viewport's own matrix so it stays the same
size on screen — a move without that transform would leave a 100 mm feature
as 100 mm of paper inside a 1:2 viewport.
Refused per entity for dimensions (unless `freeze_dimensions`), ACIS solids,
tables and proxies, viewports, and entities already in the target space;
refused outright for a twisted or non-plan viewport. Entities that end up
outside the viewport or off the sheet are moved and flagged, not refused.drawing_info tool
Get comprehensive metadata for the current drawing.
Returns: name, path, entity_count, layer_count, block_count,
extents (min/max), units, version, backend name, and the document's
`document_id` (a uuid4 hex minted when it was opened or created) and
`revision` (its content revision: moved by every content change, never by
a save, an export, a finalize or a delivery). On the live engine a call
made after the operator switched AutoCAD's active document is refused with
`kind: "active_document_changed"` (`bound`, `active`).drawing_new tool
Create a new drawing, optionally from a template.
A bundled name resolves to `templates/<name>.dxf` headlessly and
`templates/<name>.dwt` on the live engine (falling back to the DXF with
`source: "bundled_dxf"` when no `.dwt` twin is committed); a path is used
as given. The result carries `template: {name|path, path, source}`.
On the live engine only a genuine `.dwt` reaches `Documents.Add` —
measured on AutoCAD 2026, `Add(<file.dxf>)` silently returns the default
drawing — so a `.dxf` template (bundled or a path) is first converted
through AutoCAD into a cached `.dwt` and `template.dwt` names it
(`template.dwt_cached` says whether the conversion was reused). The
drawing then really carries the template's layers, tabs and page setup.
Refused before anything is replaced: a bare name that is not in the
catalogue (the message lists the five), a template path that does not
exist, and a path outside the allowed directories. With `bootstrap=True`
(default) the standard engineering linetypes and layers are ensured
afterwards — idempotent on a template that already has them.drawing_open tool
Open an existing DXF drawing file (DWG too, on the live COM backend).
Headless, a .dwg is converted to DXF (ODA File Converter, then
accoreconsole); the result carries `dwg_read: {route, seconds, log}`. No
converter: refused `dwg_read`; a failed conversion: `dwg_conversion_failed`
with each route's log.
A file that does not parse is refused (`damaged_drawing`) and the open
document is kept; the refusal names `recover=True`. The result carries the
file's `lineage`: an unchanged file last saved by this server continues its
`document_id` and `revision` across restarts; a file changed outside it
reports `external_change: true` (one revision more, journalled as
`external_edit`). `save_recovery` lists a save of this path a dead process
left half done, resolved before the read.drawing_save tool
Save the current drawing. Optionally specify a new path.
Headless, the write is atomic: a temporary file beside the target, checked,
then renamed over it - a killed save never leaves a half-written drawing.
A document opened with recover=True is refused onto its damaged source
(`recovered_source_protected`) unless overwrite_source=True.drawing_save_as tool
Save current drawing to a new path/format (DWG, DXF, or DWT template).
The on-disk format is derived from the file extension so the bytes always
match the name (N2) — e.g. 'part.dxf' writes DXF, not DWG. `format` overrides
only when the path has no recognised extension.drawing_export_dxf tool
Export the current drawing as a DXF copy.
The open document is never re-pointed: it keeps its name, path and saved flag
(drawing_save_as is the call that re-points). Live: `Document.Export`, renamed to
the name given; headless: a copy written by ezdxf. The result names the method
and the DXF version written. Refused: a name that is not .dxf (a .dwg headlessly
with capability `dwg`).drawing_export_pdf tool
Export the current drawing (or a paper-space layout) to PDF.
drawing_purge tool
Purge all unused objects (layers, blocks, linetypes, styles) from the drawing.
Live AutoCAD stores a durable checkpoint first (checkpoint_list).drawing_audit tool
Audit the drawing: repair every fixable structural problem, and report it.
This mutates the drawing. `fixes` lists repairs that have ALREADY been
applied, so save afterwards to keep them; `errors` lists problems that could
not be repaired. On the live COM backend AutoCAD applies repairs but hands
back no counts, so they arrive as null with `detail: "unavailable"` rather
than as zero.drawing_close tool
Close the active document. If save is True (default), the drawing is
saved to its current path before closing; an untitled document is closed
and `warning` says its changes were discarded (headless) or the call is
refused (live, where the alternative is a modal Save dialog). The
active-document case of `document_close`; after the last document is
closed, call drawing_new or drawing_open before any other tool.drawing_undo tool
Undo the last drawing operation.
On the live COM backend this is AutoCAD's own undo. Headless (1.8.0), undo
steps back to the newest durable checkpoint below the current revision -
taken at every save, open, new drawing, rollback-mode cad_batch /
transaction and checkpoint_create - so it works after a server restart too,
and reports `granularity` ("save", "batch" or "label") and `checkpoint`.
For per-call steps set `EZDXF_UNDO_DEPTH` (a full DXF snapshot per call -
measured 37x on entity creation, 0.18 -> 6.65 ms); those are used first,
then the checkpoints. Without a state folder (JOURNAL_DURABLE=off) and
without EZDXF_UNDO_DEPTH it is refused with capability `undo_history`.
Drawing something after an undo discards the redo branch, as in AutoCAD.
`verified` says whether the drawing observably changed: always true for a
headless snapshot restore; live, true when the entity count over every
layout or the document's edit counter moved (`evidence` has both), false
for "no change seen". An undo left at a prompt is `command_incomplete`.drawing_redo tool
Reapply the operation you just undid.
Same history as `drawing_undo`: headless, a checkpoint undo is redone from
the state it replaced (kept as a checkpoint), within the session. Anything
drawn after an undo discards the redo
branch — otherwise redo would restore a state that never existed, with
geometry you had removed reappearing beside geometry you drew afterwards.
Reports `verified` the same way `drawing_undo` does.entity_create_line tool
Create a line from (x1,y1) to (x2,y2). Returns entity info with handle.
entity_create_circle tool
Create a circle at (cx, cy) with given radius.
entity_create_arc tool
Create a circular arc. Angles are in degrees, measured counter-clockwise from the positive X axis.
entity_create_polyline tool
Create a lightweight 2D polyline through the given points.
Example: points=[[0,0],[100,0],[100,100],[0,100]], closed=true → rectangle
Example: points=[[0,0],[40,0]], bulges=[1, 0] → a semicircular arc edgeentity_create_rectangle tool
Create a closed rectangular polyline between two corner points.
Convenience wrapper around entity_create_polyline.entity_create_text tool
Create a single-line text entity (DTEXT/TEXT).
entity_create_mtext tool
Create a multi-line text entity (MTEXT) with word-wrap at the specified width.
entity_create_table tool
Create a native COM table or an explicitly-labelled ezdxf composite table.
leader_create_mleader tool
Create a native COM MLeader or an explicitly-labelled ezdxf composite.
entity_create_hatch tool
Create a hatch fill pattern inside a closed boundary polygon.
entity_create_spline tool
Create a NURBS spline curve passing through the specified fit points.
entity_create_ellipse tool
Create an ellipse. major_x/major_y define the major axis vector from the center.
entity_create_point tool
Create a point marker entity at (x, y).
entity_create_block_ref tool
Insert a block reference (instance of an existing block definition).
Refused before any write, on both engines: a name that is not a block
definition in this drawing (`block 'X' is not defined` — check
`block_list`), a layout block (`*Model_Space` / `*Paper_Space`, a
reference cycle) and a non-string name. The same gate as `block_insert`;
this tool is the no-attributes form.hatch_set_gradient tool
Fill a hatch with a gradient instead of a pattern.
hatch_edit tool
Edit an existing hatch in place.
Omitted parameters are left alone — a partial edit that resets the rest is
data loss. `changed` reports which attributes actually moved, so re-setting
a value to what it already was comes back as an empty list rather than a
false positive.hatch_add_boundary tool
Add one boundary path built from typed edges - an island inside the hatch.
Typed edges exist because a boundary that only accepts vertex lists
silently straightens every curve it is given. Every edge is validated
before any is written, so a malformed list refuses instead of leaving a
half-built path. Both engines: headlessly the edges become an edge path;
on a live seat each becomes a temporary LINE, true ARC or ELLIPSE appended
as an inner loop and then deleted (a chain of lines becomes one polyline).
A loop that does not close is refused by AutoCAD and nothing is added.entity_create_wipeout tool
Create a WIPEOUT that hides drawing content behind its outline.
Refuses fewer than three points: a zero-area mask hides nothing while
reporting success.entity_create_revcloud tool
Draw a revision cloud: a polyline whose every segment carries an arc.
A `segment_length` longer than the shortest edge is refused — the result
would carry no arcs at all and would be a plain polyline reported as a
cloud.dimension_linear tool
Create a linear dimension, optionally toleranced (ISO 129 or ISO 286 fit).
dimension_aligned tool
Create an aligned dimension that measures the true distance between two points.
dimension_angular tool
Create an angular dimension measuring the angle between two lines from a vertex.
dimension_radius tool
Create a radius dimension for a circle or arc, optionally toleranced.
dimension_diameter tool
Create a diameter dimension for a circle, optionally toleranced (e.g. ⌀20 H7).
entity_move tool
Move an entity by the specified displacement vector (dx, dy, dz).
entity_copy tool
Copy an entity and move the copy by (dx, dy, dz). Returns info of the new copy.
entity_rotate tool
Rotate an entity around a base point by the specified angle.
entity_scale tool
Scale an entity uniformly from a base point.
entity_mirror tool
Mirror an entity across a line defined by two points. Returns the mirrored copy.
entity_offset tool
Create a parallel copy of a line, circle, or polyline at the given distance.
entity_trim tool
Trim `target` against `cutter`, keeping the segment containing (keep_x, keep_y).
V1 supports LINE+LINE only. Cutter is treated as an infinite ray (AutoCAD's
default 'implied extend' trim mode). Raises if the lines are parallel.entity_extend tool
Extend `target` to meet `boundary`. If end_x/end_y is None, the target
endpoint nearest the boundary is auto-selected.
V1 supports LINE+LINE only. Raises if the lines are parallel.entity_fillet tool
Round a corner with a tangent arc. Returns info on the new ARC entity
(or the first source line for radius=0). V1 supports LINE+LINE only.entity_chamfer tool
Bevel a corner with a chamfer line. Returns info on the new chamfer LINE.
V1 supports LINE+LINE only.entity_delete tool
Permanently delete an entity by its handle.
entity_array_rectangular tool
Create a rectangular array of copies. Returns info of all created copies.
rows x cols is unbounded, so this is a result-heavy tool despite being a
create: a 40x40 grid hands back 1600 full records. fields=["handle"] is
usually all a caller needs from it.entity_array_polar tool
Create a polar (circular) array of copies around a center point.
`count` is unbounded, so the same result-shaping applies as for the
rectangular array: fields=["handle"] when the geometry is already known.entity_set_properties tool
Change one or more properties of an entity (layer, color, linetype, lineweight, visibility).
entity_edit_text tool
Edit an existing text label in place — change its content, height, rotation or position.
Use this to rename/relabel/move without deleting and recreating (which would
lose the handle and its XDATA). Works on both TEXT and MTEXT. ``x``/``y``
move the label so its reported ``insertion`` lands there; an aligned TEXT's
alignment point moves with it. A TEXT in a plane tilted out of WCS XY is
refused (capability ``ocs_tilted_plane``) — use ``entity_move``.text_set_background tool
Mask what is behind an MTEXT so it stays readable over hatch or geometry.
MTEXT only: TEXT has no background-fill attribute, so setting one on it
would report success and change nothing.text_find_replace tool
Replace text in TEXT, MTEXT and block attributes (ATTRIB and ATTDEF).
Both engines search the same places (`searched_scope`): model space, every
paper layout, every named block definition - so the next insert does not
reintroduce the old text - and the attributes of every block reference in
any of them; an xref's block holds another file's text and is not searched.
`searched_types` is on the response because "no matches" and "that type was
never searched" are different answers. DIMENSION text is out of
scope: its text field holds the `<>` override placeholder rather than the
measurement, so editing it would break the association. Anonymous blocks
(`*D` - a dimension's rendered measurement - `*T`, `*U`, `*X`) are
renderings regenerated from their owner and are not searched either. A multi-line
attribute is matched and rewritten as the whole value (`Line1\\\\PLine2`),
the same value `block_get_attributes` reports and `block_explode` bursts.
dry_run=True adds `preview`: the document's content revision, the exact
fingerprint of every matched entity and the planned rows. Applied with that
`revision` (expected_revision) and/or its `preconditions`, the search runs
again first: an edited entity, a moved revision or a new match the preview
did not list refuses the call with kind stale_revision and nothing is
replaced. A guarded apply reports `revision` ({checked, after, interleaved}).entity_edit_geometry tool
Edit the defining geometry of an existing entity in place (no delete/recreate).
CIRCLE: cx/cy/radius · LINE: x1/y1/x2/y2 · ARC: cx/cy/radius/start_angle/end_angle ·
LWPOLYLINE: points/bulges · TEXT/MTEXT: x/y.
Any argument left out is unchanged; the handle, layer and XDATA are preserved.
An argument the entity's type does not take is refused by name, never ignored.
A linear or aligned DIMENSION takes x1/y1/x2/y2 - its two measured points - and
is redrawn, so its number follows them (1.8.0); any other dimension type is refused.
On the live engine, if AutoCAD will not take a vertex list of a different
length in place, the polyline is recreated with its layer, colour, linetype,
lineweight and XDATA and the result says so in ``properties.replaced``
``[{old, new}]`` — use the new handle from then on.entity_modify_where tool
AutoCAD's QSELECT + CHPROP: one call for a whole set, not one row per entity.
Example - every override on the old layers back to ByLayer, on the new layer::
entity_modify_where(where={"layer": ["WALL*", "Walls"]},
set={"layer": "A-WALL", "color": 256, "lineweight": "ByLayer"})
Entities on a locked layer are not written (AutoCAD's rule) and are reported in
`skipped_locked`, never counted as matched. `changed` counts only entities that
really changed: re-setting a value to itself is not a change. dry_run=True adds
`preview` (the document revision, plus the region fingerprint when `where` has a
region - of the current layout); send its `count` back as `expect_count`, or the
preview to `cad_batch(expected_revision=, preconditions=)`. Refused by name before
anything is written: an unknown or malformed `where` / `set` key (invalid_args),
a `set.layer` no layer may carry, an `expect_count` the drawing no longer matches
(stale_revision).selection_window tool
AutoCAD's ssget window/crossing selection.
Corners may be given in any order. Selection is by *drawn* position, so an
entity in a mirrored frame is found where `entity_get` reports it. A
zero-area box is refused rather than answered with an empty list.selection_polygon tool
Window or crossing selection against a polygon rather than a rectangle.
selection_filter tool
AutoCAD's QSELECT: filter the drawing by properties.
Named parameters rather than a query string, deliberately — a mistyped
attribute name in a query language comes back as an empty result, which is
indistinguishable from "no matches". `filtered_by` reports which filters
actually ran.entity_get tool
Get all properties of a specific entity by its handle.
Coordinates are WCS. A HATCH also reports every boundary loop: `loops`
(each with `kind`, `flags`, `depth`, `points` and the parallel `bulges`,
`edges` for an edge path, `exact` and its `area`), `hatch_style` and the
filled `area` - outer loops minus islands by the hatch's own island style,
the rule `analysis_measure_entity` applies; None when a loop has an ellipse
or spline edge. A DIMENSION also reports `dimension`: `dimtype`, the five
`defpoints`, its own `measurement` (before DIMLFAC), `text_override`,
`dimstyle`, `dimlfac` and `angle`. On the live engine those two are read
from a DXF export of the whole drawing (`detail_source` says so), which
costs about as much as drawing_understand; it 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. A member of a block definition reports `detail_unavailable`. An
entity in a plane tilted out of WCS XY reports `plane_normal` (or
`tilted`) and omits what xy cannot express. Refused: a handle the drawing
does not hold.entity_list tool
List entities in the drawing with optional type and layer filters.
Returns handle, type, layer, color, and type-specific properties.
Use handles with entity_get, entity_move, entity_delete, etc.
This is the most expensive result on the server — the full record runs
~250 characters per entity, and `properties.bounding_box` alone is about a
third of it. When all you need is handles, say so::
entity_list(layer_filter="GEOMETRY", fields=["handle", "type"], compact=True)
Paging honesty: a plain list has nowhere to say that more entities followed
the page, so `compact=True` is the only mode that reports `total`,
`truncated` and `next_offset` — all measured against the same filters.entity_delete_many tool
Delete multiple entities in one call. Returns count of deleted entities.
All or none (unknown_handle, rolled_back).selection_get tool
Read the entities the user pre-selected in the AutoCAD viewport (COM backend only).
Returns the implied "pickfirst" selection — the entities highlighted with
grips before invoking the AI — so work can be scoped to exactly those
entities instead of the whole drawing. Typical use::
sel = selection_get()
dimension_auto(sel["handles"], style="chain")
Result keys:
ok — True on the COM backend (even for an empty selection)
count — number of selected entities
handles — list of entity handles (hex strings) to act on
entities — full per-entity info (type, layer, color, ...)
pickfirst — state of the PICKFIRST sysvar (None if unknown)
message — guidance when nothing is selected
On the ezdxf headless backend there is no viewport, so this returns
ok=False with an empty handles list.
`fields` / `compact` shape the "entities" collection — this tool already
returns an object, so the columnar envelope lands *under* that key rather
than replacing the result. `handles` is unaffected, so a caller that only
wants handles can pass fields=["handle"] and still read `handles` directly.entity_get_xdata tool
Extended entity data as {app: [values]}. An app with no XDATA is simply absent.entity_set_xdata tool
Replace the named app's XDATA on one entity; an empty list removes it.
Limits are AutoCAD's and are enforced before writing: 255 characters per
string and 16 KB per entity.layer_list tool
List all layers with their properties (color, linetype, frozen, locked, visibility).
Never truncated — a drawing's whole layer table is returned — so a compact
envelope here always reports truncated=false.layer_create tool
Create a new layer with specified properties.
layer_delete tool
Delete a layer. The layer must have no entities. Layer '0' cannot be deleted.
layer_set_current tool
Set the active/current layer for new entities.
layer_modify tool
Modify an existing layer's color, linetype, and/or lineweight.
layer_freeze tool
Freeze a layer (makes it invisible and unselectable, faster regeneration).
layer_thaw tool
Thaw a frozen layer, making it visible and selectable again.
layer_lock tool
Lock a layer (entities visible but cannot be selected or modified).
layer_unlock tool
Unlock a layer to allow entity selection and modification.
layer_hide tool
Turn off a layer (entities invisible but still processed in regeneration).
layer_show tool
Turn on a layer that was previously turned off.
layer_isolate tool
Hide all layers except the specified one (layer isolation).
layer_rename tool
AutoCAD's RENAME for a layer: the table entry and every reference to it.
Headless, every entity's layer in model space, every paper layout and every
block definition is rewritten (`entities`, `by_space`, `blocks_touched`), with
viewport frozen lists and the current layer; live, AutoCAD references a layer by
object id, so `AcadLayer.Name` renames it everywhere and no entity is rewritten
(`entities: null`). A layer state saved earlier keeps the old name. Refused by
name, before anything changes: `0`, `DEFPOINTS`, an xref-dependent layer, a
missing `old`, an existing `new` (use layer_merge), a case-only change.layer_merge tool
AutoCAD's LAYMRG: every entity on `sources` moves to `target`, then the
sources are deleted.
Reassigns in model space, every paper layout and every block definition
(attributes included); `by_space` counts per layout, `blocks_touched` names the
edited definitions - and `note` says so, because an edited definition changes
every INSERT of that block. The current layer moves to `target` when it was a
source; viewport freezes of a source are dropped with it. Live, a locked source
or target is unlocked for the move and the target relocked; a source AutoCAD
will not delete is listed in `layers_not_deleted` with its reason. Refused by
name, before anything changes: a missing source or target (layer_create the
target first), `0` / `DEFPOINTS` / an xref-dependent layer as a source, the
target among the sources.linetype_list tool
Return the names of all linetypes currently loaded in the active drawing.
linetype_load tool
Load a single linetype safely.
Use this instead of `system_run_command('_-LINETYPE _LOAD ...')` — that
raw form deadlocks on the FILEDIA file-picker dialog and on the
-LINETYPE option-menu prompt (measured on AutoCAD 2026: it loads nothing
either way). This tool loads through the ActiveX `Linetypes.Load` member,
picks the right .lin file from MEASUREMENT, and verifies the linetype
actually loaded. Refuses a name that is not a valid symbol name, a file
outside the allowed paths, and reports a name the file does not carry
or a file AutoCAD cannot find as an error naming both.block_list tool
List all block definitions in the drawing (name, origin, attribute count, entity count).
Never truncated — the whole block table is returned — so a compact envelope
here always reports truncated=false.block_insert tool
Insert a block and optionally set attribute values.
Refused before any write, on both engines: an undefined or layout block
name, and an attribute value that is not text — a string is written as
is (one line), an int or finite float as its plain digits (`101` →
`"101"`), while `null`, booleans, lists and objects are refused naming
the tag (they used to be written as their Python repr). Values for tags
the block does not define are ignored.block_explode tool
Explode a block reference into its component entities, keeping its
attribute text (the Express Tools BURST rule, on both engines).
Every attached ATTRIB becomes a TEXT with the same value, placement,
height, rotation and layer (an invisible attribute becomes an invisible
TEXT; a multi-line attribute becomes an MTEXT carrying every line), and
a constant attribute (which has no ATTRIB) becomes a TEXT of its value
too; AutoCAD's plain EXPLODE would keep only the tag-name placeholders
and drop the values. Everything lands in the layout that owns the
reference (model space or its paper-space sheet), whichever tab is
current. Returns `inserted_handles` (the geometry), `attribute_texts`
(one TEXT or MTEXT handle per attribute), `exploded_handle` and
`backend`. Refused, with nothing written: a handle that is not a block
reference, a reference nested inside a block definition (explode the
outer reference instead), an external reference (bind it first), a
MINSERT grid, and -- headless only, capability `explode_opaque_members`
-- a block holding a member ezdxf cannot transform (an OLE2FRAME logo, a
VIEWPORT, a proxy entity without proxy graphics), named by member; the
live engine hands those to AutoCAD. Not undoable except through
`drawing_undo` / a transaction.block_get_attributes tool
Get all attribute values from a block reference as {TAG: value} dict.
A multi-line attribute reports its whole content with `\\\\P` between the
lines (AutoCAD's `TextString`), on both engines.block_set_attributes tool
Update attribute values in a block reference.
Same value rule as `block_insert`: strings and numbers are written,
`null` / booleans / lists / objects are refused naming the tag before
anything changes. `updated_tags` lists the tags that exist on the
reference and were written; unknown tags are ignored.
A multi-line attribute takes `Line1\\\\PLine2` and keeps every line; the
value written is the one `block_get_attributes` reads back and
`block_explode` bursts, on both engines.block_create_from_entities tool
Create a new block definition from existing entities in the drawing.
Works on both engines. The originals stay in model space — this defines a
reusable block from them rather than consuming them the way AutoCAD's BLOCK
command does; use `block_insert` to place copies, and delete the originals
yourself if you want the command's behaviour.
Handles that do not resolve are listed in `skipped` rather than silently
dropped, and a call where none resolve fails instead of leaving an empty
definition behind.block_define tool
Create a block definition with attribute definitions from typed specs.
The whole request is validated before anything is written: one malformed
entry refuses the call and leaves no definition behind. Refusals: a
malformed primitive or ATTDEF (names `entities[i]`/`attdefs[i]` and the
key), a non-finite base point (names `base_x`/`base_y`), a name clash
without `overwrite`, an anonymous `*` name, and a primitive `layer` that
is not in the drawing's layer table (names the missing layers) unless
`create_layers=true`, which creates them and lists them in
`layers_created`. `overwrite=true` replaces the *contents* of an existing
block so its INSERTs keep pointing at the name and show the new geometry;
`replaced` reports it. Geometry inside the block is ByBlock so the
INSERT's layer supplies colour and lineweight. Insert with
`block_insert(attributes={TAG: value})`.block_find_references tool
Find all insert references to a specific block definition.
Bounded by the backend's own default entity_list page (200 INSERTs scanned),
which is a pre-existing limit, not a new one: the compact envelope's `total`
counts the references found within that scan.boundary_trace tool
AutoCAD's BOUNDARY/BPOLY: create a closed polyline around a seed point.
Returns the *nearest enclosing* loop, so a seed inside an island gives the
island rather than the outer region. Straight edges are split where they
cross, so a line drawn across a shape divides it the way it looks like it
should. A seed with no enclosing loop is refused, and the error names the
gap when the edges nearly close.boundary_from_entities tool
Chain the given entities into one closed polyline.
The handles may arrive in any order — putting them in chain order is the
tool's job. A chain that does not close is refused, and the error names the
coordinates of the gap.analysis_list_properties tool
AutoCAD's LIST: the full DXF attribute set for one handle.
`dxf_attributes` is the raw attribute set `entity_get` deliberately does
not carry. Coordinates in it are WCS, like everywhere else in this server,
and `extrusion` is reported so the entity's own frame is still visible.analysis_entity_stats tool
Analyze the drawing and return entity counts grouped by type and by layer.
Returns: total_entities, by_type (sorted by count), by_layer (sorted by count).
This is unique to AutoCAD MCP Pro – no other MCP server provides this!analysis_find_in_region tool
Find all entities within a rectangular region (crossing selection).
Uncapped: a window over a busy drawing returns every hit. Project with
`fields` and/or `compact` before widening the window.analysis_measure_distance tool
Measure the Euclidean distance between two points.
analysis_measure_area tool
Area and perimeter of a polygon you supply the vertices for.
This measures the numbers in the call, NOT the drawing. To measure something
that exists, use `analysis_measure_entity(handle)` — it reads the real
geometry, including curvature this tool can only see if you pass it.
Straight-edged polygons are exact. Pass a third `bulge` element per vertex
for arc edges; omitting it on curved geometry under-reports (28% on a
semicircular edge), which is why `assumes` says what was taken on faith.analysis_bounding_box tool
Get the bounding box (extents) of all entities in the drawing.
analysis_select_by_layer tool
Get all entities on a specific layer. Returns entity list with handles.
Capped at MAX_LIST_LIMIT (default 5000). The plain list cannot say it was
capped — the warning goes to the log stream, which most clients never show
the model — so use `compact=True` when the count matters: its `total` is the
layer's real population and `truncated` states whether the cap fired.analysis_select_by_type tool
Get all entities of a specific type. Returns entity list with handles.
Capped at MAX_LIST_LIMIT (default 5000); as with analysis_select_by_layer,
`compact=True` is the only shape that reports `total` and `truncated`.analysis_layer_stats tool
Return detailed statistics for each layer: entity count, types present.
cad_batch tool
Execute an ordered list of tool calls in ONE round trip.
N calls collapse into one request/response pair, and `bind` lets a later
step reference an earlier step's result so handles never have to be echoed
back through the model.
steps=[
{"tool": "entity_create_line", "args": {...}, "bind": "edge"},
{"tool": "point_from_snap", "args": {"handle": "$edge", "snap": "mid"},
"bind": "mid"},
{"tool": "entity_create_circle","args": {"cx": "$mid.x", "cy": "$mid.y",
"radius": 4}},
]
Successful steps report only their handle; pass verbose=True for the full
result. Anything without a handle is returned whole.
VALIDATION runs first, always: an unknown tool, a schema-invalid argument or
a reference no earlier step binds refuses the whole batch before anything
executes. So does a LITERAL handle (in a handle parameter) that names no
entity: one fingerprint read checks them all, and a missing one refuses
the batch with kind unknown_handle, naming each step index and handle -
executed 0. A literal handle after a step that opens, switches or restores
a document (drawing_open, drawing_undo, ...) is checked when its step runs.
`on_error` governs run-time failures only. dry_run=True returns that
validation report and executes nothing.
ERRORS are typed, never text: each failed step carries error.kind - one of
unsupported (with the backend `capability`), invalid_args, refused, failed,
unknown_tool, unresolved_ref, denied, malformed_step, quarantined, busy,
active_document_changed (live engine: the operator switched documents),
stale_revision, scan_incomplete, timed_out, unknown_commit (a write that
outran its deadline while its worker ran), cancelled, operation_conflict,
unknown_handle - and its own `operation_id`.
PREVIEW AND APPLY. dry_run=True also returns `preview`: the document id and
content revision, the exact fingerprint of every LITERAL handle in a handle
parameter (a '$reference' resolves late and an entity a step creates has
none) and the planned steps. Pass its `revision` as expected_revision and
its `preconditions` back, and the batch runs only if nothing moved -
otherwise it is refused with kind stale_revision and no step runs. A
guarded batch reports `revision`: {checked, after, interleaved}; each step
is its own locked call, so a change another call made between two steps is
listed under `interleaved` (a rollback restores the checkpoint, that change
included).
OPERATIONS: the batch and each step are operations with their own ids
(drawing_history lists them). Pass `operation_id` (or the
request's `_meta.operation_id`) to make a retry safe: the same id with the
same steps replays the recorded result instead of drawing twice, also
after a restart (the journal is durable since 1.8.0).
ATOMICITY is reported, not assumed. The default on_error="auto" (since
1.8.0; 1.7 defaulted to "stop") makes a batch with at least one mutating
step all or nothing: on the headless backend a run-time failure restores a
full document snapshot; on live AutoCAD it sends an UNDO, judged by the
before/after fingerprints once AutoCAD is idle (CMDACTIVE 0). A read-only
batch opens no checkpoint, and neither does one with a transaction_begin /
transaction_commit / transaction_rollback step: it runs as "stop" (live
AutoCAD does not nest a transaction). Read the `atomicity` block: `mode` is what ran,
`default_applied` (auto only) whether auto's checkpoint was opened,
`verified` whether the rollback was evidenced. Pass on_error="stop" to
keep the steps that ran before a failure. Under an explicit
on_error="rollback", a checkpoint a step opens with transaction_begin is
closed with the batch's (`unwound`).
CHANGES: `changes` {added, deleted, counts, complete} sums the steps; a
failed batch reports `partial_changes`.
NOT CALLABLE from a batch: the raw command/LISP escape hatches, and
cad_batch itself. Call those directly. A step the server's tool policy
refuses (READ_ONLY, TOOL_ALLOWLIST / TOOL_DENYLIST, MAX_TOOL_COST) refuses
the whole batch before any step runs, kind policy_refused.
For a few hundred entities of the same kind, entity_batch_create is denser
still (no per-step tool name) - and it can be one step of a cad_batch.entity_batch_create tool
Create multiple entities in a single call for better performance.
Each entity dict must have a 'type' key and the parameters for that type.
Example: [{"type": "line", "x1": 0, "y1": 0, "x2": 100, "y2": 0}, {"type": "circle", "cx": 50, "cy": 50, "radius": 25}]
Denser than cad_batch for many entities of the same kind (no per-step tool
name), and usable as one step *of* a cad_batch. Use cad_batch when the calls
differ, must be ordered, or must feed each other.entity_batch_modify tool
Apply multiple modifications in a single call.
Example: [{"handle": "1A", "action": "move", "dx": 10, "dy": 20}, {"handle": "2B", "action": "delete"}]
Covers move/rotate/scale/delete/set_properties only. For anything else, for
ordering, or to feed one step's result into the next, use cad_batch.
Every handle is checked first, in one read: one that names no entity
refuses the whole call with kind unknown_handle (`missing` lists each
index and handle) and nothing is modified.template_apply_layers tool
Apply a standard layer set from a predefined template.
Available templates: architectural, mechanical, electrical, piping.
Creates all layers defined in the template with standard colors and lineweights.template_list tool
List all available layer templates and their contents.
validation_check tool
Run quality checks on the current drawing.
Available checks:
- empty_layers: Find layers with no entities
- zero_length: Find zero-length lines
- duplicate_entities: Find entities at the same position
With summary=True or a limit the result also carries total, by_focus (per check)
and by_severity over every issue, and `issues` keeps only the first `limit`.view_zoom_extents tool
Zoom to show all entities in the drawing (fit drawing in viewport).
view_zoom_window tool
Zoom to display the specified rectangular window region.
view_screenshot tool
Capture a screenshot of the current drawing view.
COM backend: captures live AutoCAD window at current view.
ezdxf backend: renders via matplotlib to PNG.
With `region=[x0, y0, x1, y1]` only that window is drawn, on both engines:
headless it is the current space, live it is the bound document's
`Document.Export` snapshot drawn by the same renderer
(`source: "export_snapshot"`, seconds on a large drawing). Without a region
the headless engine frames the extents and the live one captures the
AutoCAD window (`source: "window"`). Beside the image comes a report:
`applied`, `framing`, `px` (read from the PNG), `region` (the window drawn —
the requested one widened by under a pixel so x and y share one scale),
`px_per_unit` (drawing point (x, y) is pixel ((x - x0)·ppu, (y1 - y)·ppu));
a window capture reports `region`/`px_per_unit` null, plus `dpi` (the
window's DPI), `dpi_awareness`, `capture` (the bitmap in physical pixels,
before `max_px`) and `window_minimized` - the server makes itself DPI-aware,
so the whole window is captured at any display scaling. A zero-width region or
a `max_px` outside 64-4096 is refused by name.
With `overlay_handles`, each entity is labelled with its handle at its own
centre — every modify tool takes a handle, and without the labels there is
nothing connecting "the circle at the top-left" to a hex string you can act
on. Crowded drawings are capped and the image says how many of how many were
labelled. Live AutoCAD captures its own window, so there is no render to
label there; it refuses with `capability: "handle_overlay"`.
Returns an Image content block with the PNG data, then the report as JSON.view_zoom_and_screenshot tool
Zoom to extents (or window if coordinates given), then capture a screenshot.
The most useful tool for visually inspecting drawing state.
The window is really applied on both engines: headless it is drawn as that
window (it used to be ignored), live AutoCAD zooms to it and the picture is
the bound document's export drawn at a stated scale
(`source: "export_snapshot"`). Without a window: extents (headless render;
live ZoomExtents + window capture). The report beside the image is the one
`view_screenshot` gives — `applied`, `px`, `region`, `px_per_unit`, and on a
live window capture `dpi`, `capture`, `window_minimized`. Give all
four corners or none: a partial window is refused, never silently widened
to the extents.transaction_begin tool
Begin a transaction (undo mark).
COM backend: Sets AutoCAD undo mark. All subsequent operations can be
rolled back to this point with transaction_rollback.
ezdxf backend: Saves a DXF snapshot. Rollback restores the full document
state to this point.
Always pair with transaction_commit or transaction_rollback.transaction_commit tool
Commit the current transaction.
COM: Ends the undo mark (changes are permanent but still undoable via drawing_undo).
ezdxf: Discards the rollback snapshot (changes are kept).transaction_rollback tool
Rollback the current transaction to the point of transaction_begin.
COM: Undoes all operations back to the UNDO Mark transaction_begin set;
refused (`ok: false`) when no transaction is active.
ezdxf: Restores the document from the saved DXF snapshot.
WARNING: This is destructive – all changes since transaction_begin are lost.checkpoint_create tool
Store the drawing as it is now as a durable checkpoint, optionally labelled.
Checkpoints live in the state folder (ACADMCP_STATE_DIR), gzip-compressed,
and survive a server restart: drawing_undo steps back to them and
checkpoint_restore brings one back. Saves, the open, a new drawing and every
rollback-mode cad_batch / transaction boundary take one by themselves; this
adds one where you want a named point (`granularity: "label"`). The drawing
is not changed. Returns `{cp, seq, tool, rev, kb, label}`.
Refused: `checkpoints` (unsupported) when there is no state folder
(JOURNAL_DURABLE=off, or a refused ACADMCP_STATE_DIR). Live: the document is
exported with Document.Export.checkpoint_list tool
The active drawing's checkpoints, newest first, across restarts.
Each row is `{cp, seq, tool, rev, kb, label, evicted}`: `rev` is the content
revision it holds (compare with system_status / drawing_info), `tool` what
took it (drawing_save, drawing_open, drawing_new, transaction_commit,
checkpoint_create, ...). A row the CHECKPOINT_KEEP / CHECKPOINT_BUDGET_MB /
CHECKPOINT_MAX_DOC_MB budget evicted stays listed with `evicted: true`; its
bytes are gone and restoring it is refused `checkpoint_evicted`.
Refused: `checkpoints` (unsupported) when there is no state folder.checkpoint_restore tool
Restore a durable checkpoint (see checkpoint_list).
`in_place` first stores the current drawing as a checkpoint
(`checkpoint_before`), so the restore is itself undoable: drawing_undo
returns to it. The result names `restored` and the new `revision`.
`new_document` leaves the active drawing alone and opens the checkpoint as
its own document, which becomes the bound/active one.
Refused by kind: `checkpoint_not_found` (no such id, seq or label - the
message names the newest ones), `checkpoint_evicted` (the budget dropped its
bytes), `stale_revision` (expected_revision no longer holds), and on live
AutoCAD `mode="in_place"` with capability `checkpoint_restore_in_place`
(ActiveX cannot replace an open drawing's database - use new_document).drawing_history tool
The active drawing's mutating calls, newest first, from the durable
journal - across restarts (reopen the file first).
Rows: {seq, op, tool, state, rev, cp, label, t}. A value from an earlier
round: label its call (_meta.label, cad_batch(label=)), then
drawing_history(label=..., detail="args"); unlabelled, detail="changes"
diffs the checkpoints around it (feature values, dimension measurements).
Refused: an unknown label (invalid_args, naming the labels); no document.system_status tool
Get full status of the AutoCAD MCP Pro server and backend connection.
Returns backend name, connection status, capabilities, document info, and
the document's `document_id` and content `revision` (headless: the active
registry entry; live: the bound document, plus `bound_document` and
`active_document_changed`). Live, the revision counts this server's writes
and the operator's object edits between two calls (an AutoLISP reactor;
`operator_edits` says whether it runs); without Visual LISP, this server's
writes only. Live, `snapshot_reuse` is `{ttl_s, exports, reused}`: the
COM_SNAPSHOT_TTL in force, and how many DIMENSION / HATCH detail reads
took a fresh export or reused one.
`operations` is `{count, last: {op, tool, state, rev}, unknown_commit}`;
drawing_history lists the calls.
`state_store` describes the durable journal (B13): `mode` (`durable`, or
`off` with JOURNAL_DURABLE=off), `path` (<ACADMCP_STATE_DIR>/journal.sqlite3),
`bytes`, `documents`, `operations`, `checkpoints`, `write_failures` and
`degraded` (false, or `{kind, reason}` when the file is unusable or
refused and records are kept in memory only - no call fails because of it).
A client id replays across restarts; a call still running when its server
died answers `requires_reconcile` with `error_kind: "process_exit"`.
`save_recovery` (only when there was one) lists the saves a dead process
left half done that this server resolved at startup: `completed`,
`finished` (the verified file put in place), `rolled_back` (the previous
file kept) per target.
`metrics` (only with metrics=True) counts this connection's earlier calls
(`session`: calls, by_tool, result_bytes, errors_by_kind, p50_ms, p95_ms)
and, live, `com_run`: each COM job's queue/guard/work/refresh/counter ms.system_capabilities tool
Return machine-readable support modes for the active backend.
system_get_variable tool
Get an AutoCAD system variable value.
system_set_variable tool
Set an AutoCAD system variable (e.g. DIMSCALE, LTSCALE, MEASUREMENT).
Refusals, before anything is written: a value outside the catalogued
range or enum of a known variable, or a write to a read-only variable
(DIMSTYLE, CANNOSCALEVALUE, DWGNAME, …), is refused with the catalogue's
message — `system_variable_describe(name)` shows the range. A variable the
catalogue does not know is passed through unchanged. The headless engine
additionally refuses registry-saved variables (`capability:
registry_sysvar`) because a file has nowhere to keep them, and names that
ezdxf has no header slot for (a `ValueError` naming the variable).drawing_settings tool
Read or change common AutoCAD drawing settings by friendly name.
A convenience facade over the system variables (INSUNITS, LUPREC, LTSCALE,
DIMSCALE, DIMTXT, DIMASZ, DIMDEC, DIMDSEP, DIMZIN, TEXTSIZE, OSMODE, LIMMIN/
LIMMAX, GRIDMODE/GRIDUNIT, SNAPMODE/SNAPUNIT, ORTHOMODE, AUTOSNAP/POLARANG,
PSLTSCALE, CANNOSCALE, LUNITS, AUNITS, DIMSTYLE, TEXTSTYLE) so the user can
say "set units to mm, limits to A3 and the grid on" without memorising
sysvar names. Call with no argument for a full snapshot; a write returns
`applied`, `changed` ({key: [old, new]} — only what moved) and `errors`.
`dim_text_height` / `dim_arrow_size` / `dim_decimals` / `decimal_separator`
/ `zero_suppression` shape the *dimension* — `text_size` is TEXTSIZE, the
height of a standalone TEXT entity, and does not touch dimensions.
Refusals, per key, nothing else rolled back: an unknown key; a value outside
its range (grid/snap spacing > 0, polar_angle 0–360, precision 0–8, …); a
malformed `limits` or `annotation_scale`; `osmode` / `polar` / `polar_angle`
on the headless engine (`capability: registry_sysvar` — AutoCAD keeps them in
the registry, a file cannot, and a headless snapshot reports them as `None`);
`dimstyle` / `textstyle` when the backend has no styles contract. On the
live engine `annotation_scale` must name a scale in the drawing's scale list
(SCALELISTEDIT) and AutoCAD refuses the write on a
paper-space layout with no active viewport; the headless engine adds the
scale, seeding AutoCAD's default list first when the drawing has none,
and refuses it on an R12 file (no OBJECTS section, so the value would
vanish at save — save as R2000 or newer first; limits/grid/ortho survive).
Headlessly, grid/snap are stored on the active VPORT and the annotation
scale in the variable dictionary — the places AutoCAD reads them from.system_run_command tool
Execute an AutoCAD command string directly (COM backend only).
Append \\\\n for Enter. Example: '_LINE 0,0 100,0 \\\\n'.
IMPORTANT: commands that finish at an option menu (e.g. -LINETYPE, -LAYER,
-STYLE return to '[?/Create/Load/Set]:' after their action) need an EXTRA
blank line or '_X\\\\n' to exit, otherwise AutoCAD stays at a prompt and the
next COM call will deadlock. Example: '_-LINETYPE _LOAD CENTER acad.lin\\\\n\\\\n'.
A verb denylist refuses obviously destructive commands, but it is a guardrail
against issuing `ERASE ALL` by accident, NOT a security boundary — AutoCAD
accepts hundreds of commands and any loaded ARX/LISP adds more. Prefer the
typed tools (entity_delete, drawing_save_as, block_insert, drawing_purge):
they validate their arguments, which a free-text command string cannot.
A refused command is error kind `policy_refused` with `verbs` and
`alternatives` ([{tool, summary}], the typed tools for those verbs that the
active profile advertises); an allowed one that a typed tool also does
carries `typed_alternative` in the same shape.
The call waits for the command to finish (CMDACTIVE, `COMMAND_DEADLINE_S`,
default 8 s) and returns `{completed: true, created: [{handle, type, space}]
(first 50), created_count, last_prompt, target_space}`; a new entity
outside the target space (model space unless `layout_set_current` chose a
sheet) adds `warning: "created_outside_target_space"`. A command still at a
prompt is cancelled with ESC x3 and fails with kind `command_incomplete`
carrying AutoCAD's own `last_prompt`.system_run_lisp tool
Execute an AutoLISP expression (COM backend only).
Example: '(vla-get-Area (vlax-ename->vla-object (handent "2A")))'
LISP_POLICY=read (default) reads the expression and runs what passes the
read tier: arithmetic and geometry (angle, distance, polar, inters, trans),
lists and control (car/cdr, cons, list, mapcar, foreach, if, cond, progn,
lambda, setq), strings (strcat, substr, rtos, vl-string-*) and database
reads (entget, entnext, entlast, handent, tblsearch, getvar, dictsearch,
ssget with a literal "_X"/"_W"/"_C"/"_CP" mode, vlax-ename->vla-object,
vla-get-*, vlax-get-property, vlax-curve-get*). Never run, under any tier:
getpoint and the other interactive get*/entsel/ssget forms (they hold
AutoCAD's only COM thread), load/autoload/arxload, startapp, dos_*,
vl-file-*, read, a non-literal eval/apply, vlax-create-object,
vla-SendCommand, vlr-*, defun, c:*, and unreadable or unbalanced text.
Anything else (command, entmod, setvar, vla-put-* ...) goes to the 1.7
symbol denylist unchanged; LISP_POLICY=denylist is 1.7's behaviour. A
guardrail, NOT a security boundary. Prefer the typed tools.
A refused expression is error kind `policy_refused` with policy
`lisp_allowlist` (`lisp_denylist` under LISP_POLICY=denylist), `symbol`,
`line`, `column`, `tier_needed` (`write`, `none`, `unclassified`; `read`
when only LISP_POLICY=denylist refused it),
`reason`, `symbols`, `verbs` (the commands its `(command "...")` forms
name) and `alternatives` ([{tool, summary}], the typed tools for them).system_about tool
Get detailed information about AutoCAD MCP Pro capabilities and available tools.
gear_draw_helical_front_view tool
Deterministic helical gear front view: full involute outline (40 pts/flank),
pitch/base/outer/root circles, helix symbol, optional bore + keyway.
Returns a handle bundle plus 'metadata' for downstream gear_draw_section_aa.gear_draw_spur_front_view tool
Deterministic spur gear front view (no helix symbol).
gear_draw_section_aa tool
Deterministic side cross-section of a gear created by gear_draw_*_front_view.
Includes top/bottom/left/right boundaries, bore lines, keyway notch, ANSI31 hatch.keyway_draw_keyed_bore tool
Bore + DIN 6885 keyway in front view. Auto-sizes keyway from bore if width/depth omitted.
keyway_draw_section tool
Side cross-section view of a keyed bore.
titleblock_apply_iso_a3 tool
ISO 7200 / A3 (420x297 mm) title block. Title text is used verbatim.
Pass `layout` to put the sheet on a paper-space layout, which is where a
title block belongs — the border frames the printed sheet, not the model.
Your current space is restored afterwards, so asking for a border does not
move you onto the sheet.drawing_finalize tool
Premium completion gate: runs BOTH the 8-step validator AND the premium critique focuses
(each named below), then saves to disk, exports a screenshot, and returns the DWG path.
The premium critique focuses
(iso128, layer_color, dim_overlap, untrimmed_corner, duplicate_entities, construction_left,
property_override, dimension_truth, gdt, plus the P&ID focuses pid_dangling_line,
pid_duplicate_tag, pid_incompatible_connection, pid_untagged_instrument, pid_illegal_tag,
pid_unconnected_equipment, pid_line_through_symbol — silent on a sheet with no P&ID symbols,
plus the
mechanical focuses mech_missing_centreline, mech_unhatched_section,
mech_view_misaligned, mech_duplicate_dimension, mech_thread_unrepresented,
mech_bom_balloon_mismatch — silent on a sheet with no mechanical part, plus the
architectural focuses arch_room_unlabelled, arch_wall_gap, arch_opening_clash —
silent on a sheet with no ACADMCP_ARCH record, plus the topology focuses
topo_dangling_endpoint, topo_near_miss, topo_interior_crossing — on network
layers no P&ID or architectural focus reads, silent on every sheet this server draws)
all run before the save.
The validator and the critique share one read of the drawing - every entity of
every space, model and paper, with no cap (one DXF export on the live engine). A
drawing over MAX_QA_ENTITIES (default 2,000,000; 0 disables) is not read in part:
the validator reports `scan_incomplete` and each entity check reports an issue with
detail.code `scan_incomplete`, so the gate fails. A check that raises is an `error`
issue with detail.code `check_failed`, never a clean result.
The payload's `qa_coverage` says what the critique did not check: {complete, records,
spaces, reason, not_checked: [{focus, layout, reason, lane}], domain_absent: [focus]}
(reasons: autocad://critique/focuses) - e.g. a paper layout without a model viewport is
`no_viewport_scale`, the live engine's dimension-legibility lane
`engine_live_document_template`.
Fails (error kind validation_failed / critique_gate_failed / failed_acceptance) if any
validator 'error' finding is present, or if critique reports an 'error' (or, with
strict_critique=True, any critique issue or any not_checked lane but domain_absent,
each a blocking row with code `not_checked`); the error carries what the gate computed -
score, blocking [{code, severity, handles, message}], blocking_count, qa_coverage - and
detail="full" adds every row and the whole report. Critique warnings are surfaced
under payload['critique'] without failing the gate by default. A quarantined document
is refused.
With `requirements` (the drawing_verify_requirements shape) every requirement is
measured on the CAD geometry after the save: the payload adds `geometry_acceptance`
(the full report), `drafting_quality` (the score, unchanged), `artifact_integrity`
(the saved file's sha256 and `reverified`: every requirement measured again on the
saved file, read fresh and re-bound by handle, feature tag, then geometry, with the
before / after comparison; a saved file that cannot be re-read - a .dwg AutoCAD
will not let us copy - fails the acceptance) and `coverage`, and a requirement
that does not pass,
stale evidence or a dimension that disagrees with its geometry raises
`failed_acceptance` - a high drafting score never offsets it. Requirements that do
not parse are refused before anything is saved (invalid_args).drawing_deliver tool
Create a hashed, validated delivery bundle and verify DXF save/reopen parity.
The result status is ``success``, ``failed_validation``, ``failed_export`` or
``failed_acceptance``. Failure intentionally keeps all generated artifacts for
diagnosis.
The open document is never re-pointed or saved: the DXF is a copy (live:
``Document.Export``), and the manifest records the document's id, revision, path
and saved flag, the DXF version, every sha256 and the build. Parity reads the
delivered DXF back and compares it with a fresh serialisation of the document over
every space: zero changed, added or removed entities, the same counts per space,
the same block definitions. Both sides are exports, so parity cannot see content
the export itself loses (`parity.scope` says so); with requirements,
`parity.content_check` is `acceptance`, the check that can.
With ``requirements`` every requirement is measured on the delivered DXF, read
fresh and re-bound from the document; the bundle gains ``acceptance.json`` and
``acceptance.md``, the result ``geometry_acceptance``, ``drafting_quality`` (the
unchanged score), ``artifact_integrity``, ``coverage`` and ``blocking``, and a
requirement that does not pass, stale evidence or a dimension that disagrees
with its geometry makes the status ``failed_acceptance`` whatever the score
(``failed_export`` and ``failed_validation`` are reported first). Refused before
any work: requirements that do not parse (invalid_args).
A ``failed_validation`` / ``failed_acceptance`` result carries ``gate_failure``,
drawing_finalize's gate payload (kind, score, blocking rows with handles,
blocking_count, qa_coverage). Every result and the manifest carry ``qa_coverage``:
the lanes the critique did not check, as drawing_finalize reports them.drawing_preflight tool
Validate and normalize requirements before committing a drawing plan.
Typed requirements go under `requirements.items`: each is checked with its
path (`items[2].target.nominal: must be greater than zero, got -1.0.` comes
back as an INVALID_REQUIREMENT conflict) and its canonical form replaces
the input in `normalized_spec`, so `spec_hash` covers what will be
verified; `requirement_set` carries the canonical set and its digest. A
legacy `dimensions` object is still accepted, kept as given and listed
under `legacy` - it is never measured. Conflicting provenance is kept and
reported (CONFLICTING_PROVENANCE, CONFLICTING_REQUIREMENT), never
collapsed to one value. Typed items are validated once `units` is known
(a MISSING_UNITS question asks for it). Nothing is refused: every problem
is a question or a conflict, and `ready` stays False until none is left.drawing_plan tool
Commit a PlanSpec before any geometry is created.
The PlanSpec is stored on the backend and surfaced for reference during
the workflow (it is not replayed as a critique). Always call this FIRST
in a premium workflow. With typed `requirements.items` the plan carries
`requirement_digest`; `persist_requirements=True` also writes the set into
the drawing (`requirements_persisted: true`) - the server's own XRECORD,
shown nowhere in AutoCAD.
Refused: a `spec_hash` that does not match the latest ready preflight; a
malformed typed item, by its path (`items[2].target.nominal: must be
greater than zero, got -1.0.`); `persist_requirements=True` with neither
typed `items` nor a legacy `dimensions` object ("nothing to read"). A
refusal stores nothing and commits no plan.drawing_critique tool
Run premium-quality checks. Returns zero issues for a clean drawing.
Standard production gate: must return [] before `drawing_finalize`. The default
result is the bare list of issues; `report`, `summary` or `limit` return a dict
instead (a summary is a page, never the clean answer: read `total`).
The entity checks (construction_left, untrimmed_corner, duplicate_entities,
dim_overlap, property_override) read every entity of every space - model and every
paper layout - and compare pairs only within one space. property_override reports
one issue per layer and code (lineweight_not_bylayer - an explicit non-ISO 128 value
is an error; color_not_bylayer; linetype_not_bylayer) on the engineering layers and
the applied layer set, title block and block members exempt, other layers at info;
lineweight -3 is Default, not ByLayer. dimension_truth binds every DIMENSION to its
geometry and reports, per dimension, dim_override_disagrees (NTS: info),
dim_dimlfac_scaled, dim_render_stale (*D block text is not what the style formats;
drawing_refine redraws it), dim_group42_stale, dim_double_prefix, dim_value_hidden
and dim_unbound (info: not checked, never a pass). Refusals and failures are issues, never
silence: a check that raises returns an `error` issue of its focus with
detail.code `check_failed`; a read that could not cover the drawing (more than
MAX_QA_ENTITIES entities, default 2,000,000; or a live export whose per-layout
counts differ from AutoCAD's) returns detail.code `scan_incomplete`. Neither code
is a focus name. A quarantined document is refused.
Coverage: every check writes `checked` or `not_checked` rows; with report=True a
lane that did not run is named with its reason (no_viewport_scale for a paper layout
with no model viewport, engine_live_document_template for the live engine's
dimension-legibility lane, domain_absent for a focus whose domain the drawing lacks).drawing_refine tool
Run a bounded, transaction-safe critique/repair/re-critique loop.
dry_run=True returns the plan with `preview` - the content revision and the
exact fingerprint of every handle a planned repair touches - also when the
score already meets min_score: `threshold_met` then says an apply at that
min_score would stop before repairing. Applied with the preview's
`revision` (expected_revision) and/or `preconditions`, the call is refused
with kind stale_revision and nothing changed when the document moved since;
the result then carries `revision` ({checked, after, interleaved}).point_from_snap tool
Compute a deterministic snap point on an entity. Use this INSTEAD OF
guessing coordinates — eliminates the most common LLM drawing error.point_intersection tool
Compute the intersection of two geometry entities (LINE-LINE, LINE-CIRCLE,
CIRCLE-CIRCLE). When two candidates exist, ref_x/ref_y selects the nearest.
Returns {x, y, on_first, on_second, on_both, candidates}. A LINE is
intersected as the infinite line through it, so the point can lie beyond
a drawn end: `on_first` / `on_second` say whether it lies on each drawn
segment (a CIRCLE always holds its own intersection points) and `on_both`
whether on both - check it before using the point as a corner.
`candidates` is how many intersections existed. Refused, with the case
named: parallel or coincident lines, a line that misses the circle,
concentric circles, circles that do not meet, any other entity pair.point_tangent tool
Compute the tangent point on a circle from an external point.
Returns {x, y}. Raises if the from-point is inside the circle.construction_xline tool
Create an infinite construction line on the CONSTRUCTION layer.
Use as scaffolding; call `construction_clear()` before finalize.construction_clear tool
Delete every entity on the CONSTRUCTION layer. Idempotent.
Must be called before `drawing_finalize` to satisfy `construction_left` critique.drawing_apply_iso_layers tool
Bootstrap a full ISO-conformant layer set with correct colors and lineweights.
Idempotent — existing layers are not modified.
Refused by name: a standard that is not one of mech, pid, iso13567, arch.dimension_auto tool
Dimension a part in one call: LINE runs, LWPOLYLINE edges per side, CIRCLE
diameters, ARC radii, overall size; text outside the part. A rerun skips
what is dimensioned.
Returns {created, skipped_existing, omitted: [{handle, type, reason}],
dim_overlap}; ELLIPSE, SPLINE etc. are omitted, never dropped.
Refused by name: neither or both of handles / selector, an unknown selector
key, style or include kind.entity_select_smart tool
Select entities by semantic predicate instead of memorising handles.
Uncapped. The usual next step is dimension_auto(handles), so
fields=["handle"] is normally all this needs to return.gd_frame tool
Draw an ISO 1101 feature control frame from LINE + TEXT primitives.
Renders identically on COM and ezdxf. Referenced datums are recorded so the
`gdt` critique focus flags any datum with no matching datum feature.datum_feature tool
Place a datum feature symbol (filled triangle + boxed letter).
Establishes the datum so a feature control frame referencing this letter
passes the `gdt` critique focus.layout_list tool
List all layout tabs (Model + paper-space layouts) and the current one.
layout_create tool
Create a new paper-space layout tab.
layout_set_current tool
Activate a layout tab and make it where new geometry goes.
Every document starts in model space (drawing_new, drawing_open and
document_activate reset it); only this tool moves the target. On a live
AutoCAD a tab the operator clicks afterwards does not move it - drawing on
a sheet takes this call, as headlessly. An entity created outside model
space reports `space` in its properties.viewport_create tool
Place a scaled model-space viewport on a paper-space layout.
The viewport window shows the model region centered at
(view_center_x, view_center_y); view height = height / scale.layout_delete tool
Delete a paper-space layout and every entity on it.
Refuses model space, a blank name, and the last remaining sheet. If the
deleted tab was the current one, the returned `current` is where geometry
goes next — and handles from the deleted sheet stop resolving.layout_rename tool
Rename a paper-space layout. Entity handles are unaffected.
layout_copy tool
Copy a paper-space layout: page setup, plot settings and all geometry.
`skipped` names any DXF types that could not be cloned — check it rather
than trusting `ok` alone. Associative hatch boundaries are re-pointed at the
cloned entities; `associativity_dropped` counts those that referenced
something outside the source layout and had to be cleared.viewport_list tool
List paper-space viewports: handle, geometry, scale and lock state.
The layout's own main viewport is included with `is_main: true` — it is the
tab's pan/zoom state rather than a drafting viewport, and it is what remains
after every drafting viewport is deleted. `scale` and `locked` are null on
documents that cannot store them (R12) rather than fabricated.viewport_set_scale tool
Rescale a viewport by adjusting its view height.
Geometric scale only: annotative text and dimensions do not resize with it.
Refuses the layout's main viewport, whose view height is the tab's own
pan/zoom state rather than a drafting scale.viewport_lock tool
Lock or unlock a viewport's display scale.
viewport_delete tool
Delete a viewport.
The layout's main viewport needs `force=true`; deleting it removes the tab's
own view state, and the layout's current-viewport pointer is repaired so the
file does not carry a dangling reference that only CAD would notice.solid_box tool
Create a native 3D solid box (COM backend, opt-in).
solid_cylinder tool
Create a native 3D solid cylinder (COM backend, opt-in).
solid_extrude tool
Extrude a closed profile into a native 3D solid (COM backend, opt-in).
solid_revolve tool
Revolve a closed profile around an axis into a native 3D solid (COM, opt-in).
solid_boolean tool
Boolean-combine two native 3D solids (COM backend, opt-in).
The tool solid is consumed; the target holds the result.pid_symbol_list tool
The symbols `pid_symbol_insert` can place, with their ports and variant options.
Authored from ISO 10628-2 (equipment, valves) and ISA-5.1 (instrumentation);
each row's `source` names the figure. Symbol-local sizes are millimetres at
A3/A1 paper scale (bubble Ø10, valve 8×4); `scale` at insertion rescales.pid_symbol_insert tool
Insert a catalogue symbol as a real block with TAG attributes and named ports.
Defines the block on first use (`defined`), creates a missing family layer
from the P&ID layer set (`layers_created`), writes an ACADMCP_PID payload
so readers without the catalogue still see the ports, and returns every
port in WCS — connect them with `pid_line_draw`. An invalid ISA-5.1 tag is
written and reported in `tag_warnings`; `drawing_critique` flags it.pid_line_draw tool
Connect two ports with one LWPOLYLINE on the class's layer.
Ports come from `pid_symbol_insert`; a bubble's radial port is entered
without a name. `auto` picks the shortest orthogonal route that leaves each
port straight for `stub` mm; when none exists the call refuses and says so
— pass waypoints. `crossings` counts existing P&ID lines the new one cuts
(reported, never refused) and `port_reuse` names ports that already had a
line (branching is legal). Signal classes get ISA-5.1 markers (`//`, `X`,
`L`, `o`) as small blocks on segments >= 15 mm; electric is dashed by layer.
A signal line carries no pipe line number: it gets no auto-built number
and no label, and does not consume the process sequence — a verbatim
`line_number` is still written and labelled. With waypoints, a bubble's
exit leaves towards the first waypoint (and the entry arrives from the
last one); `crossings` follows existing arcs, not their chords.
`avoid` keeps `clearance` from every other symbol and `keep_out` box;
none possible: kind no_route naming the tags (or `on_blocked="cross"`).
Every route reports `obstacle_hits` and `label_hits` [{handle, tag}].pid_graph tool
Connectivity of the drawing as it *is*, not as it was drawn.
Nodes: symbol INSERTs classified by catalogue name (confidence 1.0),
ACADMCP_PID payload (0.95), tag attributes / block-name keywords (0.6) or
a line touching an unknown INSERT (0.3); every node reports its `source`.
Ports come from the INSERT's real rotation, scale and mirror, measured
(a stretched bubble drops the node to 0.6 with a note). Edges: lines and
polylines; each end resolves to a port, a junction on another line, or
`dangling` with the nearest port as a hint — always within its own
space, so `scope="all"` never joins two sheets. `stats.confidence_min`
is the number to read before trusting a foreign drawing.
Returns nodes, edges, junctions, dangling, unclassified, offpage_links,
stats, tolerance, scope and backend:
- node: id, kind, block_name, family, symbol, tag, tag_parsed, tag_source,
x, y, rotation_deg, scale, y_scale, mirrored, layer, space, description
(its DESC attribute), source, confidence, notes, and ports
{name, x, y, direction_deg, kind, radius, inferred, edges};
- edge: id, line_class, class_source, line_number, number_source, size,
service, spec, insulation, from, to, length (plus length_approximate
when the engine measured none), layer, space, source; vertices and
bulges with include_geometry;
- junction: id, x, y, edges, space; dangling: edge, end, x, y, nearest.pid_instrument_index tool
Every instrument bubble with its ISA-5.1 reading and what it connects to.
Rows come from `pid_graph`, never from typed-in lists; the drawing is not
modified. `csv_path` is the only file this tool writes (so it is not
annotated read-only); it is validated before the drawing is read, and an
empty path, a directory or a missing parent folder is refused.
`signal_lines` counts ISA-5.1 signal lines only; `connected_to` names a
tag, a handle, or the lines a junction on the instrument's line joins.pid_line_list tool
Every P&ID line with its number, class, size/service/spec/insulation and endpoints.
Rows come from `pid_graph`; untagged lines sort last with `line_number: null`.
An end names a node's tag (its handle when untagged) and port, or — at a
junction — the line numbers (or handles) of the lines it joins.
The drawing is not modified; `csv_path` is the only file this tool writes,
validated before the drawing is read.pid_equipment_list tool
Every equipment, valve and connector node with its ports and how many lines reach them.
Rows come from `pid_graph`; the drawing is not modified and `csv_path` is
the only file this tool writes, validated before the drawing is read.pid_from_spec tool
Equipment, valves, instruments and connectors placed, then every line
drawn port-to-port, inside one transaction: any bad item rolls the whole
sheet back and the error names it (`lines[2].to`); so does an interruption
(a client cancellation mid-run leaves no half-drawn sheet and no open
transaction on either engine — the live one goes back to the UNDO Mark
`transaction_begin` set, so it never waits at an AutoCAD prompt; should
that rollback itself fail, the failure is logged, the cancellation is what
the client sees, and the drawing must be checked before a retry).
A non-finite coordinate, rotation, scale or stub is refused
by path before anything is placed. The response carries the graph read
back from the drawing and the P&ID critique issues, so the caller sees
dangling ends or duplicate tags in the same round trip.
`dry_run` returns
the planned vertices and crossings without touching the drawing; crossings
are counted, on both runs, against the spec's own lines and the P&ID lines
already on the current layout (`crossings_scope`). The dry run also returns
the routing `region` and a `preview` whose precondition is the fingerprint
of every entity in that region. Applied with the preview's `revision`
(expected_revision) and/or `preconditions`, the run is refused with kind
stale_revision and nothing drawn when anything in the region (or the
revision) changed; a region precondition taken from another spec is
refused by path. A guarded run reports `revision` ({checked, after,
interleaved}).
`sheet.routing`: `auto` (default) or `avoid` (lines go round symbols;
no_route by path). Both runs report `obstacle_hits`.pid_tag_parse tool
ISA-5.1-2009 Table 4.1 as a grammar: first letter, modifier, readout and
output functions, trailing high/low, loop number and suffix — with the
standard's description ("Flow Indicating Controller") or the first
offending letter. Equipment prefixes are not standardised, so the default
map (P pump, V vessel, E exchanger, ...) can be replaced per call.pid_project tool
Read every sheet of a P&ID project with the pid_graph reader; nothing is modified.
check: `links` per LINK id (matched / orphan / direction_mismatch /
duplicate, each connector with sheet + handle), cross-sheet
`duplicate_tags` (connectors never count), `line_continuity` of every
matched pair. index: instrument index, line list and equipment list
with a `sheet` column. Refused by name: over 50 sheets, a missing file,
a .dwg headless (`dwg`), .xlsx without openpyxl (`xlsx_write`).dimstyle_list tool
Every DIMSTYLE table entry with the seventeen preset variables
(DIMTXT, DIMASZ, DIMEXE, DIMEXO, DIMGAP, DIMTAD, DIMTIH, DIMTOH, DIMDEC,
DIMDSEP, DIMLUNIT, DIMZIN, DIMBLK, DIMTXSTY, DIMLWD, DIMLWE, DIMSCALE).
Headless, `values` is what the DXF stores (the schema default where an
entry omits a code). On the live engine ActiveX has no per-style getters,
so `values` is read for the *current* style only and the other rows carry
`values: null`, `values_available: false` — `dimstyle_set_current` a
style to read it. Never refuses on an open drawing.dimstyle_create tool
Create a dimension style: preset values first, then `overrides`.
Refuses, before anything is written: an unknown preset; an override key
outside the 33-variable whitelist (the 17 preset variables plus DIMTOL,
DIMTP, DIMTM, DIMTOLJ, DIMTFAC, DIMLFAC, DIMRND, DIMATFIT, DIMTMOVE,
DIMCLRD/E/T, DIMSAH, DIMBLK1/2, DIMCEN); a value outside its range
(DIMDEC 0-8, sizes > 0, DIMTAD 0-4, DIMDSEP one character, lineweights an
AutoCAD code); a name that already exists (use `dimstyle_modify`); a
user DIMBLK/DIMBLK1/DIMBLK2 naming a block the drawing does not define
(built-in arrowheads need none); a DIMTXSTY that is neither an existing
text style nor a bundled preset (ISOCP, ISOCPEUR, ARIAL, ROMANS — those
are created on both engines, `textstyle_created`; live, a preset whose
font file the seat lacks is refused the same way, nothing written). On
the live engine a write ActiveX still refuses after the style is added
is rolled back — previous style current, the half-made entry deleted.
With `set_current` the next dimension carries the style on both engines.dimstyle_modify tool
Change variables on an existing dimension style.
`changed` names only the variables that actually moved — re-setting a
value to itself is not a change. `dimensions_using_style` lists the
dimensions already drawn with it, and since 1.8.0 they are redrawn
(`rerendered`; live: Update() on each, confirmed by reading the *D text
back - one that did not change is in `stale`). A text its author placed
keeps its position (`text_kept`) unless `force`. `rerender_required: true`
means a dimension still shows the old style: `rerender=False`, or a live
redraw the read-back did not confirm. Refuses a missing style, an empty `overrides`, a key
outside the whitelist, a value outside its range, a DIMTXSTY that does
not exist, a user arrowhead block the drawing does not define — all
before any write. On the live engine, editing a non-current style makes
it current for the duration of the call and the previous style is
restored — also when a write fails midway (its unsaved overrides are
discarded, which is AutoCAD's own DIMSTYLE rule).dimstyle_set_current tool
Set `$DIMSTYLE` and load the style's variables as the current DIM*
settings — what a live seat's DIMSTYLE Restore does — so `dimension_*`
and `dimension_auto` draw with it on both engines. Per-dimension
tolerances, fits and text overrides still apply on top. Refuses a style
the drawing does not hold. Returns `previous` and `changed`.textstyle_list tool
Every STYLE table entry and the one new TEXT/MTEXT will use.
textstyle_create tool
Create a text style.
Headlessly a font nobody can find is *written* and reported
`font_resolved: false` (AutoCAD substitutes at open; the headless
renderer falls back), because a DXF stores only the name. The live
engine cannot do that: ActiveX refuses a font AutoCAD cannot open, so a
file that is neither on its support path nor in the Windows Fonts folder
is refused there before any write (the message names the folders and the
presets); a TrueType font is written by its typeface (`SetFont`, what the
STYLE dialog does — the record carries `arial.ttf`, never a machine
path), an SHX by the file name. Refuses, before any write on both
engines: a name that exists, an empty font, `width_factor <= 0`,
`height < 0`, an oblique angle outside ±85°.textstyle_set_current tool
Set `$TEXTSTYLE`; `entity_create_text` / `entity_create_mtext` then
carry the style on both engines. Refuses a style the drawing does not
hold. Returns `previous` and `changed`.mleaderstyle_list tool
Every MLEADERSTYLE with its four values on both engines
(`values_available: true`). Headless they are read from the MLEADERSTYLE
object; live from the `AcadMLeaderStyle` objects the `ACAD_MLEADERSTYLE`
dictionary holds (ActiveX exposes no *collection* property for them, but
the dictionary items are full objects). `leader_create_mleader` can still
override any of them per leader.mleaderstyle_create tool
Create a multileader style: preset values first, then `overrides`.
Headless it lands on `doc.mleader_styles`; live it is added through the
`ACAD_MLEADERSTYLE` dictionary (`AddObject(name, "AcDbMLeaderStyle")`)
and the object's properties are written. Refuses, before any write: an
unknown preset; an override key outside the four; `arrow_size` /
`text_height <= 0`, `landing_gap < 0`; a name that exists; a `text_style`
that is neither present nor a bundled preset (ISOCP, ISOCPEUR, ARIAL,
ROMANS — those are created on both engines, `textstyle_created`; live, a
preset whose font file the seat lacks is refused, nothing written).drawing_apply_standard tool
One call for the common case: the standard's dimension style (created
if missing, then current), its text style (created if missing, then
current), the shared units, and with `layers` the `mech` layer set (ANSI
layer naming is company-specific, so both standards share it).
Every item reports `created` or already present; `settings.changed`
names only the variables that moved, so a second call reports nothing.
An existing ISO-25 / ANSI style is reused as it is, not reset — use
`dimstyle_modify` to change one. Refuses an unknown standard, or a units
variable it cannot read back, before any write; the underlying style
refusals (`dimstyle_create`, `textstyle_create`) apply unchanged. In the
`lean` profile (Task 13).page_setup_list tool
The page setup stored on each paper-space layout.
`paper` is the catalogue name (ISO_A3, ANSI_B, …) when the stored size
matches one within 0.5 mm, otherwise the media name as stored; `size_mm`,
`orientation`, `plot_style` (ctb), `scale` ("fit", "1:50", or a custom
ratio), `plot_area`, `device`, `margins_mm` [top, bottom, left, right] and
`center` are read back from the LAYOUT object (headless) or the AutoCAD
Layout (live). Refuses an unknown layout name and `Model` (model space has
no sheet; plot it with `drawing_export_pdf(layout=None)`).page_setup_apply tool
AutoCAD's PAGESETUP as one call, on both engines.
Paper sizes are ISO 216 / ANSI Y14.1; the media is written in AutoCAD's own
spelling (`ISO_A3_(420.00_x_297.00_MM)`). `changed` lists only the values
that moved — re-applying the same setup reports `{}`. An unknown ctb is
written and reported `plot_style_known: false` (a missing ctb only matters
at plot time). Viewports on the sheet are never touched.
Full-bleed and expanded media (issue #18): `paper` also takes any
canonical media name the device offers, e.g.
`ISO_full_bleed_A3_(420.00_x_297.00_MM)` or
`ISO_expand_A4_(210.00_x_297.00_MM)`; it is written unchanged, its numbers
are the sheet size, and they fix the orientation (reported in `applied`).
Or keep a catalogue paper and pass `bleed="full_bleed"` / `"expand"`,
which builds `ISO_full_bleed_A3_(…)` / `ISO_expand_A3_(…)`. The ISO
full-bleed and expand names were listed by `DWG To PDF.pc3` and
`AutoCAD PDF (High Quality Print).pc3` on AutoCAD 2026 (measured
2026-11-05); the ANSI ones (`ANSI_full_bleed_B_(…)`) follow the same
pattern unmeasured. The headless engine has no device and writes the name
as given; the live engine checks it against the device's
`GetCanonicalMediaNames()`.
Refused before anything is written: an unknown paper, orientation, scale,
plot_area or bleed, an orientation that contradicts a canonical media
name, `bleed` beside a canonical media name ("paper already names the
media"), an empty device or plot_style, margins that leave no printable
area, `Model`, an unknown layout. On the live engine `margins_mm` is
refused (the .pc3 owns them) and a media the device does not offer is
refused with the device's names for the same paper and its three closest
names.
The proof is the PDF: `batch_plot` reads each sheet's `/MediaBox` back.plot_style_list tool
The ctb files AutoCAD ships (`monochrome.ctb`, `acad.ctb`, `Grayscale.ctb`,
the Screening set, …) and, on the live engine, the files actually present
in `Preferences.Files.PrinterStyleSheetPath` (`source: "installed"`,
`installed: true/false` per row). Headlessly `installed` is `null`: there
is no installation to scan, and the catalogue is not evidence of one.
Never refuses; an unreadable Preferences object degrades to the catalogue.batch_plot tool
AutoCAD's PUBLISH for a PDF set, through `drawing_export_pdf(layout=…)`.
One row per sheet: `path`, `bytes`, and `mediabox_mm` **parsed from the
PDF that was written** (`/MediaBox`, points → mm), with `paper` naming the
catalogue size it matches within 0.5 mm — so the sheet size is verified,
never assumed. Model space is included only when named.
Refused before any file is written: a format other than pdf, an empty
`layouts` list, a layout that does not exist, a `file_pattern` containing a
path separator or lacking `{layout}` when more than one sheet is plotted,
and any output path outside the allowed directories. A sheet whose PDF has
no readable MediaBox is reported with `mediabox_mm: null` and an `error`.drawing_template_list tool
The templates `drawing_new(template=<name>)` can start from.
Each row: `standard` (ISO/ANSI), `sheet`, `paper`, `layout` (the sheet tab's
name), `layer_set` (mech / pid / iso13567), `dimstyle` / `textstyle`
(ISO-25 / ISOCP or ANSI / ROMANS), `scale`, `title_block` (the ISO 5457 A3
frame, A3 sheets only), the `settings` applied, and `files.dxf` /
`files.dwt` with `present` flags — the `.dwt` twins exist only once built
on a live AutoCAD (`scripts/smoke_settings_com.py --build-dwt`). Never
refuses; it reads a catalogue.drawing_template_save tool
AutoCAD's SAVEAS → Drawing Template, on both engines.
Live AutoCAD writes a real `.dwt` (`SaveAs(path, ac2018_Template)`) and
puts `description` into the template's summary Comments; the active
document is rebound to the new file, as SAVEAS does. Headlessly a `.dxf`
template is written — `drawing_new(template=<path>)` opens it — and a
`.dwt` request is refused with capability `dwt_write` (the message names
the DXF route and the COM route); a description is reported
`description_written: false` because DXF has nowhere to keep it. Any other
suffix, and any path outside the allowed directories, is refused before
a byte is written.
Pack: core · lean: no (`drawing_save_as` is not lean either).document_list tool
Every open document with `name`, `path`, `active`, `saved` and
`entity_count`. Each row also carries the document's `document_id` and
content `revision` (None, live, for a document this session never bound).
Headless, the server keeps its own registry: `drawing_new` / `drawing_open`
add an entry (`untitled-N` or the file path) instead of replacing the only
one, and `document_activate` chooses which one every later tool targets.
Live, this is AutoCAD's `Documents` collection. No refusals: an empty
backend answers with an empty list. Pack: settings · lean: no.document_activate tool
Make one open document the active one; reports `previous`.
Matches the full path first, then the file name; an ambiguous name is
refused with the candidates, an unknown one with the list of open
documents. Headless, a document quarantined after an abandoned call cannot
be switched away from — `drawing_new`, `drawing_open` or closing it are
the ways out. Pack: settings · lean: no.document_close tool
Close a document and report `saved`, `discarded_changes` and the new `active`.
Refusals, all before anything is closed: unsaved changes with neither
`save` nor `discard`; `save` on a document that has never been saved (no
path to write — live, `Close(True)` would open AutoCAD's Save dialog and
block the COM thread); `save` together with `discard`. Closing the last
document leaves the backend with none open, which every tool already
reports. `drawing_close` is the same operation for the active document
with its 1.4 contract kept. Pack: settings · lean: no.layer_state_save tool
Snapshot every layer's on/frozen/locked/color/linetype/lineweight/plot
flags plus the current layer as a named state stored in the drawing.
These are the server's own portable layer states: JSON chunks in an XRECORD
under the `ACADMCP_LAYERSTATES` dictionary. They live in the file and
travel with it, work on both engines, and do **not** appear in AutoCAD's
Layer States Manager (LAYERSTATE). Same name replaces (`replaced: true`).
Refusals: an empty or control-character name, a non-string description.
Pack: settings · lean: no.layer_state_restore tool
Apply a saved state to the layers that still exist.
`missing_layers` (in the state, not in the drawing) are skipped, never
created; `new_layers` (in the drawing, not in the state) are untouched;
`applied` says how many layers and which properties moved. Refusals: an
unknown state name (lists the saved ones), a property outside the eight
(names the index). Live, a layer AutoCAD refuses to change (freezing the
active layer, making a frozen layer current) lands in `warnings` instead
of failing the call; the state's current layer is thawed before it is
made current when `frozen` is being restored, so save → freeze → restore
round-trips. Portable server states, not Layer States Manager entries.
Pack: settings · lean: no.layer_state_list tool
Every state under `ACADMCP_LAYERSTATES` with its description and layer
count. These are the server's portable states, not AutoCAD Layer States
Manager entries. No refusals. Pack: settings · lean: no.layer_state_delete tool
Remove the named state's XRECORD. Layers themselves are untouched.
Refusal: an unknown name (lists the saved ones). Pack: settings · lean: no.view_named_save tool
Store a VIEW table entry (AutoCAD's VIEW command). Same name replaces
(`replaced: true`). Refusals: `height`/`width` ≤ 0 or non-finite, a
malformed `center`, and headless an empty drawing with no `center`/`height`
(there are no extents to default to). Pack: settings · lean: no.view_named_restore tool
Live: zooms the active viewport to the saved window the way `-VIEW _R`
does — VIEWCTR becomes the saved centre and VIEWSIZE the saved height
(or width / display aspect when the window is wider than the display);
`applied: "zoom_window"` plus the read-back `viewctr` / `viewsize`.
Headless there is no display: the saved window is fitted into the
`*Active` VPORT — the view AutoCAD opens the file on — whose aspect ratio
is left as the file carries it (AutoCAD reconciles a changed aspect by the
viewport's lower-left corner, which shifts the centre); the result says
`applied: "header_only"` with the written `vport_height` and the kept
`aspect_ratio`, the same reported-no-op rule as `view_zoom_extents`.
Refusal: an unknown name (lists the saved views). Pack: settings · lean:
no.view_named_list tool
Every VIEW table entry with centre, height and width. No refusals.
Pack: settings · lean: no.ucs_list tool
The `world` row first, then every UCS table entry with origin and unit
axes, `current` on the active one. `world` is current only when the frame
IS the WCS (WORLDUCS live, the `$UCS*` header headless) — an unnamed UCS
(`UCS Origin` / `3P` without saving) has an empty name too and is
reported as a trailing row with `name: null` and its origin/axes, so
`current` is `null` then and never `world`. Tool coordinates stay WCS on
both engines whatever is current. No refusals. Pack: settings · lean: no.ucs_set tool
Store a UCS table entry and make it current (AutoCAD's UCS command).
Axes are normalised to unit vectors. **Every tool keeps taking and
returning WCS coordinates** — the repository rule; a UCS is for the
operator's own drafting, and no tool starts interpreting inputs in it.
Refusals, before any write: a name of `world` (reserved), a zero-length
axis, and non-perpendicular axes — the message carries the measured angle
(tolerance 0.001°). Pack: settings · lean: no.ucs_restore tool
Live: `ActiveUCS` for a named entry; `world` runs `UCS World`, which is
refused while AutoCAD has an active command (CMDACTIVE — press ESC).
Headless: the `$UCSNAME/$UCSORG/$UCSXDIR/$UCSYDIR` header variables.
Refusal: an unknown name (lists the saved ones). Tool coordinates stay
WCS. Pack: settings · lean: no.system_launch tool
Connect to the application named by `CAD_PROGID` (attach if running,
launch otherwise) and report `launched`, `attached`, `version` and the
active `document`. Refusals: headless, `capability: "live_application"`
(there is no application to launch); with `CAD_LAUNCH=never` and nothing
running, `cad_not_running` (attach only, nothing started); an `open_path`
that fails path validation. Pack: settings · lean: no.system_preferences_get tool
The whitelisted `Preferences.*` values, enum values as names
(`SaveAsType: "ac2018_dwg"`), with `read_only` naming the four `Files.*`
paths. Refusals: headless, `capability: "preferences"` (they live in the
running application, not in a file); a key outside the whitelist.
Pack: settings · lean: no.system_preferences_set tool
Write one preference and report `old`, `new` and `changed`.
Refusals, all before any write: a read-only key (`Files.*`), an unknown
key, a value of the wrong type, an int outside the authored range
(`AutoSaveInterval` 0–600 min, `CursorSize` 1–100, `PickBoxSize` 0–50, …),
an unknown `SaveAsType` name; headless, `capability: "preferences"`.
Pack: settings · lean: no.user_pick_point tool
`Utility.GetPoint`: returns the WCS `x`, `y` (`z`) the operator clicks.
ESC is an answer, not an error: `cancelled: true` with AutoCAD's reason.
Waiting longer than `COM_CALL_TIMEOUT` returns `timed_out: true` (the
prompt is abandoned on AutoCAD's side; press ESC there). Refusals: an
empty prompt; headless, `capability: "interactive_prompt"` (no operator).
Pack: settings · lean: no.user_select tool
Returns `handles` the operator picked — one with `mode="single"` (plus
the `picked` point `[x, y]` in **WCS** — AutoCAD reports it in the current
UCS and the tool translates, so a UCS made current by `ucs_set` never
shifts it), any number with `mode="multiple"` (Enter with nothing
selected is `count: 0`, not a cancel). ESC → `cancelled: true`; a wait
longer than `COM_CALL_TIMEOUT` → `timed_out: true`. Refusals: a mode
outside the two, an empty prompt; headless, `capability:
"interactive_prompt"`. Pack: settings · lean: no.system_prompt_message tool
`Utility.Prompt`: tell the operator something where they are looking.
Nothing in the drawing changes. Refusals: an empty message; headless,
`capability: "interactive_prompt"`. Pack: settings · lean: no.system_variable_describe tool
What an AutoCAD system variable means, from an authored catalogue of 90.
With `name`: `{known, name, type, range|enum, default, meaning, saved_in
(drawing|registry|not_saved), engines: {ezdxf, com}, friendly_key,
read_only}` plus `current` when the active backend can read it (omitted,
with `current_unavailable`, when it cannot — no document open, or a
registry variable headlessly). An unknown name is never an error: `known:
false` and the nearest catalogue names come back. With `search`: every row
whose name or meaning contains all the words. With neither: the index of
names. `friendly_key` names the `drawing_settings` key that wraps the
variable, which is the preferred way to set it; `engines.ezdxf: false`
means the headless engine refuses a write (registry-saved, or no header
slot in ezdxf).drawing_properties_get tool
The DWGPROPS dialog as data: `summary` (title, subject, author, keywords,
comments), `summary_available`, and `custom` ({key: value}).
On the live engine the summary comes from the document's SummaryInfo. The
headless engine cannot read that stream, so the five summary fields are
`null` with `summary_available: false` — not empty strings, which would
claim the drawing has no title. Custom properties (`$CUSTOMPROPERTYTAG` /
`$CUSTOMPROPERTY` header pairs) are read on both engines.drawing_properties_set tool
Write DWGPROPS fields. Only the arguments given are touched; returns
`summary_written`, `custom_written` and `custom_deleted` (a key that was
never there is not reported deleted).
Refusals, before anything is written: a summary field on the headless
engine (`capability: dwgprops` — SummaryInfo lives in the DWG, a DXF has
no slot for it; custom properties still work headlessly), a non-string
value (`TypeError` naming the field or key — nothing is coerced with
`str()`), an empty custom key, a custom key to *write* that AutoCAD's
AddCustomInfo would reject mid-write (measured on AutoCAD 2026: leading or
trailing whitespace, or any of the thirteen characters
`" * , / : ; < = > ? \\\\ ` |` anywhere in the key; internal spaces, tabs
and unicode are fine — `ValueError` naming the key, on both engines; a
delete is exempt because RemoveCustomByKey never validates syntax, so a
key that reached the drawing another way stays removable), two keys in
one request that AutoCAD would call the same key (its key compare is a
simple per-character case compare: `Project`/`PROJECT` and `Grün`/`GRÜN`
are one key, `Straße`/`STRASSE` are two), a line break in a custom key or
value (it corrupts the DXF on save), and headlessly a document older than
R2004 (`ValueError` — ezdxf only writes the custom-property header pairs
for AC1018+, so they would vanish at save; save as R2004 or newer first).
A key is matched to the drawing by that same rule on both engines and
keeps its stored spelling when updated. On the live engine an exact
spelling is changed with SetCustomByKey; otherwise AutoCAD decides —
AddCustomInfo, and on its 'Duplicate key' SetCustomByKey; a delete is
RemoveCustomByKey, and its 'Key not found' is reported as not deleted.mech_part_draw tool
One part model - a turned profile or a plate outline plus typed features - drawn as views.
The model is written onto the drawing as `ACADMCP_MECH` XDATA on an anchor
POINT, so `mech_view_add` can add a section months later without the caller
re-describing the part, and `mech_part_inspect` reads it back.
Refused **before anything is drawn**, by path: a non-finite or non-positive
number (`segments[2].d_outer`), a bore that is not smaller than its outside,
an outline with fewer than three distinct vertices or one that crosses
itself, an unknown material, a feature whose placement is off the part, two
features that would remove the same material (both names given), a thread
outside the transcribed ISO 261 table, a keyway outside DIN 6885's bore
range, gear teeth whose tip diameter disagrees with their segment. A DIN 509
undercut, a DIN 471/472 groove, a DIN 332 centre hole and an ISO 3601-2
O-ring groove need explicit dimensions in this build: those tables are not
transcribed and the lookup refuses by name rather than interpolate. A
feature that cannot be projected into a requested view is listed in
`omitted`, never dropped.mech_view_add tool
Another view of a part already on the drawing, laid out on its projection axis.
The part model comes back out of the drawing's `ACADMCP_MECH` XDATA, so the
caller never re-describes it, and the placement follows the projection angle
recorded when the part was drawn (first angle by default: the view from the
right goes to the left).
Refused by name: a section without a plane, or with a plane of zero length,
a plane that misses the part, or one that grazes an outline vertex so its
crossings cannot be paired; a half or offset section on the wrong kind of
plane (the message names the style that does apply); a detail without a
radius or with a scale of zero; an unknown part_id, and `part_id=None` on a
drawing that holds more than one part.mech_dimension_part tool
Every dimension the part and its features ask for, laid out without overlaps.
Axial lengths are chained, stacked from a baseline or measured from an
origin; diameters stack outside the silhouette; fillets get a radius. Each
measurement appears once (ISO 129-1): every view record carries a
`dimensioned` flag, so after a `mech_part_draw` that dimensioned the front
view and a `mech_view_add`, this call dimensions only the new view, and
`views` naming a view already dimensioned is refused by name. `fits` resolves an ISO 286 code
against the measured nominal through the repository's authored tables and
appends the code to the dimension text; an explicit `tol` on a feature's own
intent does the same through the ISO 129 path.
Refused by name: a fit together with an explicit tolerance, a fit outside
the authored ISO 286 range (over 1 mm to 500 mm, IT4-IT11), a fit on an
intent with no measurable nominal, an unknown style, an unknown part_id, a
call when every view is already dimensioned (the message lists them), and
`part_id=None` on a drawing that holds more than one part. An angular intent
is reported in `skipped` rather than drawn, because a DimIntent carries no
vertex.mech_hole_pattern tool
A hole pattern on any drawing - the part model is not required.
The same expansion `HolePattern` performs inside a part, exposed for a
drawing that was not built from the model.
Refused before anything is drawn: an unknown pattern, a count below 1 (below
2 for polar), a linear pattern with no spacing, a grid with more than one
column or row and no pitch for it, a polar pattern with no pitch-circle
diameter, and a non-finite or non-positive diameter.mech_part_from_spec tool
Several parts, their views and their dimensions, drawn inside one transaction.
Every part is validated before the transaction opens, so a refusal leaves
the drawing untouched and names the offending path (`parts[1]:
segments[0].d_outer: ...`). If a draw fails or the request is cancelled
part-way, the transaction is rolled back under an anyio shield, so a
cancelled call cannot leave half a sheet inside an open transaction.
Refused by name: an empty `parts` list, any part refusal from
`mech_part_draw`, and a transaction that cannot be opened.mech_part_inspect tool
The `ACADMCP_MECH` payload a drawn part carries, decoded.
Never modifies the drawing. Returns the part model exactly as
`mech_part_draw` accepts it (`part`), the views drawn so far with their
placements, and the payload version. `drift=True` adds `drift` (each
tagged entity that no longer matches the model: feature, view, expected,
measured, status) and `model_is_current`; `history=True` / `param` add
the revisions `mech_part_revise` stored in the drawing.
Refused by name: an unknown part_id, a handle that carries no
`ACADMCP_MECH` payload, a corrupt or foreign payload, and `part_id=None` on
a drawing that holds no part or more than one (the message lists the
handles).mech_part_revise tool
Edit a drawn part's model by path and rebuild its views in place, in one transaction.
LINE/CIRCLE/ARC keep their handles; other changed entities are redrawn
(`handle_map`); dimensions are redrawn, so their handles change. Each
revision joins the part's model history.
Refused, nothing written: a bad path or a value the part refuses
(invalid_args); a tagged entity edited by hand (hand_edited_tagged_entity)
or a part drawn before 1.8.0 (model_drift) unless overwrite=True; a moved
preview (stale_revision); a detail view or a repeated view tag.std_part_list tool
Catalogue rows with the dimensions a drawing needs, and their provenance.
Every row is transcribed from the named standard's own table and carries
its `source`. Coverage is deliberately narrow: ISO 261 first-choice sizes
only (M5-M36, M3-M24 for ISO 4762) and ISO 15 bore numbers 00-10 in the
600x / 620x / 630x series. A size outside a table is refused by name by
`std_part_insert` with the nearest entries, never interpolated and never
substituted. An unknown `standard` is refused with the list of catalogue
standards.
`coverage` is the standards coverage manifest (also the resource
`autocad://standards/coverage`): one record per registered table - the
fastener and bearing tables above, ISO 261 and the feature tables
`std_feature_draw` reads - with edition, table locator, implemented sizes,
range and source. DIN 509, DIN 471/472, DIN 332-1 and ISO 3601-2 report
"no rows transcribed"; transcriber and reviewer are null because the
repository records none.std_part_insert tool
Define the part's block once, insert it, and write its `std_part` XDATA.
The block carries DESIG / STD / SIZE / MAT attributes and an ACADMCP_MECH
payload, so a parts list is a read of the drawing rather than a naming
convention. Refusals, all before any write: a designation outside the
transcribed tables (named, with the nearest catalogue entries - nothing is
drawn approximately), a malformed designation, a missing or stray nominal
length, a view the family does not have, an attribute tag the block does
not carry, and a non-finite coordinate or rotation.std_feature_draw tool
Add a standard feature to geometry that already exists - a foreign drawing being finished.
Local frame: `(x, y)` is on the axis, +X runs along the axis in the
direction the feature extends and +Y is radially outward. The thread is the
ISO 6410 representation (minor diameter at 0.8 x major, thread-length limit
to the major) and its pitch comes from ISO 261 via `size` or from an
explicit `pitch` - it is never guessed. Every other kind takes its
dimensions from the registered standards table and is refused by name when
that table is absent, when the size is outside its coverage, or when the row
lacks a dimension the feature needs: no value is interpolated and no profile
is reconstructed. DIN 332 form R is refused - only forms A and B are drawn.surface_texture tool
Draw the 60° surface-texture vee with its annotation in the standard positions.
Refusals, all before the first entity reaches the drawing: a text height
outside the seven ISO 1302 rows (2.5/3.5/5/7/10/14/20 mm — never
interpolated), a `lay` that is not one of the seven ISO 1302 directions of
lay, a `machining` outside any/required/prohibited, and a `standard` other
than ISO 21920-1 or ISO 1302.weld_symbol tool
Draw an ISO 2553 weld annotation: reference line, identification line, symbol, dimensions.
Refusals, all before the first entity reaches the drawing: a `kind` outside
the six elementary symbols transcribed here (square, v, bevel, u, j,
fillet — the rest of the ISO 2553 table is deliberately not shipped rather
than guessed), a `side` outside arrow/other/both, a non-positive `height`,
and a `pitch` given without a `length`.centre_marks tool
Centre marks on the CENTER layer, whose linetype carries ISO 128-23's dash pattern.
Pass `handles` and the radii are read back with `entity_get` rather than
restated — a radius from memory is the classic silent wrong number.
Refusals, all before the first entity is written: neither `handles` nor
`centers` given (or both), a handle that is not a CIRCLE or ARC, a circle
in a plane tilted out of WCS XY (capability `ocs_tilted_plane`, so it has
no radius in this frame), a `style` outside mark/lines, a non-positive
`extension`, and `style='lines'` on a centre given without a radius.section_line tool
Draw the cutting-plane line and hand back the plane a section view consumes.
Wide segments at the ends on GEOMETRY, the thin long-dash-dot middle on
CENTER, an arrow at each end whose head sits on the line end and points the
way the section is viewed, and the same letter beyond both arrows.
`payload["plane"]` is exactly `{p1, p2, label, direction, style}` — feed it
to the section view so the label on the plan and the label on the view
cannot disagree. Refusals, before any entity is written: `p1 == p2`, a zero
or parallel viewing direction, an empty `label`, a `style` outside
full/half/offset/revolved, and a non-positive `height`.hatch_material tool
Section-hatch a cut face with the pattern ISO 128-50 gives its material.
Refusals: an unknown material (named, with the full list, before anything
is drawn), neither `boundary` nor `handles` (or both), a boundary with
fewer than three points, and a non-positive `scale`. With `handles` the
loop is chained by `boundary_from_entities`, which the COM engine refuses
(capability `boundary_trace`) - pass `boundary` on a live seat, or run
headlessly. The HATCH layer is created first when the drawing lacks it:
ActiveX refuses an entity on an absent layer and would otherwise leave the
hatch orphaned on layer 0.
The payload states its own accuracy, as `analysis_measure_entity` does:
`area` is the polygon actually hatched, `boundary_area` the exact area of
the chained loop, and `accuracy` is `"exact"` or `"flatten_tolerance"` -
an arc edge reaches `entity_create_hatch` as chords, so a curved cut face
is hatched to within `HATCH_FLATTEN_SAGITTA` of itself rather than being
replaced by its chord polygon. With `handles`, the outline
`boundary_from_entities` draws is scaffolding and is deleted; `traced`
reports its handle and whether the delete succeeded. A loop enclosing no
area is refused instead of writing a HATCH of area 0.0.sheet_frame tool
ISO 5457 drawing frame for A4-A0: a 20 mm filing margin, 10 mm on the
other three edges, the grid reference system and the centring/trimming marks.
Borders, rules and marks land on TITLEBLOCK; the zone lettering on TEXT.
Refusals, all before the first entity is drawn: a size outside A4-A0 is
refused by name and the five covered sizes are listed; an orientation that
is neither 'landscape' nor 'portrait'; a `layout` that does not exist. The
zone divisions drawn are equal -- ISO 5457's shorter corner fields are not
implemented -- while the division counts are the standard's.titleblock_apply tool
ISO 7200 title block, 180 mm wide, in the lower-right corner of any
A4-A0 sheet. The title text is used verbatim.
Carries the ISO 128-30 projection-angle symbol: 'first' draws the cone on
the left and the concentric circles on the right, 'third' is its mirror.
Refusals, all before the first entity: an unknown size (the five covered
sizes are listed), an unknown orientation, a projection that is not
'first'/'third'/'', a `layout` that does not exist. `titleblock_apply_iso_a3`
is this tool with size='A3' and no symbol, kept so no caller breaks.What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller choosesNo tool runs a command or program the caller supplies — 229 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 229 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Reads or writes any file path MEDIUM1 finding in drawing_deliver
- Requests any addressNo tool sends a request to an address the caller supplies — 229 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 229 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Tools that start processes1 of 229 capabilities start processes; 228 more call code the scanner could not follow, where it may happen
- Tools that touch files23 of 229 capabilities touch files; 206 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 229 capabilities; 229 more call code the scanner could not follow, where it may happen
Where the code is: 229 handlers in 1 file at commit 6f6a538255ca
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests1 manifest: pyproject.toml
- Lockfiles checked against OSV1 file resolved and checked against the OSV database; 1 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked
- Known vulnerabilities in production dependencies CRITICAL10 production packages with known advisories
- Known vulnerabilities in other dependenciesNo package used only for development, tests or examples has a known advisory
- MCP SDK versionNo MCP SDK declared in a manifest
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentialsNot seen in the traced code of 229 capabilities; 229 more call code the scanner could not follow, where it may happen
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read (1 only in code no tool reaches)
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (10 in production)
Dependency ranges were not resolved against a lockfile, so the score is capped at 7.
pillowPyPI 12.3.0 CRITICAL 62 advisories 13.0.0
- CRITICALGHSA-332p-7hrc-92wf BIT-pillow-2026-112393 CVE-2026-112393Pillow: Heap buffer overflow in _tiffWriteProc when saving TIFF to BytesIO
- CRITICALGHSA-v9pv-5gc8-w2m6 BIT-pillow-2026-96639 CVE-2026-96639 PYSEC-2026-4339Pillow multi-frame loaders can reuse stale native image storage after mode transitions
- CRITICALGHSA-w889-685w-c8fh BIT-pillow-2026-112900 CVE-2026-112900Pillow: Argument Injection in Ghostscript call, potentially leading into RCE
- CRITICALGHSA-8g5g-8vmr-9782 BIT-pillow-2026-112403 CVE-2026-112403 PYSEC-2026-4332Pillow: Heap buffer overflow in ImagingJpegDecode
- CRITICALGHSA-5x8w-8jj5-q52h BIT-pillow-2026-112398 CVE-2026-112398 PYSEC-2026-4330Pillow: Heap buffer overflow in FlashPix (FPX) JPEG decoding leads to code execution
- HIGHGHSA-27h8-gf7j-v5hc BIT-pillow-2026-112392 CVE-2026-112392 PYSEC-2026-4326Pillow: NULL dereference in ImagingExpand via rank filters on zero-size images
- HIGHGHSA-c6hw-5grf-ff96 BIT-pillow-2026-112404 CVE-2026-112404Pillow: OOB read in TiffDecode.c tile and RGBA paths leaks heap memory into pixels
- HIGHGHSA-xcvg-w56q-r89m CVE-2026-128067Pillow: Heap buffer overflow saving TIFF with libtiff when tags override image size
- HIGHGHSA-gg2r-wvfm-q9rx BIT-pillow-2026-112892 CVE-2026-112892Pillow: MSP RLE decoder expands a tiny file into unbounded memory
- HIGHGHSA-xvh5-g6gv-559v BIT-pillow-2026-112902 CVE-2026-112902 PYSEC-2026-4363 Pillow: Memory disclosure and segfault in libtiff encoder via crafted TIFF tags
- HIGHGHSA-58r4-6rv3-gfh8 BIT-pillow-2026-112397 CVE-2026-112397 PYSEC-2026-4329Pillow: Out-of-bounds access in _imagingmorph on a zero-width image
- HIGHGHSA-f2g6-542v-9j58 BIT-pillow-2026-112406 CVE-2026-112406Pillow: Infinite loop in PdfParser.rewrite_pages on page tree Parent cycle
- HIGHGHSA-65qm-jvmh-6pqg BIT-pillow-2026-112400 CVE-2026-112400Pillow: GIF seek keeps rejected size after DecompressionBombError, allowing DoS
- HIGHGHSA-3j72-p6qg-6xp7 BIT-pillow-2026-96642 CVE-2026-96642 PYSEC-2026-4341Pillow: TarIO negative size field causes infinite CPU-spin loop
- HIGHGHSA-78g4-xqwv-q3g8Pillow: Bundled libopenjp2 2.5.4 in all wheels since 11.1.0 carries OSV-2025-219 heap-buffer-overflow write reachable from Image.open().load()
- HIGHGHSA-pchr-8j38-3x4p BIT-pillow-2026-112896 CVE-2026-112896 PYSEC-2026-4334Pillow: TIFF encoder ColorMap plane-size mismatch causes a heap out-of-bounds read
- HIGHGHSA-g7cr-3p24-7wf7 BIT-pillow-2026-96778 CVE-2026-96778Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer
- HIGHGHSA-g842-9rc4-69pw BIT-pillow-2026-96637 CVE-2026-96637 PYSEC-2026-4338Pillow: Decompression bomb check bypass in SpiderImagePlugin.seek() leads to unbounded allocation DoS
- HIGHGHSA-jg86-v3jv-hrpm BIT-pillow-2026-112894 CVE-2026-112894Pillow: Quadratic-time DoS in PDF save_all (PdfParser.next_object_id)
- HIGHGHSA-j4m9-6w36-pw47 BIT-pillow-2026-112893 CVE-2026-112893Pillow: Invalid free in FreeType glyph rendering when a stroker is active
- HIGHGHSA-q45j-58j2-45rg BIT-pillow-2026-112897 CVE-2026-112897Pillow: TiffDecode returns uninitialized memory as pixels for short JPEG strips
- HIGHGHSA-p4wg-p73j-c528 BIT-pillow-2026-112895 CVE-2026-112895Pillow: Unbounded recursion parsing a PDF page tree or trailer chain (incomplete fix for CVE-2026-42310)
- HIGHGHSA-mrfp-p49p-3hf2 BIT-pillow-2026-96640 CVE-2026-96640Pillow PDF append accepts malformed shared page-tree DAG causing resource exhaustion
- HIGHGHSA-9v9v-9qvf-h2hj BIT-pillow-2026-96644 CVE-2026-96644 PYSEC-2026-4343Pillow: Heap over-read in WMF/EMF rendering via 16-bit dimension truncation (Windows builds)
- HIGHGHSA-5xm2-6676-qcp9 BIT-pillow-2026-112399 CVE-2026-112399Pillow: APNG background disposal allocates full canvas before decompression bomb check
- HIGHGHSA-g4qv-2jxx-769h BIT-pillow-2026-96643 CVE-2026-96643 PYSEC-2026-4342Pillow: PNG eXIf chunk makes EXIF parsing run in quadratic time
- HIGHGHSA-22hg-r758-rrw9 BIT-pillow-2026-112390 CVE-2026-112390Pillow: Infinite loop in MIC n_frames when the embedded TIFF
- HIGHGHSA-7mwm-ghpf-9vrm BIT-pillow-2026-112402 CVE-2026-112402 PYSEC-2026-4331Pillow: Double free in ImagingScaleAffine on calloc failure via Image.transform
- HIGHGHSA-cp9v-662q-vvx9 BIT-pillow-2026-112405 CVE-2026-112405 PYSEC-2026-4333Pillow: NULL pointer dereference in Image.merge via an unvalidated band 0
- MEDIUMPYSEC-2026-4340 BIT-pillow-2026-96641 CVE-2026-96641 GHSA-4rm8-3hmm-39fgPillow is a Python imaging library. Prior to 13.0.0, PILfont text-width accumulation in src/_imaging.c checks positive glyph advances against INT_MAX but does not check negative advances against INT_MIN. Repeating a signed 16-bit advance of -32768 can therefore execute a signed C integer overflow in xsize += dx, producing a large positive width from a negative mathematical result. Applications that use getlength(), getsize(), or derived layout, quota, serialization, or allocation calculations can experience logic-integrity errors or resource consumption, while the high-level mask path commonly retains a decompression-bomb check. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-24rc-8hj2-v98c BIT-pillow-2026-96638 CVE-2026-96638Pillow: BMP RLE decoder memory-amplification DoS via unbounded delta escape / absolute mode
- MEDIUMPYSEC-2026-4334 BIT-pillow-2026-112896 CVE-2026-112896 GHSA-pchr-8j38-3x4pPillow is a Python imaging library. Prior to 13.0.0, Pillow's TIFF encoder can read beyond a ColorMap buffer when retained TIFF metadata has a plane size inconsistent with BitsPerSample. A small TIFF can be opened normally and then retain a crafted ColorMap that is reused when the image is saved. An application that re-encodes the attacker's TIFF with libtiff can trigger the out-of-bounds read. This can disclose heap memory in the output or crash the process. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-4rm8-3hmm-39fg BIT-pillow-2026-96641 CVE-2026-96641 PYSEC-2026-4340Pillow: Reachable undefined behavior in native integer operations, potentially leading to denial of service or logic integrity compromise
- MEDIUMPYSEC-2026-4341 BIT-pillow-2026-96642 CVE-2026-96642 GHSA-3j72-p6qg-6xp7Pillow is a Python imaging library. Prior to 13.0.0, the TarIO initializer in src/PIL/TarIO.py accepts a negative octal member size and computes a backward seek that returns to the same 512-byte header. When the requested member name does not match, the parser repeatedly reads that header, consumes a full CPU core, and never returns. TarIO is reached only when an application directly uses PIL.TarIO.TarIO rather than the default Image.open() path. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-vx6w-vv9f-6gvg BIT-pillow-2026-112899 CVE-2026-112899Pillow: EPS load(scale) lets Ghostscript render past the decompression bomb limit
- MEDIUMPYSEC-2026-4329 BIT-pillow-2026-112397 CVE-2026-112397 GHSA-58r4-6rv3-gfh8Pillow is a Python imaging library. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4327 BIT-pillow-2026-112394 CVE-2026-112394 GHSA-4558-3h8r-v8xpPillow is a Python imaging library. Prior to 13.0.0, Pillow's P;2L and P;4L raw decoders can read past the end of an input buffer. ImagingRawDecode calculates a packed-pixel row size, while the unpackers read separately padded bit planes. A caller can supply a buffer and image dimensions whose accepted size is smaller than the unpacker's actual footprint. This can disclose up to three adjacent heap bytes in output pixels or crash the process. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-fc9g-5qg7-mf45 BIT-pillow-2026-112891 CVE-2026-112891Pillow: Quadratic GIF comment copying during save
- MEDIUMPYSEC-2026-4339 BIT-pillow-2026-96639 CVE-2026-96639 GHSA-v9pv-5gc8-w2m6Pillow is a Python imaging library. From 11.0.0 until 13.0.0, multi-frame loaders can retain an ImagingCore allocation created for a narrow frame mode while a later frame of the same dimensions changes the logical mode and decoder tiles to wider RGB or CMYK data. ImageFile.load_prepare() reuses the stale native storage because _im is non-null without verifying that its mode and size still match. Crafted PSD, MPO, DCX, or MIC frame transitions can then write wider pixels into the narrow allocation, causing native out-of-bounds writes and crashes. The MPO path can also cause a native over-read and, in demonstrated runtime-specific profiles, command execution. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-74r2-7ff9-mjj2 BIT-pillow-2026-112401 CVE-2026-112401Pillow: Quadratic GIF comment concatenation allows DoS in Image.open()
- MEDIUMPYSEC-2026-4328 BIT-pillow-2026-112396 CVE-2026-112396 GHSA-4rr5-89j8-mwwmPillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-654x-cwwv-5j9c BIT-pillow-2026-114501 CVE-2026-114501 PYSEC-2026-4336Pillow: Arrow export leaks stale heap memory when PILLOW_ALIGNMENT > 1
- MEDIUMPYSEC-2026-4336 BIT-pillow-2026-114501 CVE-2026-114501 GHSA-654x-cwwv-5j9cPillow is a Python imaging library. From 11.2.1 until 13.0.0, Arrow export assumes that an image's rows are tightly contiguous and exports from im->blocks[0].ptr even when PILLOW_ALIGNMENT makes aligned_linesize include row padding or an aligned offset before the first row. The resulting Arrow buffer can include uninitialized padding, bytes preceding the first row, or stale heap contents from previously freed images. Applications that configure alignment and export images to Arrow can therefore disclose one user's pixels or other process memory to another user. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-xgh8-jp6q-p5x8 BIT-pillow-2026-112901 CVE-2026-112901 PYSEC-2026-4335Pillow: ReDoS in XbmImagePlugin: 512-byte file stalls Image.open() for minutes
- MEDIUMPYSEC-2026-4342 BIT-pillow-2026-96643 CVE-2026-96643 GHSA-g4qv-2jxx-769hPillow is a Python imaging library. From 11.0.0 until 13.0.0, Exif.load() in src/PIL/Image.py repeatedly slices the remaining EXIF data while it begins with the six-byte Exif header. src/PIL/PngImagePlugin.py accepts an uncapped PNG eXIf chunk, so a file filled with repeated headers causes a new shrinking copy on every iteration and quadratic CPU work. The condition is reachable through Image.getexif(), Image._getexif(), and ImageOps.exif_transpose(), including common photo-upload rotation workflows. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4363 BIT-pillow-2026-112902 CVE-2026-112902 GHSA-xvh5-g6gv-559vPillow is a Python imaging library. In versions through 12.3.0, the libtiff TIFF encoder can pass arguments to TIFFSetField() that do not match libtiff’s definition of the corresponding tag. When an application saves attacker-controlled image metadata through this encoder, crafted tag values can cause invalid memory reads, copying process memory into the encoded output or crashing the process. Applications that return the encoded output to an attacker can disclose that memory. The issue is reachable when re-saving compressed TIFF images and through certain conversions that preserve EXIF metadata into compressed TIFF output. This vulnerability is fixed in version 13.0.0.
- MEDIUMGHSA-wqgw-9xfh-qf2g CVE-2026-128066Pillow: Memory DoS in TIFF and EXIF IFD parsing via overlapping tag data
- MEDIUMGHSA-4558-3h8r-v8xp BIT-pillow-2026-112394 CVE-2026-112394 PYSEC-2026-4327Pillow: P;2L and P;4L decoders may read 1 to 3 bytes past the passed buffer size
- MEDIUMGHSA-462x-pgg6-55fp BIT-pillow-2026-112395 CVE-2026-112395Pillow tiled-TIFF decoder reads past tile buffer in copy4 (Unpack.c:1290)
- MEDIUMGHSA-4rr5-89j8-mwwm BIT-pillow-2026-112396 CVE-2026-112396 PYSEC-2026-4328Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer
- MEDIUMPYSEC-2026-4335 BIT-pillow-2026-112901 CVE-2026-112901 GHSA-xgh8-jp6q-p5x8Pillow is a Python imaging library. Prior to 13.0.0, Pillow's XBM header parser is vulnerable to regular-expression denial of service. In XbmImageFile._open, when an application calls Image.open() on a small crafted XBM file, XbmImagePlugin applies a backtracking expression to the attacker-controlled header before image dimensions are accepted, stalling a worker for minutes and denying service. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4332 BIT-pillow-2026-112403 CVE-2026-112403 GHSA-8g5g-8vmr-9782Pillow is a Python imaging library. Prior to 13.0.0, Pillow's JPEG decoder can write a full-width scanline into a buffer sized for a requested draft scale. ImagingJpegDecode does not verify libjpeg's actual output width and component count after scaling is requested, and an 8-bit lossless SOF3 JPEG decoded by a build linked to libjpeg-turbo 3.x can ignore the requested downscaling geometry. An attacker can supply such a JPEG to an application that uses draft() or thumbnail() to request downscaling. This can corrupt heap memory, crash the process, or potentially allow code execution. Older libjpeg-turbo 2.x and IJG builds reject the SOF3 input. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4331 BIT-pillow-2026-112402 CVE-2026-112402 GHSA-7mwm-ghpf-9vrmPillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after which the error path deletes image storage that later cleanup releases again. An attacker who can drive such a large Image.transform() operation under memory pressure may trigger the failure. This can crash the process and may corrupt memory. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4338 BIT-pillow-2026-96637 CVE-2026-96637 GHSA-g842-9rc4-69pwPillow is a Python imaging library. Prior to 13.0.0, SpiderImageFile.seek() in src/PIL/SpiderImagePlugin.py reparses a later SPIDER stack frame and replaces self._size without rerunning Image._decompression_bomb_check(). A tiny file can use a safe first frame to pass Image.open() and then declare very large dimensions in a later mode F frame. Loading that frame allocates approximately four bytes per attacker-declared pixel and can consume multiple gigabytes of memory. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4343 BIT-pillow-2026-96644 CVE-2026-96644 GHSA-9v9v-9qvf-h2hjPillow is a Python imaging library. Prior to 13.0.0 on Windows, src/PIL/WmfImagePlugin.py passes unchecked 32-bit WMF or EMF dimensions to the native drawwmf handler in src/display.c. The handler sizes a DIB allocation from 16-bit-truncated bcWidth and bcHeight fields but copies pixel data using the original full dimensions. A crafted wide, short metafile can pass the pixel-count decompression-bomb check and make the Windows-only renderer read beyond the heap buffer, potentially disclosing memory or crashing the process. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4330 BIT-pillow-2026-112398 CVE-2026-112398 GHSA-5x8w-8jj5-q52hPillow is a Python imaging library. Prior to 13.0.0, Pillow's FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer. An attacker can supply a crafted OLE2 FlashPix file to an application with the optional olefile dependency installed that opens or thumbnails untrusted input. This can corrupt heap memory and may allow arbitrary code execution. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4337 BIT-pillow-2026-96636 CVE-2026-96636 GHSA-p8hx-v2p6-rp84Pillow is a Python imaging library. Prior to 13.0.0, MpoImageFile.seek() and DcxImageFile.seek() reparse later MPO or DCX frames and replace self._size without rerunning Image._decompression_bomb_check(). A crafted multi-frame image can use a tiny first frame to pass Image.open() and then declare an over-limit later frame. Normal frame iteration through seek(), load(), or ImageSequence.Iterator can decode that frame and commit hundreds of megabytes or more, causing memory-exhaustion denial of service. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-p8hx-v2p6-rp84 BIT-pillow-2026-96636 CVE-2026-96636 PYSEC-2026-4337Pillow: Decompression-bomb protection bypass via multi-frame seek() in MPO and DCX (MpoImageFile.seek / DcxImageFile.seek)
- MEDIUMPYSEC-2026-4326 BIT-pillow-2026-112392 CVE-2026-112392 GHSA-27h8-gf7j-v5hcPillow is a Python imaging library. Prior to 13.0.0, Pillow's rank-based filters can dereference invalid image storage for a zero-size image. ImagingExpand() allocates a non-empty output and then faults while replicating edges by reading the first pixel from empty input storage; ImagingRankFilter is never reached. An attacker can supply or cause creation of a zero-size image to an application that applies a rank, median, minimum, or maximum filter. This causes a native process crash. This issue is fixed in version 13.0.0.
- MEDIUMPYSEC-2026-4333 BIT-pillow-2026-112405 CVE-2026-112405 GHSA-cp9v-662q-vvx9Pillow is a Python imaging library. From 12.0.0 until 13.0.0, Pillow's Image.merge() can dereference a null image8 plane. Validation skips the first input band, allowing a 32-bit integer or floating-point image backed by image32 storage to be merged as a narrower multiband image. A crafted IPTC file can reach this path when an application opens and loads it, or a caller can invoke Image.merge() directly with such a first band. This causes a native process crash. This issue is fixed in version 13.0.0.
- MEDIUMGHSA-rfgq-q3w2-pmv2 BIT-pillow-2026-112898 CVE-2026-112898Pillow: Image.quantize() with empty palette leaks uninitialized stack memory
- MEDIUMGHSA-254f-3936-288h BIT-pillow-2026-112391 CVE-2026-112391Pillow: PdfParser can recurse without limit in get_value() and linearize_page_tree()
pyjwtPyPI 2.13.0 CRITICAL 29 advisories 2.14.02.15.0
- CRITICALGHSA-ffc3-869f-jxw9 CVE-2026-102268 PYSEC-2026-4145PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
- HIGHGHSA-w2cx-738m-mc7w CVE-2026-102273 PYSEC-2026-4151PyJWT accepts public JWK containers as HMAC secrets
- HIGHGHSA-9v7f-9g4p-ffgj CVE-2026-102267 PYSEC-2026-4144PyJWT: PyJWKClient follows redirects when fetching JWKS
- HIGHGHSA-p4g4-x82p-q773 CVE-2026-102271 PYSEC-2026-4149PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
- HIGHGHSA-9j54-fg26-wv3r CVE-2026-102266 PYSEC-2026-4143PyJWT: PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation
- HIGHGHSA-pxh4-856f-4h89PyJWT: HS256/384/512 verify accepts empty HMAC key via oct JWK (PyJWK/PyJWKClient) enabling token forgery
- HIGHGHSA-r6x4-923q-g947 CVE-2026-102272 PYSEC-2026-4150PyJWT BOM Bypass
- MEDIUMPYSEC-2026-4151 CVE-2026-102273 GHSA-w2cx-738m-mc7wPyJWT accepts public JWK containers as HMAC secrets
- MEDIUMGHSA-x33g-cr3x-6449 CVE-2026-102275 PYSEC-2026-4183PyJWT accepts inconsistent OKP x/d JWKs, causing public/private key identity confusion
- MEDIUMGHSA-gvp8-978c-rx2q CVE-2026-103001 PYSEC-2026-4146PyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse
- MEDIUMPYSEC-2026-4150 CVE-2026-102272 GHSA-r6x4-923q-g947PyJWT BOM Bypass
- MEDIUMGHSA-hxm8-2xgr-2p9m CVE-2026-102269 PYSEC-2026-4147PyJWT: Non-canonical signature segments enable raw-token revocation bypass
- MEDIUMGHSA-42vr-xj54-vc7v CVE-2026-101918 PYSEC-2026-4141PyJWT: Unauthenticated RecursionError DoS in pre-verification payload parse (PyJWKClient.get_signing_key_from_jwt / verify_signature=False)
- MEDIUMGHSA-w6j9-cwv2-h6wq CVE-2026-102274 PYSEC-2026-4152PyJWT: Malformed RSA JWK aborts parsing of an entire JWK Set
- MEDIUMPYSEC-2026-4144 CVE-2026-102267 GHSA-9v7f-9g4p-ffgjPyJWT: PyJWKClient follows redirects when fetching JWKS
- MEDIUMPYSEC-2026-4152 CVE-2026-102274 GHSA-w6j9-cwv2-h6wqPyJWT: Malformed RSA JWK aborts parsing of an entire JWK Set
- MEDIUMPYSEC-2026-4183 CVE-2026-102275 GHSA-x33g-cr3x-6449PyJWT is a Python implementation of JSON Web Token standards. From 2.1.0 until 2.15.0, PyJWT OKPAlgorithm.from_jwk in jwt/algorithms.py is affected because private-JWK import path does not compare the public key derived from d with x. This occurs when an OKP private JWK supplies non-corresponding x and d components. As a result, identity derived from x can differ from operations performed with d. Consequently, if an integration also accepts private key parameters from a proof header without rejecting them, an attacker may use a stolen sender-constrained token without the legitimate private key. This issue is fixed in version 2.15.0.
- MEDIUMGHSA-jwrc-g2q2-pq5p CVE-2026-102270 PYSEC-2026-4148PyJWT: ReDoS vulnerability when calling the `is_pem_format` function.
- MEDIUMPYSEC-2026-4147 CVE-2026-102269 GHSA-hxm8-2xgr-2p9mPyJWT: Non-canonical signature segments enable raw-token revocation bypass
- MEDIUMPYSEC-2026-4143 CVE-2026-102266 GHSA-9j54-fg26-wv3rPyJWT: PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation
- MEDIUMPYSEC-2026-4148 CVE-2026-102270 GHSA-jwrc-g2q2-pq5pPyJWT: ReDoS vulnerability when calling the `is_pem_format` function.
- MEDIUMPYSEC-2026-4146 CVE-2026-103001 GHSA-gvp8-978c-rx2qPyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse
- MEDIUMPYSEC-2026-4149 CVE-2026-102271 GHSA-p4g4-x82p-q773PyJWT: Public keys in DER form are accepted as HMAC secrets, bypassing the CVE-2022-29217 guard
- MEDIUMGHSA-2gx3-rcp4-g85q CVE-2026-101917 PYSEC-2026-4140PyJWT: PyJWKClient still amplifies unauthenticated JWKS fetches on unknown kid values (incomplete fix of CVE-2026-48524)
- MEDIUMPYSEC-2026-4142 CVE-2026-102265 GHSA-8wjv-2p76-3863PyJWT: Uncaught RecursionError in jwt.decode() on deeply nested token header
- MEDIUMPYSEC-2026-4140 CVE-2026-101917 GHSA-2gx3-rcp4-g85qPyJWT: PyJWKClient still amplifies unauthenticated JWKS fetches on unknown kid values (incomplete fix of CVE-2026-48524)
- MEDIUMPYSEC-2026-4141 CVE-2026-101918 GHSA-42vr-xj54-vc7vPyJWT: Unauthenticated RecursionError DoS in pre-verification payload parse (PyJWKClient.get_signing_key_from_jwt / verify_signature=False)
- MEDIUMPYSEC-2026-4145 CVE-2026-102268 GHSA-ffc3-869f-jxw9PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
- MEDIUMGHSA-8wjv-2p76-3863 CVE-2026-102265 PYSEC-2026-4142PyJWT: Uncaught RecursionError in jwt.decode() on deeply nested token header
authlibPyPI 1.7.2 CRITICAL 16 advisories 1.8.01.9.01.9.1
- CRITICALGHSA-6v38-4h7w-rj9h CVE-2026-96760Authlib: empty signatures validation in JWS JSON deserialization
- HIGHGHSA-c73q-w75p-j82v CVE-2026-116672Authlib RFC 7592 examples omit registration-access-token client binding
- HIGHGHSA-7vr2-2fgp-9w7p CVE-2026-114615 PYSEC-2026-4355Authlib incomplete algorithm-confusion fix permits HMAC forgery with prefixed public keys
- HIGHGHSA-8m4g-j4wp-wgcg CVE-2026-114616 PYSEC-2026-4356Authlib accepts an empty HMAC key, allowing JWS/JWT signature forgery (HS256/HS384/HS512)
- MEDIUMPYSEC-2026-4356 CVE-2026-114616 GHSA-8m4g-j4wp-wgcgAuthlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.9.1, Authlib's OctKey.import_key() and HMAC signing and verification path accept zero-length key material. If an application's secret lookup can return an empty string or empty bytes, a remote attacker can compute the deterministic HS256, HS384, or HS512 signature for arbitrary token claims and have Authlib treat the token as authentic. This issue is fixed in version 1.9.1.
- MEDIUMGHSA-q686-2qmg-hqc7 CVE-2026-114619 PYSEC-2026-4359Authlib: OpenID implicit grant checks raw scope instead of allowed scope before issuing ID tokens
- MEDIUMGHSA-x4rv-c3wx-4cr8 CVE-2026-114620 PYSEC-2026-4360Authlib: Unvalidated request_uri fetch in JWT-secured authorization request (JAR) leading to SSRF
- MEDIUMPYSEC-2026-4354 CVE-2026-114614 GHSA-jj7h-c3hg-m23xAuthlib is a Python library which builds OAuth and OpenID Connect servers. From 0.13 until 1.8.0, authlib.common.security.is_secure_transport() uses a textual prefix comparison for loopback HTTP exemptions, so a URL whose userinfo begins with a loopback host can be accepted even when its parsed host is an external non-loopback system. An external party able to supply a URL to OIDC RP-Initiated Logout registration, authorization-server metadata validation, or another call site can bypass the TLS-required guard and cause cleartext redirection or acceptance of cleartext endpoints. The issue does not bypass redirect URI exact matching and does not by itself forge tokens or authenticate users. The vulnerable authlib.common.security.is_secure_transport() implementation in authlib/common/security.py misinterprets the userinfo component before OIDC RP-Initiated Logout dynamic client registration and other consumers enforce transport security. This issue is fixed in version 1.8.0.
- MEDIUMGHSA-fch4-3c6x-j4gc CVE-2026-114618 PYSEC-2026-4358Authlib: Default JWT bearer grant accepts assertions for the wrong audience
- MEDIUMPYSEC-2026-4358 CVE-2026-114618 GHSA-fch4-3c6x-j4gcAuthlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.9.0, the default RFC 7523 JWTBearerGrant.get_audiences() returns an empty list, causing JWTBearerGrant.verify_claims() to require only that an aud claim exists without matching the current authorization server. An attacker holding a legitimate assertion for another service can present it to a server that shares the signing key and uses the default grant, obtaining an access token across a trust boundary. Implementations that override get_audiences() with the server's valid audience identifiers are not affected. This issue is fixed in version 1.9.0.
- MEDIUMPYSEC-2026-4359 CVE-2026-114619 GHSA-q686-2qmg-hqc7Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.9.0, OpenIDImplicitGrant.validate_authorization_request() checks the client-controlled raw request.payload.scope for openid after the parent grant has filtered allowed scopes into request.scope. A registered client permitted an ID token response type but not the openid scope can add openid to the request, obtain user consent, and receive a signed ID token containing the user's subject and allowed profile claims. Authorization code flow and deployments that allow openid for every client permitted an ID token response are not affected. In authlib/oidc/core/grants/implicit.py, OpenIDImplicitGrant.validate_authorization_request() checks request.payload.scope instead of the filtered request.scope. This issue is fixed in version 1.9.0.
- MEDIUMGHSA-c5mf-xmp2-59rc CVE-2026-114617 PYSEC-2026-4357Authlib: ID token can disable its own nonce validation via the nonce_supported claim
- MEDIUMPYSEC-2026-4360 CVE-2026-114620 GHSA-x4rv-c3wx-4cr8Authlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.9.0, Authlib's RFC 9101 JWTAuthenticationRequest passes the unauthenticated, client-controlled request_uri parameter to the abstract get_request_object() hook before applying a destination or registration policy; the hook itself performs no network request, while the documentation demonstrates an unrestricted HTTP fetch. In deployments whose integrator implements that hook as an unrestricted outbound fetch, a remote attacker who knows a valid public client identifier can make the authorization server request internal, link-local, or otherwise unintended URLs and can distinguish fetch outcomes through different error responses and timing. Deployments whose custom hook already applies a secure allowlist, destination controls, and retrieval limits are not affected. The JWTAuthenticationRequest implementation in authlib/oauth2/rfc9101/authorization_server.py forwards request_uri to get_request_object() before an application-approved retrieval policy accepts the destination. This issue is fixed in version 1.9.0.
- MEDIUMPYSEC-2026-4355 CVE-2026-114615 GHSA-7vr2-2fgp-9w7pAuthlib is a Python library which builds OAuth and OpenID Connect servers. From 1.3.1 until 1.9.0, OctKey.import_key() checks asymmetric-key markers only at byte zero while Authlib's PEM loaders accept leading whitespace, comments, or a byte-order mark. In deployments that use the documented mixed algorithm registry and already configure verification with PEM or certificate bytes containing such a prefix, an unauthenticated attacker who knows those same public-key bytes can use them as an HMAC secret and forge HS256 tokens with arbitrary identity or authorization claims. This is a bypass of the remediation for CVE-2024-37568. The module-level jwt object reaches OctKey.import_key() in authlib/jose/rfc7518/oct_key.py, where POSSIBLE_UNSAFE_KEYS fails to identify prefixed asymmetric key material. This issue is fixed in version 1.9.0.
- MEDIUMPYSEC-2026-4357 CVE-2026-114617 GHSA-c5mf-xmp2-59rcAuthlib is a Python library which builds OAuth and OpenID Connect servers. Prior to 1.9.0, OpenIDMixin.parse_id_token() reads the nonce_supported decision from the untrusted ID token being validated and sets the expected nonce to null when that claim is the JSON boolean false. In implicit and hybrid relying parties, or applications that directly accept externally supplied ID tokens, an attacker with a captured validly signed token can bypass the nonce-to-session binding and replay the victim's token into an attacker-controlled session. Plain authorization code flow is not affected, and the token must still pass signature, issuer, and audience validation. OpenIDMixin.parse_id_token() trusts nonce_supported in both authlib/integrations/base_client/sync_openid.py and authlib/integrations/base_client/async_openid.py to disable the expected nonce. This issue is fixed in version 1.9.0.
- LOWGHSA-jj7h-c3hg-m23x CVE-2026-114614 PYSEC-2026-4354Authlib: is_secure_transport() loopback exemption can be bypassed with a userinfo component, allowing cleartext-HTTP URLs to non-loopback hosts
certifiPyPI 2026.7.22 CRITICAL 2 advisories 2026.10.18
- CRITICALGHSA-6q48-6c7w-9gw2 PYSEC-2026-4320certifi bundles emSign root CAs with compromised intermediate CA keys
- MEDIUMPYSEC-2026-4320 GHSA-6q48-6c7w-9gw2certifi bundles emSign root CAs with compromised intermediate CA keys
mcpPyPI 1.29.0 HIGH 5 advisories 1.30.02.2.0
- HIGHGHSA-qx49-fqc8-xw99 CVE-2026-115563Model Context Protocol Python SDK: OAuth client could send credentials to an authorization server chosen by the MCP server
- MEDIUMGHSA-rwrf-2pqf-9j8j CVE-2026-116686Model Context Protocol Python SDK: Client fetched server-chosen $ref URLs while validating tool results against output schemas
- MEDIUMGHSA-84m7-p3x7-pcfv CVE-2026-59951MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion
- MEDIUMGHSA-w4fh-qvv9-3v23 CVE-2026-116684Model Context Protocol Python SDK: Server bearer-token authentication accepts tokens issued for a different resource server
- MEDIUMGHSA-5h93-6whr-6q8j CVE-2026-116685Model Context Protocol Python SDK: HTTP client transports followed cross-origin redirects carrying custom headers and bodies
dnspythonPyPI 2.8.0 HIGH 2 advisories 2.9.02.9.2
- HIGHGHSA-vvf4-9x63-8xvv CVE-2026-128089dnspython has excessive memory and CPU use
- HIGHGHSA-45c3-73f7-pv4m CVE-2026-114605dnspython dns.name.from_wire_parser() excessive CPU use
joserfcPyPI 1.7.4 HIGH 2 advisories 1.7.51.7.6
- HIGHGHSA-jpxq-7h8p-2q76 CVE-2026-119283joserfc: Unbounded JWE General JSON `recipients` Array Leads to CPU Exhaustion (DoS) via Repeated RSA Private-Key Decryption
- MEDIUMGHSA-9pg5-8c7x-5hfx CVE-2026-119284joserfc: Compact JWS size guard allocates attacker-controlled segments before rejection
opentelemetry-apiPyPI 1.44.0 MEDIUM 2 advisories 1.45.11.45.2
- MEDIUMGHSA-xcq7-p3pf-p88h CVE-2026-114603OpenTelemetry Python: Unbounded tracestate parsing in opentelemetry-api
- MEDIUMGHSA-mf5v-w3w3-f6cg CVE-2026-126360OpenTelemetry Python API: Denial of service through quadratic-time traceparent parsing
fastmcpPyPI 3.4.5 MEDIUM 1 advisory 3.4.104.1.2
- MEDIUMGHSA-7xgj-8392-5q4rFastMCP: Post-transform component authorization is skipped on direct calls
fastmcp-slimPyPI 3.4.5 MEDIUM 1 advisory 3.4.104.1.2
- MEDIUMGHSA-7xgj-8392-5q4rFastMCP: Post-transform component authorization is skipped on direct calls
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
No security advisories have been published for this server in the GitHub Advisory Database.
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | not stated in the code the scanner read; most local servers talk over stdio |
| Sign-in | not checked needs the live server |
| Servers in the code | 1 (AutoCAD MCP Pro) |
The project's own security
| Security policy | none no SECURITY.md in the repository: report issues privately through GitHub if it is enabled |
|---|---|
| Past advisories | none in the GitHub Advisory Database |
| Last push | 2026-11-06 |
| Signed releases | not checked yet |
Where it is published
| Listed in | 3 catalogs (github_search, glama, mcp_toplist) |
|---|---|
| License | MIT |
| Created | 2026-04-27 |
| Topics | ai-agents autocad autolisp cad cad-automation claude claude-code cursor dwg dxf |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.