Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
AUTOCAD_MCP_BACKENDNoThe engine used by the server: `auto` | `ezdxf` | `com`. `auto` (the default) picks `com` if a running AutoCAD instance can be reached on Windows, else falls back to `ezdxf` (headless, no AutoCAD installation needed). In `auto` mode the check is repeated on every tool call until it upgrades to `com`; it never downgrades automatically.auto
AUTOCAD_MCP_WORKSPACENoConfines every file-path argument (open/save, block import, preview output) to this directory tree. Unset = unrestricted.
AUTOCAD_MCP_ALLOW_RAW_COMMANDSNoMust be `1` to enable `autocad_send_command` (raw AutoCAD command-line / AutoLISP on a live session). A guardrail, not a sandbox. Unset by default.

Instructions

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

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
autocad_new_documentA

Create a new, empty drawing and make it the active document.

Discards any in-memory (unsaved) drawing held by the ezdxf backend. The default freestanding backend starts with one empty drawing ready to use.

Args: params (NewDocumentInput): - path (Optional[str]): '.dxf' (ezdxf) or '.dwg' (COM) file to write immediately; omit to keep the drawing unsaved. - units (DrawingUnits): 'in' | 'ft' | 'mm' | 'cm' | 'm' (default 'mm').

Returns: str: JSON {"status", "backend", "units", ...}; "path" appears when saved.

autocad_open_documentA

Open an existing drawing file and make it the active document.

Args: params (OpenDocumentInput): - path (str): existing '.dxf' (ezdxf) or '.dwg' (COM) file path.

Returns: str: JSON {"status": "opened", "backend", "path"}.

autocad_save_documentA

Save the active drawing to disk.

Args: params (SaveDocumentInput): - path (Optional[str]): target file; omit to re-save to the current path. ezdxf writes '.dxf', COM writes '.dwg'.

Returns: str: JSON {"status": "saved", "backend", "path"}.

autocad_get_document_infoA

Summarize the active drawing: backend, units, layers, entity count, extents.

Use this first to learn which backend is active and what the drawing contains.

Returns: str: JSON {"backend", "path", "units", "entity_count", "layers": [...], "extents": {"min", "max"} | null}.

autocad_connection_statusA

Report which backend is active and whether live AutoCAD is reachable.

Never launches AutoCAD — it only checks whether a running instance can be attached to. Use this before drawing to confirm you are actually about to draw inside live AutoCAD rather than the headless ezdxf fallback.

Returns: str: JSON {"active_backend": "com"|"ezdxf", "platform", "pywin32_available", "live_autocad_reachable", "backend_selection_mode": "auto"|"ezdxf"|"com"}.

autocad_set_drawing_unitsA

Apply the Drawing Units dialog settings and verify each was accepted.

Defaults to the project's standard Engineering template (Engineering length at 0.000 precision, Decimal Degrees angle, counter-clockwise, Inches insertion scale, International lighting units). Safe to call repeatedly — setting the same values twice is a no-op.

Args: params (SetDrawingUnitsInput): - length_type, length_precision, angle_type, angle_precision, clockwise, insertion_scale, lighting_units — see field docs.

Returns: str: JSON {"status", "backend", "applied": {var: value}, "verified": {var: bool}, "warnings"?: [...]}. Check "verified" before trusting a setting took effect — a variable AutoCAD rejects is reported there, not hidden.

autocad_create_boundaryA

Create (or reuse) a sheet boundary on the SHEET_BOUNDARY layer.

Idempotent: if a boundary already exists on the target layer, it is reused and reported back instead of creating a duplicate — pass replace=true to delete and recreate it instead. Zooms to the boundary extents on the COM backend.

Args: params (CreateBoundaryInput): - shape ('rectangle'|'circle'|'polyline') plus its matching fields (corner1/corner2, or center/radius, or points). - margin (float): space reserved for annotations, inset from the boundary on every side (default 0). - layer (str): default 'SHEET_BOUNDARY'. - replace (bool): force recreation instead of reusing (default False).

