Skip to main content
Glama
auto-autocad-mcp

auto-autocad-mcp

by xoaicc

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
CAD_LAUNCHNoWhen using the COM backend, start a full AutoCAD session first or leave CAD_LAUNCH=auto.
COM_CALL_TIMEOUTNoTimeout in seconds for COM calls. Large shopdrawings open slower than the default timeout, so keep COM_CALL_TIMEOUT=300 (or higher).
AUTOCAD_MCP_BACKENDNoBackend to use. On Windows it controls a live AutoCAD seat via COM ("com"); on other platforms or when set to "ezdxf" it falls back to the headless ezdxf engine.
AUTO_AUTOCAD_PROFILENoAbsolute path to your auto-autocad.profile.json project profile. Optional; if omitted, the built-in neutral profile (auto_* tools) is used. Resolution order: tool argument (non-empty) > $AUTO_AUTOCAD_PROFILE > <working dir>/auto-autocad.profile.json > built-in default.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

electrical shopdrawing helpers, on top of AutoCAD MCP Pro. Tools act on the currently bound drawing. auto_seat_health reports whether the seat is ready and whether a modal dialog is blocking it. auto_xref_repair re-points unresolved external references by basename (dry_run first). auto_plot_preflight checks every layout's plot style, device, scale and paper, and reads the plot log's warnings. auto_drawing_list validates a supplied index and writes it to CSV/XLSX. auto_source_list rebuilds the base design's drawing list from its DWG table and mints the project codes. auto_sheet_build draws an ISO A3 frame + title block per index entry, one layout each. auto_sheet_set groups shopdrawings into one publish set (a .dsd sheet list) and can publish it to a single multi-page PDF. auto_sheet_discover lists the (dwg, layout) sheets under a folder, so a set need not be listed by hand. auto_layer_takeoff counts and sums length per layer and can write CSV/XLSX. auto_material_takeoff lists a shopdrawing's materials -- conduit, wire, devices -- with the quantities computed from its geometry, the sheet's own type tables and symbol images, and can write them to XLSX with a picture per row. Tables are written to CSV/XLSX, or -- when the project's profile lists the DWG/DXF format -- as a drawing: the table drawn into a new drawing and the file written out. auto_drawing_export writes the bound drawing itself out as a DWG or a DXF. Every project-specific default -- code prefix, plot style, source layer, frame cells, material units -- comes from the project profile (auto-autocad.profile.json in the working directory, or $AUTO_AUTOCAD_PROFILE); a tool argument overrides it per call. auto_profile reports the profile in use.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
auto_seat_healthA

Check the live seat before a job: is AutoCAD there, and is anything blocking it?

ready is false when a modal dialog holds the seat -- the one state that stalls a COM call outright, which on this project is AutoCAD's Sheet Set Manager - DST File Not Found box. Dialogs whose title is not recognised are named in unknown_dialogs and left alone. A box the running job raised for itself -- AutoCAD's plot/publish progress box -- comes back under running_dialogs: the seat is busy, not waiting on an answer. The same drawing open more than once, and a seat with nothing open, come back as warnings: they change how a job should run, not whether it can. Nothing is asked of COM while a dialog is up -- that is the call the box would hold -- so the block is reported at once and document_count comes back as null.

auto_xref_repairA

Re-point unresolved external references at a file with the same basename.

Reports every reference: one whose file is present is resolved; one with no candidate is not_found; one with several is ambiguous (never picked); the rest are repaired. The drawing's own folder is searched first, then search_roots. Run with dry_run (the default) to see the plan.

A COM busy failure -- measured right after the seat starts -- is retried up to attempts times, clearing any known dialog between tries; every other failure is raised as it is.

auto_plot_preflightA

Check every paper-space layout's plot readiness, plus the plot log.

Flags an unassigned or uninstalled plot style (.ctb/.stb), and a missing device, scale or paper size. layouts limits the check to named tabs. The plot log's own last records are included, each marked warning for AutoCAD's Plotted with Warning(s) status.

