v0.2.0 releasedFreeOpen sourcePre-release
Software for hardware.
The script is the model. The model is the robot. The agent writes the script.
Design the concept with your agent
Claude Code, Codex or any MCP client drives the engine through cadex mcp. The agent has one way to change the model: it edits the script.
The script is the model
- tilt θ
- 0.0°
- rate ω
- 0°/s
- policy
- none
Every num() is a parameter. Drag it here, or run cadex params --set wheel_d=72. The model rebuilds with no AI and no tokens.Exported to MuJoCo. No controller yet, so gravity wins every time.
The task is data, in the same script
| reward | alive | +1.0 | |
upright abs(θ) | −3.0 | ||
settle abs(ω) | −0.4 | ||
stay put abs(x) | −0.012 | ||
| effort | −0.0004 | ||
| terminate | θ beyond 45° | ||
| disturb | horizontal push, 0.4 to 3 N, twice per episode | ||
| success | upright to the end, on every evaluation seed | ||
Observations, rewards, terminations, pushes and the success spec are declared next to the geometry they act on.
Train on any GPU box
- iteration
- 0 / 120
- envs
- 16
- mean reward
- 0
- episodes
- 0
The offboard trainer learns with Brax PPO: a GPU box for a gait, your own CPU for a toy mechanism. One .cxpolicy file comes back. The engine verifies it, and the dashboard plays it.
Evaluate and adapt the results
Geometry, physics and control live in one file, so a design change is one diff and one retrain. cadex evaluate holds the policy to its success spec and films each seed.
What Cadex is
Cadex is AI-native CAD for robots and mechanisms, free and open source. It is three
things. The engine is a headless fork of FreeCAD on the OCCT kernel: it runs
the parametric Python script your agent writes, and it accepts only validated, exact
solid geometry. The dashboard is a read-only page in your browser, where you
watch the design land: viewport, outliner, training curves, rollouts and the network's
activations. The agent is yours. Claude Code, Codex or any MCP client drives
the engine through cadex mcp. Cadex has no agent, API key or model of its own.
The script is the model. Every build reply measures fit, joint sweeps and
fastening, and a refused build says why. Assemblies export to MuJoCo with exact inertias,
so a mechanism falls, collides and is actuated the moment it is built. The task and its
success spec live in the same script as the geometry. The offboard trainer returns one
policy file, and cadex evaluate films it against the spec. Parameter sweeps,
exports and renders run from the CLI and spend no tokens.
Run it from source
pixi run setup-engine && pixi run build-engine
pixi run app # the dashboard, http://127.0.0.1:8765/
claude mcp add cadex -- "$PWD/cadex" mcp --project ~/cadex-projects/bracket
Built and tested on Linux x86-64. macOS arm64 passes CI. Windows is not supported. Then ask your agent: “a mounting bracket for a NEMA17, 4 mm wall”.