Returns: str: JSON {"status": "created"|"reused", "handle", "type", "extents", "usable_extents", "usable_area", "margin"}.

autocad_check_fits_boundaryA

Check whether proposed geometry fits inside the sheet boundary's usable area.

Never distorts or scales the points — it only reports whether they fit, so dimensions are never silently changed to force a fit.

Args: params (CheckFitsBoundaryInput): - points (list[Point]): corners (or any representative points) of the proposed geometry. - layer (str): boundary layer to check against (default 'SHEET_BOUNDARY'). - margin (float): annotation margin to subtract, matching the value used when the boundary was created (default 0).

Returns: str: JSON {"fits": bool, "boundary_usable_extents", "requested_extents"}.

autocad_initialize_drawingA

Idempotent one-call setup: apply drawing units, then create/reuse the sheet boundary.

Composes autocad_set_drawing_units and autocad_create_boundary. Reuses the active document (never discards it) and reuses an existing boundary on the target layer rather than duplicating it, so calling this more than once is safe.

Args: params (InitializeDrawingInput): - boundary (CreateBoundaryInput): required; see autocad_create_boundary. - units (SetDrawingUnitsInput): optional; defaults to the Engineering template.

Returns: str: JSON {"units": {...}, "boundary": {...}} — see the two underlying tools.

autocad_create_layerA

Create a layer, or update its color/linetype if it already exists.

Args: params (CreateLayerInput): - name (str): layer name, e.g. 'WALLS'. - color (int): ACI color index 0-256 (default 7). - linetype (str): e.g. 'CONTINUOUS', 'DASHED' (default CONTINUOUS).

Returns: str: JSON {"status": "created"|"updated", "name", "color", "linetype"}; includes "warning" when the requested linetype was unavailable.

autocad_list_layersA

List all layers in the active drawing with their color and linetype.

Returns: str: JSON {"count", "layers": [{"name", "color", "linetype"}, ...]}.

autocad_delete_layerA

Delete a layer. Fails if the layer still has entities on it, or is '0'/'Defpoints'.

Args: params (DeleteLayerInput): - name (str): layer to delete.

Returns: str: JSON {"status": "deleted", "name"}.

autocad_set_layer_stateA

Freeze/thaw, lock/unlock, or turn a layer on/off. Only given fields change.

Args: params (SetLayerStateInput): - name (str): layer to update (auto-created if missing). - frozen, locked, off (Optional[bool]): give at least one.

Returns: str: JSON {"status": "updated", "name", "frozen", "locked", "off"}.

autocad_set_current_layerA

Make a layer current (auto-created if missing). Mainly affects a live AutoCAD UI.

Args: params (SetCurrentLayerInput): - name (str): layer to make current.

Returns: str: JSON {"status": "updated", "current_layer"}.

autocad_create_lineA

Draw a straight line segment.

Args: params (CreateLineInput): - start, end (Point): endpoints, e.g. {"x": 0, "y": 0}. - layer (str): target layer (auto-created if missing; default '0').

Returns: str: JSON {"status": "created", "type": "LINE", "handle", "layer"}.

autocad_create_polylineA

Draw a 2D polyline through a list of vertices.

Args: params (CreatePolylineInput): - points (list[Point]): 2-1000 vertices in order. - closed (bool): join last vertex back to first (default false). - layer (str): target layer (default '0').

Returns: str: JSON {"status": "created", "type": "LWPOLYLINE", "handle", "layer"}.

autocad_create_circleB

Draw a circle.

Args: params (CreateCircleInput): - center (Point): circle center. - radius (float): radius in drawing units (> 0). - layer (str): target layer (default '0').

Returns: str: JSON {"status": "created", "type": "CIRCLE", "handle", "layer"}.

autocad_create_arcA

