Skip to content

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.

MCP server tools, forge-free, chat convo/util, and changelog updates

nirholas6e0ce631bd7f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5d1add10a..c07caddf8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -43,6 +43,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Filter the marketplace by Free or Paid** — The marketplace now has working Free / Paid filters. "Paid" surfaces every agent that charges in any way — a one-time price to own it or per-call pricing on its skills — and "Free" shows the rest. Filtering happens on the server, so the result count and "load more" stay accurate no matter how many pages deep you browse, and your choice is saved in the URL so you can bookmark or share a filtered view. (`/marketplace`) `[feature, improvement]`
- **Forge resilience: HuggingFace fallback now covers text→3D; club-payout log noise reduced** — When the NVIDIA NIM free lane returns a 5xx and the Replicate TRELLIS lane is also unavailable, the forge now falls through to the HuggingFace Spaces fallback for text→3D requests (using the FLUX-synthesized intermediate image) instead of returning a 429 to the user. Previously this fallback only fired for image uploads. Club-payout cron warnings for dancers with no registered wallet are now emitted at most once per 24 hours instead of every 5-minute tick. `[fix, infra]`
- **Game-Ready export in Forge — one click to engine-ready GLB + FBX** — Any model you generate or upload in Forge can now be turned into a clean, engine-ready asset in one click. Pick Quad retopology (field-aligned QuadriFlow edge loops that rig and animate well) or Tri low-poly (silhouette-preserving, with the texture re-baked), set a poly budget with 5k / 15k / 50k presets, and export a textured GLB plus an FBX for Unity and Unreal together. You see the before→after poly count (e.g. 28,400 → 5,012) and can flip on a live wireframe to inspect the new topology right in the viewer. Files are served from our own CDN. (`/forge`) `[feature]`
+- **Generate a rigged 3D avatar from a text prompt in chat** — Chat can now build a full avatar from a sentence. Ask it to "make me an avatar of …" and it forges a textured 3D model, auto-rigs it into an animation-ready character, saves it to your avatar library, and shows it in an orbit viewer you can spin (press S to see the skeleton). If you're not signed in it still hands back the rigged model and tells you to sign in to save. The tool is on by default in a fresh chat. (`/chat`) `[feature]`
- **iPhone now world-locks your IRL agent — it holds its real spot as you pan and walk** — iPhone Safari has no AR mode, so a placed agent used to drift with the camera. On three.ws/irl it now stays anchored to its real-world spot using the compass and GPS: pan your phone and the agent holds its real bearing instead of following the view, and walk toward it and it grows and keeps its place. Tapping Pin here saves the full placement — facing, ground height, and how good your GPS fix was — so iPhone placements match the AR-anchored version other phones see. If you pin before your location is ready, it waits for the first fix and pins precisely instead of dropping at a default spot. Permission states are designed and recoverable too: if motion or location access is off you get a clear card with the exact iOS Settings path and a Try again button, and if your phone can't read an absolute compass heading you're warned that others may see the agent rotated. (`/irl`) `[improvement]`
- **IRL agents now materialize as you walk up to them** — On three.ws/irl, a 3D agent placed further away first appears as a glowing beacon to keep things light. Previously it stayed a beacon even after you walked right up to it; now it upgrades to the full 3D avatar the moment you come within range, so approaching an agent in real life actually reveals it. Distance to each nearby agent is also recalculated live as you move instead of being frozen at the moment you arrived. Long AR sessions are smoother too: agents that leave the area now fully release their 3D model from memory instead of quietly accumulating, which keeps the camera view fast when you're somewhere busy with lots of agents coming and going. (`/irl`) `[fix, improvement]`
- **IRL agents now visibly react when someone engages them** — Walk past an agent placed in the real world and it now feels alive: the moment anyone standing nearby taps it, leaves it a message, or pays it, the agent does a little perk-up and a reaction floats up off its head — a 💜 for a glance, a ✨ 'paid' burst for a real on-chain payment, a 💬 for a message — and everyone viewing that spot sees it at once, not just the person who acted. A busy agent looks busy, which is the whole point of putting one somewhere public. Rapid taps are smoothed so the same person can't spam the reaction, while payments and messages always come through. The reaction is purely a visual flourish — it carries no one's location or wallet — and if your connection drops to the slower fallback the interaction is still recorded for the owner; only the live animation is skipped. (`/irl`) `[feature]`
@@ -89,7 +90,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Switch your agent mid-walk, and a fix for the avatar that wouldn't stop** — The walk-in to the Pole Club now has an Agent picker in the top-left: choose which avatar you walk in as — from a set of bundled rigs or any public avatar from the gallery — and the model swaps live, mid-stride, with no reload and without losing your place or heading. You can switch as many times as you like, in any room along the way. Also fixed: an avatar that could keep walking on its own after the window lost focus or you opened the cover-charge card — held keys are now released cleanly so she always stops when you do. (`/club`) `[feature, fix]`
- **Tag mini-game in /play worlds** — Server-authoritative tag comes to every /play world. When two or more players are in the same room, a random player becomes 'it'. Walk close to another player and tag transfers — the server validates proximity on authoritative positions so no client can cheat. The tagged player gets a red glow ring under their avatar and a 🏃 IT label above their head, visible to everyone. A 'YOU'RE IT!' alert flashes on your screen the moment you're tagged, and a 2-second immunity window prevents instant re-tagging. The tag HUD (bottom-right) shows who's currently 'it' and a live leaderboard of cumulative time-as-it for the session. (`/play`) `[feature]`
- **Tapping an IRL agent is now reliable — hit the body, not just the tiny label** — On three.ws/irl you can now open an agent by tapping its 3D body, not only its small floating name tag. Tapping near a name also works, with a finger-sized target that meets Apple's 44-pixel minimum, so you no longer have to pixel-hunt on a phone. When two agents stand on top of each other, the one in front wins instead of a random pick. As you move, the nearest agent you can reach lights up with a soft focus ring so you can see what you'll tap before you tap it — and if you've turned on Reduce Motion, the ring stays still. Looking and panning around no longer misfires as a tap. (`/irl`) `[improvement]`
-- **The IBM page became a live showcase — five three.ws demos in one place** — The IBM page at three.ws/ibm/x402-demo is now a full showcase of the IBM × three.ws partnership: five real, unmocked demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step. (`/ibm/x402-demo`) `[feature]`
+- **The IBM page became a live showcase — five three.ws demos in one place** — The IBM page at three.ws/ibm/x402-demo is now a live showcase: five real, unmocked three.ws demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step. (`/ibm/x402-demo`) `[feature]`
- **The Oracle's proof pages — wins, backtest, and live activity — load again** — The conviction Oracle's evidence views had stopped responding: the Wins gallery, the accuracy Backtest, and the global Activity feed were all erroring instead of returning data, and the live activity feed failed on every request. The cause was in how those queries were assembled — optional filters (time window, tier, agent) weren't being stitched into the database query correctly, so the database rejected them. All three views now build their filters cleanly and return the Oracle's track record, hit-rate, and real-time agent actions as intended. (`/oracle`) `[fix]`
- **The sniper now runs as an always-on service — armed strategies fire in real time** — An armed sniper strategy now has a live engine behind it. The sniper runs as a dedicated always-on worker that holds the pump.fun launch feed open continuously and acts the moment a launch matches your rules — not on a slow timer. It starts in a safe simulate mode (real scoring, zero spend) and going live is a deliberate, gated step that needs a funded agent wallet, so nothing trades real money by accident. If the launch feed ever drops, the worker reconnects on its own and pages the operators, and a public health check at /api/sniper/status reports whether it's live, reconnecting, or down — so 'is the sniper actually working right now?' is always answerable. Every safety limit you set — daily budget, per-trade size, max open positions, mandatory stop-loss, price-impact cutoff — is enforced by the running service exactly as configured. (`/dashboard/sniper`) `[infra, feature]`
- **Try x402 live — pay a tenth of a cent to call a real API from your own wallet** — There's now a live, self-contained x402 demo you can try in a browser. Pay $0.001 USDC from your own wallet — MetaMask on Base or Phantom on Solana — and call a real three.ws data API. The page reads the live HTTP 402 price the server quotes, runs the paid call once your wallet signs a gasless authorization, and shows the response next to an on-chain transaction receipt you can open on Basescan or Solscan. Nothing is mocked and there's no account or backend. The same eight-line embed it runs on — one script tag from three.ws plus any button carrying a data-x402-endpoint — is copy-pasteable into any site, so a developer can add a working pay-per-call paywall in minutes. Built with IBM as the public face of the partnership and designed to host cleanly on a strict-CSP enterprise page. (`/ibm/x402-demo`) `[feature, sdk]`
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index 8f6869d6b..c40659f48 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -68,7 +68,7 @@
} from './feather.js';
import { defaultToolSchema, agentToolSchema, pumpToolSchema, agentPaymentsToolSchema, pumpTradingToolSchema, walletToolSchema, curatedToolPacks } from './tools.js';
import { signMessageSolana, signMessageEVM } from './walletAuth.js';
- import { debounce, readFileAsDataURL } from './util.js';
+ import { debounce, readFileAsDataURL, parseToolCallArguments } from './util.js';
import { flash, focusOnMount } from './actions';
import Message from './Message.svelte';
import { deleteSingleItem, initEncryption, sendSingleItem, syncPull, syncPush } from './sync.js';
@@ -818,16 +818,18 @@
const toolcall = convo.messages[i].toolcalls[ti];
try {
- if (typeof toolcall.arguments === 'string') {
- // Empty string = a tool that takes no arguments; treat as {} rather than a parse error.
- toolcall.arguments = toolcall.arguments.trim()
- ? JSON.parse(toolcall.arguments)
- : {};
- }
- // Otherwise arguments is already an object — leave it as-is.
+ // Normalize across providers: JSON strings, already-parsed objects,
+ // empty (no-arg) calls, and Markdown-fenced payloads all land as an object.
+ toolcall.arguments = parseToolCallArguments(toolcall.arguments);
} catch (err) {
+ const detail = err instanceof Error ? err.message : String(err);
+ const payload = err && err.payload != null ? String(err.payload) : '';
+ const truncated = payload.length > 500 ? payload.slice(0, 500) + '…' : payload;
+ // Fence the payload so model-emitted markdown can't break the error rendering.
+ const fenced = truncated.replace(/```/g, '`​``');
convo.messages[i].error =
- 'Failed to parse tool call arguments: ' + err + toolcall.arguments;
+ `The ${toolcall.name || 'tool'} call returned arguments that couldn't be read (${detail}).` +
+ (fenced ? `\n\nReceived:\n\`\`\`\n${fenced}\n\`\`\`` : '');
saveMessage(convo.messages[i]);
return;
}
@@ -1635,6 +1637,26 @@
console.warn('[forge-text-to-3d] bootstrap failed:', err);
}
+ // Same one-time bootstrap for the Text → 3D Avatar pack, so "make me an
+ // avatar of…" runs the full forge → rig → save-to-library pipeline on a
+ // fresh chat. Honors removal via the bootstrap flag, like the packs above.
+ try {
+ if (!localStorage.getItem('forgeAvatarPackBootstrapped')) {
+ const avatarPack = curatedToolPacks.find((p) => p.id === 'forge-avatar');
+ if (avatarPack && !$toolSchema.some((g) => g.name === avatarPack.name)) {
+ $toolSchema = [...$toolSchema, { name: avatarPack.name, schema: avatarPack.schema }];
+ }
+ if (avatarPack && convo && (convo.messages?.length ?? 0) === 0) {
+ const names = avatarPack.schema.map((t) => t.function?.name).filter(Boolean);
+ convo.tools = Array.from(new Set([...(convo.tools || []), ...names]));
+ saveConversation(convo);
+ }
+ localStorage.setItem('forgeAvatarPackBootstrapped', '1');
+ }
+ } catch (err) {
+ console.warn('[forge-avatar] bootstrap failed:', err);
+ }
+
// When the user installs a Local skill from the Skills modal, auto-enable
// the new tools in the current conversation so the LLM can call them on
// the next turn — same UX as the x402-pay bootstrap above, but
diff --git a/chat/src/convo.js b/chat/src/convo.js
index cbc0ac691..727ea2ad3 100644
--- a/chat/src/convo.js
+++ b/chat/src/convo.js
@@ -1,6 +1,7 @@
import { get } from 'svelte/store';
import { controller, params, toolSchema, knowledgeSkills } from './stores.js';
import { headersForFetch, providers } from './providers.js';
+import { serializeToolCallArguments } from './util.js';
const KNOWLEDGE_SOFT_CAP = 60_000;
@@ -252,7 +253,7 @@ function messageToOpenAIFormat(msg) {
type: 'function',
function: {
name: t.name,
- arguments: JSON.stringify(t.arguments),
+ arguments: serializeToolCallArguments(t.arguments),
},
};
});
diff --git a/chat/src/util.js b/chat/src/util.js
index fc42119e4..fabc9336a 100644
--- a/chat/src/util.js
+++ b/chat/src/util.js
@@ -97,3 +97,75 @@ export function debounce(func, wait) {
timers.set(id, timer);
};
}
+
+/**
+ * Strip a Markdown code fence (```json … ``` or ``` … ```) that some models
+ * wrap around tool-call arguments, returning the inner payload.
+ *
+ * @param {string} text
+ * @returns {string}
+ */
+function stripCodeFence(text) {
+ const fenced = text.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);
+ return fenced ? fenced[1] : text;
+}
+
+/**
+ * Normalize a tool call's `arguments` into a plain object, tolerating the
+ * range of shapes real model providers emit:
+ * - a JSON string (the OpenAI streaming default)
+ * - an already-parsed object (e.g. GPT OSS 120B sends the object in one chunk)
+ * - an empty / whitespace-only string (a tool that takes no arguments)
+ * - a JSON payload wrapped in a Markdown ```json code fence
+ *
+ * @param {unknown} raw
+ * @returns {Record<string, any>} the parsed arguments object
+ * @throws {Error} with a clean, user-readable message when the payload is
+ * genuinely unparseable. The raw payload is attached as `err.payload`.
+ */
+export function parseToolCallArguments(raw) {
+ // Already an object (and not null) — providers that hand back parsed args.
+ if (raw !== null && typeof raw === 'object') {
+ return raw;
+ }
+
+ if (typeof raw !== 'string') {
+ // null / undefined / number — treat as "no arguments".
+ return {};
+ }
+
+ const trimmed = stripCodeFence(raw.trim()).trim();
+ if (trimmed === '') {
+ return {};
+ }
+
+ try {
+ const parsed = JSON.parse(trimmed);
+ // A bare JSON scalar (e.g. `"foo"` or `5`) isn't a valid arguments object.
+ if (parsed === null || typeof parsed !== 'object') {
+ throw new Error('arguments did not decode to an object');
+ }
+ return parsed;
+ } catch (err) {
+ const message = err instanceof Error ? err.message : String(err);
+ const wrapped = new Error(message);
+ // @ts-ignore — attach the offending payload for diagnostics/UI.
+ wrapped.payload = raw;
+ throw wrapped;
+ }
+}
+
+/**
+ * Serialize a tool call's `arguments` back into the JSON string the OpenAI
+ * Chat Completions API expects, without double-encoding a value that is
+ * already a string (which can happen if a prior parse failed mid-turn).
+ *
+ * @param {unknown} args
+ * @returns {string}
+ */
+export function serializeToolCallArguments(args) {
+ if (typeof args === 'string') {
+ return args;
+ }
+ return JSON.stringify(args ?? {});
+}
diff --git a/data/changelog.json b/data/changelog.json
index 316b5daa7..dcf749781 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,15 @@
{
"$comment": "Curated changelog entries for three.ws \u2014 the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-17",
+ "title": "Generate a rigged 3D avatar from a text prompt in chat",
+ "summary": "Chat can now build a full avatar from a sentence. Ask it to \"make me an avatar of …\" and it forges a textured 3D model, auto-rigs it into an animation-ready character, saves it to your avatar library, and shows it in an orbit viewer you can spin (press S to see the skeleton). If you're not signed in it still hands back the rigged model and tells you to sign in to save. The tool is on by default in a fresh chat.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/chat"
+ },
{
"date": "2026-06-17",
"title": "Simpler color picker in advanced controls",
@@ -85,7 +94,7 @@
{
"date": "2026-06-17",
"title": "The IBM page became a live showcase — five three.ws demos in one place",
- "summary": "The IBM page at three.ws/ibm/x402-demo is now a full showcase of the IBM × three.ws partnership: five real, unmocked demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step.",
+ "summary": "The IBM page at three.ws/ibm/x402-demo is now a live showcase: five real, unmocked three.ws demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step.",
"tags": [
"feature"
],
diff --git a/mcp-server/package.json b/mcp-server/package.json
index 87690e703..07d1bdeb3 100644
--- a/mcp-server/package.json
+++ b/mcp-server/package.json
@@ -1,8 +1,8 @@
{
"name": "@three-ws/mcp-server",
- "version": "1.1.0",
+ "version": "1.2.0",
"mcpName": "io.github.nirholas/3d-agent-mcp",
- "description": "Paid MCP tools for the 3d-agent stack — pose generation, pump.fun snapshots, ERC-8004 agent reputation, Solana vanity grinder. Settled in USDC via x402.",
+ "description": "MCP tools for the 3d-agent stack — free text→3D (TRELLIS) plus paid 3D/avatar/rigging, pump.fun snapshots, ERC-8004 reputation, vanity grinder. Paid calls settled in USDC via x402.",
"type": "module",
"author": "nirholas",
"license": "Apache-2.0",
@@ -24,7 +24,10 @@
"erc-8004",
"ai-agent",
"pose-generation",
- "vanity-address"
+ "vanity-address",
+ "text-to-3d",
+ "trellis",
+ "free"
],
"publishConfig": {
"access": "public"
diff --git a/mcp-server/src/index.js b/mcp-server/src/index.js
index c334d1d9f..a122e7ab6 100755
--- a/mcp-server/src/index.js
+++ b/mcp-server/src/index.js
@@ -33,6 +33,7 @@ import { buildAgentReputationTool } from './tools/agent-reputation.js';
import { buildVanityGrinderTool } from './tools/vanity-grinder.js';
import { buildTextToAvatarTool } from './tools/text-to-avatar.js';
import { buildMeshForgeTool } from './tools/mesh-forge.js';
+import { buildForgeFreeTool } from './tools/forge-free.js';
import { buildRigMeshTool } from './tools/rig-mesh.js';
import { buildSentimentPulseTool } from './tools/sentiment-pulse.js';
import { buildEnsSnsResolveTool } from './tools/ens-sns-resolve.js';
@@ -44,9 +45,12 @@ import { buildAixbtIntelTool } from './tools/aixbt-intel.js';
import { buildAixbtProjectsTool } from './tools/aixbt-projects.js';
const SERVER_INSTRUCTIONS =
- 'Paid x402 MCP tools from three.ws. Each tool quotes its USDC price in its description. ' +
- 'Tool calls without an x402 payment payload in _meta return a PaymentRequired structuredContent ' +
- '(v2 MCP transport spec). Tools cover: 3D avatar generation (text_to_avatar), ' +
+ 'MCP tools from three.ws. Most are paid: each quotes its USDC price in its description, and a call ' +
+ 'without an x402 payment payload in _meta returns a PaymentRequired structuredContent (v2 MCP ' +
+ 'transport spec). ONE tool is free and needs no payment, wallet, or API key: forge_free generates a ' +
+ 'textured 3D GLB from a text prompt on the free NVIDIA NIM (Microsoft TRELLIS) lane and returns a ' +
+ 'GLB URL + three.ws viewer link — use it for zero-cost text→3D. ' +
+ 'Tools cover: free text→3D generation (forge_free), 3D avatar generation (text_to_avatar), ' +
'text/image-to-3D mesh generation via a Granite-directed model chain (mesh_forge), ' +
'auto-rigging a GLB into an animation-ready model (rig_mesh), ' +
'ENS + SNS name resolution ' +
@@ -70,6 +74,7 @@ const { version: PKG_VERSION } = createRequire(import.meta.url)('../package.json
const TOOL_BUILDERS = [
buildTextToAvatarTool,
buildMeshForgeTool,
+ buildForgeFreeTool,
buildRigMeshTool,
buildEnsSnsResolveTool,
buildAgentDelegateActionTool,
diff --git a/mcp-server/src/payments.js b/mcp-server/src/payments.js
index 4c429f5fd..4b1236f69 100644
--- a/mcp-server/src/payments.js
+++ b/mcp-server/src/payments.js
@@ -265,6 +265,35 @@ export function paid(cfg, handler) {
};
}
+/**
+ * Wrap a tool handler as a FREE (no-payment) MCP tool callback — the
+ * counterpart to `paid()` for tools the platform offers at zero cost (the free
+ * NVIDIA NIM / Microsoft TRELLIS text→3D lane).
+ *
+ * It funnels the handler's return value through the SAME `buildToolResult`
+ * envelope every paid tool uses (text mirror + structuredContent + isError on
+ * `toolError`), so a free tool is indistinguishable from a paid one to the
+ * client EXCEPT that it never emits a 402 PaymentRequired challenge and never
+ * touches payment env: no x402 resource server, no facilitator, no pay-to
+ * address. That keeps the free lane working on a deployment that has not
+ * configured MCP_SVM_PAYMENT_ADDRESS at all.
+ *
+ * @param {object} cfg
+ * @param {string} cfg.toolName — e.g. "forge_free" (used only in error messages)
+ * @param {object} [cfg.inputSchema] — JSON Schema for the args (parity with paid(); unused here)
+ * @param {Function} handler — async (args, context) → result
+ * @returns {Function} MCP tool callback for McpServer.registerTool()
+ */
+export function free(cfg, handler) {
+ const { toolName } = cfg || {};
+ if (!toolName) throw new Error('free(): toolName is required');
+ if (typeof handler !== 'function') throw new Error('free(): handler must be a function');
+ return async function freeToolCallback(args, context) {
+ const result = await handler(args, context);
+ return buildToolResult(result);
+ };
+}
+
/**
* Build the MCP `CallToolResult` envelope from a handler's return value.
*
diff --git a/mcp-server/src/tools/forge-free.js b/mcp-server/src/tools/forge-free.js
new file mode 100644
index 000000000..0e0798e92
--- /dev/null
+++ b/mcp-server/src/tools/forge-free.js
@@ -0,0 +1,262 @@
+// `forge_free` — FREE MCP tool: text prompt → textured 3D GLB. No payment, no key.
+//
+// The zero-cost counterpart to `mesh_forge` / `text_to_avatar`. It drives the
+// three.ws /api/forge pipeline pinned to the FREE NVIDIA NIM (Microsoft TRELLIS)
+// text→3D lane — the same free engine the /forge web page uses for prompt
+// drafts — so anyone can turn a text prompt into a downloadable, viewable 3D
+// model with NO x402 payment and NO API key.
+//
+// Pipeline:
+// POST /api/forge { prompt, tier, backend:"nvidia" }
+// → NVCF generates the mesh natively from the prompt (no FLUX intermediate
+// view), persists the GLB to three.ws R2, and returns a durable URL. NVCF
+// usually completes synchronously (~12–15s at draft) → status:"done" on
+// the submit; when it queues the job we poll GET ?job=<id> to a terminal
+// state. Returns the GLB URL plus a three.ws viewer link that renders the
+// model in-browser. Feed the GLB to `rig_mesh` to make it animation-ready.
+//
+// Honesty: the free lane is the platform's "never dead-end" default — if NVCF is
+// momentarily unreachable or over-quota, /api/forge degrades the SAME request to
+// its standing engine and reports the backend that actually ran. This tool
+// surfaces that `backend` verbatim, so a degrade is visible, never silent. The
+// CALLER is never charged either way (there is no x402 here); only the
+// platform's own infra is involved.
+//
+// Environment (all optional — sensible prod defaults):
+// FORGE_FREE_API_BASE — three.ws origin. Default https://three.ws
+// FORGE_FREE_TIMEOUT_MS — overall reconstruct poll budget. Default 180000.
+// FORGE_FREE_POLL_MS — poll interval. Default 3000.
+
+import { z } from 'zod';
+
+import { free, toolError } from '../payments.js';
+import { jsonSchemaFromZod } from './_shared.js';
+
+const TOOL_NAME = 'forge_free';
+const TOOL_DESCRIPTION =
+ 'Generate a textured 3D GLB model from a text prompt — FREE: no x402 payment, no API key, no wallet. ' +
+ 'Drives the three.ws /api/forge pipeline on the free NVIDIA NIM (Microsoft TRELLIS) text→3D lane — ' +
+ 'the same zero-cost engine the /forge web page uses for prompt drafts. Returns a durable GLB URL, a ' +
+ 'three.ws viewer link that renders the model in the browser, the quality tier used, and the backend ' +
+ 'that actually produced it. Choose tier draft (fast, default), standard, or high — all free; higher ' +
+ 'tiers just take longer. Text-only (NVIDIA\'s hosted TRELLIS preview does not accept uploaded photos); ' +
+ 'for image/multi-view → 3D or the Granite-directed paid chain use mesh_forge. Feed the returned glbUrl ' +
+ 'to rig_mesh to make it animation-ready. Free — no payment required.';
+
+const VALID_TIER = new Set(['draft', 'standard', 'high']);
+
+function env(k, def) {
+ const v = process.env[k];
+ return v && String(v).trim() ? String(v).trim() : def;
+}
+
+function apiBase() {
+ return env('FORGE_FREE_API_BASE', 'https://three.ws').replace(/\/$/, '');
+}
+
+// Submit a text→3D job to the free NVIDIA NIM lane. The forge endpoint may
+// answer in one of two shapes:
+// • synchronous completion — { status:"done", glb_url, ... } (NVCF finished
+// inside the submit window; no job to poll), or
+// • queued — { job_id, status:"queued", ... } (poll GET ?job=<id>).
+// Accept BOTH; mesh_forge's startForge requires a job_id and would wrongly throw
+// on the free lane's common synchronous-done response.
+async function startForge({ prompt, tier }) {
+ const base = apiBase();
+ let res;
+ try {
+ res = await fetch(`${base}/api/forge`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ // Pin the free NVIDIA NIM (TRELLIS) lane explicitly so the happy path is
+ // always the zero-cost engine — never the platform's paid Replicate lane.
+ // The endpoint still degrades to its standing engine if NVCF is down and
+ // reports which backend ran (surfaced in the result), so this is honest,
+ // not a silent paid fallback. path:"image" is the only path NVIDIA serves.
+ body: JSON.stringify({ prompt, tier, backend: 'nvidia', path: 'image' }),
+ // NVCF can complete synchronously inside the submit (the endpoint holds the
+ // connection up to its ~45s provider window before returning done), so give
+ // the submit a generous ceiling rather than the 30s paid-lane budget.
+ signal: AbortSignal.timeout(90_000),
+ });
+ } catch (err) {
+ if (err?.name === 'TimeoutError' || err?.name === 'AbortError') {
+ const e = new Error('the free 3D lane took too long to accept the job; try again');
+ e.code = 'timeout';
+ throw e;
+ }
+ const e = new Error(`forge unreachable: ${err?.message || err}`);
+ e.code = 'provider_error';
+ throw e;
+ }
+
+ const data = await res.json().catch(() => ({}));
+ if (res.status === 503) {
+ const e = new Error(data?.message || 'free text→3D is not configured on the three.ws deployment');
+ e.code = 'not_configured';
+ throw e;
+ }
+ if (res.status === 429) {
+ const e = new Error(data?.message || 'the free 3D lane is busy; try again shortly');
+ e.code = 'rate_limited';
+ e.retryAfter = data?.retry_after;
+ throw e;
+ }
+ const completedSync = data?.status === 'done' && data?.glb_url;
+ if (!res.ok || !(data?.job_id || completedSync)) {
+ const e = new Error(data?.message || `forge returned ${res.status}`);
+ e.code = 'provider_error';
+ throw e;
+ }
+ return data; // { job_id?, creation_id, status, glb_url?, backend, durable?, ... }
+}
+
+async function pollForge(jobId, { timeoutMs, intervalMs }) {
+ const base = apiBase();
+ const deadline = Date.now() + timeoutMs;
+ let last = null;
+ while (Date.now() < deadline) {
+ let res;
+ try {
+ res = await fetch(`${base}/api/forge?job=${encodeURIComponent(jobId)}`, {
+ headers: { accept: 'application/json' },
+ signal: AbortSignal.timeout(Math.max(intervalMs * 3, 15_000)),
+ });
+ } catch (err) {
+ if (err?.name === 'AbortError' || err?.name === 'TimeoutError') {
+ await new Promise((r) => setTimeout(r, intervalMs));
+ continue;
+ }
+ const e = new Error(`forge poll failed: ${err?.message || err}`);
+ e.code = 'provider_error';
+ throw e;
+ }
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok) {
+ const e = new Error(data?.message || `forge poll returned ${res.status}`);
+ e.code = 'provider_error';
+ throw e;
+ }
+ last = data;
+ if (data.status === 'done' && data.glb_url) return data;
+ if (data.status === 'failed') {
+ const e = new Error(data.error || 'generation failed');
+ e.code = 'generation_failed';
+ throw e;
+ }
+ await new Promise((r) => setTimeout(r, intervalMs));
+ }
+ return { ...(last || {}), _timedOut: true };
+}
+
+// Shape the final success envelope. `backend` is reported verbatim from the
+// pipeline so a degrade off the free NVIDIA lane is visible, never silent.
+function shapeResult({ data, prompt, tierId, jobId, startedAt }) {
+ const glbUrl = data.glb_url;
+ const preview = `${apiBase()}/viewer?src=${encodeURIComponent(glbUrl)}`;
+ return {
+ ok: true,
+ free: true,
+ cost: '$0.00',
+ mode: 'text_to_3d',
+ glbUrl,
+ preview,
+ prompt,
+ tier: tierId,
+ backend: data.backend ?? null,
+ jobId,
+ creationId: data.creation_id ?? null,
+ durable: Boolean(data.durable),
+ durationMs: Date.now() - startedAt,
+ fetchedAt: new Date().toISOString(),
+ };
+}
+
+const inputZodShape = {
+ prompt: z
+ .string()
+ .min(3)
+ .max(1000)
+ .describe(
+ 'Natural-language description of the single object or character to model, e.g. "a friendly round robot mascot, glossy white plastic". The free TRELLIS lane conditions on ~77 characters, so lead with the subject plus its key materials and colors.',
+ ),
+ tier: z
+ .enum(['draft', 'standard', 'high'])
+ .describe(
+ 'Geometry/texture budget: draft = fast preview (default), standard = balanced, high = densest mesh. All three are free on the NVIDIA NIM lane — higher tiers only cost more time, never money.',
+ )
+ .optional(),
+};
+
+const inputJsonSchema = jsonSchemaFromZod(inputZodShape);
+
+export function buildForgeFreeTool() {
+ const handler = free(
+ { toolName: TOOL_NAME, inputSchema: inputJsonSchema },
+ async ({ prompt, tier }) => {
+ const trimmed = typeof prompt === 'string' ? prompt.trim() : '';
+ if (trimmed.length < 3) {
+ return toolError('invalid_input', 'Provide a text prompt of at least 3 characters.');
+ }
+ const tierId = VALID_TIER.has(tier) ? tier : 'draft';
+ const startedAt = Date.now();
+
+ // Stage 1 — submit to the free NVIDIA NIM text→3D lane.
+ let job;
+ try {
+ job = await startForge({ prompt: trimmed, tier: tierId });
+ } catch (err) {
+ return toolError(err.code || 'provider_error', err.message, {
+ ...(err.retryAfter ? { retryAfter: err.retryAfter } : {}),
+ });
+ }
+
+ // Fast path — NVCF completed inside the submit and already persisted the GLB.
+ if (job.status === 'done' && job.glb_url) {
+ return shapeResult({ data: job, prompt: trimmed, tierId, jobId: null, startedAt });
+ }
+
+ // Stage 2 — poll the queued job to a terminal state.
+ const timeoutMs = Number(env('FORGE_FREE_TIMEOUT_MS', '180000'));
+ const intervalMs = Number(env('FORGE_FREE_POLL_MS', '3000'));
+ let final;
+ try {
+ final = await pollForge(job.job_id, { timeoutMs, intervalMs });
+ } catch (err) {
+ return toolError(err.code || 'provider_error', err.message, {
+ jobId: job.job_id,
+ creationId: job.creation_id ?? null,
+ durationMs: Date.now() - startedAt,
+ });
+ }
+
+ if (final._timedOut) {
+ return toolError('timeout', `generation did not finish within ${timeoutMs}ms`, {
+ jobId: job.job_id,
+ creationId: job.creation_id ?? null,
+ status: final.status || 'running',
+ resumeUrl: `${apiBase()}/api/forge?job=${job.job_id}`,
+ durationMs: Date.now() - startedAt,
+ });
+ }
+
+ return shapeResult({ data: final, prompt: trimmed, tierId, jobId: job.job_id, startedAt });
+ },
+ );
+
+ return {
+ name: TOOL_NAME,
+ title: 'Free text → 3D (TRELLIS)',
+ description: TOOL_DESCRIPTION,
+ inputSchema: inputZodShape,
+ // Mints a fresh hosted GLB artifact via the free generation lane; destroys
+ // nothing, and the same prompt can yield a different mesh each call.
+ annotations: {
+ readOnlyHint: false,
+ destructiveHint: false,
+ idempotentHint: false,
+ openWorldHint: true,
+ },
+ handler,
+ };
+}
diff --git a/public/changelog.json b/public/changelog.json
index d026048eb..306054bf2 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T22:29:45.437Z",
+ "generated_at": "2026-06-17T22:34:21.137Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -385,6 +385,16 @@
"feature"
]
},
+ {
+ "date": "2026-06-17",
+ "type": "update",
+ "title": "Generate a rigged 3D avatar from a text prompt in chat",
+ "summary": "Chat can now build a full avatar from a sentence. Ask it to \"make me an avatar of …\" and it forges a textured 3D model, auto-rigs it into an animation-ready character, saves it to your avatar library, and shows it in an orbit viewer you can spin (press S to see the skeleton). If you're not signed in it still hands back the rigged model and tells you to sign in to save. The tool is on by default in a fresh chat.",
+ "link": "/chat",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-17",
"type": "update",
@@ -864,7 +874,7 @@
"date": "2026-06-17",
"type": "update",
"title": "The IBM page became a live showcase — five three.ws demos in one place",
- "summary": "The IBM page at three.ws/ibm/x402-demo is now a full showcase of the IBM × three.ws partnership: five real, unmocked demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step.",
+ "summary": "The IBM page at three.ws/ibm/x402-demo is now a live showcase: five real, unmocked three.ws demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step.",
"link": "/ibm/x402-demo",
"tags": [
"feature"
diff --git a/public/changelog.xml b/public/changelog.xml
index 58c456dfa..63ef2ff69 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -302,6 +302,14 @@
<category>feature</category>
<description>Any model you generate or upload in Forge can now be turned into a clean, engine-ready asset in one click. Pick Quad retopology (field-aligned QuadriFlow edge loops that rig and animate well) or Tri low-poly (silhouette-preserving, with the texture re-baked), set a poly budget with 5k / 15k / 50k presets, and export a textured GLB plus an FBX for Unity and Unreal together. You see the before→after poly count (e.g. 28,400 → 5,012) and can flip on a live wireframe to inspect the new topology right in the viewer. Files are served from our own CDN.</description>
</item>
+ <item>
+ <title>Generate a rigged 3D avatar from a text prompt in chat</title>
+ <link>https://three.ws/chat</link>
+ <guid isPermaLink="false">2026-06-17:Generate a rigged 3D avatar from a text prompt in chat</guid>
+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Chat can now build a full avatar from a sentence. Ask it to &quot;make me an avatar of …&quot; and it forges a textured 3D model, auto-rigs it into an animation-ready character, saves it to your avatar library, and shows it in an orbit viewer you can spin (press S to see the skeleton). If you're not signed in it still hands back the rigged model and tells you to sign in to save. The tool is on by default in a fresh chat.</description>
+ </item>
<item>
<title>iPhone now world-locks your IRL agent — it holds its real spot as you pan and walk</title>
<link>https://three.ws/irl</link>
@@ -676,7 +684,7 @@
<guid isPermaLink="false">2026-06-17:The IBM page became a live showcase — five three.ws demos in one place</guid>
<pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
<category>feature</category>
- <description>The IBM page at three.ws/ibm/x402-demo is now a full showcase of the IBM × three.ws partnership: five real, unmocked demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step.</description>
+ <description>The IBM page at three.ws/ibm/x402-demo is now a live showcase: five real, unmocked three.ws demos you can try in sequence. Pay a tenth of a cent over x402 and watch it settle on-chain; meet a 3D AI agent that pays for its own data and celebrates the moment your payment clears; then Forge (turn text into a 3D model), Play (a shared 3D world), and IRL (an agent in augmented reality) each run full-size right on the page, with a one-tap full-screen. Everything still loads from three.ws with no build step.</description>
</item>
<item>
<title>The Oracle's proof pages — wins, backtest, and live activity — load again</title>
diff --git a/public/features.json b/public/features.json
index 8d608e83a..104ec54b6 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T22:29:45.425Z",
+ "generated_at": "2026-06-17T22:34:21.122Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/tests/mcp-tool-result.test.js b/tests/mcp-tool-result.test.js
index 30d58150c..08d3a2e3e 100644
--- a/tests/mcp-tool-result.test.js
+++ b/tests/mcp-tool-result.test.js
@@ -70,9 +70,13 @@ describe('buildToolResult — MCP CallToolResult envelope', () => {
// The tool surface must be enumerable WITHOUT any payment env — tool
// registration is secret-free; only an actual paid invocation needs a pay-to.
describe('MCP tool surface', () => {
+ // Tools the platform offers at zero cost — exempt from the paid-price
+ // assertion below, and asserted to advertise their free-ness instead.
+ const FREE_TOOLS = new Set(['forge_free']);
+
it('builds every tool descriptor with a complete, unique contract', async () => {
const tools = await buildTools();
- expect(tools.length).toBeGreaterThanOrEqual(15);
+ expect(tools.length).toBeGreaterThanOrEqual(16);
const names = new Set();
for (const t of tools) {
@@ -81,8 +85,13 @@ describe('MCP tool surface', () => {
expect(typeof t.title).toBe('string');
expect(t.title.length).toBeGreaterThan(0);
expect(typeof t.description).toBe('string');
- // Every paid tool must quote its USDC price in its description.
- expect(t.description).toMatch(/\$[0-9]/);
+ if (FREE_TOOLS.has(t.name)) {
+ // A free tool must say so plainly and must NOT quote a USDC price.
+ expect(t.description.toLowerCase()).toContain('free');
+ } else {
+ // Every paid tool must quote its USDC price in its description.
+ expect(t.description).toMatch(/\$[0-9]/);
+ }
expect(t.inputSchema).toBeTypeOf('object');
expect(t.handler).toBeTypeOf('function');
expect(names.has(t.name)).toBe(false);
@@ -145,7 +154,7 @@ describe('MCP tool surface', () => {
// Generation + delegation tools are writes (they create hosted artifacts
// or dispatch actions); everything else is a pure read.
- const writes = ['text_to_avatar', 'mesh_forge', 'rig_mesh', 'agent_delegate_action'];
+ const writes = ['text_to_avatar', 'mesh_forge', 'forge_free', 'rig_mesh', 'agent_delegate_action'];
for (const [name, a] of Object.entries(byName)) {
expect(a.readOnlyHint, `${name}.readOnlyHint`).toBe(!writes.includes(name));
}