# 3DJ Studio — MCP Connector Guide (Claude & ChatGPT)

**Canonical MCP Endpoint:** `https://www.3dj.app/api/mcp` (alias: `https://3dj-neuraldeepnet.on.adaptive.ai/api/mcp`)  
**Transport:** Streamable HTTP (`POST /api/mcp`) + SSE (`GET /api/mcp`)  
**Protocol Versions:** `2026-07-28` (stateless, per-request metadata, `server/discover`), and by handshake `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05`  
**Authentication:** OAuth 2.1 + S256 PKCE + Dynamic Client Registration (`Bearer 3djoa_...`) or per-user API key (`Bearer 3dj_live_...`, minted at `https://www.3dj.app/agents`).  
**Reviewer / User Sign-In Helper:** `https://www.3dj.app/api/oauth/login`  
**Website & Legal:** `https://www.3dj.app` · `/support` · `/privacy` · `/terms`

---

## 1. Scope & Workflow Boundaries

3DJ Studio (`https://www.3dj.app`) is an industrial parametric 3D CAD, DfAM 3D-printing, live Three.js configurator, OpenSCAD validation, and 3D concept modeling program (built directly for 3D CAD, mechanical engineering, 3D printing, and GLB/OpenUSD workflows — never an audio or music DJ tool):

- **Public Starter, Build-Validation, Configurator & Brief Tools (`noauth`):** Inspect editable Replicad B-Rep CAD starters (`cad_get_starters`, with `index: true` for a lightweight starter list), build and measure a B-Rep script in the isolated OpenCascade kernel (`cad_validate_script`), inspect or reopen a script or saved `modelId` as a live Three.js configurator with `Param.*` schema, parts, joints, and CDN imports (`cad_get_configurator`), inspect Design Evidence Pack DfAM gates (`cad_get_evidence_schema`), retrieve editable OpenSCAD starters (`openscad_get_starters`), and compose a product render brief plus Blender/FreeCAD/Fusion handoff steps (`compose_design_brief`) without authentication.
- **Server-Side CAD Export, Gallery Save & Live Configurator Publishing (`models:write`):** Build a script with chosen parameter values and download a measured binary STL (or `stl-fins` with breakaway Support Fins), ISO 10303 STEP, GLB (one named, coloured node per part, for Blender and viewers) or per-part ZIP with BOM (`cad_export_model`); build and save an editable part to the account gallery (`cad_save_model`); or publish a live Three.js configurator (`cad_publish_configurator` -> `https://www.3dj.app/configurator/<id>`).
- **MCP Apps (`ui://3dj/configurator`):** `cad_get_starters`, `cad_validate_script`, `cad_get_configurator`, `cad_save_model`, and `cad_publish_configurator` link the `ui://3dj/configurator` MCP App resource so Claude can render the live Three.js configurator inline.
- **Isolated OpenSCAD Compilation & Measurement (`models:write`):** Compile portable OpenSCAD source in an isolated OpenSCAD/Manifold engine (`openscad_compile_model`, read-only validation), measure bounding box, triangle count, watertightness, and optional printer build-volume fit.
- **Saved Gallery & Concept 3D Mesh Generation (`account:read`, `models:read`, `models:write`):** Check account status (`get_account_status`) and live provider availability (`list_providers`), start asynchronous text/image-to-3D jobs (`generate_from_text`, `generate_from_image_url`), poll status (`get_generation_status`), list owned models (`list_my_models`, `cad_list_models`), and retrieve `.glb` / `.stl` download links (`get_model_download_url`).
- **Print Quote Review Lifecycle (`quotes:read`, `quotes:write`):** Submit saved models for operator quote review (`request_print_quote`), inspect requests and operator-issued EUR quotes (`list_print_requests`, `list_print_quotes`), accept exact quote terms (`accept_print_quote`), or cancel pending requests (`cancel_print_request`). **Accepting a quote records terms only (`paymentRequiredNow: false`)—no payment checkout, subscription upgrade, printer dispatch, or shipping action is executed by the connector.**

---

## 2. Tool Catalogue (32 Tools)

