Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(openai): serve the ChatGPT plugin from a surface that needs no frameDomains, behind a two-origin CSP
nirholas41cfaecc6d1a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c460c9480..5eaf03991 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-09-12- **Corrected what the 3D Studio connector declares about checking a pending job**: The tool that collects a finished 3D generation was labelled a read-only status probe. It is not: the first check that finds a job done copies the model into permanent storage, records it, and scores it, and it can route failed work to another provider. Any AI client reading those labels to decide whether a call is safe to repeat was being told the wrong thing. The labels and the documentation now match the behaviour. Nothing about how the tool works changed. (`/docs/mcp-studio`) `[fix, sdk]`+- **The 3D viewer inside ChatGPT now loads everything through three.ws**: The interactive viewer that shows your 3D model inside ChatGPT now fetches every model and every preview image through three.ws itself, so the only places it is allowed to reach are three.ws and the 3D viewer library it runs on. Nothing about what you see changes: the model still renders, spins and downloads the same way. There is also a dedicated connection address for the ChatGPT plugin directory, https://three.ws/api/mcp-chatgpt, carrying the eight 3D creation tools. The existing connector at https://three.ws/api/mcp-studio keeps every tool, including the living agent body. (`/docs/mcp-studio`) `[improvement, security]`## 2026-09-11diff --git a/STRUCTURE.md b/STRUCTURE.mdindex d9c12a931..0c529e768 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -95,7 +95,7 @@ bottom.| Conversational refinement + remix economy | Iterate: [api/_mcp-studio/tools.js](api/_mcp-studio/tools.js) `refine_model` (free, on `/api/mcp-studio`) + [mcp-server/src/tools/refine-model.js](mcp-server/src/tools/refine-model.js) (paid stdio, $0.25); shared lineage core [mcp-server/src/tools/_lineage.js](mcp-server/src/tools/_lineage.js). Remix (paid track): feed [api/remix-feed.js](api/remix-feed.js) `→ /api/remix-feed` (free browse/publish/lineage), settlement [api/x402/remix-asset.js](api/x402/remix-asset.js) `→ /api/x402/remix-asset` + core [api/_lib/remix-settlement.js](api/_lib/remix-settlement.js) + split math [api/_lib/remix-royalty.js](api/_lib/remix-royalty.js). Docs [docs/remix.md](docs/remix.md), [docs/mcp-studio.md](docs/mcp-studio.md). | Live | Talk to a model to iterate it ("make it metallic") — real anchored re-generation with a revertable/branchable version lineage rendered as a viewer version strip; free on both the OpenAI 3D Studio and the paid MCP server. Creators publish a finished model as remixable (provenance + license + royalty on the existing `forge_creations` rows — no parallel store); another agent pays $0.25 USDC to remix it and a creator-set royalty (≤20%, capped) routes on-chain to the original creator via the audited `transferSolanaUSDC` rail. Split/caps/payout unit-tested ([tests/remix-settlement.test.js](tests/remix-settlement.test.js), [tests/remix-royalty.test.js](tests/remix-royalty.test.js), [tests/refine-lineage.test.js](tests/refine-lineage.test.js)). Free track stays crypto-free. Prompt 09. || Terminal renderer (3D in a shell, no GPU) | Renderer core [packages/tty-3d/](packages/tty-3d) (`@three-ws/tty-3d`, CLI `three-tty`), hosted stream [api/tty.js](api/tty.js) `→ /tty`, `/tty/:id`, `/api/tty`, page [pages/tty.html](pages/tty.html) + [src/tty-page.js](src/tty-page.js) `→ /tty`. Docs: [docs/tty.md](docs/tty.md). Tests: [packages/tty-3d/tests/tty-3d.test.js](packages/tty-3d/tests/tty-3d.test.js), [tests/api-tty.test.js](tests/api-tty.test.js) | Live | `curl three.ws/tty` and a rigged agent walks in your terminal, with nothing installed on either side. A pure-CPU software rasterizer (z-buffer, per-vertex linear blend skinning off the glTF animation samplers, meshopt decode on the way in) draws into a framebuffer the size of the caller's terminal and encodes it as `▀` half-blocks, so one cell carries two independently coloured pixels and pixels come out square. The server streams paced frames as `text/plain`, so the HTTP response IS the animation. Sibling of [packages/tty-avatar/](packages/tty-avatar), which adds moods, avatar-id resolution and Claude Code hooks on top of a terminal renderer but deliberately does not do skeletal animation; this package owns the 3D. || Restyle Studio (material/PBR editor + AI restyle + variants) | [pages/restyle.html](pages/restyle.html) `→ /restyle`, [src/restyle.js](src/restyle.js). PBR preset/variant library [packages/viewer-presets/src/materials.js](packages/viewer-presets/src/materials.js) (`@three-ws/viewer-presets`). AI restyle + persistence core [api/_lib/material-studio-store.js](api/_lib/material-studio-store.js), free hosted endpoint [api/material-studio.js](api/material-studio.js) `→ /api/material-studio`; paid agent twin [mcp-server/src/tools/restyle-material.js](mcp-server/src/tools/restyle-material.js) (`restyle_material`, $0.05 stdio MCP), thin core [mcp-server/src/tools/_material-core.js](mcp-server/src/tools/_material-core.js). Shares the `refine_model` lineage core ([mcp-server/src/tools/_lineage.js](mcp-server/src/tools/_lineage.js)) so a restyle/variant is just another kind of version, feeding prompt 09 remix. Docs: [docs/restyle.md](docs/restyle.md), [docs/mcp-tools.md](docs/mcp-tools.md). | Live | Re-skin any GLB without regenerating its mesh: live PBR editing (color/metalness/roughness/emissive/texture) with a one-click preset library (18 looks: chrome, gold, copper, brushed steel, gunmetal, matte, glossy, rubber, ceramic, glass, real glass, wood, stone, fabric, skin, car paint, neon, holographic), seeded reproducible colorway variants (mulberry32 PRNG, so the same base plus seed yields the same set), and free-text AI restyle ("make it chrome", "cyberpunk neon") via IBM Granite-proposed PBR factors applied + re-exported server-side. Every AI restyle / saved checkpoint mints a real, `gltf-validator`-checked, durably-stored GLB recorded in an immutable parent to child lineage: non-destructive in the durable sense, not just an in-browser Reset. Every server failure surfaces the API's own `error_description`, and a storage outage says so and points at Export GLB, which is wholly in-browser. Roadmap prompt 06. |-| Embodiment: a living agent body in the chat | Hosted embed [pages/embodiment/embed.html](pages/embodiment/embed.html) `→ /embodiment/embed` (Vite input + vercel route, `frame-ancestors *`); engine [apps-sdk/embodiment/embodiment-stage.js](apps-sdk/embodiment/embodiment-stage.js) (`EmbodimentStage`) + [overlay.js](apps-sdk/embodiment/overlay.js); persona tools (free) [api/_mcp-studio/persona-tools.js](api/_mcp-studio/persona-tools.js) → `/api/mcp-studio` (`create_agent_persona`, `get_agent_persona`, `persona_say`) and (paid) [api/_mcp3d/tools/studio.js](api/_mcp3d/tools/studio.js); shared inline-body artifact [api/_lib/embodiment-artifact.js](api/_lib/embodiment-artifact.js); identity store [api/_lib/persona-store.js](api/_lib/persona-store.js) (Postgres `agent_personas` + fs fallback + durable R2 GLB); reload route [api/mcp3d/persona.js](api/mcp3d/persona.js) `→ /api/mcp3d/persona`; live chain-state feed [api/mcp3d/persona-identity.js](api/mcp3d/persona-identity.js) `→ /api/mcp3d/persona-identity` (polled only when the embed is opened with `?wallet=1`). Emotion/rig/lip-sync cores under [src/embodiment/](src/embodiment) + [src/voice/](src/voice). | Live | A generated avatar becomes a persistent, named body that renders inline in ChatGPT/Claude: it lip-syncs each reply, blends the matching expression + gesture, idles between turns, and reloads by `persona_id` in a fresh session (the id is the capability, no sign-in). Rides the universal canonicalize/retarget clip library; a rig without face morphs animates the jaw, a non-humanoid GLB falls back to a gentle idle (`decideRigMode`/`supportsCanonicalClips`), never a bind-pose T-pose. Zero crypto/token surface. Tests: [tests/persona-store.test.js](tests/persona-store.test.js), [tests/api/persona-resolve-route.test.js](tests/api/persona-resolve-route.test.js), [tests/api/persona-identity-route.test.js](tests/api/persona-identity-route.test.js), [tests/mcp-studio.test.js](tests/mcp-studio.test.js), [tests/embodiment-rig-mode.test.js](tests/embodiment-rig-mode.test.js). Evidence: [prompts/store-submissions/_generated/embodiment/](prompts/store-submissions/_generated/embodiment/). Store-submission prompt 07. |+| Embodiment: a living agent body in the chat | Hosted embed [pages/embodiment/embed.html](pages/embodiment/embed.html) `→ /embodiment/embed` (Vite input + vercel route, `frame-ancestors *`); engine [apps-sdk/embodiment/embodiment-stage.js](apps-sdk/embodiment/embodiment-stage.js) (`EmbodimentStage`) + [overlay.js](apps-sdk/embodiment/overlay.js); persona tools (free) [api/_mcp-studio/persona-tools.js](api/_mcp-studio/persona-tools.js) → `/api/mcp-studio` (`create_agent_persona`, `get_agent_persona`, `persona_say`; deliberately absent from the ChatGPT plugin surface `/api/mcp-chatgpt`, because their widget needs `frameDomains`) and (paid) [api/_mcp3d/tools/studio.js](api/_mcp3d/tools/studio.js); shared inline-body artifact [api/_lib/embodiment-artifact.js](api/_lib/embodiment-artifact.js); identity store [api/_lib/persona-store.js](api/_lib/persona-store.js) (Postgres `agent_personas` + fs fallback + durable R2 GLB); reload route [api/mcp3d/persona.js](api/mcp3d/persona.js) `→ /api/mcp3d/persona`; live chain-state feed [api/mcp3d/persona-identity.js](api/mcp3d/persona-identity.js) `→ /api/mcp3d/persona-identity` (polled only when the embed is opened with `?wallet=1`). Emotion/rig/lip-sync cores under [src/embodiment/](src/embodiment) + [src/voice/](src/voice). | Live | A generated avatar becomes a persistent, named body that renders inline in ChatGPT/Claude: it lip-syncs each reply, blends the matching expression + gesture, idles between turns, and reloads by `persona_id` in a fresh session (the id is the capability, no sign-in). Rides the universal canonicalize/retarget clip library; a rig without face morphs animates the jaw, a non-humanoid GLB falls back to a gentle idle (`decideRigMode`/`supportsCanonicalClips`), never a bind-pose T-pose. Zero crypto/token surface. Tests: [tests/persona-store.test.js](tests/persona-store.test.js), [tests/api/persona-resolve-route.test.js](tests/api/persona-resolve-route.test.js), [tests/api/persona-identity-route.test.js](tests/api/persona-identity-route.test.js), [tests/mcp-studio.test.js](tests/mcp-studio.test.js), [tests/embodiment-rig-mode.test.js](tests/embodiment-rig-mode.test.js). Evidence: [prompts/store-submissions/_generated/embodiment/](prompts/store-submissions/_generated/embodiment/). Store-submission prompt 07. || Claude.ai artifact embed + builder | Endpoint [api/artifact.js](api/artifact.js) `→ /api/artifact`, prebuilt viewer [public/artifact-viewer.bundle.js](public/artifact-viewer.bundle.js) (source [scripts/artifact-viewer/src.js](scripts/artifact-viewer/src.js), `npm run build:artifact-viewer`), builder page [public/artifact/index.html](public/artifact/index.html) `→ /artifact` + [README](public/artifact/README.md), contract [specs/CLAUDE_ARTIFACT.md](specs/CLAUDE_ARTIFACT.md), vendored sandbox CSP [public/claude-artifact-csp.txt](public/claude-artifact-csp.txt) (refresh: [scripts/refresh-claude-csp.mjs](scripts/refresh-claude-csp.mjs)). | Live | `GET /api/artifact?agent=<uuid>` returns ONE self-contained HTML document with three.js, GLTFLoader, the viewer and the agent GLB all inlined, because Claude's artifact sandbox CSP blocks every external script and fetch. Paste the URL into a Claude conversation and the agent renders inline. The builder page is the pre-flight: it lists real public agents that carry an embeddable avatar (`/api/agents/public?avatar=1`), renders the response in a sandboxed iframe under the same CSP Claude applies, and reports payload size, fetch time, frame render time and sandbox compliance before you paste. Size is graded against the ceiling the endpoint can actually emit (a 6 MB model base64-inlines to 8 MB, plus the 565 KB viewer), not against the raw model cap, so a large-but-accepted artifact is not flagged as over budget. `?model=<glb url>` is the viewer-only lane (allowlisted https origins, SSRF-guarded, 6 MB cap). Tests: [tests/api/artifact.test.js](tests/api/artifact.test.js) pins the generated HTML against the vendored Claude CSP. || Avatar Artifact: the standalone shareable viewer | Page [pages/avatar-artifact.html](pages/avatar-artifact.html) `→ /avatar-artifact`, scene + artifact loader [src/avatar-artifact.js](src/avatar-artifact.js), docs [docs/avatar-artifact.md](docs/avatar-artifact.md). | Live | One page, one avatar, no wrapper: the URL you paste into an `<iframe>` on someone else's site or send to a person who has never heard of three.ws. `?agent=<uuid>` renders that agent's avatar from the live public record (the name becomes the heading and the document title, an Open profile link appears), `?model=<glb url>` renders any GLB from the same allowlisted hosts `/api/artifact` enforces, and a bare link renders the house portrait: a procedural figure that tracks cursor, touch and arrow keys. Ships no third-party CDN (three.js is bundled, because an embed host never agreed to a cross-origin script) and suspends its render loop on a hidden tab. An avatar with no baked clips is driven by the shared retargeted `idle` from the universal clip library rather than left in a bind-pose T-pose. Every failure lane (no such agent, private avatar, no avatar yet, blocked host, dead model, no WebGL) has its own sentence and its own next move; the Copy embed snippet carries the artifact parameters so the iframe shows what you were looking at. || Spatial MCP (3D as a native response type) | Spec [specs/SPATIAL_MCP.md](specs/SPATIAL_MCP.md), pure validator/builder/lint [public/spatial-mcp/spatial-validator.js](public/spatial-mcp/spatial-validator.js) (published at `https://three.ws/spatial-mcp/spatial-validator.js`; server-side re-export [api/_lib/spatial-mcp.js](api/_lib/spatial-mcp.js)), npm package + conformance fixture corpus [packages/spatial-mcp/](packages/spatial-mcp) (`@three-ws/spatial-mcp`, CC0, drift-guarded byte-identical to the published module), validator tool [api/_mcp3d/tools/spatial.js](api/_mcp3d/tools/spatial.js) (`validate_spatial_response`, free), reference renderer [public/spatial-mcp/spatial-renderer.js](public/spatial-mcp/spatial-renderer.js) + demo/checker [public/spatial-mcp/index.html](public/spatial-mcp/index.html) + [public/spatial-mcp/demo.js](public/spatial-mcp/demo.js) `→ /spatial-mcp`, docs [docs/spatial-mcp.md](docs/spatial-mcp.md). | Live · both stores | Open (CC0) shape for returning a live, interactive 3D scene as a first-class MCP tool result (scene GLB, camera, environment, animation, AR handoff, affordances) instead of a URL. Every three.ws 3D generator emits a conformant artifact under `structuredContent.spatial`; the validator returns actionable errors, not a boolean; the framework-free reference renderer displays any conformant payload — including one transformed from a foreign tool result (portability proof at `/spatial-mcp`). The page runs the real validator in the browser: every rendered payload shows its verdict, and a paste-in checker validates arbitrary payloads as you type (with a deliberately broken example) so an implementer debugs an adapter without leaving the page. Zero coin surface — reusable in the OpenAI free app. Tests: [tests/spatial-mcp.test.js](tests/spatial-mcp.test.js), render smoke [tests/e2e/spatial-mcp-render.spec.js](tests/e2e/spatial-mcp-render.spec.js). Evidence: [prompts/store-submissions/_generated/spatial-mcp/](prompts/store-submissions/_generated/spatial-mcp/). Store-submission prompt 20. |@@ -213,7 +213,7 @@ bottom.| On-chain agent invocation | [contracts/agent-invocation/](contracts/agent-invocation) | In-repo | Anchor program: verifiable agent-to-agent skill invocation events. SDK: [agent-protocol-sdk/](agent-protocol-sdk) || Escrowed knocks (pay-per-reply) | [contracts/knock-escrow/](contracts/knock-escrow) | In-repo | Anchor program making a knock's payment conditional instead of final: `knock` parks the price in a vault owned by the knock's own PDA, and only three things can happen to it. `answer` pays the owner minus a fee capped at 10% in the program itself, `refuse` refunds the sender in full and takes no fee, and `reclaim` refunds the sender once the reply window closes and can be called by anyone. Each `KnockRecord` snapshots the fee that was in force when it was made, so an authority cannot reprice money already in escrow, and it stores only the SHA-256 of the message and the reply, never their text. The trust-me version of this settles straight to the owner at [api/knock/](api/knock) (row above); this is the version that works between strangers. Both sides are reachable from a browser: senders escrow and crank their own refund from the door page, owners open their on-chain door, answer for payment or refuse for a refund from [/knock](pages/knock.html), all signed by their own wallet ([src/knock/escrow-checkout.js](src/knock/escrow-checkout.js)). Docs: [contracts/knock-escrow/README.md](contracts/knock-escrow/README.md), [docs/knock.md](docs/knock.md). Tests: [tests/knock-escrow-program.test.js](tests/knock-escrow-program.test.js), [tests/knock-escrow-pda.test.js](tests/knock-escrow-pda.test.js), [tests/api-knock-escrowed.test.js](tests/api-knock-escrowed.test.js), [tests/api-knock-escrow-sync.test.js](tests/api-knock-escrow-sync.test.js) || Cross-chain SDKs | [sdk/](sdk), [solana-agent-sdk/](solana-agent-sdk), [agent-payments-sdk/](agent-payments-sdk), [agent-protocol-sdk/](agent-protocol-sdk) | Published | Cross-chain agent SDKs |-| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 43 npm servers + 7 hosted remote (50 total, incl. the free `/api/mcp-studio` 3D Studio), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas). Canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json), generated from the manifests by [scripts/build-mcp-listing-source.mjs](scripts/build-mcp-listing-source.mjs) (`npm run audit:mcp-listing` fails when it drifts) | Model Context Protocol surface, full server list in [docs/mcp.md](docs/mcp.md). Searchable index of every tool: [pages/mcp-tools.html](pages/mcp-tools.html) `→ /mcp-tools`, rendered from the generated [public/mcp-catalog.json](public/mcp-catalog.json) ([scripts/build-mcp-catalog.mjs](scripts/build-mcp-catalog.mjs), `npm run build:mcp-catalog`, staleness gated by `npm run audit:mcp-catalog`). Tool safety annotations are verified against each handler by [scripts/audit-mcp-safety.mjs](scripts/audit-mcp-safety.mjs) (`npm run audit:mcp-safety`, rules in [scripts/lib/mcp-safety-check.mjs](scripts/lib/mcp-safety-check.mjs), guarded-file list shared with the golden snapshot via [scripts/lib/mcp-tool-sources.mjs](scripts/lib/mcp-tool-sources.mjs)); docs [docs/mcp-safety.md](docs/mcp-safety.md) `→ /docs/mcp-safety`. Trust policy: [api/mcp-policy.js](api/mcp-policy.js) `-> GET /api/mcp-policy` turns those verified labels into a ready-to-paste client allowlist (profiles strict/balanced/open x formats claude/vscode/json), surfaced by the builder panel on `/mcp-tools`. Connector-review readiness (every paid stdio tool answers a clean x402 challenge, and the reviewer entitlement lifts it): [scripts/audit-mcp-reviewer-path.mjs](scripts/audit-mcp-reviewer-path.mjs), `npm run audit:mcp-reviewer`. Tests: [tests/mcp-safety-audit.test.js](tests/mcp-safety-audit.test.js), [tests/mcp-catalog.test.js](tests/mcp-catalog.test.js), [tests/api/mcp-policy.test.js](tests/api/mcp-policy.test.js) |+| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 43 npm servers + 7 hosted remote (50 total, incl. the free `/api/mcp-studio` 3D Studio, whose ChatGPT plugin surface [api/mcp-chatgpt.js](api/mcp-chatgpt.js) `→ /api/mcp-chatgpt` serves the eight 3D tools and the model viewer without the persona tools or any `frameDomains`; both doors share [api/_mcp-studio/handler.js](api/_mcp-studio/handler.js), and `SURFACES` in [api/_mcp-studio/dispatch.js](api/_mcp-studio/dispatch.js) defines what each advertises), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas). Canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json), generated from the manifests by [scripts/build-mcp-listing-source.mjs](scripts/build-mcp-listing-source.mjs) (`npm run audit:mcp-listing` fails when it drifts) | Model Context Protocol surface, full server list in [docs/mcp.md](docs/mcp.md). Searchable index of every tool: [pages/mcp-tools.html](pages/mcp-tools.html) `→ /mcp-tools`, rendered from the generated [public/mcp-catalog.json](public/mcp-catalog.json) ([scripts/build-mcp-catalog.mjs](scripts/build-mcp-catalog.mjs), `npm run build:mcp-catalog`, staleness gated by `npm run audit:mcp-catalog`). Tool safety annotations are verified against each handler by [scripts/audit-mcp-safety.mjs](scripts/audit-mcp-safety.mjs) (`npm run audit:mcp-safety`, rules in [scripts/lib/mcp-safety-check.mjs](scripts/lib/mcp-safety-check.mjs), guarded-file list shared with the golden snapshot via [scripts/lib/mcp-tool-sources.mjs](scripts/lib/mcp-tool-sources.mjs)); docs [docs/mcp-safety.md](docs/mcp-safety.md) `→ /docs/mcp-safety`. Trust policy: [api/mcp-policy.js](api/mcp-policy.js) `-> GET /api/mcp-policy` turns those verified labels into a ready-to-paste client allowlist (profiles strict/balanced/open x formats claude/vscode/json), surfaced by the builder panel on `/mcp-tools`. Connector-review readiness (every paid stdio tool answers a clean x402 challenge, and the reviewer entitlement lifts it): [scripts/audit-mcp-reviewer-path.mjs](scripts/audit-mcp-reviewer-path.mjs), `npm run audit:mcp-reviewer`. Tests: [tests/mcp-safety-audit.test.js](tests/mcp-safety-audit.test.js), [tests/mcp-catalog.test.js](tests/mcp-catalog.test.js), [tests/api/mcp-policy.test.js](tests/api/mcp-policy.test.js) || Awesome 3D Agents (curated list) | Source [data/awesome.json](data/awesome.json), generator [scripts/build-awesome.mjs](scripts/build-awesome.mjs) (`npm run build:awesome`, drift-gated by `npm run check:awesome`, publishable mirror via `npm run awesome:standalone`), outputs [awesome/README.md](awesome/README.md) + [public/awesome.json](public/awesome.json), page [pages/awesome.html](pages/awesome.html) `-> /awesome`, link checker [scripts/check-awesome-links.mjs](scripts/check-awesome-links.mjs) (`npm run awesome:links`) | Live | An awesome-list of everything needed to give an AI agent a body: text-to-3D, capture and splatting, avatars, rigging, motion, lipsync and voice, web renderers, asset pipelines, physics and networking, agent frameworks, datasets, free assets, learning. One JSON source produces both the GitHub-facing list and the searchable page, so they cannot disagree. Every url is fetched and classified (ok / moved / bot-filtered / broken) before it ships; the checker stays out of the deploy path so a third-party outage cannot redden someone else's build. The README is written to pass `npx awesome-lint`: badge on the heading line, no License section, no Contributing entry in the contents, and every description capitalised and ended with a period, all enforced by the generator and by [tests/awesome-list.test.js](tests/awesome-list.test.js). Its last two lint rules read GitHub repository topics, which a list inside a product repo cannot satisfy, so `--standalone` emits a ready-to-publish mirror repo (readme, contributing, code of conduct, license) outside this checkout. Contributing: [awesome/CONTRIBUTING.md](awesome/CONTRIBUTING.md) || Agent Skills pack | [.agents/skills/](.agents/skills) (canonical) → manifest [.agents/skills/SKILLS.md](.agents/skills/SKILLS.md), [.agents/skills/skills-pack.json](.agents/skills/skills-pack.json); published 3D subset [public/skills/3d-studio/](public/skills/3d-studio) `→ /skills/3d-studio/` | In-repo; bundled in the `three-ws-core` [plugin](.claude-plugin/marketplace.json); 3D subset live on the site | 43 portable `SKILL.md` folders (Agent Skills open standard) for any Claude surface: 3d/creative (cross-platform-safe), wallet/payments, intel/trading. The 3d/creative ones are also published as a public, downloadable bundle at `/skills/3d-studio/` (`three-ws-3d-skills.zip`), which is what an OpenAI Plugin Directory submission uploads on its Skills tab; a skill referencing a tool [api/_mcp-studio/](api/_mcp-studio) does not declare is dropped rather than shipped as a dead path. Regenerate manifest: `node scripts/build-skills-pack.mjs`; regenerate the published bundle: `npm run build:openai-skills` (drift gate `npm run check:openai-skills`, wired into `npm run gate`). Docs: [docs/agent-skills.md](docs/agent-skills.md) || Claude Code plugin marketplace | [marketplace/](marketplace) → plugins [three-ws-3d](marketplace/plugins/three-ws-3d), [three-ws-developer](marketplace/plugins/three-ws-developer) | In-repo · installable via `/plugin marketplace add nirholas/three.ws` | 3D generation + rigged avatars inside Claude Code (free lane + paid x402 tools) and developer tooling for building on three.ws. Index: [marketplace/README.md](marketplace/README.md) |@@ -474,7 +474,7 @@ array. Runbook: [docs/contributing.md](docs/contributing.md#publishing-packages-- **On-chain identity & contracts** — [contracts/](contracts), [packages/avatar-schema/](packages/avatar-schema)- **API endpoints** — [api/](api) (serverless-style handlers, served in production by the [server/](server) Cloud Run container), [workers/](workers) (long-running workers)- **Examples & demos** — [examples/](examples), [multiplayer/](multiplayer)-- **Announcement pipeline**: [docs/announcements/](docs/announcements/README.md) (one pack per feature: the claim and its evidence, the postable text, the media by shot id, the Telegram variant), `data/announcements.json` (the ledger `npm run announce:rank` writes: every shipped surface, whether it was ever announced, its score and its stage; generated, so it is gitignored rather than committed), [data/announce-media.json](data/announce-media.json) (media recipes captured from the live product into `public/announce/`), [docs/announce-voice.md](docs/announce-voice.md) (the voice contract, derived from the engagement archive). `npm run announce:rank` ranks the backlog, `npm run announce:media` captures the frames, `npm run check:announce` gates a pack. Nothing here posts: publishing stays owner-gated.+- **Announcement pipeline**: [docs/announcements/](docs/announcements/README.md) (one pack per feature: the claim and its evidence, the postable text, the media by shot id, the Telegram variant), `data/announcements.json` (the ledger `npm run announce:rank` writes: every shipped surface, whether it was ever announced, its score and its stage; generated, so it is gitignored rather than committed), [data/announce-media.json](data/announce-media.json) (media recipes captured from the live product into `public/announce/`), [docs/announce-voice.md](docs/announce-voice.md) (the voice contract, derived from the engagement archive). [docs/announcement-checklist.md](docs/announcement-checklist.md) is the work plan over that backlog: every unannounced surface grouped into a cluster (one post or one thread each), ordered into waves, with the endpoint that proves the surface has something to show and the verified reason where it does not, plus the platform problems the verification turned up. Its inventory reaches beyond the ranker's: the top-level SDKs, `robinhood/`, `extensions/`, `integrations/`, `apps/`, `examples/`, the native apps, the plugin marketplace and published skills, the hosted MCP servers, `specs/`, and platform-wide capabilities declared in the plan are all covered, and feature releases that shipped inside existing surfaces are listed from the changelog. Its editorial content lives in [data/announcement-plan.json](data/announcement-plan.json) and it is rendered by [scripts/announce-checklist.mjs](scripts/announce-checklist.mjs). `npm run announce:rank` ranks the backlog, `npm run announce:checklist` re-renders the plan (`-- --probe` re-verifies every blocker against production first), `npm run check:announce-checklist` fails if a shipped surface is in no cluster, `npm run announce:media` captures the frames, `npm run check:announce` gates a pack. Nothing here posts: publishing stays owner-gated.- **Marketing assets**: [marketing/](marketing/README.md) (produced promo videos + re-render scripts, e.g. [marketing/imessage-video/](marketing/imessage-video); source-of-truth assets, not shipped to production). The narrated product demo lives in [marketing/product-demo/](marketing/product-demo/README.md): [scripts/make-product-demo.mjs](scripts/make-product-demo.mjs) (`npm run demo:video`) films a presenter walking every feature page on the live site, chaptered, with narration from the platform's own TTS lane. Its route is the Feature Tour curriculum, so a new page is in the next recording without editing a script. Docs: [docs/product-demo.md](docs/product-demo.md)- **Platform agents (server-side)**: [agents/](agents/README.md) (endpoint-shopper, fact-checker, tutor, unstoppable, x402-buildout: library modules imported by `api/` handlers, each with its own README)- **Site data files**: [data/](data/README.md) (pages.json, changelog.json, skills seed, RSS items: what each file drives and which script regenerates it)diff --git a/api/_mcp-studio/component.js b/api/_mcp-studio/component.jsindex 87774daf7..92de0f9b2 100644--- a/api/_mcp-studio/component.js+++ b/api/_mcp-studio/component.js@@ -207,6 +207,14 @@ export const COMPONENT_HTML = `<!doctype html>return 'https://three.ws/api/glb?src=' + encodeURIComponent(glb);}+ // The painted concept image is loaded directly as the poster, so it needs the+ // same treatment: the widget CSP allowlists three.ws, and an off-origin poster+ // goes through the same-origin image proxy instead of widening that list.+ function posterUrl(img) {+ try { if (new URL(img).hostname === 'three.ws') return img; } catch (e) { return img; }+ return 'https://three.ws/api/img?url=' + encodeURIComponent(img) + '&fallback=none';+ }+// Swap the displayed GLB with a cross-fade (no hard pop). Used both for the// initial refined result and for clicking an earlier version in the strip.function swapTo(glb) {@@ -282,7 +290,7 @@ export const COMPONENT_HTML = `<!doctype html>// The forge paints a concept image before sculpting the mesh, so use it as// the model-viewer poster so the user sees the painted reference the// instant the widget renders, while the GLB is still streaming in.- if (isHttps(out.referenceImageUrl)) { mv.setAttribute('poster', out.referenceImageUrl); }+ if (isHttps(out.referenceImageUrl)) { mv.setAttribute('poster', posterUrl(out.referenceImageUrl)); }else { mv.removeAttribute('poster'); }mv.setAttribute('src', fetchable(glb));armWatchdog();@@ -337,36 +345,18 @@ export const COMPONENT_URI = 'ui://widget/three-studio-model.html';// Established Apps SDK skybridge MIME for HTML widget resources.export const COMPONENT_MIME = 'text/html+skybridge';-// The public origin generated GLBs are actually served from (the R2 public-// bucket, e.g. https://pub-<hash>.r2.dev). ChatGPT ENFORCES the widget CSP-// inside its sandbox, so leaving this origin out blocks every model fetch and-// the widget error-states on 100% of generations, even though the same widget-// works in permissive test harnesses. Resolved lazily because S3_PUBLIC_DOMAIN-// is a required-env getter (throws when storage isn't configured, e.g. tests).-function glbStorageOrigin() {- try {- let v = env.S3_PUBLIC_DOMAIN;- if (!/^https?:\/\//i.test(v)) v = `https://${v}`;- const origin = new URL(v).origin;- return origin.startsWith('https://') ? origin : null;- } catch {- return null;- }-}--// CSP for the widget iframe: where it may connect (fetch GLBs) and load resources-// (the model-viewer script + GLB assets). Declared on the resource _meta so the-// ChatGPT host can enforce it. Built per-read so the storage origin tracks env.+// CSP for the widget iframe, declared on the resource _meta so the ChatGPT host+// enforces it inside its sandbox. It lists exactly what the widget loads and+// nothing wider:+// - https://three.ws: every GLB, because fetchable() re-serves anything+// off-origin through /api/glb, and every poster, because posterUrl() does+// the same through /api/img. No storage bucket or provider host is ever+// loaded directly, so none needs to be allowlisted.+// - the model-viewer CDN: the pinned <model-viewer> build.+// OpenAI's own Apps SDK example servers declare no wildcard domains, and the+// submission review flags broad or unused ones.export function componentCsp() {- const domains = [- 'https://three.ws',- 'https://*.three.ws',- MODEL_VIEWER_CDN_ORIGIN,- 'https://replicate.delivery',- 'https://*.replicate.delivery',- ];- const storage = glbStorageOrigin();- if (storage && !domains.includes(storage)) domains.push(storage);+ const domains = ['https://three.ws', MODEL_VIEWER_CDN_ORIGIN];return { connect_domains: [...domains], resource_domains: [...domains] };}diff --git a/api/_mcp-studio/dispatch.js b/api/_mcp-studio/dispatch.jsindex c01a0ed2b..1a5f38496 100644--- a/api/_mcp-studio/dispatch.js+++ b/api/_mcp-studio/dispatch.js@@ -21,21 +21,11 @@ import {personaComponentCsp,} from './component.js';-// The full catalog the free studio advertises, eleven tools in all: the eight in-// ./tools.js (five generators + refine_model + the check_job collector + the-// look_at_model inspector) plus three embodiment/persona tools. The persona-// tools render the persona widget (the living-body embed) rather than the-// model-viewer widget; they and check_job aren't in the generation-quota set,-// see api/mcp-studio.js callsGenerationTool. look_at_model is read-only but-// renders frames server-side, so it does ride that quota.-const ALL_TOOL_CATALOG = [...TOOL_CATALOG, ...PERSONA_TOOL_CATALOG];-const ALL_TOOLS = { ...TOOLS, ...PERSONA_TOOLS };-export const PROTOCOL_VERSION = '2025-06-18';const SERVER_INFO = { name: 'three-ws-3d-studio-free', version: '1.0.0' };-const INSTRUCTIONS = [+const BASE_INSTRUCTIONS = ['three.ws 3D Studio turns a text prompt or an image into an interactive, downloadable 3D model (GLB), free.','forge_free(prompt) generates a model from text; text_to_avatar and mesh_forge generate an avatar or art-directed','mesh from text or a reference image; rig_mesh(glb_url) makes a static model animation-ready; forge_avatar does',@@ -43,17 +33,63 @@ const INSTRUCTIONS = ['refine_model(glb_url, instruction) iterates on a generated model in plain language ("make it metallic") and keeps','a version lineage you can branch or revert. If a result comes back with status "pending", the model is still','rendering: call check_job(job_id) after the suggested wait to collect it.',+];++const PERSONA_INSTRUCTIONS = ['To give the assistant a LIVING body: create_agent_persona(glb_url, name) saves a rigged model as a named,','persistent persona and returns a persona_id; persona_say(persona_id, text) makes that body lip-sync the reply and','emote; get_agent_persona(persona_id) brings the same body back in a later session. The persona renders inline and','idles between turns.',-].join(' ');+];++// Two surfaces share this dispatcher, each advertising a consistent set of+// tools, widgets and model instructions.+// full /api/mcp-studio: every tool and both widgets, for Claude, the+// examples, and any MCP host that renders the inline living body.+// chatgpt /api/mcp-chatgpt: the eight tools in ./tools.js and the+// model-viewer widget only. The persona widget frames the hosted+// embodiment page, which requires frameDomains, and OpenAI's app+// guidelines reserve frame domains for embedding an essential+// third-party experience, saying those apps "are often not approved+// for broad distribution". Framing our own page is not that case, so+// the plugin listing leaves the persona tools out rather than ask+// review for an exception.+// check_job and the persona tools stay out of the generation quota on both; see+// ./handler.js callsGenerationTool. look_at_model renders frames server-side, so+// it rides that quota.+const SURFACES = {+ full: {+ server: 'mcp-studio',+ catalog: [...TOOL_CATALOG, ...PERSONA_TOOL_CATALOG],+ tools: { ...TOOLS, ...PERSONA_TOOLS },+ personas: true,+ instructions: [...BASE_INSTRUCTIONS, ...PERSONA_INSTRUCTIONS].join(' '),+ },+ chatgpt: {+ server: 'mcp-chatgpt',+ catalog: [...TOOL_CATALOG],+ tools: { ...TOOLS },+ personas: false,+ instructions: BASE_INSTRUCTIONS.join(' '),+ },+};++export const SURFACE_NAMES = Object.keys(SURFACES);++function surfaceOf(name) {+ return Object.hasOwn(SURFACES, name) ? SURFACES[name] : SURFACES.full;+}++/** The tool descriptors a surface advertises on tools/list. */+export function toolCatalogFor(name = 'full') {+ return surfaceOf(name).catalog;+}// The Apps SDK widget resources: the model viewer every generation tool renders,// and the living-body persona widget the embodiment tools render. _meta (incl.// the CSP) is built per call so the storage origin always tracks env.-function widgetResources() {- return [+function widgetResources(personas = true) {+ const all = [{uri: COMPONENT_URI,name: 'three.ws 3D model viewer',@@ -81,6 +117,7 @@ function widgetResources() {},},];+ return personas ? all : all.filter((r) => r.uri !== PERSONA_COMPONENT_URI);}const log = logger('mcp-studio');@@ -104,9 +141,9 @@ function summarize(args) {return o;}-async function onToolCall(params, auth, started, req) {+async function onToolCall(params, auth, started, req, surface) {const { name, arguments: args = {} } = params || {};- const tool = typeof name === 'string' && Object.hasOwn(ALL_TOOLS, name) ? ALL_TOOLS[name] : null;+ const tool = typeof name === 'string' && Object.hasOwn(surface.tools, name) ? surface.tools[name] : null;if (!tool) throw rpcError(-32602, `unknown tool: ${name}`);if (tool.validate && !tool.validate(args)) {const first = tool.validate.errors?.[0];@@ -115,17 +152,18 @@ async function onToolCall(params, auth, started, req) {}try {const result = await tool.handler(args, auth, req);- recordEvent({ kind: 'tool_call', tool: name, latencyMs: Date.now() - started, meta: { args_summary: summarize(args), server: 'mcp-studio' } });+ recordEvent({ kind: 'tool_call', tool: name, latencyMs: Date.now() - started, meta: { args_summary: summarize(args), server: surface.server } });return result;} catch (err) {- recordEvent({ kind: 'tool_call', tool: name, status: 'error', latencyMs: Date.now() - started, meta: { error: err.message, server: 'mcp-studio' } });+ recordEvent({ kind: 'tool_call', tool: name, status: 'error', latencyMs: Date.now() - started, meta: { error: err.message, server: surface.server } });if (err.code && typeof err.code === 'number') throw err;- const { message } = sanitizeToolError(err, { tool: name, server: 'mcp-studio', log });+ const { message } = sanitizeToolError(err, { tool: name, server: surface.server, log });return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };}}-export async function dispatch(msg, auth, req) {+export async function dispatch(msg, auth, req, { surface: surfaceName = 'full' } = {}) {+ const surface = surfaceOf(surfaceName);const started = Date.now();const id = msg.id;const isNotification = id === undefined;@@ -138,19 +176,19 @@ export async function dispatch(msg, auth, req) {protocolVersion: PROTOCOL_VERSION,serverInfo: SERVER_INFO,capabilities: { tools: { listChanged: false }, resources: { listChanged: false, subscribe: false }, logging: {} },- instructions: INSTRUCTIONS,+ instructions: surface.instructions,});}if (method === 'ping') return ok(id, {});if (method === 'notifications/initialized') return null;- if (method === 'tools/list') return ok(id, { tools: ALL_TOOL_CATALOG });- if (method === 'tools/call') return ok(id, await onToolCall(msg.params, auth, started, req));+ if (method === 'tools/list') return ok(id, { tools: surface.catalog });+ if (method === 'tools/call') return ok(id, await onToolCall(msg.params, auth, started, req, surface));if (method === 'resources/list') {- return ok(id, { resources: widgetResources().map(({ text: _t, ...r }) => r) });+ return ok(id, { resources: widgetResources(surface.personas).map(({ text: _t, ...r }) => r) });}if (method === 'resources/read') {const uri = msg.params?.uri;- const res = widgetResources().find((r) => r.uri === uri);+ const res = widgetResources(surface.personas).find((r) => r.uri === uri);if (!res) throw rpcError(-32602, `unknown resource: ${uri}`);return ok(id, { contents: [{ uri: res.uri, mimeType: res.mimeType, text: res.text, _meta: res._meta }] });}diff --git a/api/_mcp-studio/handler.js b/api/_mcp-studio/handler.jsnew file mode 100644index 000000000..380f67b1e--- /dev/null+++ b/api/_mcp-studio/handler.js@@ -0,0 +1,104 @@+// Shared HTTP handler for the free three.ws 3D Studio MCP surfaces.+//+// POST JSON-RPC (initialize, tools/list, tools/call, resources/*)+// GET not offered (no server-initiated stream), answers 405+// OPTIONS CORS preflight+//+// Parameterized by the tool surface it serves (SURFACES in ./dispatch.js):+// api/mcp-studio.js surface 'full' every tool, both widgets+// api/mcp-chatgpt.js surface 'chatgpt' generation tools, model viewer only+// Both front doors share one transport cap, one per-IP generation quota and one+// platform-wide circuit breaker, so a second door never doubles the free GPU+// budget.+//+// There is no OAuth and no payment path anywhere in this server: generation runs+// operator-funded over /api/forge, whose server-side keys cover provider cost.+// Abuse protection is real: a per-IP transport cap plus a per-IP generation burst+// and hourly quota (../_lib/rate-limit.js), enforced whenever Redis is healthy.+// Because every studio tool routes through a zero-cost free lane, these+// generation caps fail OPEN on a Redis outage, so a Redis blip never dead-ends a+// free feature; real paid spend stays fail-closed one layer down in /api/forge.++import { cors, wrap, readJson, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';+import { dispatch, PROTOCOL_VERSION } from './dispatch.js';+import { TOOL_NAMES } from './tools.js';++// check_job collects a job that is already running rather than starting one: it+// must never burn the caller's generation quota, or collecting a pending job+// could be rate-blocked by the very generation that created it. It rides the+// transport cap only.+const GEN_TOOLS = new Set(TOOL_NAMES.filter((name) => name !== 'check_job'));++function rpcError(res, status, code, message, extra = {}) {+ res.statusCode = status;+ res.setHeader('content-type', 'application/json; charset=utf-8');+ res.end(JSON.stringify({ jsonrpc: '2.0', id: null, error: { code, message, ...(Object.keys(extra).length ? { data: extra } : {}) } }));+}++// Does the (possibly batched) body invoke any generation tool? Used to apply the+// cost-bearing generation quota only to calls that actually generate.+function callsGenerationTool(body) {+ const batch = Array.isArray(body) ? body : [body];+ return batch.some((m) => m && m.method === 'tools/call' && GEN_TOOLS.has(m?.params?.name));+}++export function studioHandler({ surface = 'full' } = {}) {+ return wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,HEAD,POST,OPTIONS', origins: '*', payments: false })) return;++ // No server-initiated SSE stream, this server answers requests synchronously.+ if (req.method === 'GET' || req.method === 'HEAD') {+ res.statusCode = 405;+ res.setHeader('allow', 'POST, OPTIONS');+ res.setHeader('content-type', 'application/json; charset=utf-8');+ res.end(JSON.stringify({ error: 'method_not_allowed', error_description: 'POST JSON-RPC to this MCP endpoint' }));+ return;+ }+ if (req.method !== 'POST') return rpcError(res, 405, -32600, 'method not supported');++ const ip = clientIp(req);++ // Cheap transport cap on every request (discovery + calls).+ const ipRl = await limits.studioIp(ip);+ if (!ipRl.success) return rateLimited(res, ipRl, 'too many requests');++ let body;+ try {+ body = await readJson(req, 1_000_000);+ } catch (err) {+ return rpcError(res, err.status || 400, -32700, err.message || 'invalid JSON');+ }++ const batch = Array.isArray(body) ? body : [body];+ if (batch.length > 16) return rpcError(res, 400, -32600, 'batch too large (max 16)');++ // Generation quota, burst then hourly, per IP. Applied only when the request+ // actually calls a generation tool, so discovery is never throttled by it.+ if (callsGenerationTool(body)) {+ const burst = await limits.studioGenBurst(ip);+ if (!burst.success) return rateLimited(res, burst, 'generation rate limit, slow down and try again shortly');+ const hourly = await limits.studioGenHourly(ip);+ if (!hourly.success) return rateLimited(res, hourly, 'hourly generation limit reached, try again later');+ // Platform-wide circuit breaker across ALL free-studio callers, backstops+ // the shared GPU/provider budget when many distinct IPs, each under their+ // own hourly cap, would collectively drain it. Fails closed in prod.+ const global = await limits.studioGenerateGlobal();+ if (!global.success) return rateLimited(res, global, 'the free 3D studio is at capacity right now, please try again later');+ }++ // Anonymous principal, no auth, no scope. rateKey carries the IP for usage logs.+ const auth = { userId: null, rateKey: ip, scope: '' };++ const responses = [];+ for (const msg of batch) {+ const r = await dispatch(msg, auth, req, { surface });+ if (r !== null) responses.push(r);+ }++ res.statusCode = 200;+ res.setHeader('content-type', 'application/json; charset=utf-8');+ res.setHeader('mcp-protocol-version', PROTOCOL_VERSION);+ res.end(JSON.stringify(Array.isArray(body) ? responses : (responses[0] ?? null)));+ });+}diff --git a/api/mcp-chatgpt.js b/api/mcp-chatgpt.jsnew file mode 100644index 000000000..929d9df5b--- /dev/null+++ b/api/mcp-chatgpt.js@@ -0,0 +1,15 @@+// three.ws 3D Studio for the ChatGPT plugin directory.+//+// POST /api/mcp-chatgpt JSON-RPC (initialize, tools/list, tools/call, resources/*)+//+// The eight 3D tools and the model-viewer widget, and nothing that needs+// frameDomains. OpenAI's app guidelines reserve frame domains for embedding an+// essential third-party experience and say those apps "are often not approved+// for broad distribution". The persona widget frames our own embodiment page,+// which is not that case, so this surface leaves the persona tools out rather+// than ask review for an exception; they stay on /api/mcp-studio for every other+// MCP host. Same transport, rate limits and shared generation quota:+// ./_mcp-studio/handler.js.+import { studioHandler } from './_mcp-studio/handler.js';++export default studioHandler({ surface: 'chatgpt' });diff --git a/api/mcp-studio.js b/api/mcp-studio.jsindex b2dcfc63e..8df99f833 100644--- a/api/mcp-studio.js+++ b/api/mcp-studio.js@@ -1,101 +1,12 @@-// three.ws 3D Studio (free) — remote MCP server for the OpenAI Apps SDK.+// three.ws 3D Studio (free): remote MCP server, full surface.//-// POST /api/mcp-studio — JSON-RPC (initialize, tools/list, tools/call, resources/*)-// GET /api/mcp-studio — not offered (no server-initiated stream) → 405-// OPTIONS — CORS preflight+// POST /api/mcp-studio JSON-RPC (initialize, tools/list, tools/call, resources/*)//-// A free, NON-CRYPTO, payment-free MCP endpoint exposing ONLY 3D-generation-// tools (_mcp-studio/tools.js) and the embodiment/persona tools built on top of-// them (_mcp-studio/persona-tools.js, which carry their own write rate limit).-// There is no OAuth, no x402, no wallet, no token, and no PaymentRequired-// anywhere in this server — generation runs operator-funded over /api/forge (the-// platform's server-side keys cover provider cost). Built for the ChatGPT App-// Directory, whose policy disqualifies tokens/credits and embedded payments.-//-// Abuse protection is real: a per-IP transport cap plus a per-IP generation-// burst + hourly quota (api/_lib/rate-limit.js), enforced whenever Redis is-// healthy. Because every studio tool routes through a zero-cost free lane-// (NVIDIA NIM / HF Spaces), these generation caps fail OPEN on a Redis outage —-// a Redis blip must never dead-end a free feature — mirroring the paid server's-// own free lane. Real paid spend stays fail-closed one layer down in /api/forge.-// The paid, crypto-enabled studio lives separately at /api/mcp-3d.-import { cors, wrap, readJson, rateLimited } from './_lib/http.js';-import { limits, clientIp } from './_lib/rate-limit.js';-import { dispatch, PROTOCOL_VERSION } from './_mcp-studio/dispatch.js';-import { TOOL_NAMES } from './_mcp-studio/tools.js';--// check_job is a status probe, not a generation: it must never burn the-// caller's generation quota, or collecting a pending job could be rate-blocked-// by the very generation that created it. It rides the transport cap only.-const GEN_TOOLS = new Set(TOOL_NAMES.filter((name) => name !== 'check_job'));--function rpcError(res, status, code, message, extra = {}) {- res.statusCode = status;- res.setHeader('content-type', 'application/json; charset=utf-8');- res.end(JSON.stringify({ jsonrpc: '2.0', id: null, error: { code, message, ...(Object.keys(extra).length ? { data: extra } : {}) } }));-}--// Does the (possibly batched) body invoke any generation tool? Used to apply the-// cost-bearing generation quota only to calls that actually generate.-function callsGenerationTool(body) {- const batch = Array.isArray(body) ? body : [body];- return batch.some((m) => m && m.method === 'tools/call' && GEN_TOOLS.has(m?.params?.name));-}--export default wrap(async (req, res) => {- if (cors(req, res, { methods: 'GET,HEAD,POST,OPTIONS', origins: '*', payments: false })) return;-- // No server-initiated SSE stream — this server answers requests synchronously.- if (req.method === 'GET' || req.method === 'HEAD') {- res.statusCode = 405;- res.setHeader('allow', 'POST, OPTIONS');- res.setHeader('content-type', 'application/json; charset=utf-8');- res.end(JSON.stringify({ error: 'method_not_allowed', error_description: 'POST JSON-RPC to this MCP endpoint' }));- return;- }- if (req.method !== 'POST') return rpcError(res, 405, -32600, 'method not supported');-- const ip = clientIp(req);-- // Cheap transport cap on every request (discovery + calls).- const ipRl = await limits.studioIp(ip);- if (!ipRl.success) return rateLimited(res, ipRl, 'too many requests');-- let body;- try {- body = await readJson(req, 1_000_000);- } catch (err) {- return rpcError(res, err.status || 400, -32700, err.message || 'invalid JSON');- }-- const batch = Array.isArray(body) ? body : [body];- if (batch.length > 16) return rpcError(res, 400, -32600, 'batch too large (max 16)');-- // Generation quota — burst then hourly, per IP. Applied only when the request- // actually calls a generation tool, so discovery is never throttled by it.- if (callsGenerationTool(body)) {- const burst = await limits.studioGenBurst(ip);- if (!burst.success) return rateLimited(res, burst, 'generation rate limit — slow down and try again shortly');- const hourly = await limits.studioGenHourly(ip);- if (!hourly.success) return rateLimited(res, hourly, 'hourly generation limit reached — try again later');- // Platform-wide circuit breaker across ALL free-studio callers — backstops- // the shared GPU/provider budget when many distinct IPs, each under their- // own hourly cap, would collectively drain it. Fails closed in prod.- const global = await limits.studioGenerateGlobal();- if (!global.success) return rateLimited(res, global, 'the free 3D studio is at capacity right now — please try again later');- }-- // Anonymous principal — no auth, no scope. rateKey carries the IP for usage logs.- const auth = { userId: null, rateKey: ip, scope: '' };-- const responses = [];- for (const msg of batch) {- const r = await dispatch(msg, auth, req);- if (r !== null) responses.push(r);- }-- res.statusCode = 200;- res.setHeader('content-type', 'application/json; charset=utf-8');- res.setHeader('mcp-protocol-version', PROTOCOL_VERSION);- res.end(JSON.stringify(Array.isArray(body) ? responses : (responses[0] ?? null)));-});+// Every studio tool and both Apps SDK widgets, including the living-body persona+// tools. Transport, rate limits and the shared generation quota live in+// ./_mcp-studio/handler.js, which also backs /api/mcp-chatgpt (the ChatGPT plugin+// listing, without the persona tools; SURFACES in ./_mcp-studio/dispatch.js+// explains why).+import { studioHandler } from './_mcp-studio/handler.js';++export default studioHandler({ surface: 'full' });diff --git a/data/changelog.json b/data/changelog.jsonindex d3910f9cf..59c4f682d 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -28156,6 +28156,16 @@"sdk"],"link": "/docs/mcp-studio"+ },+ {+ "date": "2026-09-12",+ "title": "The 3D viewer inside ChatGPT now loads everything through three.ws",+ "summary": "The interactive viewer that shows your 3D model inside ChatGPT now fetches every model and every preview image through three.ws itself, so the only places it is allowed to reach are three.ws and the 3D viewer library it runs on. Nothing about what you see changes: the model still renders, spins and downloads the same way. There is also a dedicated connection address for the ChatGPT plugin directory, https://three.ws/api/mcp-chatgpt, carrying the eight 3D creation tools. The existing connector at https://three.ws/api/mcp-studio keeps every tool, including the living agent body.",+ "tags": [+ "improvement",+ "security"+ ],+ "link": "/docs/mcp-studio"}]}diff --git a/docs/mcp-studio.md b/docs/mcp-studio.mdindex cf17bcf23..dc1ff6e9a 100644--- a/docs/mcp-studio.md+++ b/docs/mcp-studio.md@@ -23,13 +23,32 @@ answers every request synchronously over `POST`. `OPTIONS` is handled for CORS.### ChatGPT (Apps SDK)-Add the connector with the URL above and **No authentication**. Each generation-tool renders its result inline in an interactive 3D viewer widget-(`ui://widget/three-studio-model.html`); the persona tools render a living agent-body in their own widget (`ui://widget/three-studio-persona.html`). Both widgets-declare an `openai/widgetCSP` whose allowlist includes the GLB storage origin,-so models load inside real ChatGPT (which enforces the CSP), not just in-permissive test harnesses.+Two front doors serve the same tools over one handler+([`api/_mcp-studio/handler.js`](../api/_mcp-studio/handler.js)) and share one+generation quota:++| URL | Serves | Use it for |+|---|---|---|+| `https://three.ws/api/mcp-studio` | all eleven tools, both widgets | any MCP host, including a ChatGPT developer-mode connector |+| `https://three.ws/api/mcp-chatgpt` | the eight 3D tools and the model viewer | the ChatGPT plugin directory listing |++The ChatGPT surface leaves out the three persona tools because their widget+frames the hosted embodiment page, which needs `frameDomains`. OpenAI's app+guidelines reserve frame domains for embedding an essential third-party+experience and say those apps "are often not approved for broad distribution";+framing our own page is not that case. `SURFACES` in+[`api/_mcp-studio/dispatch.js`](../api/_mcp-studio/dispatch.js) is the single+definition of what each door advertises.++Add either connector with **No authentication**. Each generation tool renders its+result inline in an interactive 3D viewer widget+(`ui://widget/three-studio-model.html`); on `/api/mcp-studio` the persona tools+also render a living agent body in their own widget+(`ui://widget/three-studio-persona.html`). The model viewer's `openai/widgetCSP`+allowlists exactly two origins, `https://three.ws` and the model-viewer CDN,+because the widget re-serves every off-origin GLB through `/api/glb` and every+poster through `/api/img`. ChatGPT enforces that CSP, and its review flags+wildcard or unused domains.### Any MCP clientdiff --git a/prompts/store-submissions/_generated/openai-portal-fields.md b/prompts/store-submissions/_generated/openai-portal-fields.mdindex 8a3d1d171..b2f15d35d 100644--- a/prompts/store-submissions/_generated/openai-portal-fields.md+++ b/prompts/store-submissions/_generated/openai-portal-fields.md@@ -140,63 +140,6 @@ Fetches an arbitrary public GLB URL, so it reaches third-party hosts outside ourOnly reads the supplied model in order to render it, and never modifies or deletes the source file.```-### create_agent_persona--**Read Only** (109/200)-```-Saves a new persona record and copies the model into our durable storage so the body outlives the source URL.-```--**Open World** (136/200)-```-Fetches the GLB from a public URL outside our domain and republishes it from our storage at a public URL anyone with the link can fetch.-```--**Destructive** ( 86/200)-```-Only creates a new persona and never modifies or deletes an existing persona or model.-```--### get_agent_persona--**Read Only** (115/200)-```-Looks up a stored persona by its id and returns that persona's configuration without creating or changing anything.-```--**Open World** ( 89/200)-```-Reads only persona records held in our own private store and contacts no external system.-```--**Destructive** ( 65/200)-```-Only reads a persona record and never writes or removes anything.-```--### persona_say--**Read Only** (106/200)-```-Increments the persona's turn counter in our own store while returning the render directive for this turn.-```--**Open World** (111/200)-```-Acts only on a persona in our own private store and renders through our own embed, reaching no external system.-```--**Destructive** (110/200)-```-Only appends a turn and updates a counter, never deleting or overwriting the persona's configuration or model.-```--## MCP tab: Frame Domains (199/200)--```-The persona tools render a live WebGL avatar that lip-syncs its reply. It is framed from https://three.ws, our verified domain and the same origin as this connector. No third-party content is framed.-```-## Testing tab: test cases### Test Case 1@@ -291,22 +234,22 @@ Frames from several angles returned as MCP image content blocks, which the clien**Scenario**```-Turn a generated model into a persistent agent body that speaks+Generate a model through the art-directed lane```**User prompt**```-Save that knight as a persistent agent body called Sir Gareth, then have him introduce himself.+Use the art-directed generator to make a detailed vintage brass telescope on a wooden tripod.```**Tool triggered**```-create_agent_persona, then persona_say+mesh_forge, then check_job if it returns status "pending"```-**Expected output** (258/300)+**Expected output** (241/300)```-Run after test case 2, in the same conversation. An inline living-body widget framed from https://three.ws, in which the avatar lip-syncs the line with a matching expression and gesture. Returns a persona_id that get_agent_persona reloads in a fresh session.+A textured GLB in the same inline viewer, with Download and Open in three.ws. An art-direction pass may first tighten the prompt into a single-subject spec. Free, no account. One to four minutes; a pending result is collected with check_job.```## Testing tab: negative casesdiff --git a/prompts/store-submissions/_generated/openai-submission.md b/prompts/store-submissions/_generated/openai-submission.mdindex c57dd7a9c..352ea9066 100644--- a/prompts/store-submissions/_generated/openai-submission.md+++ b/prompts/store-submissions/_generated/openai-submission.md@@ -1,19 +1,40 @@# three.ws 3D Studio — OpenAI ChatGPT App Directory submission package**Prepared:** 2026-07-07 · **Last re-verified live:** 2026-09-09 · **Submitted:** 2026-09-12 · **Owning prompt:** 07-**Endpoint:** `https://three.ws/api/mcp-studio`+**Endpoint:** `https://three.ws/api/mcp-chatgpt` (the ChatGPT plugin surface of `https://three.ws/api/mcp-studio`)**Prereqs verified live:** prompt 04 (`/api/mcp-studio` deployed), prompt 05 (widget renders real GLBs).-This is the answer sheet that was used to submit the free three.ws 3D Studio to the OpenAI-Plugin Directory, plus an evidence-backed compliance audit. **Submitted 2026-09-12 at 00:10Z as-version 1.0.0, now showing status Review in the portal.** Keep it accurate rather than frozen:-a resubmission, a reviewer question, or a new version all start from this file.+This is the answer sheet for submitting the free three.ws 3D Studio to the OpenAI Plugin+Directory, plus an evidence-backed compliance audit. **Version 1.0.0 was rejected twice on+2026-09-12, and the resubmission points at `https://three.ws/api/mcp-chatgpt`.** Keep it+accurate rather than frozen: a resubmission, a reviewer question, or a new version all start+from this file.----## 0. Submission verdict: SUBMITTED 2026-09-12, in review--**Version 1.0.0 was submitted on 2026-09-12 at 00:10Z and the portal shows status Review.**+## 0. Submission verdict: RESUBMITTING on the ChatGPT surface++**Version 1.0.0 was submitted on 2026-09-12 at 00:10Z and rejected twice that day.** The portal+never displayed a reason, so every cause below was found by measuring the submission against the+portal's own export, OpenAI's app guidelines, and OpenAI's example servers:++1. **Four required icon slots were empty** (directory and composer, light and dark). Built by+ `scripts/build-openai-icons.mjs`.+2. **Every justification over 200 characters and every expected output over 300 was silently cut+ mid-word.** `npm run check:openai-fields` now refuses any field over the limit.+3. **`check_job` declared `readOnlyHint: true` while its first poll writes** a permanent model and+ a database row. Corrected in source, docs and the golden fixture, and live since `87c44fb46`.+4. **The persona widget used `frameDomains` to frame our own page.** OpenAI's app guidelines+ reserve frame domains for embedding an essential third-party experience and say those apps+ "are often not approved for broad distribution"; none of OpenAI's example servers use it. The+ resubmission points at `/api/mcp-chatgpt`, which serves the eight 3D tools and the model viewer+ and no persona tools.+5. **The model viewer's CSP listed wildcard and unused domains.** The resubmission's viewer+ allowlists exactly `https://three.ws` and the model-viewer CDN. Verified by rendering the widget+ in Chromium under that CSP with an off-origin GLB and an off-origin poster: the model loaded+ through `/api/glb`, the poster through `/api/img`, with zero CSP violations.++The record of the first submission follows.What went in, as submitted:@@ -22,9 +43,9 @@ What went in, as submitted:| Name | three.ws 3D AI Studio || Tagline | Create 3D models from text || Type | With MCP (remote MCP connector) |-| MCP server URL | `https://three.ws/api/mcp-studio` |+| MCP server URL | `https://three.ws/api/mcp-studio` (resubmission: `https://three.ws/api/mcp-chatgpt`) || Authentication | None |-| Tools | 11, imported by Scan Tools, with all 33 annotation justifications and the frame-domains justification |+| Tools | 11 with 33 justifications and a frame-domains justification (resubmission: 8 with 24, and no frame domains) || Domain verification | Verified. `/.well-known/openai-apps-challenge` shipped in commit `f569ec6c4` and went live 2026-09-11 at 23:46Z || Prompts | 3 (the free lane, the rigged character, the low-poly prop) || Test cases | 5 positive and 3 negative, all in Step 5 below |@@ -38,11 +59,11 @@ embodiment embed carries no send, sign, swap or trade path, and the `wallet` flanever passing it, so the opt-in chain-state mode is unreachable from ChatGPT. Nothing thisconnector exposes can initiate or execute a transfer.-**Two things the reviewer was warned about, deliberately.** The listing uses `frame_domains`-for the three persona tools, which the portal says raises review requirements because an iframe-reduces its visibility into the rendered experience; test case 5 exercises that widget on-purpose, because a reviewer who never sees it is left more suspicious of it. And the latency-note quotes the measured 74s/149s/213s spread rather than a single figure.+**What the first submission told the reviewer, and why the resubmission does not.** It used+`frame_domains` for the three persona tools and exercised that widget in test case 5. That was the+wrong call: the guidelines quoted in item 4 say frame domains are for third-party embeds, so the+resubmission surface carries no persona tools and no frame domains at all. The latency note still+quotes the measured 74s/149s/213s spread rather than a single figure.### How B3, the last blocker, closed (2026-09-11)@@ -221,7 +242,7 @@ a separate surface, `api/_mcp-studio/component.js`; `/viewer` is the "open in a| **App name** | **three.ws 3D Studio** || **Tagline** | Turn a text prompt into a downloadable, animation-ready 3D model. Free, inside ChatGPT. || **Short description** | three.ws 3D Studio generates textured 3D models, avatars, and rigged characters from a text prompt (or a reference image) and renders each result inline in an interactive 3D viewer you can rotate, inspect, and download as a GLB. It can also auto-rig a static model into an animation-ready one. Free to use: no account, no key, no payment. |-| **Long description** | Describe anything ("a friendly round robot mascot," "a low-poly treasure chest," "a knight character I can animate") and three.ws 3D Studio builds a real, textured 3D model and shows it in an interactive viewer right in the conversation. Eleven tools cover the full path from idea to asset: generate a model from text, generate an avatar, generate an art-directed mesh, auto-rig a static model into an animation-ready one, generate-then-rig a character in a single step, refine an existing model by describing a change, collect a detailed model that took longer than one turn, look at a finished model from several angles to check the result, and save a rigged model as a persistent persona that can speak with lip-sync and emotion. Every result is a standard **GLB** you can download and drop into Blender, Unity, Unreal, three.js, or any glTF pipeline. Generation runs on three.ws's own free 3D lane, so there is nothing to sign up for and nothing to pay. Not natively possible in ChatGPT: turning language into a manipulable, downloadable 3D asset with an inline viewer. |+| **Long description** | Describe anything ("a friendly round robot mascot," "a low-poly treasure chest," "a knight character I can animate") and three.ws 3D Studio builds a real, textured 3D model and shows it in an interactive viewer right in the conversation. Eight tools cover the full path from idea to asset: generate a model from text, generate an avatar, generate an art-directed mesh, auto-rig a static model into an animation-ready one, generate-then-rig a character in a single step, refine an existing model by describing a change, collect a detailed model that took longer than one turn, and look at a finished model from several angles to check the result. Every result is a standard **GLB** you can download and drop into Blender, Unity, Unreal, three.js, or any glTF pipeline. Generation runs on three.ws's own free 3D lane, so there is nothing to sign up for and nothing to pay. Not natively possible in ChatGPT: turning language into a manipulable, downloadable 3D asset with an inline viewer. || **Category** | Creativity & Design (secondary: Productivity) || **Country availability** | All countries / Global (no geo-restriction; anonymous + free). || **Age suitability** | Suitable for ages 13 to 17 (content-safety gate on every generation lane, see §2.6). |@@ -246,11 +267,11 @@ a separate surface, `api/_mcp-studio/component.js`; `/viewer` is the "open in a| `rig_mesh` | Rig a 3D model for animation | Static GLB URL → humanoid-rigged, animation-ready GLB. || `forge_avatar` | Generate a rigged, animation-ready avatar | Text/image → generate + auto-rig in one step. || `refine_model` | Refine a 3D model by describing a change | Existing GLB + instruction → regenerated model with version lineage. |-| `check_job` | Check a pending 3D generation | Job id → the finished model, or a fresh pending state with a live ETA. Read-only; collects a generation that outran its original tool call. |+| `check_job` | Check a pending 3D generation | Job id → the finished model, or a fresh pending state with a live ETA. Collects a generation that outran its original tool call; the first check that finds it done saves the model, so it is not read-only. || `look_at_model` | Look at a 3D model | GLB URL → rendered frames from several angles as images, plus geometry stats (triangles, materials, textures) and a plain reading of them. Read-only; works on any public https GLB. |-| `create_agent_persona` | Save a rigged model as a living, persistent agent body | Rigged GLB + name → persona id (continuity across sessions). |-| `get_agent_persona` | Reload a persona by id (continuity across sessions) | Persona id → saved persona (read-only). |-| `persona_say` | Speak a reply through a persona: lip-sync + emotion + gesture | Persona id + text → lip-sync, emotion, and gesture playback in the viewer. |+| `create_agent_persona` (`/api/mcp-studio` only) | Save a rigged model as a living, persistent agent body | Rigged GLB + name → persona id (continuity across sessions). |+| `get_agent_persona` (`/api/mcp-studio` only) | Reload a persona by id (continuity across sessions) | Persona id → saved persona (read-only). |+| `persona_say` (`/api/mcp-studio` only) | Speak a reply through a persona: lip-sync + emotion + gesture | Persona id + text → lip-sync, emotion, and gesture playback in the viewer. |---@@ -323,7 +344,7 @@ checkout; the app charges the user nothing. (If monetization is ever added, Opengoods via external checkout — out of scope here.)### 2.3 Tool annotations correct on all eleven tools: **PASS**-Pulled from the live `tools/list` (all eleven rows re-checked against it on 2026-09-09):+Pulled from the live `tools/list` (all eleven rows re-checked against it on 2026-09-09; `check_job` corrected on 2026-09-12). The ChatGPT plugin surface `/api/mcp-chatgpt` serves the first eight rows only:| Tool | readOnlyHint | destructiveHint | idempotentHint | openWorldHint ||------|:---:|:---:|:---:|:---:|@@ -333,18 +354,19 @@ Pulled from the live `tools/list` (all eleven rows re-checked against it on 2026| rig_mesh | false | false | false | **true** || forge_avatar | false | false | false | **true** || refine_model | false | false | false | **true** |-| check_job | **true** | false | **true** | **true** |+| check_job | false | false | false | **true** || look_at_model | **true** | false | **true** | **true** |-| create_agent_persona | false | false | false | **true** |-| get_agent_persona | **true** | false | **true** | false |-| persona_say | false | false | false | false |+| create_agent_persona (`/api/mcp-studio` only) | false | false | false | **true** |+| get_agent_persona (`/api/mcp-studio` only) | **true** | false | **true** | false |+| persona_say (`/api/mcp-studio` only) | false | false | false | false |Rationale (matches OpenAI guidance): each generation tool **creates a new hosted asset** → notread-only; it **never modifies or deletes** existing data → `destructiveHint: false` (generation isnon-destructive; `refine_model` creates a new version, the parent is preserved in the lineage); sameprompt yields a fresh mesh → not idempotent; generation runs against **external model APIs** →-`openWorldHint: true`. `check_job` only reads the state of a job already submitted → `readOnlyHint:-true`, `idempotentHint: true`, and it still polls the external provider → `openWorldHint: true`.+`openWorldHint: true`. `check_job` is not a pure read: the first check that finds a job finished copies the model into+our storage, records the creation and runs the quality gate, so `readOnlyHint: false` and+`idempotentHint: false`, and it collects work from external providers → `openWorldHint: true`.`look_at_model` draws pictures of a model that already exists and creates nothing → `readOnlyHint:true`, `idempotentHint: true`, and it fetches a caller-supplied GLB from wherever it is hosted →`openWorldHint: true`.@@ -393,9 +415,9 @@ No chat-history or "just in case" fields; `additionalProperties: false` on every| refine_model | `glb_url`, `instruction`, `parent_prompt`, `reference_image_url`, `parent_lineage`, `parent_index` | `glb_url`, `instruction` || check_job | `job_id` | `job_id` || look_at_model | `glb_url`, `views`, `size` | `glb_url` |-| create_agent_persona | `glb_url`, `name`, `voice`, `source_prompt` | `glb_url`, `name` |-| get_agent_persona | `persona_id` | `persona_id` |-| persona_say | `persona_id`, `text`, `emotion` | `persona_id`, `text` |+| create_agent_persona (`/api/mcp-studio` only) | `glb_url`, `name`, `voice`, `source_prompt` | `glb_url`, `name` |+| get_agent_persona (`/api/mcp-studio` only) | `persona_id` | `persona_id` |+| persona_say (`/api/mcp-studio` only) | `persona_id`, `text`, `emotion` | `persona_id`, `text` |### 2.6 Age-appropriate (13–17) — **PASS** (safety gate present + live-tested)A synchronous, dependency-free content-safety gate (`api/_mcp-studio/safety.js`) runs **before any@@ -424,7 +446,7 @@ re-verified live; nothing stands between this package and a submission.| Field | Value ||-------|-------|-| **MCP server URL** | `https://three.ws/api/mcp-studio` |+| **MCP server URL** | `https://three.ws/api/mcp-chatgpt` (the full surface, with the persona tools, stays at `https://three.ws/api/mcp-studio`) || **Transport** | Streamable HTTP / JSON-RPC 2.0 over `POST` (synchronous responses; no server-initiated stream). `GET` → `405`. || **Protocol version** | `2025-06-18` (echoed on `initialize` and the `mcp-protocol-version` response header). || **serverInfo** | `{ "name": "three-ws-3d-studio-free", "version": "1.0.0" }` |@@ -483,9 +505,9 @@ re-capturing to whatever the form asks for is trivial.]`**No credentials needed** (anonymous, free). Full flow re-verified green against production 2026-09-09.1. **Discover**: `initialize` → `tools/list` → `resources/list` against- `https://three.ws/api/mcp-studio`. Expect 11 tools + two resources,- `ui://widget/three-studio-model.html` (the inline 3D viewer) and- `ui://widget/three-studio-persona.html` (the living agent body).+ `https://three.ws/api/mcp-chatgpt`. Expect 8 tools and one resource,+ `ui://widget/three-studio-model.html` (the inline 3D viewer), with no `frame_domains` in its+ CSP.2. **Generate** a model that reliably succeeds — say to ChatGPT: *"Make a 3D model of a friendly roundrobot mascot, glossy white plastic."* Expect, in ~15–60s, an inline interactive 3D viewer with themodel plus **Download / Spin / Recenter / Open in three.ws**.@@ -573,7 +595,7 @@ Description, fitted to the portal's "concrete value, no marketing language" guid| Field | Value ||---|---|-| Server URL | `https://three.ws/api/mcp-studio` |+| Server URL | `https://three.ws/api/mcp-chatgpt` || Transport | Streamable HTTP, JSON-RPC 2.0 over POST || Protocol version | `2025-06-18` || Authentication | **None** |@@ -587,8 +609,8 @@ does not apply: there is no login to give. Full connectivity detail is in §3.Two things land here, and they are separate.**Tools come from the MCP server, not from this tab.** Selecting **Scan Tools** on the MCP-tab imports all 11, each already carrying its four `openai/*` annotations and its-`outputTemplate`, plus two widget resources. Do not hand-edit the annotations after import:+tab imports all 8, each already carrying its four `openai/*` annotations and its+`outputTemplate`, plus the one model-viewer widget resource. Do not hand-edit the annotations after import:§2.3 audits them and a wrong `readOnlyHint` on a tool that spends compute is a documentedrejection reason.@@ -679,19 +701,17 @@ three slots. Every tool named below was confirmed against a live `tools/list` onassistant describes the armchair from images it can actually see. Free, seconds not minutes.The URL is on our own domain and needs no credentials, so the case is self-contained.-**Test case 5. Turn a model into a persistent agent body that speaks**+**Test case 5. Generate a model through the art-directed lane**-- Prompt, in the same conversation as case 2: `Save that knight as a persistent agent body- called Sir Gareth, then have him introduce himself.`-- Tools: `create_agent_persona`, then `persona_say`-- Expected: an inline living-body widget framed from `https://three.ws`, our own verified- domain and the same origin as the connector, in which the avatar lip-syncs the line with a- matching expression and gesture and idles between turns. Returns a `persona_id` that- `get_agent_persona` reloads in a fresh session with its accumulated turn count.+- Prompt: `Use the art-directed generator to make a detailed vintage brass telescope on a wooden+ tripod.`+- Tool: `mesh_forge`, then `check_job` if it returns status "pending"+- Expected: a textured GLB in the same inline viewer, with Download and Open in three.ws. An+ art-direction pass may first tighten the prompt into a single-subject spec. Free, no account.+ Verified live on 2026-09-12: `mesh_forge` returned a finished GLB in 146 seconds.-Include this case rather than hiding it. The portal warns that `frame_domains` raises review-requirements because an iframe reduces its visibility into the rendered experience; a reviewer-who never exercises the widget is left more suspicious of it, not less.+This replaced the first submission's persona test case, because the persona tools are not on the+resubmission surface (§0 item 4).Required test data: none. No account, no key, no seed files.@@ -751,8 +771,7 @@ listing is actually public.## 9. Tool justifications (the MCP step's annotation panel)The portal asks, for every tool, why each explicit annotation value is accurate, "in enough-detail for us to confirm it doesn't misrepresent what the tool does". Eleven tools times three-annotations, plus one frame-domains justification.+detail for us to confirm it doesn't misrepresent what the tool does". Eight tools times three annotations on the resubmission surface.Every justification below is derived from the annotation constants in the source rather thanwritten to sound good: `GEN_ANNOTATIONS` in [`api/_mcp-studio/tools.js`](../../../api/_mcp-studio/tools.js)@@ -762,90 +781,18 @@ already carries its own one-line rationale comment. If an annotation changes, chfirst and re-derive this section; a justification that no longer matches the served annotationis the exact misrepresentation the panel exists to catch.-### Group A: the six generation tools--`forge_free`, `text_to_avatar`, `mesh_forge`, `rig_mesh`, `forge_avatar`, `refine_model`.-Identical annotations, so the same three answers apply to all six.--**Read Only is False.** The call creates a new hosted asset. Each invocation runs a generation-and writes a new GLB to our object storage, then returns its URL. The call has a real side-effect (a stored file, and the compute spent producing it), so marking it read-only would-understate what it does.--**Open World is True.** The work runs against external model providers rather than a bounded-dataset we own. Results depend on third-party inference services, and the same prompt-legitimately yields a different mesh on different calls, so the tool's effects are not confined-to a closed, predictable domain.--**Destructive is False.** The tool only ever adds. It writes a new asset and never modifies,-overwrites or deletes anything. This holds for the two tools that take an existing model as-input: `rig_mesh` and `refine_model` read the source and emit a separate new GLB, leaving the-original untouched and still addressable at its original URL.--### Group B: the two generation-side read tools--**`check_job` - Read Only is True.** A status probe. It looks up an existing job by id and-reports its state. It creates nothing and changes nothing.--**`check_job` - Open World is True.** The job it reports on is executing on external model-providers, so the status reflects third-party systems outside our control rather than a closed-internal dataset.--**`check_job` - Destructive is False.** It reads job state only. Nothing is written, modified or-removed.--**`look_at_model` - Read Only is True.** It renders views of a model that already exists and-returns images. It creates no new stored asset and modifies nothing.--**`look_at_model` - Open World is True.** It accepts an arbitrary public GLB URL, so it fetches-from hosts outside our own domain and its result depends on that external resource.--**`look_at_model` - Destructive is False.** It only reads the supplied model in order to render-it. The source file is never modified or deleted.--### Group C: the three persona tools--**`create_agent_persona` - Read Only is False.** It saves a new persona record, a persistent-body tied to a rigged model, so the call has a durable side effect.--**`create_agent_persona` - Open World is True.** Creating the persona involves external model-and speech providers, and it accepts a model URL that may be hosted outside our domain.--**`create_agent_persona` - Destructive is False.** It only creates. Existing personas and models-are never modified or deleted.--**`get_agent_persona` - Read Only is True.** A pure read. It looks up an existing persona by id-and returns its configuration. Nothing is created or changed.--**`get_agent_persona` - Open World is False.** It reads only our own stored persona records. No-external provider is contacted, and the result is fully determined by data we hold.--**`get_agent_persona` - Destructive is False.** A read-only lookup. Nothing is written or-removed.--**`persona_say` - Read Only is False.** It is a render directive that also increments the-persona's turn counter, which is a write to our stored state.--**`persona_say` - Open World is False.** It acts only on a persona we already store and renders-through our own embed. It does not reach outside our own systems.--**`persona_say` - Destructive is False.** It appends a turn and updates a counter. It never-deletes or overwrites the persona's configuration or its model.--### Frame Domains+### The justifications themselves-Only the three persona tools declare `frame_domains`, and the single declared origin is-`https://three.ws`.+Superseded. The first submission pasted per-tool justifications from this section, and the portal+cut every one over 200 characters mid-word. The paste-ready text now lives in one generated file,+[`openai-portal-fields.md`](openai-portal-fields.md), written by+`scripts/build-openai-portal-fields.mjs` to OpenAI's stated hint meanings, one sentence each,+measured against the portal's limits, and exported as `chatgpt-app-submission.json` with the+annotations read off the live connector. Edit it there, never here.-> The three persona tools render a living agent body: an interactive WebGL avatar that speaks-> with lip-synced facial animation. It is framed from https://three.ws, our own verified domain-> and the same origin that serves this MCP connector. No third-party origin is framed. An-> iframe is used because the embodiment surface needs a real-time WebGL canvas driving 52-> facial blendshapes alongside synchronised audio, which cannot be expressed as static inline-> content. The framed page is first-party, carries no advertising and no third-party scripts-> beyond the pinned CDN entries already declared in the CSP metadata, and exposes no payment,-> login or account surface. The eight tools that do not need it declare no frame_domains at-> all.+The persona tools and their `frame_domains` explanation are not part of the resubmission: they live+only on `/api/mcp-studio`, and the ChatGPT plugin surface `/api/mcp-chatgpt` does not serve them+(§0 item 4).### The outputSchema nudge@@ -876,7 +823,7 @@ existing behaviour rather than new work.- [x] Review surface is the MCP connector metadata, not `/.well-known/ai-plugin.json` (§2.1a, cited);live `initialize` + `tools/list` return `three-ws-3d-studio-free` on protocol `2025-06-18` with theexact 11-tool surface, each carrying its four `openai/*` annotations and its `outputTemplate`- (the 8 model tools to the model widget, the 3 persona tools to the persona widget), and+ (the 8 model tools to the model widget, the 3 persona tools to the persona widget, on `/api/mcp-studio`; the ChatGPT surface serves only the first), and`resources/list` returns both skybridge resources with `widgetCSP`, `widgetDescription` and`widgetDomain` (re-verified live 2026-09-09).- [x] App discovery schema served + guarded — `/.well-known/3d-studio-openapi.yaml`, free-only,diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex d8bda51e0..71f76ed6b 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-09-12T01:51:12.338Z",+ "generated_at": "2026-09-12T20:49:03.649Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3674,+ "total": 3675,"complete": false,"full_feed": "/changelog.json","entries": [@@ -20,6 +20,17 @@"sdk"]},+ {+ "date": "2026-09-12",+ "type": "update",+ "title": "The 3D viewer inside ChatGPT now loads everything through three.ws",+ "summary": "The interactive viewer that shows your 3D model inside ChatGPT now fetches every model and every preview image through three.ws itself, so the only places it is allowed to reach are three.ws and the 3D viewer library it runs on. Nothing about what you see changes: the model still renders, spins and downloads the same way. There is also a dedicated connection address for the ChatGPT plugin directory, https://three.ws/api/mcp-chatgpt, carrying the eight 3D creation tools. The existing connector at https://three.ws/api/mcp-studio keeps every tool, including the living agent body.",+ "link": "/docs/mcp-studio",+ "tags": [+ "improvement",+ "security"+ ]+ },{"date": "2026-09-11","type": "update",@@ -1610,16 +1621,6 @@"feature","sdk"]- },- {- "date": "2026-09-07",- "type": "update",- "title": "Reference-image upload now tells you to paste a URL instead of failing with a network error",- "summary": "When the image storage credentials are rejected, /forge used to hand the browser an upload address that the storage service refused. The refusal arrives without the header a browser needs to read it, so the page could only say \"Network error during upload\" and the reference image was lost. The upload endpoint now checks storage the same way the rest of the site does, so it says up front that direct upload is unavailable and points you at the paste-a-URL field, which keeps working through the outage.",- "link": "/forge",- "tags": [- "fix"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex fb7cc60c6..a41a3c881 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-12T01:51:12.316Z",+ "generated_at": "2026-09-12T20:49:03.627Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -17,6 +17,17 @@"sdk"]},+ {+ "date": "2026-09-12",+ "type": "update",+ "title": "The 3D viewer inside ChatGPT now loads everything through three.ws",+ "summary": "The interactive viewer that shows your 3D model inside ChatGPT now fetches every model and every preview image through three.ws itself, so the only places it is allowed to reach are three.ws and the 3D viewer library it runs on. Nothing about what you see changes: the model still renders, spins and downloads the same way. There is also a dedicated connection address for the ChatGPT plugin directory, https://three.ws/api/mcp-chatgpt, carrying the eight 3D creation tools. The existing connector at https://three.ws/api/mcp-studio keeps every tool, including the living agent body.",+ "link": "/docs/mcp-studio",+ "tags": [+ "improvement",+ "security"+ ]+ },{"date": "2026-09-11","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex f114c9ca8..21bbfb729 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -14,6 +14,14 @@<category>fix</category><description>The tool that collects a finished 3D generation was labelled a read-only status probe. It is not: the first check that finds a job done copies the model into permanent storage, records it, and scores it, and it can route failed work to another provider. Any AI client reading those labels to decide whether a call is safe to repeat was being told the wrong thing. The labels and the documentation now match the behaviour. Nothing about how the tool works changed.</description></item>+ <item>+ <title>The 3D viewer inside ChatGPT now loads everything through three.ws</title>+ <link>https://three.ws/docs/mcp-studio</link>+ <guid isPermaLink="false">2026-09-12:The 3D viewer inside ChatGPT now loads everything through three.ws</guid>+ <pubDate>Sat, 12 Sep 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The interactive viewer that shows your 3D model inside ChatGPT now fetches every model and every preview image through three.ws itself, so the only places it is allowed to reach are three.ws and the 3D viewer library it runs on. Nothing about what you see changes: the model still renders, spins and downloads the same way. There is also a dedicated connection address for the ChatGPT plugin directory, https://three.ws/api/mcp-chatgpt, carrying the eight 3D creation tools. The existing connector at https://three.ws/api/mcp-studio keeps every tool, including the living agent body.</description>+ </item><item><title>Selfie to avatar is unstuck: a scan that used to wait forever now finishes in seconds</title><link>https://three.ws/create/selfie</link>diff --git a/public/mcp-catalog.json b/public/mcp-catalog.jsonindex 863123a9b..f599c89d0 100644--- a/public/mcp-catalog.json+++ b/public/mcp-catalog.json@@ -6,8 +6,8 @@"servers": 41,"free": 289,"paid": 28,- "read": 212,- "write": 80,+ "read": 211,+ "write": 81,"irreversible": 25,"withSchema": 317,"withArguments": 292@@ -14264,7 +14264,7 @@{"name": "check_job","title": "Check a pending 3D generation",- "description": "Check on a 3D generation that returned status \"pending\" and collect the finished model. Pass the job_id from the pending result. While it is still rendering you get updated timing; call again after the suggested wait. When it is done the model renders inline in the interactive 3D viewer.",+ "description": "Check on a 3D generation that returned status \"pending\" and collect the finished model. Pass the job_id from the pending result. While it is still rendering you get updated timing; call again after the suggested wait. Checking can save the completed model and restart failed work on another provider. When it is done the model renders inline in the interactive 3D viewer.","server": {"id": "threews-3d-studio-free","title": "3D Studio (free)",@@ -14272,11 +14272,11 @@"transport": "remote","auth": "none"},- "safety": "read",+ "safety": "write","annotations": {- "readOnlyHint": true,+ "readOnlyHint": false,"destructiveHint": false,- "idempotentHint": true,+ "idempotentHint": false,"openWorldHint": true},"price": {diff --git a/scripts/build-openai-portal-fields.mjs b/scripts/build-openai-portal-fields.mjsindex 450b72eb9..92b0a8047 100644--- a/scripts/build-openai-portal-fields.mjs+++ b/scripts/build-openai-portal-fields.mjs@@ -14,11 +14,11 @@// measure before pasting. That is this file's whole job.//// Every justification is still derived from the annotation constants in-// api/_mcp-studio/tools.js and api/_mcp-studio/persona-tools.js. Shortening the+// api/_mcp-studio/tools.js. Shortening the// prose must never soften the claim: if an annotation changes, change it there// first, then re-derive here.-const LIMITS = { justification: 200, frame: 200, negative: 200, expected: 300, subtitle: 30 };+const LIMITS = { justification: 200, negative: 200, expected: 300, subtitle: 30 };// The six generation tools carry identical annotations, so they share one set.const GENERATION = {@@ -44,26 +44,8 @@ const JUSTIFICATIONS = {open_world: 'Fetches an arbitrary public GLB URL, so it reaches third-party hosts outside our own domain.',destructive: 'Only reads the supplied model in order to render it, and never modifies or deletes the source file.',},- create_agent_persona: {- read_only: 'Saves a new persona record and copies the model into our durable storage so the body outlives the source URL.',- open_world: 'Fetches the GLB from a public URL outside our domain and republishes it from our storage at a public URL anyone with the link can fetch.',- destructive: 'Only creates a new persona and never modifies or deletes an existing persona or model.',- },- get_agent_persona: {- read_only: 'Looks up a stored persona by its id and returns that persona\'s configuration without creating or changing anything.',- open_world: 'Reads only persona records held in our own private store and contacts no external system.',- destructive: 'Only reads a persona record and never writes or removes anything.',- },- persona_say: {- read_only: 'Increments the persona\'s turn counter in our own store while returning the render directive for this turn.',- open_world: 'Acts only on a persona in our own private store and renders through our own embed, reaching no external system.',- destructive: 'Only appends a turn and updates a counter, never deleting or overwriting the persona\'s configuration or model.',- },};-const FRAME_DOMAINS =- 'The persona tools render a live WebGL avatar that lip-syncs its reply. It is framed from https://three.ws, our verified domain and the same origin as this connector. No third-party content is framed.';-const TEST_CASES = [{scenario: 'Generate a 3D prop from a text description',@@ -95,11 +77,11 @@ const TEST_CASES = ['Frames from several angles returned as MCP image content blocks, which the client renders into the conversation, plus geometry stats. The assistant describes the armchair from images it can actually see. Free, seconds not minutes. The URL is ours and needs no credentials.',},{- scenario: 'Turn a generated model into a persistent agent body that speaks',- prompt: 'Save that knight as a persistent agent body called Sir Gareth, then have him introduce himself.',- tools: 'create_agent_persona, then persona_say',+ scenario: 'Generate a model through the art-directed lane',+ prompt: 'Use the art-directed generator to make a detailed vintage brass telescope on a wooden tripod.',+ tools: 'mesh_forge, then check_job if it returns status "pending"',expected:- 'Run after test case 2, in the same conversation. An inline living-body widget framed from https://three.ws, in which the avatar lip-syncs the line with a matching expression and gesture. Returns a persona_id that get_agent_persona reloads in a fresh session.',+ 'A textured GLB in the same inline viewer, with Download and Open in three.ws. An art-direction pass may first tighten the prompt into a single-subject spec. Free, no account. One to four minutes; a pending result is collected with check_job.',},];@@ -151,7 +133,6 @@ for (const [tool, set] of Object.entries(JUSTIFICATIONS)) {oneSentence(`${tool}.${kind}`, text);}}-measure('frame_domains', FRAME_DOMAINS, LIMITS.frame);TEST_CASES.forEach((t, i) => measure(`test case ${i + 1} expected output`, t.expected, LIMITS.expected));NEGATIVE_CASES.forEach((n, i) => measure(`negative case ${i + 1} scenario`, n.scenario, LIMITS.negative));@@ -164,7 +145,7 @@ if (violations.length) {if (process.argv.includes('--check')) {const n = Object.values(JUSTIFICATIONS).reduce((a, s) => a + Object.keys(s).length, 0);- console.log(`every portal field fits: ${n} justifications, 1 frame-domains explanation, ${TEST_CASES.length} test cases, ${NEGATIVE_CASES.length} negative cases.`);+ console.log(`every portal field fits: ${n} justifications, ${TEST_CASES.length} test cases, ${NEGATIVE_CASES.length} negative cases.`);process.exit(0);}@@ -183,10 +164,6 @@ if (!process.argv.includes('--json')) {console.log('```\n');}}- console.log(`## MCP tab: Frame Domains (${bar(FRAME_DOMAINS.length, LIMITS.frame)})\n`);- console.log('```');- console.log(FRAME_DOMAINS);- console.log('```\n');console.log('## Testing tab: test cases\n');TEST_CASES.forEach((t, i) => {@@ -215,7 +192,7 @@ const APP_INFO = {display_name: 'three.ws 3D Studio',subtitle: 'Create 3D models from text',description:- 'Describe any object or character and three.ws 3D Studio builds a real, textured 3D model, then shows it in an interactive viewer inside the conversation. Eleven tools cover the path from idea to asset: generate a model from text or a reference image, generate an avatar, auto-rig a static model so it can be animated, refine a model by describing a change, and inspect a finished model from several angles. Every result downloads as a standard GLB that opens in Blender, Unity, Unreal, three.js, or any glTF pipeline. No account, no API key, no payment.',+ 'Describe any object or character and three.ws 3D Studio builds a real, textured 3D model, then shows it in an interactive viewer inside the conversation. Eight tools cover the path from idea to asset: generate a model from text or a reference image, generate an avatar, auto-rig a static model so it can be animated, refine a model by describing a change, and inspect a finished model from several angles. Every result downloads as a standard GLB that opens in Blender, Unity, Unreal, three.js, or any glTF pipeline. No account, no API key, no payment.',// The skill's enum has no "creativity", so the closest true member is used.category: 'DESIGN',};@@ -224,7 +201,7 @@ measure('app_info.subtitle', APP_INFO.subtitle, LIMITS.subtitle);if (process.argv.includes('--json')) {const { writeFileSync } = await import('node:fs');- const CONNECTOR = process.env.OPENAI_CONNECTOR_URL || 'https://three.ws/api/mcp-studio';+ const CONNECTOR = process.env.OPENAI_CONNECTOR_URL || 'https://three.ws/api/mcp-chatgpt';// Read the annotations off the running connector rather than restating them// here. A justification is only true of the annotation actually served, and@@ -246,13 +223,10 @@ if (process.argv.includes('--json')) {// But a local source fix that has not shipped yet would make this file// disagree with their scan, which is the same misrepresentation the// justifications exist to prevent. Refuse to generate until they match.- // TOOL_CATALOG / PERSONA_TOOL_CATALOG are the served descriptor arrays; the- // TOOLS maps beside them are name-keyed handler tables, not descriptors.- const { TOOL_CATALOG } = await import('../api/_mcp-studio/tools.js');- const { PERSONA_TOOL_CATALOG } = await import('../api/_mcp-studio/persona-tools.js');- const local = new Map(- [...TOOL_CATALOG, ...PERSONA_TOOL_CATALOG].map((t) => [t.name, t.annotations || {}]),- );+ // The descriptors the ChatGPT surface serves, read from the same SURFACES table+ // the endpoint dispatches on, so this comparison cannot pick a different set.+ const { toolCatalogFor } = await import('../api/_mcp-studio/dispatch.js');+ const local = new Map(toolCatalogFor('chatgpt').map((t) => [t.name, t.annotations || {}]));if (local.size !== served.length) {console.error(`this checkout declares ${local.size} tool descriptors but ${CONNECTOR} serves ${served.length}`);process.exit(1);diff --git a/tests/mcp-studio.test.js b/tests/mcp-studio.test.jsindex fa2faa395..3d1bc9693 100644--- a/tests/mcp-studio.test.js+++ b/tests/mcp-studio.test.js@@ -2,8 +2,9 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';import { TOOL_CATALOG, TOOL_NAMES } from '../api/_mcp-studio/tools.js';import { PERSONA_TOOL_CATALOG, PERSONA_TOOL_NAMES } from '../api/_mcp-studio/persona-tools.js';-import { dispatch } from '../api/_mcp-studio/dispatch.js';-import { COMPONENT_URI, PERSONA_COMPONENT_URI, componentCsp } from '../api/_mcp-studio/component.js';+import { dispatch, toolCatalogFor } from '../api/_mcp-studio/dispatch.js';+import { COMPONENT_HTML, COMPONENT_URI, PERSONA_COMPONENT_URI, componentCsp } from '../api/_mcp-studio/component.js';+import { MODEL_VIEWER_CDN_ORIGIN } from '../api/_lib/model-viewer-cdn.js';// The eight tools in api/_mcp-studio/tools.js: six generators (which render the// model-viewer widget) + check_job (collects a pending generation) +@@ -152,29 +153,22 @@ describe('mcp-studio dispatch', () => {expect(readPersona.result.contents[0]._meta['openai/widgetCSP'].frame_domains).toContain('https://three.ws');});- it('widget CSP allowlists the GLB storage origin (ChatGPT enforces it in the sandbox)', () => {- const prev = process.env.S3_PUBLIC_DOMAIN;- process.env.S3_PUBLIC_DOMAIN = 'https://pub-abc123.r2.dev';- try {- const csp = componentCsp();- expect(csp.connect_domains).toContain('https://pub-abc123.r2.dev');- expect(csp.resource_domains).toContain('https://pub-abc123.r2.dev');- } finally {- if (prev === undefined) delete process.env.S3_PUBLIC_DOMAIN;- else process.env.S3_PUBLIC_DOMAIN = prev;- }+ // ChatGPT enforces this CSP inside the widget sandbox, and its submission+ // review flags wildcard and unused domains. The widget re-serves every GLB+ // through /api/glb and every poster through /api/img, so three.ws plus the+ // model-viewer CDN is the complete list.+ it('widget CSP lists only the origins the widget actually loads', () => {+ const csp = componentCsp();+ const expected = ['https://three.ws', MODEL_VIEWER_CDN_ORIGIN];+ expect(csp.connect_domains).toEqual(expected);+ expect(csp.resource_domains).toEqual(expected);+ expect(JSON.stringify(csp)).not.toContain('*');+ expect(csp.frame_domains).toBeUndefined();});- it('widget CSP stays valid when storage is unconfigured', () => {- const prev = process.env.S3_PUBLIC_DOMAIN;- delete process.env.S3_PUBLIC_DOMAIN;- try {- const csp = componentCsp();- expect(csp.connect_domains).toContain('https://three.ws');- expect(csp.connect_domains.every((d) => d.startsWith('https://'))).toBe(true);- } finally {- if (prev !== undefined) process.env.S3_PUBLIC_DOMAIN = prev;- }+ it('widget proxies off-origin GLBs and posters so the narrow CSP holds', () => {+ expect(COMPONENT_HTML).toContain("'https://three.ws/api/glb?src='");+ expect(COMPONENT_HTML).toContain("'https://three.ws/api/img?url='");});it('unknown tool returns an error', async () => {@@ -593,3 +587,57 @@ describe('mcp-studio dispatch', () => {});});});++// The ChatGPT plugin surface (/api/mcp-chatgpt). It must never advertise a tool+// or widget that needs frameDomains, and a persona call on it must fail rather+// than succeed off-listing.+describe('mcp-studio chatgpt surface', () => {+ const opts = { surface: 'chatgpt' };++ it('lists exactly the eight tools in tools.js', async () => {+ const r = await dispatch({ jsonrpc: '2.0', id: 1, method: 'tools/list' }, auth, mkReq(), opts);+ expect(r.result.tools.map((t) => t.name).sort()).toEqual([...ALLOWED].sort());+ expect(toolCatalogFor('chatgpt').map((t) => t.name).sort()).toEqual([...ALLOWED].sort());+ });++ it('serves only the model-viewer widget, with no frame domains anywhere', async () => {+ const list = await dispatch({ jsonrpc: '2.0', id: 2, method: 'resources/list' }, auth, mkReq(), opts);+ expect(list.result.resources.map((r) => r.uri)).toEqual([COMPONENT_URI]);+ const persona = await dispatch(+ { jsonrpc: '2.0', id: 3, method: 'resources/read', params: { uri: PERSONA_COMPONENT_URI } },+ auth,+ mkReq(),+ opts,+ );+ expect(JSON.stringify(persona)).toContain('unknown resource');+ const model = await dispatch(+ { jsonrpc: '2.0', id: 4, method: 'resources/read', params: { uri: COMPONENT_URI } },+ auth,+ mkReq(),+ opts,+ );+ const tools = await dispatch({ jsonrpc: '2.0', id: 5, method: 'tools/list' }, auth, mkReq(), opts);+ expect(JSON.stringify([list, model, tools])).not.toMatch(/frame_domains|frameDomains/);+ });++ it('refuses a persona tool call', async () => {+ const r = await dispatch(+ {+ jsonrpc: '2.0',+ id: 6,+ method: 'tools/call',+ params: { name: 'create_agent_persona', arguments: { glb_url: 'https://three.ws/x.glb', name: 'x' } },+ },+ auth,+ mkReq(),+ opts,+ );+ expect(JSON.stringify(r)).toContain('unknown tool');+ });++ it('does not tell the model about persona tools', async () => {+ const r = await dispatch({ jsonrpc: '2.0', id: 7, method: 'initialize' }, auth, mkReq(), opts);+ expect(r.result.instructions).not.toMatch(/persona/i);+ expect(FORBIDDEN.test(JSON.stringify(r))).toBe(false);+ });+});diff --git a/vercel.json b/vercel.jsonindex d78d0c0cc..a6dd36246 100644--- a/vercel.json+++ b/vercel.json@@ -111,7 +111,7 @@"includeFiles": "{src/solana/vanity/wasm/**,examples/skills/**,data/pages.json,data/archives/**,data/rss/**,data/_generated/**,sdk/src/sas-config.json}","maxDuration": 60},- "{api/mcp-studio,api/forge-nim,api/nim-forge,api/launch/mm,api/cron/avaturn-seed-cron,api/irl/interactions-stream}.js": {+ "{api/mcp-studio,api/mcp-chatgpt,api/forge-nim,api/nim-forge,api/launch/mm,api/cron/avaturn-seed-cron,api/irl/interactions-stream}.js": {"maxDuration": 300},"api/x402/remix-asset.js": {