auto_drawing_listA

Validate a supplied drawing index and, with path, write it out.

Each entry is {code, title, building?, sheet?, revision?, scale?}. A code is upper-cased and carried verbatim; one missing the project prefix (the profile's codes.prefix) is flagged but kept, and a row with no code is dropped (see issues). Without path the validated rows come back only.

auto_source_listA

Rebuild the base design's drawing list and mint the project's own codes.

kind names the reader (the profile's source.kind when left blank). text_grid -- the default -- reads the .dwg headless (the core converts it; the input is never written), rebuilds its text table (the profile's source.layer, e-text by default) row by row. acad_table reads a real ACAD_TABLE instead, through the live seat: the source drawing is brought into AutoCAD and its table read by one AutoLISP call, so the seat is left on that drawing -- the one side effect of this otherwise read-only tool.

Either way each row with a source code becomes a project entry (the profile's codes.prefix). Section headers and rows with no code are reported in issues and left out; a tower/plan mismatch or a numbering gap is reported, not fixed.

order="list" reads the left table then the right one; "row" interleaves them top down. include_catalog=false drops the two drawing-list sheets. With out the list is also written to CSV/XLSX.

auto_sheet_buildA

Draw one layout per index entry: the ISO title block, or the project frame.

A layout is created when it does not exist and drawn into when it does. Sheet numbers default to position/total and the revision to the entry's (the profile's list.default_revision if unset). save writes the drawing once every sheet is drawn.

size and the project frame's own geometry come from the profile (sheets.*) unless given here. frame (a path to X-FRAME-E.dwg) draws the project's own frame instead: the DWG is attached as an external reference on every layout, and the entry's code, title and scale are written into the frame's cells (title_vi and revision fill their cells only when given). That path never writes the drawing the backend is bound to, so save requires output -- a new DWG (COM) or DXF (headless, which cannot write DWG).

auto_sheet_discoverA

List the (dwg, layout) sheets under root, instead of listing them by hand.

Every drawing is opened to read its layouts, so this is a seat job, not a file scan; Model is never a sheet and a layout with no paper (AutoCAD's spare tabs plot on 0x0) is left out unless exclude_empty=false. include / exclude are fnmatch globs against each drawing's path relative to root ("01. Shopdrawing/*.dwg"); an excluded drawing is named in skipped, and one that will not open in issues. Rows are sorted by drawing then layout, so two calls on one tree agree.

auto_sheet_setA

Group shopdrawings into one publish set and, with publish, plot it.

Each entry is {dwg, layout, setup?}: the drawing to take the sheet from, the layout tab on it, and optionally the page setup to plot that sheet with (blank = the layout's own). dwg may be relative to base_dir.

With discover (and no entries) the sheet list is read from the tree under base_dir instead of being supplied: every drawing's paper-space layouts, minus the empty ones, ordered by drawing then layout. include / exclude narrow that scan.

The set is written as a .dsd sheet list at dsd_path -- the file AutoCAD's Publish dialog and -PUBLISH both read -- and pdf_path is the single multi-page PDF the set targets (default: dsd_path with a .pdf suffix). publish runs -PUBLISH on the live backend and reports the PDF it wrote; a row whose drawing is not on disk is reported in issues and left out, since -PUBLISH fails the whole job on it.

Publishing holds the seat clear of the DST File Not Found dialog (the Sheet Set Manager is stopped from opening itself for the duration, and a box that still appears is pressed away), and judges success by the PDF on disk: see publish_set for the state it reports.

Before publishing, every sheet's layout is read and its plot style checked against the styles AutoCAD has installed. A sheet naming a style that is not installed -- -PUBLISH would plot it anyway, leaving a warning only in the plot log -- blocks the run: nothing is plotted and plot_styles names the gap. Fix the layout's page setup (or install the style file) and publish again; pass allow_missing_styles to publish despite a known gap (the overridden flag in plot_styles says the override was used).

A set published straight from discovery comes out in discovery order -- by drawing file name -- which is not the reference OUTPUT's order. order reorders the sheets the way OUTPUT groups them: by the sheet number a layout ends with (every .01 sheet, then every .02), and by code inside a run. The sheets that belong to no run, or that close one, are named in pin ({"layout": ..., "where": "first" | "last"}): the drawing list goes first, the elevation and the title last in their own run. A layout whose name carries no sheet number (the elevation is laid out as plain Layout1) names the run it closes: "run": "01". See order_rows.

plot_style moves every sheet onto one plot style for the run -- the project's own colour table (the profile's plot.style, and the default when this is left blank), which is what gives OUTPUT its screened grey background, where the INPUT layouts are not uniform -- and takes the change back once the set is plotted, so no drawing is written. Because the run replaces every layout's style anyway, a forced style is not blocked by the styles the layouts already name: the change the seat did not take is in plot_style_change, and what the undo put back in plot_style_restored.

auto_layer_takeoffA

Count entities and sum length per layer over the model space.

layers / types restrict the scan. Lengths are only summed where the core reported one (LINE / ARC / POLYLINE), converted from the drawing's own units to unit (mm, cm or m) using the profile's takeoff.length_units. With path the table is written to CSV/XLSX.

auto_material_takeoffA

List a shopdrawing's materials and compute their quantities from geometry.

The sheet's own tables name the types -- its legend and the conduit / wire quantity tables -- while the quantities, a placeholder (n) on the drawing, are computed here: conduit and wire by summed drawn length, devices by count. A conduit type is identified by its conductor count, so the geometry on every E-CD-…(nC)… layer of a type adds up into the table's row for it.

The .dwg is read headless (the core converts it; the input is never written). Devices and wire carry a symbol block, rendered to PNG and, with out, embedded in the XLSX's KÝ HIỆU column (CSV keeps the block's name as text instead). rules is an optional materials.map.json overriding the layer rules from the profile's materials section. A layer no rule claims, a wire with no conduit to pair with, and a symbol that will not render are reported in issues, never guessed.

auto_drawing_exportA

Write the drawing the backend is bound to out as a DWG or a DXF.

The one way to get the open drawing as a file of its own -- after a sheet build, say -- without touching it: nothing is drawn and the bound drawing is only read.

The format is fmt or path's suffix. dxf is always written; dwg is written through drawing_export_dwg with version (the profile's export.dwg_version when left blank), which headless needs the ODA File Converter and returns a typed refusal (dwg_write) without one, while a live seat writes DWG natively.

