{
  "markdown": "# MCP CAD Studio\n\nA self-contained parametric CAD workspace delivered as an MCP server and an\ninteractive [MCP App](https://modelcontextprotocol.io/docs/extensions/apps).\nAgents can create and edit models through tools; people can work on the same\nmodels in a live 3D studio rendered inside any compatible host.\n\n## What it does\n\n- Renders a full 3D editor through the `studio_ui` tool.\n- Creates boxes, spheres, cylinders, cones, polygon extrusions, imported meshes,\n  transforms, and nested union/difference/intersection trees.\n- Generates editable brackets, pipes, gears, enclosures, and bolts.\n- Loads, patches, regenerates, and deletes persistent model documents with\n  optimistic revision checks.\n- Preflights extrusion outlines and raw meshes with actionable topology\n  diagnostics before they reach the CAD kernel.\n- Imports ASCII/binary STL and OBJ; exports ASCII STL and OBJ.\n- Keeps an open app synchronized with model-initiated MCP tool calls.\n- Runs over stdio or Streamable HTTP, with direct HTTPS support.\n- Uses a bundled WebAssembly CAD kernel—no OpenSCAD, Python, compiler, Docker,\n  or native CAD installation is needed.\n\nThe server's data tools are UI-independent. A client that cannot render MCP Apps\ncan still perform every CAD operation and receive structured model/mesh data.\n\n## Install\n\nNode.js 20 or later is the only runtime requirement. The CAD engine and all\nJavaScript dependencies install with the package.\n\nRun the published npm package:\n\n```bash\nnpx -y mcp-cad-studio --stdio\n```\n\nOr clone and build:\n\n```bash\ngit clone https://github.com/flujo-app/mcp-cad-studio.git\ncd mcp-cad-studio\nnpm install\nnpm run build\nnpm start -- --stdio\n```\n\n### MCP client configuration (stdio)\n\n```json\n{\n  \"mcpServers\": {\n    \"cad-studio\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"mcp-cad-studio\", \"--stdio\"]\n    }\n  }\n}\n```\n\nModels persist by default to `~/.mcp-cad-studio/models.json`. Use\n`--data-file <path>` to choose another file or `--no-persist` for an in-memory\nsession.\n\n## HTTPS / Streamable HTTP\n\nRun a local HTTPS endpoint with a generated self-signed certificate:\n\n```bash\nmcp-cad-studio --transport https --host 127.0.0.1 --port 8787\n```\n\nFor a remotely reachable production server, use a trusted certificate:\n\n```bash\nmcp-cad-studio --transport https \\\n  --host 0.0.0.0 \\\n  --port 8787 \\\n  --tls-cert /run/secrets/fullchain.pem \\\n  --tls-key /run/secrets/privkey.pem\n```\n\nThe MCP endpoint is `/mcp`; a read-only health endpoint is available at\n`/health`. TLS termination at a reverse proxy is also supported—run with\n`--transport http` behind the proxy.\n\n## MCP tools\n\n| Tool | Purpose |\n| --- | --- |\n| `studio_ui` | Open the interactive MCP App and optionally select a model |\n| `list_models` | List saved models and revisions |\n| `load_model` | Load the parametric document and its render mesh |\n| `create_model` | Create a model from a declarative shape tree |\n| `generate_model` | Create a template model, or regenerate one in place by `modelId` |\n| `update_model` | Patch or replace a model's definition, name, or color in place |\n| `validate_shape` | Preflight a shape without saving it |\n| `transform_model` | Apply an incremental translation, rotation, or scale |\n| `boolean_models` | Union, subtract, or intersect saved models into a new model |\n| `duplicate_model` | Make an editable copy |\n| `delete_model` | Permanently delete a model |\n| `import_model` | Import STL/OBJ text or base64 data |\n| `export_model` | Export ASCII STL/OBJ data |\n\nAll mutating results include `models`, `activeModel`, and `mesh` in\n`structuredContent`, so the UI and model see the same canonical state. Model\ncreation is reserved for genuinely separate models. For revisions, first call\n`load_model`, then pass its `modelId` and `revision` back as\n`expectedRevision` to `update_model`, `generate_model`, or `delete_model`.\n\n### Updating without creating copies\n\n`update_model` preserves the model ID and supports either a complete replacement\n`shape` or small RFC 6901 JSON-Pointer-style patches. This changes the X size of\na saved box without resending its whole definition:\n\n```json\n{\n  \"modelId\": \"5e44fd24-b7df-450a-a7bb-31c95496832f\",\n  \"expectedRevision\": 3,\n  \"patches\": [\n    { \"op\": \"replace\", \"path\": \"/shape/size/0\", \"value\": 80 }\n  ]\n}\n```\n\nPatches can target `/shape`, `/name`, or `/color` and are applied in order.\n`add`, `replace`, and `remove` are supported. The completed definition is\nschema-checked and geometry-checked before the saved model is changed.\n\nFor template-level edits, such as changing a gear's tooth count, call\n`generate_model` with the existing `modelId` and `expectedRevision`. The\ntemplate is regenerated into the same document instead of creating another\nmodel.\n\n## Parametric model format\n\n`create_model` and `update_model` accept a recursive shape tree. For example, a\nplate with a cylindrical hole:\n\n```json\n{\n  \"name\": \"Mounting plate\",\n  \"color\": \"#60a5fa\",\n  \"shape\": {\n    \"kind\": \"difference\",\n    \"children\": [\n      { \"kind\": \"box\", \"size\": [80, 50, 6], \"center\": true },\n      {\n        \"kind\": \"cylinder\",\n        \"height\": 8,\n        \"radius\": 5,\n        \"segments\": 48,\n        \"center\": true\n      }\n    ]\n  }\n}\n```\n\nEvery node can include a transform:\n\n```json\n{\n  \"transform\": {\n    \"translation\": [10, 0, 4],\n    \"rotation\": [0, 0, 45],\n    \"scale\": [1, 1, 1]\n  }\n}\n```\n\nRotations use degrees. Dimensions are unit-agnostic in the kernel; the studio\nlabels them as millimeters.\n\nShape objects are strict: misspelled or unsupported fields produce an error\ninstead of being silently ignored. `validate_shape` checks a draft without\nsaving and reports JSON paths, error codes, and suggested repairs. Checks\ninclude:\n\n- repeated, zero-length, zero-area, and self-intersecting extrusion outlines;\n- incomplete or out-of-range mesh arrays and degenerate triangles;\n- open boundaries, edges shared by too many faces, inconsistent winding, and\n  disconnected surface fans at a vertex;\n- shape-tree and twisted-extrusion complexity limits;\n- final verification by the Manifold CAD kernel.\n\nIf the kernel still rejects a shape, its status is translated into guidance for\nnon-finite vertices, non-manifold geometry, invalid construction, oversized\nresults, and the other kernel status classes.\n\n## Architecture\n\n```mermaid\nflowchart LR\n  A[Agent or person] --> H[MCP host]\n  H <-->|stdio or Streamable HTTP/S| S[MCP CAD Studio server]\n  H <-->|MCP Apps JSON-RPC bridge| U[Interactive CAD app]\n  U -->|tools/call| H\n  S --> P[Persistent parametric documents]\n  S --> K[Bundled Manifold WebAssembly kernel]\n  K --> M[Render mesh and STL/OBJ]\n  M --> S\n```\n\nThe `studio_ui` tool links to `ui://cad-studio/studio.html` with\n`_meta.ui.resourceUri`. The component uses the stable MCP Apps bridge\n(`ui/initialize`, `ui/notifications/*`, and `tools/call`) rather than requiring\nhost-specific globals. Model polling is revision-aware, making external tool\nedits visible in an already-open editor.\n\n## Development\n\n```bash\nnpm install\nnpm run check\n```\n\n`npm run check` performs strict TypeScript checking, 16 kernel/store/protocol/\ntransport tests, and a production build. The test suite uses the real\nWebAssembly geometry engine and both in-memory and Streamable HTTP MCP clients.\n\nUseful commands:\n\n```bash\nnpm run dev       # HTTP development server on port 8787\nnpm test          # Vitest suite\nnpm run typecheck # TypeScript only\nnpm run build     # bundle the MCP App and server\nnpm pack          # verify the single-package artifact\n```\n\nTo publish the current version to npm:\n\n```bash\nnpm run release\n```\n\nThe release command signs in through npm when necessary, runs the complete\ncheck suite, publishes the package publicly, and confirms that npm serves the\nversion. It is safe to rerun: if that exact version is already published, it\nverifies the project and skips the duplicate publish.\n\nRun `npm run release:check` to validate the release helper without publishing.\n\n## Security notes\n\n- Tool schemas cap shape depth, node count, mesh size, and imported file size.\n- Mutation tools accurately declare read-only/destructive/open-world hints.\n- `expectedRevision` prevents accidental overwrites and stale deletion during\n  concurrent editing.\n- Patch paths are restricted to editable model fields and reject prototype\n  traversal.\n- The app resource declares an empty external-resource/connect CSP.\n- A generated self-signed certificate is intended for local development only.\n- Authentication is deployment-specific. Put remote multi-user instances behind\n  an authenticated gateway and enforce per-user authorization there.\n\n## License\n\nMIT\n",
  "bytes": 8617,
  "sha": "6d0451c0b8f79d67478da3c14113873c66838d0af246d3e939710f902cfd3449",
  "repo_slug": "flujo-app/mcp-cad-studio",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_mario_andreschak_mcp_cad_studi_4434393a/readme"
}