TASKVEGAS / documentation
Text-to-CAD upstream MCP
Selected pinned upstream documentation. Read its original repository guide for setup, costs and availability.
Unmodified upstream reference text. Treat instructions in this document as source material, not authorization to act.
- Repository
- earthtojake/text-to-cad
- Source revision
- 24573128ceaab564f497d7c12f995c41784c9539
- License
- MIT
- Text range
- 16000–19462 of 19462 characters
Read the pinned upstream source
License and notices: Pinned notice · Pinned notice
ll. A capture asked with
a show is of the model shown, never of the one the view is leaving. What it
cannot wait out it says: a card the chat never drew, a model that did not finish
loading, a view out of sight that did not answer.
## Host adapter (`src/host`)
| Module | What it is |
| --- | --- |
| `bridge.ts` | JSON-RPC 2.0 over `postMessage`: requests, the opening tool's result, host context, teardown |
| `server.ts` | typed calls to the page's three tools: its sync, its answer to a capture, and `cad_http` |
| `tunnel.ts` | the `fetch` over `cad_http`, a long body a range at a time, and the CAD client over it (`App.tsx` makes one per view): the library, Open, Reveal and the person's settings among its requests |
| `prompt.ts` | Quick Edit's chat: `chatReach`, what the host's chat takes, and the prompt port over it — Queue through `ui/update-model-context` (a text block titled `Quick edit · <file>` and the sketch's image block, kept until the host clears its model context), Send through `ui/message` — with references as absolute paths (Copy Prompt spells them as copied references are) |
| `live.ts`, `sync.ts` | the mounted view's live controller (`@text-to-cad/ui/host`'s registry), and its sync (`cad_sync`), every second: its state for the agent, the agent's requests (`show`, `capture`), the catalog's revision and its build feeds |
| `presentation.ts` | how the host presents the page, and the election that retires older inline views |
`ModelView.tsx` is the page: the shared `CadViewer` (`@text-to-cad/ui/cad-viewer`,
the one the web Viewer shows) showing the launch's model, with this host's ports — its
tunnel (which also carries a copied prompt's sketch to the server: `attachments`), the
explorer's folders and search over it (`createCadFileSource`), its chat, its file menu
(copy path, Reveal), the app menu's links (its Send feedback and
an alert's Report Issue open a new issue), followed through `ui/open-link`,
and its home: the library, with Open, the desktop's file chooser, where any file can be
chosen. A view keeps its tab record in memory (`App.tsx`): the model on screen keeps
its view — camera, Display settings, pose — through updates of it, and leaving it for
another model or the home drops it, as in the web Viewer. A view the
host creates again (its frame re-created) starts afresh: nothing names a view across its
frames, so there is nothing to keep its record under. `App.tsx` frames it (full page, or
an inline card whose height the host is told; its Full size is the last of the navbar's
own controls, before the view's Display and Preview). In a tab, preview's playbar sits on the line of Codex's
composer, which floats over the page (`--cad-viewport-bottom-center`), and the
home's list scrolls clear of it (`--cad-host-bottom-inset`).
## Develop
```bash
npm run build:mcp # packages, then this app
npm --prefix apps/mcp run test # jsdom units
scripts/install/dev_install.py codex --restart # run it in the Codex app
scripts/install/dev_install.py claude-desktop # run it in Claude Desktop (then restart it)
```
`scripts/test/test-js.sh --select mcp` is what CI runs: the tests, then the
build. Every host `dev_install.py` takes is in CONTRIBUTING.md ("Test In Agent
Apps"). A checkout's `cadgen mcp` serves `apps/mcp/dist` when it exists
(`CADGEN_MCP_APP_DIR` overrides it); a wheel serves `cadgen/_runtime/mcp`,
built by `scripts/bundle/bundle.sh`.
End of document.