Warning
scratchcad is under active development. APIs, tools and script syntax may change without notice, and things may break between commits.
scratchcad is a rust based solid modelling API, plus an MCP server so AI assistants can use it.
docker compose up --build # or `docker compose watch` to reload on editsThen add the MCP server (http://localhost:8000/mcp) to your agent:
# Claude Code
claude mcp add --transport http scratchcad http://localhost:8000/mcp
# OpenAI Codex CLI
codex mcp add scratchcad --url http://localhost:8000/mcp
# Gemini CLI
gemini mcp add --transport http scratchcad http://localhost:8000/mcp
# VS Code (GitHub Copilot agent mode)
code --add-mcp '{"name":"scratchcad","type":"http","url":"http://localhost:8000/mcp"}'For other clients, point them at http://localhost:8000/mcp using the
streamable HTTP transport.
compose.yaml runs both dev images:
Run the MCP checks inside its container with
docker compose run --rm mcp uv run pytest.
With docker compose watch, edits
under server/src or mcp/src restart the affected container (the Rust
side recompiles in a few seconds), and changes to Cargo.toml, Cargo.lock,
pyproject.toml or uv.lock rebuild its image. To require an API token, put
SCRATCHCAD_API_TOKEN=<16+ characters> in a .env file next to compose.yaml.
Exported STL files appear in ./output. These will be the main file that you recieve from the agent unless you also explicitly ask for the Rhai script that the agent created to be saved to ./output.
The two are independent: the MCP server talks to the service over HTTP, so it works with a local build, the dev containers, or a deployed instance.
scratchcad is licensed under the Apache License 2.0. Its dependencies, are listed
with their licenses in THIRD_PARTY_LICENSES.txt.
A huge shoutout to Matt Keeter the developer of Fidget, scratchcad uses fidget as the core implicit kernal and this project would not be possible without fidget.