Skip to main content
Glama
hp-mcp-autocad

hp-mcp-autocad

by HuuPhucGL

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HP_MCP_TAT_AN_TOANNoSet to `1` to disable all safety locks. Not recommended.
AUTOCAD_MCP_BACKENDNoBackend to use: `auto` (default; uses AutoCAD if available, otherwise falls back to ezdxf), `file_ipc` (requires AutoCAD), or `ezdxf` (no AutoCAD needed).auto
AUTOCAD_MCP_IPC_DIRNoDirectory used for command file exchange between the Python server and the AutoCAD LISP dispatcher (must match the LISP side).C:/temp
AUTOCAD_MCP_ONLY_TEXTNoDisable screen capture of the drawing.false
AUTOCAD_MCP_IPC_TIMEOUTNoTimeout for each command, in seconds (1–300).10.0

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
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
drawingA

Drawing file management.

Operations: create — Create a new empty drawing. data: {name?} open — Open an existing drawing. data: {path} info — Get drawing extents, entity count, layers, blocks. save — Save current drawing. data: {path?} (saves to path if given, else QSAVE) save_as_dxf — Export as DXF. data: {path} plot_pdf — Plot to PDF. data: {path} purge — Purge unused objects. get_variables — Get system variables. data: {names: [...]} undo — Undo last operation. redo — Redo last undone operation.

HP safety rules (ask the user before unlocking): create erases ALL entities: refused on a non-empty drawing unless data.xac_nhan_xoa = true. save / save_as_dxf / plot_pdf never overwrite an existing file (or QSAVE over the open drawing) unless data.ghi_de = true; a new "YYMMDD - name" path is suggested instead.

entityA

Entity creation, querying, and modification.

Create operations: create_line — x1, y1, x2, y2, layer? create_circle — data: {cx, cy, radius}, layer? create_polyline — points: [[x,y],...], data: {closed?}, layer? create_rectangle — x1, y1, x2, y2, layer? create_arc — data: {cx, cy, radius, start_angle, end_angle}, layer? create_ellipse — data: {cx, cy, major_x, major_y, ratio}, layer? create_mtext — data: {x, y, width, text, height?}, layer? create_hatch — entity_id, data: {pattern?}

Read operations: list — layer? → list entities count — layer? → count entities get — entity_id → entity details

Modify operations: copy — entity_id, data: {dx, dy} move — entity_id, data: {dx, dy} rotate — entity_id, data: {cx, cy, angle} scale — entity_id, data: {cx, cy, factor} mirror — entity_id, x1, y1, x2, y2 offset — entity_id, data: {distance} array — entity_id, data: {rows, cols, row_dist, col_dist} fillet — data: {id1, id2, radius} chamfer — data: {id1, id2, dist1, dist2} erase — entity_id

layerA

Layer creation and management.

Operations: list — List all layers with properties. create — data: {name, color?, linetype?} set_current — data: {name} set_properties — data: {name, color?, linetype?, lineweight?} freeze — data: {name} thaw — data: {name} lock — data: {name} unlock — data: {name}

blockA

Block definition, insertion, and attribute management.

Operations: list — List all block definitions. insert — data: {name, x, y, scale?, rotation?, block_id?} insert_with_attributes — data: {name, x, y, scale?, rotation?, attributes: {tag: value}} get_attributes — data: {entity_id} update_attribute — data: {entity_id, tag, value} define — data: {name, entities: [{type, ...}]}

annotationA

Annotation: text, dimensions, and leaders.

Operations: create_text — data: {x, y, text, height?, rotation?, layer?} create_dimension_linear — data: {x1, y1, x2, y2, dim_x, dim_y} create_dimension_aligned — data: {x1, y1, x2, y2, offset} create_dimension_angular — data: {cx, cy, x1, y1, x2, y2} create_dimension_radius — data: {cx, cy, radius, angle} create_leader — data: {points: [[x,y],...], text}

pidA

P&ID drawing with CTO symbol library.

Operations: setup_layers — Create standard P&ID layers. insert_symbol — data: {category, symbol, x, y, scale?, rotation?} list_symbols — data: {category} draw_process_line — data: {x1, y1, x2, y2} connect_equipment — data: {x1, y1, x2, y2} add_flow_arrow — data: {x, y, rotation?} add_equipment_tag — data: {x, y, tag, description?} add_line_number — data: {x, y, line_num, spec} insert_valve — data: {x, y, valve_type, rotation?, attributes?} insert_instrument — data: {x, y, instrument_type, rotation?, tag_id?, range_value?} insert_pump — data: {x, y, pump_type, rotation?, attributes?} insert_tank — data: {x, y, tank_type, scale?, attributes?}

viewA

Viewport control and screenshot capture.

Operations: zoom_extents — Zoom to show all entities. zoom_window — Zoom to window: x1, y1, x2, y2 get_screenshot — Capture current view as PNG image.

systemB

Server status and management.

Operations: status — Backend info, capabilities, health check. health — Quick health check (ping backend). get_backend — Return current backend name and capabilities. runtime — Return process/runtime details for spawn diagnostics. init — Re-initialize the backend. execute_lisp — Execute arbitrary AutoLISP code (File IPC only). data: {code} batch — Run many commands in one round-trip + one UNDO group (File IPC only). data: {commands: [{command, params}, ...]} e.g. {"commands": [ {"command": "create-line", "params": {"x1":0,"y1":0,"x2":100,"y2":0}}, {"command": "create-text", "params": {"x":10,"y":10,"text":"Phòng ngủ","height":25}} ]} Far faster than one call per entity; use for bulk drawing.

HP safety rules (ask the user before unlocking): execute_lisp with erase/delete/purge code is refused unless data.cho_phep_xoa = true. batch never accepts drawing-create, execute-lisp, drawing-purge or nested batch; batch with entity-erase needs data.cho_phep_xoa = true.

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 8 tools

Disambiguation3/5

Several operations overlap: insert_symbol(category) vs insert_valve/insert_instrument/insert_pump/insert_tank, and block.insert also places symbols; connect_equipment vs draw_process_line vs entity.create_line all draw lines; create_text vs create_mtext vs add_equipment_tag all place text. Grouping helps, but an agent must guess which layer of abstraction to use for the same visual result.

Naming Consistency4/5

Most names follow verb_noun snake_case (create_line, insert_symbol, zoom_extents, set_current), and namespacing by group keeps bare nouns like list/get/count unambiguous. Minor deviations: bare verb operations (create, open, info, save, undo) and kebab-case in the batch examples (create-line, create-text) drift from the tool naming convention.

Tool Count3/5

Eight groups is tidy, but the actual operation surface is roughly 70 commands, well past the comfortable range for one server. The domain breadth justifies much of it, yet P&ID-specific inserts duplicate generic entity/block operations and could be trimmed.

Completeness4/5

Coverage is broad: entity CRUD plus transforms, layers, blocks with attributes, dimensions/leaders, drawing file lifecycle, plotting, viewport screenshots, and a batch escape hatch. Gaps remain in modifying or deleting P&ID-specialized items (tags, line numbers, valves) and no layer delete or text-edit operation.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues