Documentation navigation

CAD over MCP

The AiChat MCP server lets an external agent create and edit parametric build123d models, inspect saved revisions, measure clearance, and search parts and materials. Projects and revisions stay in your AiChat account. Builds run in isolated CAD sandboxes; the external agent supplies the model reasoning.

The Streamable HTTP endpoint is:

text
https://aichat.cinderworks.ai/mcp

Connect

You need an AiChat account. Local agent access must be enabled by the operator; the endpoint returns 404 while it is off. OAuth sign-in requires a client that supports Client ID Metadata Documents (CIMD).

Claude and Claude Desktop

In Settings ▸ Connectors ▸ Add custom connector, enter the endpoint above. Sign in to AiChat in the browser, then approve the requested access on the consent page. Enable the connector in your conversation.

Claude Code

bash
claude mcp add --transport http aichat https://aichat.cinderworks.ai/mcp

Run /mcp in Claude Code and select AiChat to sign in through the browser.

Codex

bash
codex mcp add aichat --url https://aichat.cinderworks.ai/mcp
codex mcp login aichat

Sign in through the browser. The equivalent entry in ~/.codex/config.toml is:

toml
[mcp_servers.aichat]
url = "https://aichat.cinderworks.ai/mcp"
tool_timeout_sec = 240

The timeout allows a CAD build to finish within its three-minute deadline. See the Codex MCP documentation for configuration and client support.

Access tokens

In AiChat Settings ▸ Local agents, create an access token with read access and, if needed, write access. Copy it once and configure your client's HTTP authorization header:

text
Authorization: Bearer cwk_…

For Codex, set bearer_token_env_var = "AICHAT_ACCESS_TOKEN" in the server's config table and supply that environment variable to Codex.

Scopes

ScopeAllows
cad:readInspect your projects, revisions, geometry evidence, views, parts and materials; open a workspace for those reads.
cad:writeCreate projects, propose checks, create alternatives, build or restore revisions, and add library parts or materials. Requires cad:read as well.
offline_accessKeep the connection signed in using rotating OAuth refresh tokens. Adds no CAD permissions.

Tools

Tools use a workspace handle from Open CAD workspace. Read tools do not edit the design. Design and library writes require write access and are annotated for client confirmation. Opening a workspace is also marked as a write because it creates audit state, but requires only read access.

Tool titleToolAccessPurpose
Open CAD workspacecad_open_workspaceWrite (audit; read scope)Open a credential-bound workspace, optionally for an existing project.
Find CAD projectscad_list_projectsReadPage your saved projects and current revisions.
Find CAD revisionscad_list_revisionsReadPage a project's revision history and build status.
Browse CAD groupscad_list_groupsReadFind named groups or browse an assembly hierarchy.
Find CAD partscad_list_partsReadPage part facts by exact IDs, labels or group.
Find CAD uploadscad_list_importsReadPage saved STEP uploads for a project.
Read CAD projectcad_open_projectReadGet a compact overview of a project or historical revision.
Read CAD startercad_read_starterReadRead the public starter source or build contract.
Read CAD revision evidencecad_read_revisionReadRead source, parameters, checks, part facts, provenance or downloads.
Look at the CAD modelcad_viewReadRender orthographic views, or explicit capture frames as overlays, guides or masks.
Check the fit against photoscad_fit_checkReadCompare selected parts against explicit capture frames using oriented photo edges and depth; return scores and overlays.
Measure clearancecad_measureReadRead recorded kernel clearance between parts or groups.
Find matching CAD partscad_resolve_partsReadRank lexical matches for a part reference without a model call.
Search standard partscad_library_searchReadSearch standard hardware and saved STEP parts.
Search materialscad_material_searchReadFind material IDs, properties, units and sources.
Create CAD projectcad_create_projectWriteCreate a project with a build123d starter.
Propose a measured CAD checkcad_propose_checkWriteFreeze expected dimensions for one separate rectangular addition.
Create CAD alternativescad_create_alternativesWriteMake lettered alternatives from a revision to build several designs.
Build CAD revisioncad_buildWriteBuild source or parameter edits as a saved revision.
Restore CAD revisioncad_restore_revisionWriteRestore an earlier ready design as a new revision.
Delete CAD alternativecad_delete_alternativeWriteDelete an agent-made alternative that has no builds of its own.
Delete CAD workspacecad_delete_projectWritePermanently delete a workspace and its files, after the user confirms its exact name.
Add a library partcad_part_addWriteSave and measure a STEP file as a reusable part.
Create materialscad_material_createWriteAdd sourced material properties to your library.
Refresh CAD scenecad_viewer_sceneRead; viewer onlyRenew the scene URL for the same saved revision.

Alternatives

For several designs of one request, Create CAD alternatives makes up to six named alternatives at once, lettered in order (B, C, D…), each starting from the current model or another ready revision. Build CAD revision with option set to a letter builds into that alternative; the main model doesn't change. Each alternative appears in the workspace's model menu as it's made, and keeping one is your choice in AiChat. A project holds up to 50 alternatives; an alternative an agent made that has no builds of its own can be deleted, and its letter is never given to another. Pass the same idempotency_key to make a retried call return the same alternatives: any deleted since are marked deleted rather than made again, and the key can't be reused with different names or base.

Part phases

A home or renovation project models the house as it stands with parts of phase existing, and each design change as phase new parts plus phase removal volumes: boxes marking material to demolish or cut, such as an opening widened through a wall. Part facts include phase when the source declares one; an unphased part counts as new.

Existing parts are never edited to show a design. A build into an alternative, or in a project with a protected revision, fails when an existing part is missing, changes phase or changes shape (existing_part_changed and related codes), or when it adds survey parts. On the main model of an unprotected project the build succeeds and records the change as a survey correction, with a warning. Removal volumes have no material, stay out of the BOM, mass and STL, and show as red ghosts; the preview cuts existing parts open where they reach. STEP keeps every part uncut, with removal volumes labelled "(removal)".

Part provenance

A build can record how each part it adds or changes was known, keyed by part ID: observed (fitted to capture evidence or a tape measurement), estimated (standard sizes, priors or partial views), inferred (a small unseen gap filled by symmetry or continuation) or unknown (a placeholder), with optional capture IDs, a scale source (arkit, tape or prior) and a short note. Pass it as provenance on Build CAD revision: up to 200 entries within 32 KB, and every capture must belong to the project.

Later builds keep a part's record while its geometry stays the same, measured by its geometry fingerprint; a part that changes loses its record unless the build records it again, and an attempt that fails records nothing. Restoring or keeping a revision keeps its records. The build result summarises how many parts are recorded, carried over or unrecorded, and cad_read_revision with section provenance lists every part. Notes are the agent's own text and are treated as data, not instructions.

Architecture kit

Build source can model a building with from arch import ...: walls whose joins and openings are data, door and window fills, removal boxes, slabs and rooms. cad_library_search with category architectural returns its reference, and it is part of aichat://cad/guidance. Walls mitre where they meet, and the kit derives every solid from those records, so the same source gives the same parts. A new opening in an existing wall becomes a removal box plus a new door or window, and the wall itself is never cut, so alternatives keep the surveyed house unchanged. The kit refuses impossible requests with a code and a fix (opening_outside_wall: … Fix: offset must be 0–3100). A RoomPlan scan becomes a survey model whose source holds the scan as data (ws = load_plan(PLAN)): existing walls, openings, door and window placeholders and floors, ready to protect before designing on it.

Builds with kit parts run an advisory house check: the receipt's summary.arch counts its errors, warnings and notes and lists the first, and cad_read_revision with section arch lists every issue and the rooms the walls enclose. It never fails a build, and issues on existing parts alone are notes, since it judges the design rather than the survey.

Revisions of a house project carry the house plan as data. cad_read_revision with section plan lists the plan's elements (walls, openings, floors, roofs and more) with their sources, and filters by ids. A revision without a plan reports available: false.

Resources and prompts

  • aichat://cad/guidance: CAD modelling guidance and evidence limits.
  • aichat://cad/library: the standard parts catalog.
  • aichat://cad/projects/{project}/revisions/{revision}: a compact owned revision overview, available without opening a workspace.
  • ui://aichat-cad/viewer: the inline 3D viewer.

The optional prompts are design_part (description and constraints), fix_interference (project ID) and review_revision (project ID and optional revision ID). They provide starting workflows for those requests.

Inline 3D viewer

Clients with MCP Apps support show the model in the conversation after a build, revision read or rendered view. The message holds a preview card: the rendered view, or a still frame of the model, with the part count and any overlaps. Expand opens the interactive viewer full screen, with the parts and interference lists. Pop out keeps it in a floating window while you keep chatting. Each appears when the client supports that mode. In the viewer, orbit, zoom, fit the model, select parts and inspect interference highlights. Clients without either mode offer Interactive 3D in the message instead; click the model before scrolling to zoom it. Open in AiChat opens the saved revision in the full workspace.

Where the client accepts it, the viewer tells the agent which revision you are looking at and which parts you have selected. Scene links expire after ten minutes and the viewer can refresh them. Clients without MCP Apps support receive text results and model links.

Manage access

AiChat Settings ▸ Local agents lists access tokens and OAuth grants with their permissions. Revoke a grant or token there to stop its next request. Revocation preserves your projects and revisions. Reconnect and sign in again to grant new access.

Limits

  • A workspace admits at most 20 builds per hour. Account quotas and the 50 builds per day CAD limit also apply.
  • A build waits at most three minutes and sends progress about every five seconds. Interruption or cancellation cancels the build; its saved status distinguishes ready, failed and cancelled attempts.
  • Workspace handles expire seven days after their last use and belong to the credential that opened them.
  • Inspection and build text results use a 12 kB serialized budget. Larger inventories and source return cursors or explicit fragments; rendered images and catalog results have separate bounds. Lists default to 20 rows, with at most 50; source searches default to five matches.
  • MCP requests are limited to 4 MiB. STEP files added to the parts library are limited to 25 MiB.

Geometry checks establish the facts reported in a revision. They do not certify structural strength, printability or manufacturing readiness.

Privacy and support

AiChat stores your projects, source, revision artifacts, and tool audit records in conversations named External agent · …. A measured-check proposal also stores the short owner request supplied by the external agent. The server does not retrieve your external client's chat history. OAuth stores client metadata, consent grants and token records; access tokens are stored as hashes.

See the privacy policy for storage, service providers and retention. For support, email [email protected].