dxfplan — Free Open-Source 2D Floorplan Generator CLI for AI Agents
dxfplan — AutoCAD-style 2D floorplan drafting for AI Agents: Turn one JSON spec into a valid DXF 2D floorplan — walls, doors, windows, rooms and dimensions, validated before writing — with 3.7× fewer tokens than hand-written DXF. Offline, fast, and free.
Install in one minute — see the install commands below. Source and README: github.com/creatorops-studio/dxfplan. 100% local — no network calls at all in the free build.
What it is not, stated up front: dxfplan is a draft, visualisation and validation tool for 2D floorplans. It is NOT a substitute for CAD software or a licensed architect, and its output is NOT construction-ready, permit-ready or architect-grade. It reads and writes DXF only — never DWG.
One JSON spec, one valid DXF
dxfplan template two-bed > plan.json, edit the rooms/walls/doors/windows, then dxfplan build plan.json -o plan.dxf. The output is a plain DXF R12 file (AC1009) that opens in AutoCAD, LibreCAD, QCAD and LibreOffice Draw — walls as rectangles with door/window openings, door swing arcs, room outlines with names and areas in m², and dimension lines with extension lines and arrow ticks.
# 1. Get a template plan (studio, two-bed, office)
dxfplan template two-bed > plan.json
# 2. Validate it — machine-readable issues, exit 2 when invalid
dxfplan validate plan.json
# 3. Build the DXF (+ SVG and PNG previews)
dxfplan build plan.json -o plan.dxf --svg plan.svg --png plan.png
# 4. Room-area report
dxfplan report plan.json
The report for the two-bedroom sample reads:
Plan: Two-bedroom apartment
Rooms: 2 Walls: 5 Doors: 2 Windows: 3
Room Width Height Area (m²)
Living 5000.0 4000.0 20.00
Bedroom 3500.0 4000.0 14.00
Total area: 34.00 m²
Validated before writing — no broken DXF, ever
dxfplan build validates first and writes nothing when the plan has errors: rooms that overlap, openings that run off their wall or overlap each other, openings pointing at a wall that does not exist, duplicate room names, zero-size geometry, non-finite numbers. dxfplan validate prints every issue with a code, a message and a fix suggestion (JSON with --json).
Install in one minute
Install straight from GitHub with a Rust toolchain (cargo) — the crate is not on crates.io yet:
cargo install --git https://github.com/creatorops-studio/dxfplan
Prefer a ready-made binary? Download the Release v0.1.0 binary (3,652,784 B) from github.com/creatorops-studio/dxfplan/releases/tag/v0.1.0.
Measured numbers, not marketing
Measured 5 December 2026 on Linux x86_64, release build, with dxfplan benchmark examples/plan.json on the sample two-bedroom plan. Tokens ≈ characters / 4 (standard approximation); the hand-written DXF is the complete, valid R12 file for the same floorplan, so the comparison is reproducible.
| What was measured | Result |
|---|---|
| Token cost for one plan — spec JSON | 402 tokens vs 1,500 tokens (hand-written DXF) — 3.7× saving |
| Build (DXF + SVG + PNG), mean of 3 runs | 88.0 ms |
| Peak RSS | ~17.4 MB |
| DXF output | 6,409 B (70 LINE, 2 ARC, 6 TEXT, 5 layers) |
| SVG output | 4,435 B |
| PNG output | 137,626 B (1,600 × 858 px) |
| Tests | 50 green |
| Binary size (release, stripped) | 3,652,784 B (3.48 MiB) |
Built for AI agents first
MCP server with five tools (dxfplan_validate, dxfplan_build, dxfplan_report, dxfplan_template, dxfplan_benchmark). Add this to your MCP config — no Python, no browser, no cloud:
{
"mcpServers": {
"dxfplan": {
"command": "dxfplan",
"args": ["mcp"]
}
}
}
A two-bedroom plan that used to cost an agent 1,500 tokens of hand-written DXF group codes now costs 402 tokens of plan-spec JSON (3.7× saving, measured — see the repo README for the full benchmark and how the hand-written DXF was counted).
Built with: Rust, a single static binary, and an MCP server — clap + serde + serde_json + resvg.
What it is not (read this before you build anything)
dxfplan is a draft, visualisation and validation tool for 2D floorplans. It is NOT a substitute for CAD software or a licensed architect, and its output is NOT construction-ready, permit-ready, architect-grade, and makes NO claim about building-code compliance. It reads and writes DXF only — never DWG. Always have a qualified professional review any plan before building anything.
Free, offline, MIT
Single static binary, no cloud, no account. Free core is the full 2D floorplan generator; Pro (coming later, $10–29/month) adds template packs, batch/CI features and a Cloud API.
Frequently asked questions
Is dxfplan really free?
Yes — MIT licensed, free core forever. Pro is a separate paid tier for template packs/batch/API features.
Does it work offline?
Yes. 100% local; no network calls at all in the free build.
Can it read or write DWG files?
No — DXF only, by design. DWG is a proprietary format.
Is the output construction-ready?
No — this is a draft/visualisation/validation tool. Its output is not construction-ready, permit-ready or architect-grade, and it makes no building-code claims. Have a qualified professional review any plan before building.
Which CAD programs open the DXF?
Any program that reads DXF R12 (AC1009): AutoCAD, LibreCAD, QCAD, LibreOffice Draw, and others. $INSUNITS is set from the plan's units and $DWGCODEPAGE is UTF-8.
How do I use it with Claude Code?
Add the MCP server block from the repo README to your MCP config; the agent gets dxfplan_validate, dxfplan_build, dxfplan_report, dxfplan_template, dxfplan_benchmark.
How do I install it?
Run cargo install --git https://github.com/creatorops-studio/dxfplan (needs a Rust toolchain), or download the Release v0.1.0 binary (3,652,784 B) from the v0.1.0 release. The crate is not on crates.io yet.
Draft a valid 2D floorplan in one command.
Free, offline, MIT licensed — get the source on GitHub. A draft, visualisation and validation tool only: not a substitute for CAD software or a licensed architect, and its output is not construction-ready, permit-ready or architect-grade.