Open editor
For developers

CADCraft MCP: a CAD engine your agent can drive

In CADCraft every menu item, tool and prompt is a command. The cadcraft-cli tool serves them over the Model Context Protocol, so an AI agent can type at the command line exactly like a person, call any command with JSON, inspect the drawing to verify its work and render it to an image.

MCP needs cadcraft-cli on your computer. The browser editor on this site can’t be driven by an agent; in the browser, the AI DXF generator panel draws from a description instead.

Get the CLI

The 0.5.0 release ships cadcraft-cli as its own signed and notarized macOS zip (cadcraft-cli-0.5.0-macos-universal.zip). On Windows it comes in the portable zips next to cadcraft.exe, and on Linux the packages and tarballs include it. Or build it from source with cargo build --release -p cadcraft-cli.

Set up with Claude Code

A headless session, with an in-process drawing and no window:

claude mcp add cadcraft -- /path/to/cadcraft-cli mcp

Or add it to your agent’s MCP configuration (.mcp.json in a project for Claude Code):

{
  "mcpServers": {
    "cadcraft": { "command": "cadcraft-cli", "args": ["mcp"] }
  }
}

To watch the agent draw, start the desktop app with a control port and bridge to it:

cadcraft --control 7979 &
cadcraft-cli mcp --connect 127.0.0.1:7979

With --connect, startup fails if the app can’t be reached, so a client meant for the app never edits a separate headless drawing by mistake.

What the agent gets

The drawing and the command catalog are also resources (cadcraft://drawing, cadcraft://commands).

A typical session

  1. command_line {"text": "rectang 0,0 100,60"}
  2. execute {"command": "circle", "params": {"center": [10, 10], "radius": 4}}
  3. command_line {"text": "dimlinear 0,0 100,0 50,-8"}
  4. inspect_drawing {} to verify counts and geometry.
  5. render {} to look at it.

Without MCP: the CLI on its own

cadcraft-cli info drawing.dxf                     # layers, counts, extents as JSON
cadcraft-cli convert drawing.dxf drawing.svg      # or .png, .pdf, .dwg
cadcraft-cli run --sample --script 'CIRCLE 22,3 1\n' --save out.dxf --export out.png
cadcraft-cli convert drawing.dwg detail.png --window 0,0,20000,15000

DWG conversion runs in the CLI and the desktop app; the browser build reads DXF only (see opening DXF files online).

FAQ

Can an AI agent control the browser version on this site?

No. The MCP server is part of cadcraft-cli and runs on your computer, either headless or connected to the CADCraft desktop app. The web build has no agent channel. In the browser, use the AI drafting panel instead: it generates DXF drawings and answers questions about them.

Which agents work with it?

Any MCP client that can launch a local stdio server: Claude Code, Claude Desktop, Cursor, VS Code agents and others. They all take the same command and arguments.

Does it open a network port?

cadcraft-cli mcp itself talks over stdin and stdout only. To let an agent drive the desktop app, you start the app with --control and a port number; that control server listens on localhost, and cadcraft-cli mcp --connect bridges to it.

How does the agent check its own work?

inspect_drawing returns counts, extents, layers, styles, blocks, layouts and entities as JSON; query_entities filters them by type, layer or window; render returns a PNG image of the drawing the model can look at. When connected to the app, screenshot shows the whole window.

Source: the CADCraft README, MCP guide and control protocol. Flags and tools can change between releases; check cadcraft-cli --help.