auto_profileA

Report the project profile this server is running with.

source says where it came from -- default (the built-in defaults), cwd (auto-autocad.profile.json in the working directory) or env ($AUTO_AUTOCAD_PROFILE) -- and path names the file when there is one. profile is the merged profile the tools read: every constant a new project would set, so you can see the run's defaults without reading code. A tool argument still overrides any of them for a single call.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 12 tools

Disambiguation4/5

Most tools have clearly distinct purposes: seat health, xref repair, plot preflight, layer takeoff, material takeoff, sheet build/discover/set, and export are separable. The main overlaps are auto_drawing_list vs auto_source_list (both produce drawing indexes) and auto_sheet_discover vs auto_sheet_set with discover mode (both enumerate sheets), though descriptions explain the difference.

Naming Consistency4/5

All names share an auto_ prefix and snake_case domain_action structure, which is predictable and readable. Minor inconsistency: some second tokens are verbs (build, discover, repair) while others are nouns (list, set, profile), but the pattern remains understandable.

Tool Count5/5

Twelve tools is well within the appropriate range for a specialized AutoCAD automation server. Each tool maps to a distinct workflow stage (health, discovery, takeoff, build, publish, export), so none feels redundant.

Completeness4/5

The surface covers the core shopdrawing lifecycle: profile inspection, seat health, drawing/source indexes, sheet discovery/build/publish, xref repair, takeoffs, and export. Gaps include no explicit drawing open/close or layer/entity editing tools, but those may be outside the intended read/build/export scope.