Draw an arc, counter-clockwise from start angle to end angle.

Args: params (CreateArcInput): - center (Point), radius (float > 0) - start_angle, end_angle (float): DEGREES, 0 = east/+X, CCW positive. - layer (str): target layer (default '0').

Returns: str: JSON {"status": "created", "type": "ARC", "handle", "layer"}.

autocad_create_textB

Draw a single-line text.

Args: params (CreateTextInput): - position (Point): lower-left insertion point. - text (str): content (max 255 characters). - height (float): text height in drawing units (default 2.5). - layer (str): target layer (default '0').

Returns: str: JSON {"status": "created", "type": "TEXT", "handle", "layer"}.

autocad_query_entitiesA

List entities in the drawing, optionally filtered by layer or type.

Args: params (QueryEntitiesInput): - layer (Optional[str]): only this layer. - entity_type (Optional[str]): 'LINE', 'LWPOLYLINE', 'CIRCLE', 'ARC', 'TEXT'. - limit (int): page size 1-500 (default 50). - offset (int): skip N matches (pagination).

Returns: str: JSON {"total", "count", "offset", "has_more", "next_offset", "entities": [{"handle", "type", "layer", "geometry"}, ...]}.

autocad_get_entityA

Get one entity by handle, including its geometry.

Args: params (GetEntityInput): - handle (str): hex handle from a create/query tool, e.g. '1A4'.

Returns: str: JSON {"handle", "type", "layer", "geometry"}; "Error (...)": message if the handle is unknown.

autocad_delete_entityB

Delete one entity by handle. This cannot be undone via MCP.

Args: params (DeleteEntityInput): - handle (str): hex handle from a create/query tool.

Returns: str: JSON {"status": "deleted", "handle"}.

autocad_delete_entitiesA

Delete several entities by handle in one call. Partial failures are reported, not raised.

Args: params (DeleteEntitiesInput): - handles (list[str]): 1-500 hex handles.

Returns: str: JSON {"deleted": [...], "errors": [{"handle", "error"}, ...]}.

autocad_move_entityC

Move an entity in place by (dx, dy, dz).

Args: params (MoveEntityInput): - handle (str): entity to move. - dx, dy, dz (float): displacement in drawing units (dz default 0).

Returns: str: JSON {"status": "moved", "handle", "type"}.

autocad_copy_entityA

Copy an entity, offset by (dx, dy, dz). The original is left unchanged.

Args: params (CopyEntityInput): - handle (str): entity to copy. - dx, dy, dz (float): displacement in drawing units (dz default 0).

Returns: str: JSON {"status": "created", "type", "handle" (of the new copy), "source"}.

autocad_rotate_entityB

Rotate an entity in place about a base point.

Args: params (RotateEntityInput): - handle (str): entity to rotate. - base (Point): pivot point. - angle (float): DEGREES, counter-clockwise positive.

Returns: str: JSON {"status": "rotated", "handle", "type"}.

autocad_scale_entityB

Uniformly scale an entity in place about a base point.

Args: params (ScaleEntityInput): - handle (str): entity to scale. - base (Point): fixed point. - factor (float): scale factor (> 0).

Returns: str: JSON {"status": "scaled", "handle", "type"}.

autocad_mirror_entityA

Create a mirrored copy of an entity across a line. The original is left unchanged.

Args: params (MirrorEntityInput): - handle (str): entity to mirror. - p1, p2 (Point): two distinct points defining the mirror line.

Returns: str: JSON {"status": "created", "type", "handle" (of the mirrored copy), "source"}.

autocad_array_linearA

Create a linear array of copies of an entity (the original counts as the first instance).

Args: params (ArrayLinearInput): - handle (str): entity to array. - count (int): total instances including the original (2-500). - dx, dy, dz (float): spacing between successive instances.

Returns: str: JSON {"status": "created", "count", "handles": [original, ...copies]}.