| Tool | Auth / OAuth Scope | Read-Only | Idempotent | Summary |
| --- | --- | --- | --- | --- |
| `openscad_get_starters` | `noauth` | Yes | Yes | Retrieve 3 editable OpenSCAD starters and portable language rules. |
| `cad_get_starters` | `noauth` | Yes | Yes | Retrieve verified Replicad B-Rep parametric CAD starters (or `index: true` summary list) and DSL reference. |
| `cad_validate_script` | `noauth` | Yes | Yes | Build a Replicad CAD script in the isolated kernel, measure it, extract `Param.*` controls, and optionally return a preview PNG (`preview: true`). |
| `cad_render_views` | `noauth` | Yes | Yes | Build a script and return orthographic/isometric PNG views (`iso`, `front`, `top`, `right`) as MCP `image` content, with section cuts and DfAM highlights. |
| `cad_check_assembly` | `noauth` | Yes | Yes | Check a multi-part assembly for pairwise interference volumes, minimum surface clearance, and `placeAt` joint range collisions. |
| `cad_import_model` | `models:write` | No | No | Import STEP, STL or GLB (URL or base64 <= 20 MB) as private reference geometry (`importedModel("<id>")`) or delete on request (`deleteModelId`). |
| `cad_compare_revisions` | `noauth` | Yes | Yes | Compare two script or saved `modelId` revisions and return parameter, size, volume, mass, part and check deltas plus an overlay PNG. |
| `cad_export_drawing` | `models:write` | No | No | Export a one-page A4 manufacturing drawing (PDF, SVG or DXF) with front/top/right orthographic views, isometric, title block, overall dimensions and `dim: true` parameters. |
| `cad_save_feature` | `models:write` | No | Yes | Validate and save a reusable parametric feature (`defineFeature` / `lib.mine.<name>`) to your private account library (cross-account team sharing is gated until workspace membership is configured). |
| `cad_list_features` | `models:read` | Yes | Yes | List reusable parametric features (`lib.mine.<name>`) saved in your account library. |
| `cad_add_review_comment` | `models:write` | No | No | Pin a design review comment to an owned saved CAD model, revision, part name or 3D point `[x, y, z]` in mm. |
| `cad_list_review_comments` | `models:read` | Yes | Yes | List design review comments pinned to an owned saved CAD model or revision. |
| `cad_get_configurator` | `noauth` | Yes | Yes | Inspect a script or saved `modelId`: returns `Param.*` schema, parts, connectors/joints, BOM, and pinned CDN URLs for `<threedj-configurator>`. |
| `compose_design_brief` | `noauth` | Yes | Yes | Measure a script and prepare a product render brief plus Blender / FreeCAD / Fusion / slicer / SketchMonkey handoff steps. Returns an inline viewport preview; stores nothing. |
| `cad_get_evidence_schema` | `noauth` | Yes | Yes | Retrieve 3DJ DfAM manufacturing gates and STEP/STL specification. |
| `get_account_status` | `account:read` | Yes | Yes | Check connected 3DJ account ID, saved model counts, and print-request gate. |
| `list_providers` | `account:read` | Yes | Yes | Check live 3D provider availability and remaining hourly/daily allowance. |
| `openscad_compile_model` | `models:write` | Yes | No | Compile OpenSCAD source in isolated Manifold engine and measure dimensions/fit. |
| `generate_from_text` | `models:write` | No | No | Start an asynchronous 3D concept mesh job from a text prompt. |
| `generate_from_image_url` | `models:write` | No | No | Start an asynchronous 3D concept mesh job from a public HTTPS image URL. |
| `get_generation_status` | `models:read` | Yes | Yes | Poll an owned 3D generation job (`processing`, `complete`, `failed`). |
| `list_my_models` | `models:read` | Yes | Yes | List owned saved 3D models (`glb` and `stl`). |
| `cad_list_models` | `models:read` | Yes | Yes | List owned parametric CAD (`script-cad`, `photo-cad`, `primitive`) parts. |
| `cad_export_model` | `models:write` | No | No | Build a script server-side and return a measured STL / Support Fins STL / STEP / GLB / ZIP download URL (30/hour, 150/day). |
| `cad_save_model` | `models:write` | No | No | Build a script server-side and save it as an editable gallery part with an STL and a workbench link (20/hour, 100/day). |
| `cad_publish_configurator` | `models:write` | No | No | Build and publish a live Three.js configurator to the gallery (`https://www.3dj.app/configurator/<id>`). |
| `get_model_download_url` | `models:read` | Yes | Yes | Return the HTTPS download URL and format (`glb` / `stl`) for an owned model. |
| `request_print_quote` | `quotes:write` | No | Yes | Submit an owned saved model for operator print quote review. |
| `list_print_requests` | `quotes:read` | Yes | Yes | List owned print quote requests and operator review notes. |
| `cancel_print_request` | `quotes:write` | No | Yes | Cancel an active print quote request owned by the caller. |
| `list_print_quotes` | `quotes:read` | Yes | Yes | List operator-issued EUR print quotes for the caller's requests. |
| `accept_print_quote` | `quotes:write` | No | Yes | Record customer acceptance of exact operator quote terms (`quoteId` + `quoteHash`). |

