The plugin provides a cadcraft stdio service that by default runs a cadcraft-cli mcp Headless session. If the task requires operating a running desktop application, you can connect to its 127.0.0.1:PORT control service; in the host MCP configuration, change the startup argument to launch.py --connect 127.0.0.1:PORT. A Headless MCP process maintains only its own drawing state; hand off between different processes using saved files.
Operations
list_commandsdiscover the current command ID, parameter text, and enabled state.command_line {"text":"rectang 0,0 100,60"}simulates step-by-step prompts;execute {"command":"circle","params":{"center":[10,10],"radius":4}}directly executes JSON and is usually better suited for precise automation. Programmatic invocation does not pop up interactive dialogs.inspect_drawingandquery_entitiesinspect entities, layers, and coordinates;renderreturns a PNG of the drawing. After connecting to the desktop,screenshot、ui_inspectare additionally available.ui_click。save {"path":"/absolute/output.dxf"}, then reopen and re-check key content; saving or opening is a file write/read operation, so determine the path and overwrite authorization first.
execute in isError should be treated as a failure.command_line may report command errors in the error field of a normal MCP result; also check that field and the current running / prompt. If constraint solving reports failure, check constraint state and geometry; do not substitute a successful command return for acceptance.
The desktop bridge may resend the same request after a transport failure; on timeout or disconnection, treat side effects such as creation/deletion asresult unknown, first query the current drawing or reopen the saved file to confirm whether it has taken effect before deciding on subsequent actions. Canceling an interactive command may retain partially drawn content; when the original state needs to be restored, check and explicitly perform undo. For scripts or multi-command tasks, save the handle and expected entity snapshot after each important step.