autocad_array_polarA

Create a polar (circular) array of copies of an entity around a center point.

Args: params (ArrayPolarInput): - handle (str): entity to array. - center (Point): center of the array. - count (int): total instances including the original (2-500). - angle (float): total DEGREES to fill; 360 spaces instances evenly around a full circle.

Returns: str: JSON {"status": "created", "count", "handles": [original, ...copies]}.

autocad_create_hatchA

Draw a closed boundary polyline and fill it with a hatch pattern.

Args: params (CreateHatchInput): - boundary (list[Point]): 3-1000 vertices (implicitly closed). - pattern (str): e.g. 'SOLID', 'ANSI31' (default 'SOLID'). - scale (float): pattern scale, ignored for SOLID (default 1.0). - layer (str): layer for both the boundary and the hatch (default 'HATCH').

Returns: str: JSON {"status": "created", "type": "HATCH", "boundary", "hatch", "layer"}.

autocad_dim_alignedA

Draw a true-distance dimension parallel to the line between two points.

Args: params (DimAlignedInput): - p1, p2 (Point): the two measured points. - offset (float): perpendicular distance from p1-p2 to the dimension line. - layer (str): default 'DIMENSIONS'.

Returns: str: JSON {"status": "created", "type": "DIMENSION", "handle"}.

autocad_dim_angularB

Dimension the angle at a vertex between rays to two points.

Args: params (DimAngularInput): - vertex (Point): angle vertex. - p1, p2 (Point): a point on each ray. - offset (float): radius of the dimension arc from the vertex (> 0). - layer (str): default 'DIMENSIONS'.

Returns: str: JSON {"status": "created", "type": "DIMENSION", "handle"}.

autocad_dim_radiusA

Dimension the radius or diameter of a circular feature.

Args: params (DimRadiusInput): - center (Point), radius (float > 0). - angle (float): DEGREES the leader points away from center (default 45). - diameter (bool): dimension the diameter instead of the radius (default false). - layer (str): default 'DIMENSIONS'.

Returns: str: JSON {"status": "created", "type": "DIMENSION", "handle"}.

autocad_insert_blockB

Insert a block reference, by name (already defined in the drawing) or by an external drawing file path to import.

Args: params (InsertBlockInput): - name (str): block name, or a path to an external '.dxf' file (COM backend also accepts '.dwg'). - insertion_point (Point), x_scale/y_scale/z_scale (float > 0, default 1.0). - rotation (float): DEGREES, counter-clockwise positive (default 0). - layer (str): default '0'. - attributes (Optional[dict[str, str]]): initial {tag: value} for any attributes defined on the block.

Returns: str: JSON {"status": "created", "type": "INSERT", "handle", "block"}.

autocad_list_block_attributesA

List the attribute tags/values on a block reference.

Args: params (ListBlockAttributesInput): - handle (str): handle of a block reference (INSERT entity).

Returns: str: JSON {"handle", "block", "attributes": [{"tag", "value"}, ...]}.

autocad_set_block_attributeB

Set the value of one attribute on a block reference.

Args: params (SetBlockAttributeInput): - handle (str): handle of a block reference (INSERT entity). - tag (str): attribute tag name. - value (str): new text value.

Returns: str: JSON {"status": "updated", "handle", "tag", "value"}.

autocad_undoA

Undo the last N operations. COM backend only (needs a live AutoCAD session).

Args: params (UndoInput): - steps (int): number of operations to undo (default 1, max 50).

Returns: str: JSON {"status": "undone", "steps"}; an "Error (NotImplementedError)" message if the active backend is ezdxf.

autocad_send_commandA

Send a raw AutoCAD command-line string (or AutoLISP via (command ...)) to a live AutoCAD session. COM backend only.