---

## 3. Writing Scripts That Configure Well (`@neuraldeep/3dj-runtime` & `<threedj-configurator>`)

1. **Grouped `Param.*` declarations:** Declare overall envelope parameters (`Width`, `Depth`, `Height`) first, wall/clearance parameters next, and feature counts or joint angles last.
2. **Explicit bounds, steps, and units:** Always supply `{ min, max, step, unit: "mm" }` (or `unit: "deg"`, `integer: true`) on `Param.number(...)` so sliders have sensible ranges.
3. **Choices for variants:** Use `Param.choice("Material", "Matte PLA", ["Matte PLA", "PETG", "ASA"])` for discrete options and pass the choice to `.material(finish)`.
4. **Joints as `Param.number`:** Drive `placeAt` joints with a parameter (e.g. `const opening = Param.number("Opening", 35, { min: 0, max: 110, unit: "deg" }); lid.placeAt(base, "hinge", "hinge", { angle: opening });`) so the configurator can swing or slide the joint live.
5. **CDN imports for single-page HTML artifacts:** Use `https://cdn.jsdelivr.net/npm/three@0.183.0/build/three.module.js` and `https://cdn.jsdelivr.net/npm/@neuraldeep/3dj-runtime@0.1.0/dist/index.js` (or `<threedj-configurator>` from `https://cdn.jsdelivr.net/npm/@neuraldeep/3dj-runtime@0.1.0/dist/threedj-configurator.js`, see `https://www.3dj.app/examples/configurator.html`).

---

## 4. Data Handling & Safety Guarantees

- **Strict Account Isolation & OAuth Scopes:** Every authenticated tool derives `userId` exclusively from the validated OAuth 2.1 access token (`3djoa_...`, SHA-256 hashed at rest, bound to `https://www.3dj.app/api/mcp` or its `3dj-neuraldeepnet.on.adaptive.ai` alias) or per-user API key (`3dj_live_...`). Missing credentials return `HTTP 401` with all 5 scopes in `WWW-Authenticate`; insufficient scope returns `HTTP 403` with `error="insufficient_scope"` and `scope="<needed>"`.
- **Sensitive Personal Data Refusal:** Payment card numbers (Luhn), government IDs, PHI/medical records, biometric templates, and secret tokens are refused before execution (`sensitive_data_prohibited`).

---

## 5. AI Client & Desktop CAD Integrations

- **Anthropic Claude (Visual Live 3D Configurator & PNG Views):** [`NeuralDEEPnet/3dj-claude-plugin`](https://github.com/NeuralDEEPnet/3dj-claude-plugin) (`/plugin marketplace add NeuralDEEPnet/3dj-claude-plugin`) or custom MCP connector `https://www.3dj.app/api/mcp` (`ui://3dj/configurator` + `cad_render_views`).
- **OpenAI ChatGPT & Codex:** `plugins/3dj-studio` in `NeuralDEEPnet/3dj` (`https://www.3dj.app/api/mcp` with OAuth 2.1 + PKCE), plus Custom GPT Actions OpenAPI 3.1 at `https://www.3dj.app/api/gpt/openapi.json` (inline visual `![3DJ 3D Preview]` renders).
- **Google Gemini CLI & AI Studio / Vertex:** `gemini extensions install https://github.com/NeuralDEEPnet/3dj` (`gemini-extension.json`), plus OpenAPI 3.0.3 (`https://www.3dj.app/api/gemini/openapi.json`) and Function Declarations (`https://www.3dj.app/api/gemini/tools.json`).
- **Blender 4.2+ add-on** (`integrations/blender`): pulls starters and gallery parts as GLB through `cad_export_model`, rebuilds after parameter edits, saves back with `cad_save_model`, and pushes meshes via `PUT https://www.3dj.app/api/assets/mesh`.
- **Autodesk Fusion 360 add-in** (`integrations/fusion360`): pulls 3DJ parametric models as native editable multi-body ISO 10303 STEP and pushes active Fusion components to 3DJ via `cad_import_model`.
- **Shapr3D iPadOS / macOS / Windows bridge** (`integrations/shapr3d`): millimeter AP214 STEP round-trip with Apple Shortcuts Share-Sheet guide and zero-dependency sync bridge.
- **FreeCAD 1.0+ macro** (`integrations/freecad`): `ThreeDJStudio.FCMacro` for 2-way OpenCascade STEP import and `importedModel(id)` push-back.
