Drawing MCP Server
v0.2.13Read, query, edit and render DWG drawings with AI.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
cad.license_status Account and allowance
The signed-in account, plan, trial and remaining allowance from the latest authorization. Anonymous use reports no account.
cad.sign_in Sign in to your Drawing MCP Server account
Start browser sign-in for this computer and return the link at once. It does not wait: signing up for the first time means an emailed code and accepting the product agreements, which no tool call can sit through. Give the user the link, then call cad.license_status when they say they have finished to confirm the account.
cad.show_document
Show an open drawing in an interactive image viewer with pan, zoom, a layer list to switch layers on and off, and model/layout/block/named-view switching. onlyLayers, hideLayers and onlyHandles open it already showing only part of the drawing. Falls back to a PNG in clients without MCP Apps.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
hideLayers | array | Hide these layers. |
onlyHandles | array | Show only these entities (hex handles). |
onlyLayers | array | Show only these layers (names, any case). |
cad.list_roots Folders this server may read drawings from
List the folders this server may open drawings from. Call this first: cad.open_file only accepts a rootUri from here.
cad.open_file
Open a DWG read-only and return a documentId plus a summary (version, counts, and how much of it this build decodes). Every other tool needs the documentId.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path relative to that root. |
rootUri * | string | A uri from cad.list_roots. |
cad.close_file
Close this session's document and free its memory. A stored drawing reference can be used again to reopen the original file; in-memory edits are session-local and are discarded on close or reconnect.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
cad.list_documents Drawings open in this session
List the drawings this session currently has open. This is not a library of available drawings: it starts empty and only reports what cad.open_file, cad.open_uploaded_file or cad.create_document opened.
cad.document_info
Re-read a document's summary — counts and decode coverage. Useful after an edit, when the counts may have moved.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
cad.move_entities
Translate entities by a world-space offset [dx, dy, dz], atomically and in memory: all of them move or none do. Works on LINE, CIRCLE, ARC, POINT and 3DFACE (the families with a byte-exact writer); circles and arcs with a non-default extrusion are refused. Other types are refused by name. Hosted created drawings auto-save; other drawings use cad.save_as. Rotate and scale are not available yet.
| Parameter | Type | Description |
|---|---|---|
delta * | array | [dx, dy, dz] in drawing units. |
documentId * | string | documentId from cad.open_file or cad.create_document. |
handles * | array | Hex entity handles. |
cad.update_entities
Change the layer, ACI color, linetype, linetype scale, lineweight or visibility of existing entities, atomically and in memory: all change or none do. This is how to move entities to another layer (create it first with cad.create_symbol). Works on LINE, CIRCLE, ARC, POINT, 3DFACE, TEXT, MTEXT, INSERT, LWPOLYLINE, ELLIPSE, SOLID, SPLINE and HATCH (the families with a byte-exact writer); other types, such as dimensions, are refused by name. Omitted properties are left alone. Hosted stored drawings auto-save; other drawings use cad.save_as.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
handles * | array | Hex entity handles. |
color | integer | ACI color: 0 BYBLOCK, 256 BYLAYER. Replaces any true color. |
layer | string | Existing layer name. |
linetype | string | BYLAYER, BYBLOCK, CONTINUOUS or an existing linetype name. |
linetypeScale | number | |
lineweight | integer | Lineweight index; 29 is BYLAYER. |
visible | boolean |
cad.copy_entities
Copy entities, offset by [dx, dy, dz], into the same space as the originals, atomically and in memory. Keeps layer, color and linetype. Works on LINE, CIRCLE, ARC, POINT, 3DFACE, TEXT, MTEXT, INSERT, LWPOLYLINE, ELLIPSE and SOLID; other types (SPLINE and HATCH included), and block references that carry attributes, are refused by name. Returns the new handles in input order.
| Parameter | Type | Description |
|---|---|---|
delta * | array | [dx, dy, dz] in drawing units. |
documentId * | string | documentId from cad.open_file or cad.create_document. |
handles * | array | Hex entity handles. |
cad.delete_entities
Permanently delete entities from the drawing, atomically and in memory. Works on LINE, CIRCLE, ARC, POINT, 3DFACE, TEXT, MTEXT, INSERT, LWPOLYLINE, ELLIPSE, SOLID, SPLINE and HATCH; an entity that other objects reference (such as an associative dimension's target) or a block reference with attributes is refused. There is no undo: re-open the source file to recover.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
handles * | array | Hex entity handles. |
cad.make_block
Group existing entities into a new named block definition, like BLOCK in a CAD program. The entities are moved into the block (rebased so basePoint becomes its origin). With insert true (default) one block reference is placed at basePoint where the entities were, so the drawing looks unchanged; with insert false only the definition is created. Works on LINE, CIRCLE, ARC, POINT, 3DFACE, TEXT, MTEXT, INSERT, LWPOLYLINE, ELLIPSE, SOLID, SPLINE and HATCH in one space (block references with attributes are refused); other types are refused by name. Returns the block handle and the INSERT handle.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
handles * | array | Hex entity handles, all in the same space. |
name * | string | |
basePoint | array | World point that becomes the block origin; default [0,0,0]. |
insert | boolean | Place one reference where the entities were. Default true. |
cad.set_object_properties
Atomically edit an entity or non-entity object in memory. Read cad.describe_type for writable names and value types. Non-entity edits currently require AC1032 and byte-exact verification of the object. Supports layer settings, text styles/fonts, simple linetype dashes, dimension styles, layout settings and validated dictionary entries. All hosted stored drawings, including uploads, auto-save before reporting success. Local sources use cad.save_as to create a verified new file. Complex linetypes, ownership changes and dictionary graph rewiring are refused.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
handle * | string | Hex object handle. |
properties * | object | Writable field names to typed values. References are hex strings; colors are {method,index,rgb}; simple dashes accept lengths or returned dash objects; entries are [{name,handle}]. |
cad.create_document
Create an empty native R2018 DWG without a template or source file. Hosted HTTP storage immediately saves an account-owned drawing with one-year (365-day) default retention and returns stable documentId, fileId and storedFile metadata. Entity, symbol and property edits are saved automatically and survive reconnects. Add geometry with cad.add_entities and preview with cad.show_document. Local stdio drawings stay in memory until cad.save_as.
| Parameter | Type | Description |
|---|---|---|
units | integer | INSUNITS: 0 unitless, 1 inches, 2 feet, 4 millimeters (default), 5 centimeters, 6 meters. |
cad.add_entities
Atomically add native AC1032 entities into model space (default) or blockHandle (a named block or layout blockHandle): LINE, CIRCLE, ARC, LWPOLYLINE (bulges/width/elevation), ELLIPSE, SPLINE (NURBS controlPoints or cubic fitPoints), TEXT, MTEXT, DIMENSION (linear, aligned, diameter), LEADER (optional attached MTEXT), SOLID. Points are [x,y,z]; polyline vertices [x,y]. Angles/ellipse parameters and rotations are degrees. Dimensions use the WCS XY plane and include evaluated graphics blocks; they are non-associative. Symbols must exist; create them with cad.create_symbol. Set layer, ACI color, l…
cad.create_symbol
Create a named LAYER, STYLE (text/font), LTYPE (simple dash pattern), or DIMSTYLE in a native AC1032 DWG. Copies the drawing's default entry and applies validated properties atomically. Read cad.describe_type for property names/types. Use font_name for STYLE; dashes for LTYPE; dimtxt/dimasz/dimdec for DIMSTYLE; color/linetype_handle/lineweight_index for LAYER. References are hex handles returned by creation/query tools. Returns the new handle. Symbols can then be assigned by name in cad.add_entities. Existing names are refused. Font files must be available to the renderer/CAD application; sett…
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
family * | string | |
name * | string | |
properties | object |
cad.save_as
Save current in-memory changes as a new DWG; never overwrites. Reopens and verifies all object bytes and section payloads first. Hosted HTTP storage: saves a new account-owned stored drawing (optional name) and returns fileId plus a downloadUrl to present as a link; rootUri and path are not used. Local stdio: requires rootUri and a new relative .dwg path inside the root, and returns that path.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
name | string | Hosted only: file name for the new stored drawing, e.g. plan-v2.dwg. |
path | string | Local stdio only: new relative .dwg path inside the root; parent directory must exist. |
rootUri | string | Local stdio only. |
cad.set_entity_properties
Compatibility alias for cad.set_object_properties. All hosted stored drawings, including uploads, auto-save; local source files stay unchanged. Only families with a byte-exact writer accept edits — ask cad.describe_type, whose `writable` list names the fields and, for each, the read property holding the same value. A field the family does not declare is refused before anything is changed, so a typo cannot half-apply a batch.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
handle * | string | Hex handle of the entity. |
properties * | object | Writable field name to typed value, e.g. {"Radius": 5.0}. Names come from cad.describe_type's `writable`, not from the readable property names. |
cad.list_types
List the DWG types this build decodes fields for.
cad.list_file_types
List the types actually present in one drawing, with counts and full/partial/unsupported decode counts. Use this before querying: it tells you what is in the file rather than what is possible.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
cad.describe_type
Readable fields/types and engine-supported writable fields/types. Instance decode or byte-exact writer verification may still fail explicitly. Non-entity editing is currently AC1032 only.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
type * | string | e.g. LINE, INSERT, LAYER. |
cad.get_objects
Fetch entities and non-entity objects by handle, in the order asked for. Full properties include owners, extension dictionaries, references and collections where decoded, including read-only BLOCK/ENDBLK/SEQEND markers, symbol-table controls and SORTENTSTABLE. Opaque control tails are returned with partial status. decodeStatus distinguishes full, partial and unsupported bodies. Handles that are not in the drawing come back under `missing` rather than being dropped.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
handles * | array | Hex handle strings, e.g. "1A3". |
properties | "summary" (default), "full", or an array of property names. |
cad.query_objects
Find objects by type, layer, block, layout or space, with optional exact property matches and a text search. This is the main way to explore a drawing.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
block | string | Owning block name. |
decodedOnly | boolean | Skip objects whose family this build does not decode. |
layer | string | Layer name (case-insensitive). |
layout | string | Paper-space layout name. |
limit | integer | Default 50, max 1000. |
offset | integer | |
properties | "summary" (default), "full", or names. | |
space | string | |
textContains | string | Case-insensitive substring over any string property — text, block names. |
types | array | e.g. ["INSERT","MTEXT"]. |
where | object | Exact property matches, e.g. {"closed": true}. |
cad.list_render_views
What can be drawn: model space, each paper-space layout with its viewports, and every block definition.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
cad.show_renders
Show several pictures of a drawing at once as a titled gallery, for example one image per layer, per sheet, or per detail. Each entry takes what cad.render_view takes (view, handle, onlyLayers, hideLayers, onlyHandles, region, width, height, dark) plus a title; settings given outside renders apply to every entry. Use this, rather than several cad.render_view calls, whenever the user asks for more than one image. The pictures appear in a widget; set imageForModel to be handed them yourself as well.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
renders * | array | One entry per picture, in order. |
format | string | Default png. |
height | integer | |
imageForModel | boolean | Hand the picture to you as an image block as well. Off by default where the host draws the widget: the user already sees the render, and the image block is the same bytes again. Set it true when you n… |
width | integer | Default width for every entry; 800 keeps eight pictures small. |
cad.render_view
Render model space, a paper-space sheet, or one block, as SVG or PNG. The picture appears in a widget for the user; set imageForModel to be handed it yourself. The result carries diagnostics — what was drawn, culled, or missing a font — so a thin-looking drawing can be explained rather than guessed at.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
background | string | Canvas background for PNG and SVG: any #RRGGBB color, white, black, or transparent. Defaults to opaque white (black when dark=true). Opaque backgrounds automatically select the light/dark drawing pale… |
dark | boolean | Legacy background choice: true=opaque black, false=opaque white. For transparent output, selects the drawing's light/dark palette. |
format | string | Default png. Ask for svg only when the caller needs vector output: model space of a real drawing can emit tens of MB of SVG, which large clients refuse to render. |
handle | string | Layout, block or named-view handle, from cad.list_render_views. Required unless view=model. |
handles | array | Zoom to these entities (hex handles) instead of giving a region. Model space or block views only. |
height | integer | Default 1000. |
hideLayers | array | Do not draw these layers. Combines with onlyLayers. |
imageForModel | boolean | Hand the picture to you as an image block as well. Off by default where the host draws the widget: the user already sees the render, and the image block is the same bytes again. Set it true when you n… |
layer | string | Zoom to everything on this layer (case-insensitive). |
onlyHandles | array | Draw only these entities (hex handles) of the viewed space; a block reference stands for everything it places. Unlike handles/layer, which only zoom, this hides everything else. |
onlyLayers | array | Draw only these layers (names, any case). A view of a few layers is fitted to what remains unless region is given. Layer names come from cad.query_objects or the layers list of cad.show_document. |
region | array | [minX, minY, maxX, maxY] in drawing units. Omit to fit the whole view. |
showLineweights | boolean | Draw stored lineweights. Off by default: heavy weights hide detail. |
text | string | Zoom to TEXT/MTEXT containing this string (case-insensitive). Filters combine with AND; ignored if region is set. |
title | string | Caption shown under the picture. |
view | string | Default model. |
width | integer | Default 1600. |
cad.viewer_render
Refresh the authenticated viewer image or 3D geometry without consuming tool-call allowance.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
viewerToken * | string | |
background | string | Canvas background for PNG and SVG: any #RRGGBB color, white, black, or transparent. Defaults to opaque white (black when dark=true). Opaque backgrounds automatically select the light/dark drawing pale… |
dark | boolean | Legacy background choice: true=opaque black, false=opaque white. For transparent output, selects the drawing's light/dark palette. |
format | string | Default png. Ask for svg only when the caller needs vector output: model space of a real drawing can emit tens of MB of SVG, which large clients refuse to render. |
handle | string | Layout, block or named-view handle, from cad.list_render_views. Required unless view=model. |
handles | array | Zoom to these entities (hex handles) instead of giving a region. Model space or block views only. |
height | integer | Default 1000. |
hideLayers | array | Do not draw these layers. Combines with onlyLayers. |
layer | string | Zoom to everything on this layer (case-insensitive). |
mode | string | Default 2d. 3d exports model-space GPU geometry for local orbiting. |
onlyHandles | array | Draw only these entities (hex handles) of the viewed space; a block reference stands for everything it places. Unlike handles/layer, which only zoom, this hides everything else. |
onlyLayers | array | Draw only these layers (names, any case). A view of a few layers is fitted to what remains unless region is given. Layer names come from cad.query_objects or the layers list of cad.show_document. |
region | array | [minX, minY, maxX, maxY] in drawing units. Omit to fit the whole view. |
showLineweights | boolean | Draw stored lineweights. On by default in the viewer. |
text | string | Zoom to TEXT/MTEXT containing this string (case-insensitive). Filters combine with AND; ignored if region is set. |
title | string | Caption shown under the picture. |
view | string | Default model. |
viewport | array | [minX, minY, maxX, maxY] actually on screen, when region asks for more. Not drawn; remembered as the camera. |
width | integer | Default 1600. |
cad.create_block
Create an empty named local block definition. basePoint defaults to [0,0,0]. Populate it using cad.add_entities with its returned handle as blockHandle, then place instances using cad.insert_block.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
name * | string | |
basePoint | array |
cad.insert_block
Place an existing local block definition. position uses target-space coordinates; scale defaults to [1,1,1], rotation is degrees. targetBlockHandle defaults to model space; use a named block or layout blockHandle to place it there. layer names an existing layer for the new reference (default: the current layer). Cyclic references are refused.
| Parameter | Type | Description |
|---|---|---|
blockHandle * | string | Hex object handle. |
documentId * | string | documentId from cad.open_file or cad.create_document. |
position * | array | |
layer | string | Existing layer name; create it first with cad.create_symbol. |
rotation | number | |
scale | array | |
targetBlockHandle | string | Hex object handle. |
cad.create_layout
Create a paper-space sheet with paperWidth/paperHeight in millimetres. Returns layout handle, blockHandle for paper geometry and overall viewportHandle. Add model windows using cad.create_viewport. Render using view=layout and the layout handle.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | documentId from cad.open_file or cad.create_document. |
name * | string | |
paperHeight * | number | |
paperWidth * | number |
cad.create_view
Save a named untwisted orthographic top view: center [x,y], width and height in model units. Render using view=named and its handle, or place it on a sheet using cad.create_viewport.
| Parameter | Type | Description |
|---|---|---|
center * | array | |
documentId * | string | documentId from cad.open_file or cad.create_document. |
height * | number | |
name * | string | |
width * | number |
cad.create_viewport
Place a saved top view on a paper layout. center [x,y], width and height use paper millimetres. Copies the camera and fits the complete view preserving aspect ratio; later named-view edits do not change the window. The layout's overall viewport is managed automatically.
| Parameter | Type | Description |
|---|---|---|
center * | array | |
documentId * | string | documentId from cad.open_file or cad.create_document. |
height * | number | |
layoutHandle * | string | Hex object handle. |
viewHandle * | string | Hex object handle. |
width * | number |
cad.report_issue Report an issue
Email a sanitized Drawing MCP Server issue to the maintainer. Show the report for review and call only after explicit user approval. Free of CAD call quota; no drawing or credentials are attached automatically. Generate one UUID reportId and preserve the exact payload for authorized retries; never retry automatically after a timeout. Optional contact requires an explicitly supplied reporterEmail; no account lookup is performed. Optional host-supplied attachment bytes only: never invent base64 or read server paths.
| Parameter | Type | Description |
|---|---|---|
approved * | boolean | User approved this report and every attachment. |
body * | string | |
reportId * | string | |
title * | string | |
attachments | array | User-approved txt/log/json/csv/png/jpg/jpeg/pdf bytes, 5 MiB combined. DWGs and filesystem paths are not accepted. |
contactPreference | string | |
environment | object | |
reporterEmail | string | Explicit contact address only for opted-in contact. Omit for none. |