DISABLED BY DEFAULT. Set AUTOCAD_MCP_ALLOW_RAW_COMMANDS=1 in the server's environment to enable it. A small denylist blocks a few especially dangerous verbs (QUIT, SHELL, NETLOAD, ...) but this is a guardrail, not a sandbox — anything the AutoCAD command line can do, this can do, including running arbitrary AutoLISP and overwriting files. Only enable it in a trusted, single-user environment.

Args: params (SendCommandInput): - command (str): raw command-line string, e.g. 'ZOOM E '.

Returns: str: JSON {"status": "sent", "command"}.

autocad_render_previewA

Render the drawing to an image file so it can be inspected without AutoCAD.

ezdxf backend: rendered headlessly via matplotlib (needs the 'preview' extra). COM backend: a screenshot of the live AutoCAD viewport.

Args: params (RenderPreviewInput): - path (str): output image path (e.g. '.png'). - width, height (int): pixel dimensions (100-4000, default 1200x800).

Returns: str: JSON {"status": "saved", "path", "width", "height"}.

autocad_draw_wallA

Draw a wall along a centerline path as two parallel faces (+ end caps).

Args: params (DrawWallInput): - points (list[Point]): centerline vertices (2-200). - thickness (float): wall thickness (default 100 drawing units). - closed (bool): closed loop, no end caps (default false). - layer (str): wall layer (default 'WALLS').

Returns: str: JSON {"status", "type": "WALL", "length", "thickness", "faces": {"left", "right"}, "end_caps": [...]}.

autocad_draw_roomB

Draw a rectangular room: outer + inner wall loops and an area label.

Args: params (DrawRoomInput): - x, y (float): lower-left corner coordinates. - width, height (float): room dimensions in drawing units. - thickness (float): wall thickness (default 100). - label (bool): draw an area text at the center (default true). - label_height (float): 0 = auto (1/12 of the smaller dimension). - layer (str): wall layer (default 'WALLS'). - text_layer (str): label layer (default 'TEXT').

Returns: str: JSON {"status", "type": "ROOM", "gross_area", "net_area", "outer", "inner", "label"?}.

autocad_add_doorA

Draw a door: leaf line + quarter-circle swing arc anchored at the hinge.

The wall itself is not trimmed — leave a gap in the wall (e.g. two separate autocad_draw_wall calls) sized to the door width, then anchor the door at the gap jamb.

Args: params (AddDoorInput): - hinge (Point): hinge-side jamb point. - width (float): door width, e.g. 900 (mm). - closed_angle (float): DEGREES along the wall for the closed door. - swing_angle (float): DEGREES of swing, + = CCW (default 90). - layer (str): door layer (default 'DOORS').

Returns: str: JSON {"status", "type": "DOOR", "width", "hinge", "leaf", "swing_arc"}.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.5/5.0

Scored across 43 tools

Disambiguation4/5

Tools are largely distinct by resource and action (document, layer, entity, dimension, block, architectural element), with clear descriptions. Minor overlap exists between single vs batch delete and between high-level composition tools (initialize_drawing) and their lower-level components, but boundaries are communicated.

Naming Consistency4/5

All tools use the autocad_ prefix and snake_case; most follow verb_noun (create_line, delete_layer, set_current_layer). A few deviate (new_document vs create_*, dim_aligned, draw_wall, add_door, connection_status), but the pattern remains predictable.

Tool Count3/5

43 tools is high for the apparent scope and exceeds the typical 3-15 range; several operations are split (delete_entity vs delete_entities, array_linear vs array_polar, dim_* into three tools) and could be consolidated. However, the domain is complex and each tool is purposeful, so it is heavy but not chaotic.

Completeness4/5

Core lifecycle for documents, layers, entities, dimensions, blocks, and architectural elements is well covered. Notable gaps include advanced editing (offset, trim, extend, fillet, chamfer, polyline vertex editing), block definition creation, and more dimension/layer property controls, though raw command and undo mitigate some.

Maintenance

ActivityMaintained
ResponsivenessNo issues