scratchcad is no longer being developed or actively receiving security or any other updates please fork it if you would like to use it
scratchcad is a Rust solid modelling API built on the OpenCASCADE CAD kernel, plus a local MCP server and editor so AI assistants (and you) can use it. Parts are Rhai scripts that build exact B-rep solids, which export to STEP, IGES, BREP, STL, OBJ and 3MF.
Quick start (requires Docker)
Clone the latest release (main moves fast and may be broken between releases) and start the server, the MCP server and the editor:
git clone --branch v0.4.0 https://github.com/scratchcad/scratchcad.git cd scratchcad docker compose up --build # or `docker compose watch` to reload on edits The first build takes a few minutes. Then open the editor at http://localhost:8000. To require an API token, put SCRATCHCAD_API_TOKEN= in a .env file next to compose.yaml.
The MCP server is already configured for this directory in .mcp.json. Clients that don't read .mcp.json can use http://localhost:8000/mcp with the streamable HTTP transport.
Each part was modelled by Claude Code (on high effort) from the prompt beside it. The links under the renders go to the scripts it wrote; copy one into ./output to open it in the editor.
The agent writes a part as a Rhai script and saves it to ./output, where the editor picks it up:
The functions scripts can call are listed in the Rhai API reference.
The MCP server reaches scratchcad at SCRATCHCAD_URL, so it works with a local build, the dev container or a deployed instance; the editor only talks to the MCP server, so an API token never reaches the browser. See server/README.md and mcp/README.md for running each on its own, and docker compose run --rm mcp npm test for the MCP server's checks.
Contributions are welcome. See CONTRIBUTING.md; every commit needs a DCO sign-off (git commit -s). Report security vulnerabilities privately as described in SECURITY.md, not in public issues.
scratchcad is licensed under the Apache License 2.0, except for the crates in crates/, which are licensed under the LGPL 2.1 only: each has its own LICENSE and NOTICE. Its dependencies are listed with their licenses in THIRD_PARTY_NOTICES.txt.
scratchcad makes use of Open CASCADE Technology, which is licensed under the LGPL 2.1 with the Open CASCADE exception, through those crates. Until 2026-10-18 they were developed in scratchcad-occt-rs, whose history has their earlier changes.
If you've found scratchcad useful please leave a star




