Skip to main content
Glama
auto-autocad-mcp

auto-autocad-mcp

by xoaicc

auto-autocad-mcp

An electrical shopdrawing workflow MCP server and Agent Skill for AutoCAD: seat health, xref repair, plot preflight, Drawing List extraction & code minting, A3 title-block / project-frame sheets, sheet-set publish to a single grey PDF, layer and material takeoff (XLSX / CSV / DWG / DXF), and drawing export.

It is a thin FastMCP 3.x server built over autocad-mcp-pro. On Windows it controls a live AutoCAD seat via COM; on other platforms (or when AUTOCAD_MCP_BACKEND=ezdxf) it falls back to the headless ezdxf engine.

It is project-agnostic: every project-specific constant (code prefix, source layer, title-block cell coordinates, plot style, material rules, even the server's name and tool-name prefix) is loaded from a JSON project profile, so adapting to a new project is a config change rather than a code change.

Repository layout

Component

Path

MCP server package (auto_autocad)

auto_autocad/

Pipeline Agent Skill & PDF verifier

skills/auto-autocad-pipeline/

Worked sample profile

examples/sample.profile.json

Offline test suite & live harness

tests/ and tests/live/

Related MCP server: AutoCAD MCP Pro

Requirements

  • Python >= 3.11 and uv (recommended).

  • Windows + full AutoCAD (not AutoCAD LT) for live COM operations and multi-sheet PDF publishing.

  • autocad-mcp-pro>=1.8.0,<1.9 (install with [full] extra for openpyxl XLSX export and pywin32 COM support).

NOTE

Headless .dwg read/write support: Stock autocad-mcp-pro v1.8.0 on PyPI supports headless .dxf via ezdxf and headless .dwg conversion via the ODA File Converter. Headless .dwg export/read via AutoCAD's accoreconsole.exe requires the upstream fork/PR patch on top of autocad-mcp-pro v1.8.0; when running against stock PyPI v1.8.0 without ODA File Converter, use fmt="dxf" or export on a live Windows AutoCAD COM seat.

1. Install

Run directly with uvx (once published), or install from this repository:

# From PyPI
uvx --from auto-autocad-mcp auto-autocad-mcp

# Build and install local wheel
uv build
uv tool install dist\auto_autocad_mcp-0.4.0-py3-none-any.whl

For local development:

pip install "autocad-mcp-pro[full]>=1.8.0,<1.9"
pip install -e .

2. Register the MCP server

Add to your MCP client config (Claude Code, Antigravity, Trae, Cursor, etc.):

{
  "mcpServers": {
    "auto-autocad-mcp": {
      "command": "auto-autocad-mcp",
      "args": [],
      "env": {
        "AUTOCAD_MCP_BACKEND": "com",
        "COM_CALL_TIMEOUT": "300",
        "AUTO_AUTOCAD_PROFILE": "<absolute path to your auto-autocad.profile.json>"
      }
    }
  }
}

If running via uvx without installing locally, set "command": "uvx" and "args": ["--from", "auto-autocad-mcp", "auto-autocad-mcp"]. AUTO_AUTOCAD_PROFILE is optional; if omitted, the built-in neutral profile (auto_* tools) is used.

3. AutoCAD COM notes

When using the COM backend (AUTOCAD_MCP_BACKEND=com), start a full AutoCAD session first (or leave CAD_LAUNCH=auto). Large shopdrawings open slower than the default timeout, so keep COM_CALL_TIMEOUT=300 (or higher).

During publish jobs, the modal "Sheet Set Manager - DST File Not Found" dialog is expected. auto_autocad/dialogs.py::KNOWN_DIALOGS defines the exact whitelist of dialogs that may be dismissed automatically; unknown dialogs are never clicked.

4. Project profile

Every project-specific setting comes from one JSON file; omitted keys fall back to neutral built-in defaults. Resolution order (highest wins):

tool argument (non-empty)  >  $AUTO_AUTOCAD_PROFILE  >  <working dir>/auto-autocad.profile.json  >  built-in default

Minimal example:

{
  "project": "My Building",
  "codes": { "prefix": "MB1-SD-EL" },
  "source": { "layer": "E-TEXT" },
  "plot": { "style": "MB1.ctb" }
}

See examples/sample.profile.json for a full template, or call auto_profile from your MCP client to inspect the active merged profile.

5. Install the pipeline skill

The five-stage workflow lives in skills/auto-autocad-pipeline (Agent Skills standard) and includes scripts/check_pdf.py for post-publish verification. Copy skills/auto-autocad-pipeline into your client's skills folder:

Client

Skills directory

Antigravity

<workspace-root>\.agents\skills\

Claude Code

.claude\skills\

Trae

.trae\skills\

6. Run & verify

auto-autocad-mcp                               # STDIO (default)
python -m auto_autocad.server                  # STDIO, from checkout
auto-autocad-mcp --transport http --port 8010  # streamable HTTP

Verify any published shopdrawing PDF before delivering:

python skills/auto-autocad-pipeline/scripts/check_pdf.py "<path-to-published.pdf>" --expect-pages <N>

Check that the page count matches the sheet count, TOTAL NON-GREY OPS: 0, bookmark order matches the drawing list, and no .bak / .ds$ / staging leftovers remain in the pack.

Tests

pytest tests -q

The offline suite runs against a scripted fake backend (no AutoCAD required). Live tests against a running AutoCAD seat live in tests/live/.

License

MIT — see LICENSE.

Available Tools

12 tools
auto_drawing_exportdrawing 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.

Inputs: path (required), fmt, version. Returns: object

auto_drawing_listdrawing 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.

Inputs: fmt, path, entries. Returns: object

auto_layer_takeofflayer 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.

Inputs: fmt, path, unit, types, +2 more. Returns: object

auto_material_takeoffmaterial takeoffA
Read-only

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.

Inputs: path (required), fmt, out, unit, +3 more. Returns: object

auto_plot_preflightplot preflightA
Read-only

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.

Inputs: layouts, log_limit. Returns: object

auto_profileprofileA
Read-only

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.

Inputs: no named parameters. Returns: object

auto_seat_healthseat healthA
Read-only

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.

Inputs: no named parameters. Returns: object

auto_sheet_buildsheet 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).

