Skip to content

Getting started

This tutorial gets you from a clean checkout to an LLM client that can call CAD tools. Ten minutes, two paths: local stdio or a deployed HTTP endpoint.

  • uv installed
  • A checkout of the mcdrafter repository
  • An MCP client — the examples use the claude CLI

FreeCAD is not required for this tutorial. The six DXF analysis tools run on pure Python dependencies, which uv resolves automatically.

The stdio transport is the simplest way to wire the server into Claude Code. The client spawns the server as a subprocess and talks JSON-RPC over stdin/stdout.

Terminal window
claude mcp add mcdrafter -- \
uv run --directory /path/to/mcp-drafter cad-mcp-server --transport stdio

That’s it. uv run resolves the environment from pyproject.toml on first launch, and the cad-mcp-server console script starts the FastMCP app.

Verify the connection:

Terminal window
claude mcp list

Then, in a Claude session, ask something that forces a tool call:

Use mcdrafter’s list_supported_formats tool and summarize what this server can do.

You should get back the import/export format tables and the capability list.

If the server is running somewhere (see Run with Docker), point your client at its HTTP transport. FastMCP serves the MCP endpoint at /mcp:

Terminal window
claude mcp add --transport http mcdrafter https://cad.example.com/mcp

The server runs HTTP with json_response=True and stateless_http=True, which matters more than it sounds: remote clients behind TLS-terminating reverse proxies get plain JSON responses with no SSE accept-header or session-ID requirements. If you’ve fought an MCP server that works locally but breaks behind Caddy or nginx, this is the fix.

Running the HTTP server directly for a quick test:

Terminal window
uv run cad-mcp-server --transport http --host 0.0.0.0 --port 8000

With either path connected, try a file. Any DXF will do — if you don’t have one handy, ask the agent to create one first with create_2d_geometry (FreeCAD tier) or grab any sample DXF:

Survey the layers in /path/to/site-plan.dxf and tell me which ones carry the most linework.

The agent should call survey_dxf_layers and come back with a busiest-first layer inventory. From there, the Investigate an unknown DXF tutorial walks the full reconnaissance workflow.