KufCad

MCP for AI assistants

Ribbon: Manage ▸ Applications ▸ MCP ServerCommand: MCPSERVERAlias: -MCPSERVER

MCP (Model Context Protocol) is the standard that lets AI assistants such as Claude Code, Claude Desktop or Cursor work with an application. KufCad has a built-in MCP server: the AI reads the drawing, measures, checks standards and — if you allow it — draws and edits directly while you see the result on screen.

Turning the server on

Click Manage ▸ Applications ▸ MCP Server or type MCPSERVER:

MCPSERVER
Figure 14.1 — The MCP Server (AI agents) dialog: status 1 · Start … when KUFCAD starts 2 · Port 3 · permission tier 4 · allowed folders 5.
  1. Choose the Port (default 7333) and the permission tier (below).
  2. Click Apply & Restart to start it (or Stop to stop it, Save settings to keep the choices). Status says Running on http://127.0.0.1:<port>/mcp. The server listens on your own machine only (127.0.0.1).
  3. Tick Start the MCP server when KUFCAD starts to start it every time KufCad opens (off by default).

Connecting an AI assistant

MCP connect
Figure 14.2 — The Connect a client section: the Copy for Claude Code button 1, Copy for Claude Desktop, Copy for Cursor.

Each time it starts, KufCad makes a fresh random access token. Click the Copy for … button for your software: the configuration (token included) is copied to the clipboard. Paste it into the MCP settings of Claude Code, Claude Desktop or Cursor as their guides describe, then restart the assistant. The Log box lists the AI's calls.

Permission tiers

TierWhat the AI may do
Read (default)Ask for drawing information, list layers / blocks / styles, query objects, measure, check standards, render images, select, zoom
WriteAdds: create / modify / erase objects, layers, styles, blocks; save and export PDF / SVG / PNG to the allowed folders (the drawing's folder is always allowed)
ExecAdds: run any command and LISP code, write anywhere — only for an assistant you fully trust

Text in a drawing (TEXT, attributes, layer names…) can hold planted "instructions" meant to fool the AI. KufCad tells the AI it is data, not instructions, but the permission tier is still the main protection: switch Exec on only when you really need it.

While the AI works

  • Objects the AI just changed flash an orange outline for about a second; the command line shows [MCP] <tool name> ….
  • Each AI write to the drawing is one undo step: Ctrl+Z or U reverts it.
  • While you are in the middle of a command the AI cannot write over it.

What the AI can do (tools)

TaskDescription
OverviewDrawing information: units, extents, object counts by type / layer, layouts
TablesList layers, blocks, text styles, dim styles, linetypes, layouts, views…
QueryFilter objects by type, layer, colour, window, text; read all properties
MeasureDistance, length, area, bounding box, 2D mass properties
Standards checkCompare with a .dws / .dwg / .dxf / .dwt standards file; report only, no changes
PicturesPNG pictures of the view or around objects
Draw / editCreate lines, circles, polylines, text, hatches, dimensions…; move, copy, rotate, scale, mirror, offset, explode, join, arrays…
Layers and stylesCreate / edit layers, text styles, dim styles, blocks; purge
FilesUndo / redo, save, save as, export PDF / SVG / PNG, open drawings
Commands and LISP(Exec tier) type any command as you would; run KufLISP code

Four ready-made prompts are included: check against a standard, summarise the drawing, draw from a description, clean up the drawing.

Headless mode

KufCad can also run MCP with no window to process drawings in bulk or on a server: run the kufcad program with the argument mcp and a drawing file name. Only Read by default; this mode cannot run the built-in interactive commands (LINE, TRIM…) — the AI uses the create / modify tools and LISP instead.

Full details (ports, access token, per-application setup) are in the docs/mcp.md file shipped with KufCad.