Inputs: date, save, size, frame, +10 more. Returns: object

auto_sheet_discoversheet discoverA
Read-only

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.

Inputs: root (required), exclude, include, max_drawings, +1 more. Returns: object

auto_sheet_setsheet 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.

Inputs: pin, order, entries, exclude, +8 more. Returns: object

auto_source_listsource listA
Read-only

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.

Inputs: path (required), fmt, out, kind, +4 more. Returns: object

auto_xref_repairxref 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.

Inputs: reload, dry_run, attempts, max_files, +1 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to create, read, validate and revise engineering drawings — mechanical parts, architectural floor plans, P&IDs, dimensions and ISO GD&T tolerance checks — either by driving a live AutoCAD session over COM on Windows or headlessly through ezdxf anywhere. Typed tool packs cover symbol libraries, standards-compliant layers and title blocks, takeoff workbooks, and critique of drawings made by others.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to drive a live AutoCAD seat over COM or run fully headless through ezdxf, producing mechanical parts, floor plans, and P&ID sheets with ISO-compliant dimensions, tolerances, frames, and title blocks. It also reads existing drawings back for critique, topology and scale checks, diffing, and pipe, cable, or data takeoffs into CSV/XLSX workbooks.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables source-preserving import and analysis of EPLAN export reports (devices, connections, PLC I/O, terminals, cables, parts, network, pages) as immutable queryable snapshots, plus inspection of DXF/PDF/DWG drawings and derivation of electrical project evidence. Works offline without EPLAN, supporting querying, duplicate/endpoint checks, revision comparison, and verified JSON export.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to work with AutoCAD/Plant 3D drawings either live through COM or headlessly through DXF, supporting drawing creation and editing, entity queries, block attributes, dimensions, Excel round-trips, support-register QA, and PDF/PNG/SVG export for piping and pipe-support workflows.
      50
      MIT