Type what you want. Get a real, verified CAD part.
Describe a product in plain words β a kettle, a desk lamp, a bracket β and an AI agent designs it as real, editable, correctly-sized geometry. It builds the part step by step through a CAD engine, measures its own work, fixes its own mistakes, and only claims success when a deterministic kernel check proves every requirement is met.
chamfer is a small, plain-Python agent harness, not a framework and not a chat wrapper. The harness itself is CAD-agnostic: the LLM drives an external CAD MCP server (build123d by default) to synthesize geometry, and a fixed verifier β never the model's own word β decides PASS. The whole loop reads top to bottom.
One real run, replayed frame by frame: the agent places every component, measures its own geometry, catches interpenetrating parts, and rebuilds them before the independent verifier passes it. (This GIF is from an earlier Autodesk-Fusion-backed version; the current harness targets an external build123d MCP server β same loop, same measured finish line.)
flowchart TD
P["π A plain-language prompt"] --> LOOP
subgraph LOOP["π The agent loop β builds the design one small step at a time"]
direction TB
ORCH["Harness<br>feeds in the task, skills,<br>and the CAD tools"] --> LLM["LLM<br>decides the next small step"]
LLM -- "writes a bit of CAD code" --> RUN["Run it on the CAD MCP server<br>a real part appears"]
LLM -- "unsure of the API" --> DOCS["Look it up<br>in the server's own resources"]
LLM -- "wants ground truth" --> MEAS["Measure the parts<br>fixed probe code β not written by the LLM"]
RUN -- "result, or the error to fix" --> LLM
DOCS -- "the real answer" --> LLM
MEAS -- "real sizes, volumes, positions" --> LLM
end
LOOP -- "the agent says: done" --> CHECK["π Independent check<br>the harness re-measures the exported STEP with fixed code<br>β no LLM involved"]
CHECK -- "checks fail: measured problems go back" --> LOOP
CHECK -- "every check passes" --> DONE["β
Verified STEP"]
style LLM fill:#fff7ed,stroke:#ea580c
style ORCH fill:#fff7ed,stroke:#ea580c
style RUN fill:#eff6ff,stroke:#2563eb
style DOCS fill:#eff6ff,stroke:#2563eb
style MEAS fill:#eff6ff,stroke:#2563eb
style CHECK fill:#eff6ff,stroke:#2563eb
style DONE fill:#dcfce7,stroke:#059669
- You ask in plain words. A prompt describing the part you want.
- It designs in small steps. The agent loop: write a small piece of CAD code, run it on the CAD MCP server, look at what happened, continue. Unsure of an API? It reads the server's own resources instead of guessing. A step fails? It reads the error and fixes it.
- It measures its own work. After building, it asks the CAD kernel for the real numbers β sizes, volumes, positions β and repairs what's off: parts crossing each other, floating parts, a cavity that came out too small.
- The harness has the final word. When the agent says "done", the harness independently re-measures the exported STEP and grades it with fixed code. Anything failing goes back to the agent, with the measured numbers, for another bounded round. Success is only reported when every check passes.
uv tool install chamfer-cad # or: pip install chamfer-cad (the CLI command is `chamfer`)On first run, chamfer provisions ~/.chamfer/ with a set of default skills and an MCP config (the build123d server), the same way other CLIs provision their config directory.
# build a part from a prompt (set your provider's API key in the environment first)
export ANTHROPIC_API_KEY=... # or OPENAI_API_KEY / OPEN_ROUTER_API
chamfer run "a 2 L electric kettle with a rounded rim" --provider anthropic
# deliver the verified STEP to a path of your choice (dirs are created)
chamfer run "a desk lamp" --provider openai -o out/lamp.step
# use the stricter CAD quality profile for more evidence before completion
chamfer run "a 120 mm mounting bracket with four M6 holes" \
--provider anthropic --profile strict-cad -o out/bracket.step
# use attached references or source CAD
chamfer run "make a bracket matching this drawing" \
--provider openai --image reference.png -o out/bracket.step
chamfer run "make the front slot 8 mm wider and preserve the rest" \
--provider anthropic --profile strict-cad --input original.step -o out/edited.step
# no API key? drive it from Claude Code / Codex CLIs instead
chamfer run "a mounting bracket" --provider claude-codeThe full test suite runs offline β no key, no network:
uv run --group dev pytest -q--provider {scripted,openrouter,openai,anthropic,codex-cli,claude-code}β where the reasoning comes from.openrouter/openai/anthropicread their API key from the environment (OPEN_ROUTER_API/OPENROUTER_API_KEY,OPENAI_API_KEY,ANTHROPIC_API_KEY);codex-cli/claude-codeshell out to those CLIs.--model <id>β model id for the chosen provider.--attach <path>β attach a reference/source file. Images and STEP/STP files get specialized handling; other files are copied as workspace references.--image <path>β attach an image reference explicitly. Vision-capable providers receive the image pixels; text-only providers receive an honest workspace-path fallback.--input <path>β attach a source CAD input for editing/reference. Currently STEP/STP only.-o, --output <path>β copy the final verified CAD artifact to this path (parent dirs created).--out <dir>β run root for workspaces/evidence (default~/.chamfer/runs).--profile {default,strict-cad}β choose the workflow quality profile.defaultkeeps Chamfer's standard CAD-agnostic, less opinionated loop;strict-cadadds stronger CAD completion gates and feedback review before success.--sandbox/--no-sandboxβ filesystem discipline for tool calls (disabled by default for now).--max-turns <n>β agent turn budget (default50).--verbose {true,false}β print clean user-facing progress and summary (defaulttrue); use--verbose falseor--verbose 0for quiet output.
--profile strict-cad selects a general CAD workflow quality profile. It is for
tasks where you want the agent to spend more effort on model evidence before it
is allowed to finish:
chamfer run "edit the existing STEP so the front slot is 8 mm wider" \
--provider openai --profile strict-cad -o out/edited.stepThe default profile remains the small, CAD-agnostic Chamfer loop: ask the active MCP server to build geometry, export a durable artifact when possible, and let the deterministic verifier decide truth. It is intentionally less opinionated, which makes it suitable for quick experiments and for CAD backends with limited inspection capability.
The strict profile keeps the same backend-agnostic core, but adds completion rules that require stronger evidence. Before success, the workflow expects a STEP candidate at the requested output path, a successful latest geometry-changing action, reviewed export feedback, reviewed validation feedback, and, for editing tasks, evidence that the candidate differs from the input. When inspection tools are available, the strict profile also asks the agent to review visual or spatial inspection feedback.
Chamfer accepts a text task plus optional files. Every attachment is copied into
the run workspace under inputs/ and recorded in the manifest/session so the
run is reproducible.
- Use
--attach PATHfor generic references. Chamfer infers image and STEP/STP handling by extension; other files are preserved as reference files. - Use
--image PATHwhen the file must be treated as an image. If the selected provider supports vision, Chamfer sends the image as a multimodal content block on the first agent turn. If not, the prompt explicitly says the provider cannot see the pixels and gives the workspace path for any backend tools that can read files. - Use
--input PATHfor a source CAD model to edit or inspect. STEP/STP inputs are copied intoinputs/, summarized with Chamfer's deterministic STEP verifier when possible, and surfaced as source attachments. They are not treated as generated outputs.
Strict feedback is expressed as categories, not hardcoded backend calls:
import/export result, geometric validity, visual or spatial inspection,
dimensional checks when dimensions are known, original-vs-candidate comparison
for edits, and defect localization or repair guidance after failures. Backend
skills map those categories to concrete tools. For example, the shipped
build123d-mcp skill describes how a build123d MCP backend can inspect,
validate, compare, checkpoint, and export STEP files; another CAD backend can
provide a different skill with its own tool names.
chamfer layers configuration highest-precedence first:
| Scope | Instructions | Skills | MCP servers |
|---|---|---|---|
| Project (your working dir) | CHAMFER.md (searched up from the cwd) |
.chamfer/skills/*/SKILL.md |
.mcp.json or .chamfer/mcp.* |
| User global | β | ~/.chamfer/skills/*/SKILL.md |
~/.chamfer/mcp.json |
A project skill or MCP server overrides a same-named global one. The defaults in ~/.chamfer/ are seeded on first run and are yours to edit or extend. Skills are progressive-disclosure Markdown (SKILL.md with a name + description in front-matter); their names go into the prompt and the agent reads the body on demand.
Drop a CHAMFER.md in your project (chamfer searches up from the working directory) to add your own instructions to the agent's system prompt β conventions, house rules, units, whatever the model should always know for this project. It is optional and not shipped with chamfer; the base system instruction lives in code. Think of it as chamfer's equivalent of a project AGENTS.md/CLAUDE.md.
The system prompt is assembled in a fixed order:
chamfer system instruction (built-in)
β built-in tools + MCP tools
β MCP server instructions / resources
β your CHAMFER.md
β skills (names + descriptions only; bodies read on demand)
β your prompt
Any MCP server you declare is bridged generically into the agent loop β its tools are discovered via tools/list, risk-classified, and registered alongside the harness's built-ins. build123d ships as the default; point chamfer at another CAD MCP server and the same loop drives it.
Each GIF below is a script-for-script replay of a real session log β actual geometry states, not illustrations. These runs are from an earlier Autodesk-Fusion-backed version of the harness; the current release drives an external build123d MCP server through the same measured loop.
A cylindrical body on a power base, a C-handle with measured hand clearance, a domed lid and a spout β with one live self-correction: the spout first extruded upside-down, the agent saw it in its own measurement and rebuilt it at the rim.
A weighted base, a slim stem, an overhanging arm and a hollow shade β with a kept-clear light zone verified at a measured 258 mm, and stability confirmed from the center of mass sitting inside the base edge.
The one non-negotiable: the finish line is kernel-measured, never self-reported.
- The LLM gets freedom where geometry is synthesized. It free-writes small CAD scripts against the live document, looks up real API details on demand, and repairs from raw errors β the standard coding-agent loop, applied to CAD.
- Determinism decides what is true. After the agent declares done, a fixed tiered verifier re-reads the exported STEP (structural checks with an optional geometric tier) and the acceptance checks run against that snapshot. Failures β with measured numbers β become the next round's task.
- Risk is gated. Every tool carries a risk class behind a policy gate: reads run freely; writes and CAD execution are consequential; a human can be required before irreversible actions.
- Everything is logged. Full session JSONL (every prompt, reply, and tool call) under
~/.chamfer/.
The load-bearing decision is where determinism lives: the LLM writes any CAD code it wants (freedom where geometry is synthesized), and deterministic code decides what is true (a kernel-backed verifier + acceptance checks, with measured failures driving bounded repair rounds).
The source is flat, plain Python you can read top to bottom β the agent loop, the tools, the generic MCP bridge, and the verifier β under src/, with no agent framework.
Not a product, not a chat assistant, and not affiliated with Autodesk. It is a reference harness for building reliable codegen agents on top of a CAD kernel: bounded loops, measured verification, risk-gated actions, every deterministic module unit-tested.
Apache-2.0 β see LICENSE.
This is an independent open-source project β not affiliated with, endorsed by, or sponsored by Autodesk, Inc. Autodesk and Fusion are trademarks of Autodesk, Inc.


