{"slug": "show-hn-an-oss-text-to-cad-mcp-and-api", "title": "Show HN: An OSS text to CAD MCP and API", "summary": "Developer Zesuperaker released scratchcad, an open-source Rust solid-modelling API and MCP server that lets AI assistants generate CAD geometry from text prompts, licensed under Apache License 2.0. The MCP server runs on Python 3.14 with FastMCP and exposes the service's five endpoints as tools over streamable HTTP at http://localhost:8000/mcp, supporting Claude Code, OpenAI Codex CLI, Gemini CLI and VS Code GitHub Copilot agent mode. The project is under active development, with APIs, tools and script syntax subject to change without notice.", "body_md": "Warning\n\nscratchcad is under active development. APIs, tools and script syntax may change without notice, and things may break between commits.\n\nscratchcad is a rust based solid modelling API, plus an MCP server so AI assistants can use it.\n\n```\ndocker compose up --build        # or `docker compose watch` to reload on edits\n```\n\nThen add the MCP server (`http://localhost:8000/mcp`) to your agent:\n\n```\n# Claude Code\nclaude mcp add --transport http scratchcad http://localhost:8000/mcp\n\n# OpenAI Codex CLI\ncodex mcp add scratchcad --url http://localhost:8000/mcp\n\n# Gemini CLI\ngemini mcp add --transport http scratchcad http://localhost:8000/mcp\n\n# VS Code (GitHub Copilot agent mode)\ncode --add-mcp '{\"name\":\"scratchcad\",\"type\":\"http\",\"url\":\"http://localhost:8000/mcp\"}'\n```\n\nFor other clients, point them at `http://localhost:8000/mcp` using the\nstreamable HTTP transport.\n\n| prompt (using opus 5.5 medium through cc) | output | \n|---|---|\n| Create an M10 hex bolt with 26 mm thread length, a course pitch of 1.5 mm and head height 6.4 mm. Also create a matching hex nut with 8.4 mm height. Both of these should be in the same file displayed beside each other. |  | \n| Create a 3DBenchy. |  | \n| Create a mid-stage compressor blisk with these dimensions: an outer tip diameter of 440 mm, a hub platform diameter of 241.2 mm, and a radial blade span of 99.4 mm across its 29 twisted aerodynamic airfoils. Mechanically, the component is defined by an 80.0 mm shaft interface bore diameter, an axial hub length of 77.5 mm, and an airfoil rim width of 45.0 mm, with rear mounting flange diameters measuring 184 mm at the inner shoulder and 202 mm at the outer rim. Blade count of 29 twisted aerodynamic airfoils. |  | \n\n`compose.yaml` runs both dev images:\n\n| service | port | image | \n|---|---|---|\n| `server` | `127.0.0.1:8080` | [`server/Dockerfile.dev`](https://github.com/Zesuperaker/scratchcad/blob/main/server/Dockerfile.dev) :` cargo run` with fast incremental rebuilds | \n| `mcp` | `127.0.0.1:8000` | [`mcp/Dockerfile.dev`](https://github.com/Zesuperaker/scratchcad/blob/main/mcp/Dockerfile.dev) : the MCP server over streamable HTTP at`/mcp` | \n\nRun the MCP checks inside its container with\n`docker compose run --rm mcp uv run pytest`.\n\nWith `docker compose watch`, edits\nunder `server/src` or `mcp/src` restart the affected container (the Rust\nside recompiles in a few seconds), and changes to `Cargo.toml`, `Cargo.lock`,\n`pyproject.toml` or `uv.lock` rebuild its image. To require an API token, put\n`SCRATCHCAD_API_TOKEN=<16+ characters>` in a `.env` file next to `compose.yaml`.\n\nExported 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`.\n\n| directory | what it is | \n|---|---|\n| [`server/`](https://github.com/Zesuperaker/scratchcad/blob/main/server) | The scratchcad HTTP service (Rust 1.98, [Fidget](https://github.com/mkeeter/fidget) + axum). Validates, evaluates, renders and meshes[Rhai](https://rhai.rs) scripts that describe implicit surfaces. | \n| [`mcp/`](https://github.com/Zesuperaker/scratchcad/blob/main/mcp) | An [MCP](https://modelcontextprotocol.io) server (Python 3.14,[FastMCP](https://gofastmcp.com) ) that exposes the service's five endpoints as tools, so a model can write a script, look at renders, measure the part and export an STL. | \n\nThe 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.\n\nscratchcad is licensed under the [Apache License 2.0](https://github.com/Zesuperaker/scratchcad/blob/main/LICENSE). Its dependencies, are listed\nwith their licenses in [`THIRD_PARTY_LICENSES.txt`](https://github.com/Zesuperaker/scratchcad/blob/main/THIRD_PARTY_LICENSES.txt).\n\nA huge shoutout to Matt Keeter the developer of [Fidget](https://github.com/mkeeter/fidget), scratchcad uses fidget as the core implicit kernal and this project would not be possible without fidget.", "url": "https://wpnews.pro/news/show-hn-an-oss-text-to-cad-mcp-and-api", "canonical_source": "https://github.com/Zesuperaker/scratchcad", "published_at": "2026-09-30 16:59:50+00:00", "updated_at": "2026-09-30 17:19:36.427482+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "developer-tools", "ai-tools", "artificial-intelligence"], "entities": ["scratchcad", "Zesuperaker", "Fidget", "Matt Keeter", "Model Context Protocol", "FastMCP", "Rhai", "Claude Code"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-an-oss-text-to-cad-mcp-and-api", "markdown": "https://wpnews.pro/news/show-hn-an-oss-text-to-cad-mcp-and-api.md", "text": "https://wpnews.pro/news/show-hn-an-oss-text-to-cad-mcp-and-api.txt", "jsonld": "https://wpnews.pro/news/show-hn-an-oss-text-to-cad-mcp-and-api.jsonld"}}