Drawing MCP Server

v0.2.13
net.dmytro-prototypes/drawing-mcp-server Checked 32 minutes ago Published 13 days ago

Read, 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
hideLayersarrayHide these layers.
onlyHandlesarrayShow only these entities (hex handles).
onlyLayersarrayShow 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.

ParameterTypeDescription
path *stringPath relative to that root.
rootUri *stringA 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.

ParameterTypeDescription
documentId *stringdocumentId 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.

ParameterTypeDescription
documentId *stringdocumentId 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.

ParameterTypeDescription
delta *array[dx, dy, dz] in drawing units.
documentId *stringdocumentId from cad.open_file or cad.create_document.
handles *arrayHex 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
handles *arrayHex entity handles.
colorintegerACI color: 0 BYBLOCK, 256 BYLAYER. Replaces any true color.
layerstringExisting layer name.
linetypestringBYLAYER, BYBLOCK, CONTINUOUS or an existing linetype name.
linetypeScalenumber
lineweightintegerLineweight index; 29 is BYLAYER.
visibleboolean

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.

ParameterTypeDescription
delta *array[dx, dy, dz] in drawing units.
documentId *stringdocumentId from cad.open_file or cad.create_document.
handles *arrayHex 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
handles *arrayHex 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
handles *arrayHex entity handles, all in the same space.
name *string
basePointarrayWorld point that becomes the block origin; default [0,0,0].
insertbooleanPlace 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
handle *stringHex object handle.
properties *objectWritable 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.

ParameterTypeDescription
unitsintegerINSUNITS: 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…

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
family *string
name *string
propertiesobject

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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
namestringHosted only: file name for the new stored drawing, e.g. plan-v2.dwg.
pathstringLocal stdio only: new relative .dwg path inside the root; parent directory must exist.
rootUristringLocal 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
handle *stringHex handle of the entity.
properties *objectWritable 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.

ParameterTypeDescription
documentId *stringdocumentId 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
type *stringe.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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
handles *arrayHex 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
blockstringOwning block name.
decodedOnlybooleanSkip objects whose family this build does not decode.
layerstringLayer name (case-insensitive).
layoutstringPaper-space layout name.
limitintegerDefault 50, max 1000.
offsetinteger
properties"summary" (default), "full", or names.
spacestring
textContainsstringCase-insensitive substring over any string property — text, block names.
typesarraye.g. ["INSERT","MTEXT"].
whereobjectExact 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.

ParameterTypeDescription
documentId *stringdocumentId 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
renders *arrayOne entry per picture, in order.
formatstringDefault png.
heightinteger
imageForModelbooleanHand 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…
widthintegerDefault 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
backgroundstringCanvas 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…
darkbooleanLegacy background choice: true=opaque black, false=opaque white. For transparent output, selects the drawing's light/dark palette.
formatstringDefault 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.
handlestringLayout, block or named-view handle, from cad.list_render_views. Required unless view=model.
handlesarrayZoom to these entities (hex handles) instead of giving a region. Model space or block views only.
heightintegerDefault 1000.
hideLayersarrayDo not draw these layers. Combines with onlyLayers.
imageForModelbooleanHand 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…
layerstringZoom to everything on this layer (case-insensitive).
onlyHandlesarrayDraw 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.
onlyLayersarrayDraw 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.
regionarray[minX, minY, maxX, maxY] in drawing units. Omit to fit the whole view.
showLineweightsbooleanDraw stored lineweights. Off by default: heavy weights hide detail.
textstringZoom to TEXT/MTEXT containing this string (case-insensitive). Filters combine with AND; ignored if region is set.
titlestringCaption shown under the picture.
viewstringDefault model.
widthintegerDefault 1600.

cad.viewer_render

Refresh the authenticated viewer image or 3D geometry without consuming tool-call allowance.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
viewerToken *string
backgroundstringCanvas 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…
darkbooleanLegacy background choice: true=opaque black, false=opaque white. For transparent output, selects the drawing's light/dark palette.
formatstringDefault 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.
handlestringLayout, block or named-view handle, from cad.list_render_views. Required unless view=model.
handlesarrayZoom to these entities (hex handles) instead of giving a region. Model space or block views only.
heightintegerDefault 1000.
hideLayersarrayDo not draw these layers. Combines with onlyLayers.
layerstringZoom to everything on this layer (case-insensitive).
modestringDefault 2d. 3d exports model-space GPU geometry for local orbiting.
onlyHandlesarrayDraw 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.
onlyLayersarrayDraw 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.
regionarray[minX, minY, maxX, maxY] in drawing units. Omit to fit the whole view.
showLineweightsbooleanDraw stored lineweights. On by default in the viewer.
textstringZoom to TEXT/MTEXT containing this string (case-insensitive). Filters combine with AND; ignored if region is set.
titlestringCaption shown under the picture.
viewstringDefault model.
viewportarray[minX, minY, maxX, maxY] actually on screen, when region asks for more. Not drawn; remembered as the camera.
widthintegerDefault 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.

ParameterTypeDescription
documentId *stringdocumentId from cad.open_file or cad.create_document.
name *string
basePointarray

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.

ParameterTypeDescription
blockHandle *stringHex object handle.
documentId *stringdocumentId from cad.open_file or cad.create_document.
position *array
layerstringExisting layer name; create it first with cad.create_symbol.
rotationnumber
scalearray
targetBlockHandlestringHex 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.

ParameterTypeDescription
documentId *stringdocumentId 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.

ParameterTypeDescription
center *array
documentId *stringdocumentId 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.

ParameterTypeDescription
center *array
documentId *stringdocumentId from cad.open_file or cad.create_document.
height *number
layoutHandle *stringHex object handle.
viewHandle *stringHex 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.

ParameterTypeDescription
approved *booleanUser approved this report and every attachment.
body *string
reportId *string
title *string
attachmentsarrayUser-approved txt/log/json/csv/png/jpg/jpeg/pdf bytes, 5 MiB combined. DWGs and filesystem paths are not accepted.
contactPreferencestring
environmentobject
reporterEmailstringExplicit contact address only for opted-in contact. Omit for none.