Three-Live
This MCP server lets AI agents build, verify, simulate, and ship Three.js scenes across Android, iOS/visionOS, and Web without a GPU.
Validate (
three_live_validate): compile a.js,.html, or.glband run the spatial linter (frustum, grounding, AABB collisions, lighting, accessibility) with optional camera and texture-pack overrides.Render (
three_live_render): headless 4-up contact sheets, single viewports, filmstrips, and turntables; pass a reference image for aREFERENCE | RENDER | OVERLAY | SILHOUETTE DIFFsheet with silhouette IoU and proportion guidance.Convert (
three_live_convert): compile a scene to binary glTF (.glb) or Apple.usdzfor Filament, Jetpack XR, RealityKit, Quick Look, and Web.Simulate (
three_live_sim): runKHR_interactivitygraphs, orbit/explode traits, and deterministic 60 Hz rigid-body physics, joints, characters, agents, hit zones, and objectives, with optional keyframe strips.Share (
three_live_link): validate a scene and return a self-contained playground link (raw DEFLATE in the URL fragment) with optional terminal/SVG QR code.Agent gym (
three_live_gym_reset/step/close): play a scene step by step like an RL environment—act, observe rewards/events/objectives, and detect victory, defeat, or time limits.Image to scene (
three_live_from_image): reconstruct a procedural Three.js script from a photo, sketch, or blueprint via a multimodal endpoint, with auto-repair, closed-loop visual refinement, spatial priors, and comparison renders.AI textures (
three_live_bake_textures): generate the textures a scene requests through an OpenAI-compatible Images endpoint and save them as a reusable, shippable texture pack.
Compiles Three.js scenes to native Android rendering via Google Filament and Jetpack XR, including zero-copy GLB loading and spatial XR traits.
Compiles Three.js scenes to GLB (binary glTF) for native runtimes and zero-copy loading.
Compiles Three.js scenes to Apple RealityKit for native iOS rendering, including live KHR_interactivity, physics, and spatial traits.
Supports native macOS RealityKit rendering of compiled Three.js scenes, including live interactivity and physics.
Compiles, validates, renders, and simulates Three.js scenes, serving as the core input format for AI-generated 3D content.
Renders the same Three.js scenes in WebGL2/WebXR on the web, with 6DoF WebXR and mobile AR handoff.
Disclaimer: This is not an officially supported Google product.
Three-Live
AI-First Native 3D, CAD & Spatial Computing: On-device JIT compiler turning live, AI-generated Three.js into native Android (Google Filament & Jetpack XR), iOS & visionOS (Apple RealityKit), and WebXR.
🧭 Why Three-Live? • ⚡ Quickstarts (Android • iOS • CLI • Web) • 📦 Install (JitPack • SwiftPM • Cargo • npm) • ▶ Live 3D Studio • 🧩 Domain Kits Catalog • 🥽 Live Spatial XR Studio • 📚 Docs
iOS & visionOS · RealityKit | Android XR · Google Filament |
|
|
LLMs and developers excel at writing concise Three.js code—not hundreds of
lines of platform-specific native 3D, shader, and AR boilerplate. Three-Live
compiles standard Three.js (THREE.Mesh, THREE.CSG, userData.xr,
KHR_interactivity) on-device in a sandboxed Rust VM and renders natively in
Google Filament and Jetpack XR SceneCore on Android, Apple RealityKit and
Quick Look on iOS and visionOS, headless 4-up PNG contact sheets
(three-live-cli) for AI coding agents, and WebGL2 / WebXR on the Web.
Quickstarts
1. Run Three.js natively on Android (Google Filament & Jetpack XR SceneCore)
Compile standard Three.js code over zero-copy JNI and drive native Google Filament rendering, 60 Hz physics, and Jetpack XR SceneCore spatial entities:
import com.google.threelive.FilamentHelper
import com.google.threelive.XRLiveRuntimeSession
import com.google.threelive.XRLiveSceneCoreHelper
val threeJsCode = """
const core = new THREE.Mesh(
new THREE.IcosahedronGeometry(0.55, 3),
new THREE.MeshStandardMaterial({ color: 0x38bdf8, metalness: 0.85, roughness: 0.15 })
);
core.userData.xr = { grab: '2-hand', orbit: { speed: -0.4 } };
scene.add(core);
""".trimIndent()
// Compile Three.js to a zero-copy GLB ByteBuffer and load directly into Google Filament
val holder = FilamentHelper.loadModelZeroCopy(threeJsCode) { buffer ->
assetLoader.createAssetFromBinary(buffer)
}
// Step live KHR_interactivity graphs, 60 Hz rigid-body physics, and spatial traits per frame
val runtime = XRLiveRuntimeSession.fromGlb(holder.byteBuffer)
runtime.step(dtSeconds = 1.0 / 60.0)
// Or attach interactive spatial traits (grab, scale, billboard, anchor) in Android XR SceneCore
XRLiveSceneCoreHelper.attachTraitsFromGlb(xrSession, entity, holder.byteBuffer)2. Run Three.js natively on iOS, macOS, and visionOS (Apple RealityKit)
Compile the exact same Three.js code into Apple RealityKit (ARView /
RealityView) or .usdz:
import ThreeLiveCompiler
import RealityKit
@MainActor
func loadSpatialScene(from threeJsCode: String, into arView: ARView) async throws -> XRLiveRealityKitSession? {
let glb = try ThreeCompiler.compileToGLB(script: threeJsCode)
let entity = try await RealityKitHelper.loadEntity(fromGLB: glb)
XRLiveRealityKit.installTraits(on: entity, in: arView)
// Bind live KHR_interactivity, 60 Hz physics, and spatial traits to RealityKit SceneEvents.Update
let session = XRLiveRealityKitSession(glbData: glb, root: entity)
session?.installInputTargets()
session?.start()
return session
}3. Verify & compile Three.js headlessly for AI agents (three-live-cli & MCP server)
Render a 4-up orthographic/camera contact sheet (zero GPU required), run the
spatial linter for JSON frustum/overlap telemetry, compile scene.js to .glb
/ .usdz, generate a scene from a reference image (from-image), or attach
three-live-cli mcp as a zero-dependency Model Context Protocol (MCP) stdio
server (three_live_validate, three_live_render, three_live_convert,
three_live_from_image, three_live_bake_textures, three_live_sim,
three_live_link, and the three_live_gym_reset / three_live_gym_step /
three_live_gym_close agent gym) in Gemini CLI, Google Antigravity, Claude
Code, or any MCP client. The agent gym lets an agent play a scene step by step
(act, observe, react) to check a level is winnable; "gym" is the
reinforcement-learning term for such a reset/step environment, and no ML is
involved. Not using MCP? three-live-cli gym reset level.js --session ep.json
and three-live-cli gym step --session ep.json --actions '[...]' do the same,
one command per step. three-live-cli link scene.js --qr prints a playground
link (and a terminal QR code) that opens the scene on a phone, one tap from AR.
Building from a photo, mockup, sketch, or blueprint? Pass --reference (or
reference in MCP) to get a side-by-side + aligned-overlay + silhouette-diff
sheet with IoU and proportion guidance, or run from-image to synthesize and
verify a procedural Three.js scene directly from an image:
$ npx three-live-cli render scene.js --view=quad --grid --annotations -o contact_sheet.png
$ npx three-live-cli render scene.js --reference=blueprint.png --view=front -o compare.png
$ npx three-live-cli from-image photo.jpg -o scene.js --visual-turns 2 --render compare.png
$ npx three-live-cli validate scene.js --json
$ npx three-live-cli link scene.js --qr
$ npx three-live-cli convert scene.js -o model.usdz
$ npx three-live-cli textures bake scene.js -o scene.textures.json # AI textures (needs THREE_LIVE_AI_IMAGE_ENDPOINT)
$ npx three-live-cli convert scene.js --texture-pack scene.textures.json -o model.glb
# Or register the built-in MCP server for closed-loop visual + spatial AI verification:
$ claude mcp add three-live -- npx -y -p three-live three-live-cli mcp4. Run on the Web (<three-live> and <xr-live>)
On the web, <three-live> (< 35 KB gz viewer, < 88 KB gz with the live
Three.js compiler) and <xr-live> (< 100 KB gz) render the same Three.js
scenes in WebGL2 and 6DoF WebXR with 1-tap mobile AR handoff:
// Standard Three.js scene (runs identically in Android, iOS, CLI, and Web)
const mesh = new THREE.Mesh(
new THREE.TorusKnotGeometry(0.4, 0.14, 64, 16),
new THREE.MeshStandardMaterial({ color: 0x38bdf8, metalness: 0.8, roughness: 0.15 })
);
mesh.userData.xr = { grab: '1-hand', billboard: 'capsule' };
scene.add(mesh);Add three-live-ai.min.js (< 35 KB gz; built into the full bundles) to let
users reshape a scene with any LLM: every edit is compiled in the sandbox
first, auto-repaired once on failure, and only then hot-swapped, so a bad
generation never breaks the live scene.
<three-live capabilities="scripts ai network:https@https://your-backend.example"
ai-endpoint="https://your-backend.example/chat" ai-model="gemini-2.5-flash">
<script type="text/three">/* your scene */</script>
</three-live>
<script type="module">
const el = document.querySelector('three-live');
const result = await el.editScene('make the roof red and add a chimney');
if (!result.applied) console.warn(result.error); // live scene unchanged
// el.undoEdit() reverts; el.aiProvider = { complete: async ({messages}) => '...' } plugs in any model.
</script>ai-endpoint speaks the widely supported Chat Completions protocol
(ai-provider="ai-chat"): your own backend proxy, Ollama or LM Studio
(http://localhost:..., no account needed), vLLM, OpenRouter, or Gemini's
compatibility endpoint. Keep API keys on your server; never put them in pages.
Tap & Speak: let users tap a mesh and say what to change. The voice model
talks, and your code model writes the edit through an edit_scene tool, so edit
quality never depends on the voice model.
<three-live capabilities="scripts ai microphone network"
ai-endpoint="https://your-backend.example/chat"
ai-select-on-tap ai-voice-button
ai-voice-url="wss://your-backend.example/realtime">
<script type="text/three">/* your scene */</script>
</three-live>ai-select-on-tap: tapping a mesh setsselected-mesh(tap again to clear), so "make this red" knows what "this" is.ai-voice-button: a mic button. Withai-voice-urlit toggles a realtime voice conversation (ai-voice-provider="ai-realtime", the default, for any server speaking the Realtime WebSocket protocol, or"gemini-live"). Without it, it runs push-to-talk with the browser's speech recognizer (el.startVoiceEdit()).From code:
await el.connectVoice({provider: 'gemini-live', url})orawait el.startVoiceEdit(). Progress arrives asthree-live-voiceevents (listening,editing, transcripts, results).
Talk-to-Select: users can select by voice instead of tapping, so they can check that the right objects are highlighted before an edit.
Say "select the two red chairs on the left", "also select the lamp", "deselect the small one", or "clear the selection". References are resolved locally with no model call: names (with synonyms and plurals), material colors, left / right / front / back from the current camera, top / bottom, size, ordinals ("the second mug"), counts ("both"), "all … except …", and lists ("the lamp and the sofa").
"Select the lamp and make it blue" selects first, then edits right away when the reference was unambiguous. When it isn't, it asks ("Which one: Chair Left or Chair Right?") and changes nothing.
References the local matcher can't resolve ("the cup next to the sofa", other languages) go to your code model, which picks from a compact scene index or asks a question.
Shift / Ctrl / Cmd-tap or a long press adds to the selection.
el.selectedMeshesholds it;three-live-selectevents report it.Push-to-talk shows confirmation chips: each selected mesh with ×, buttons for the candidates of a question, and Apply for an edit that is waiting on a model-resolved selection. Set
ai-select-chips="off"to hide them. Realtime voice sessions read the selection back instead, using theselect_meshestool.From code:
await el.selectByVoice('the red chairs', {mode: 'add'}).
Image to Scene (compileFromImage): turn a photo, sketch, or blueprint into
a live procedural Three.js scene across Web
(await el.compileFromImage(image, {prompt, priors, visualTurns: 2})), Android
(editor.compileFromImage(bitmap, prompt, priors)), iOS
(await editor.compileFromImage(imageData: ...)), CLI
(three-live-cli from-image --visual-turns 2), and MCP (three_live_from_image
with visualTurns). Images are automatically downscaled and JPEG-normalized,
compiled in the sandbox, verified against spatial quality gates (minimum 2
meshes, finite bounds, non-empty frustum coverage, and zero critical overlap
errors) with one-turn auto-repair, optionally refined closed-loop against
rendered REFERENCE | RENDER | OVERLAY 50/50 (+ 4-up orthographic/iso) sheets
(visualTurns: 0..5), and hot-swapped into the scene (el.undoEdit()
reverts). Optional metric spatial priors (userHeight, floorNormal, and 3D
detected object bounding boxes from ARCore / ARKit / world-understanding, or a
whole RoomPlan scan on iOS via AISpatialPriors.fromCapturedRoom(room), or any
room scan via AISpatialPriors.fromRoomScan on Android) anchor real-world scale
and placement.
AI textures (userData.xr.material.prompt): add a texture prompt next to a
material preset. The preset is the offline fallback, so the scene always renders
the same way without a network:
<three-live capabilities="scripts remote_content ai network" texture-pack="scene.textures.json"
ai-image-endpoint="https://your-backend.example/v1/images/generations">
<script type="text/three">
const wall = new THREE.Mesh(new THREE.BoxGeometry(4, 2.5, 0.2),
new THREE.MeshStandardMaterial());
wall.name = 'TempleWall';
wall.userData.xr = {material: {preset: 'brick',
prompt: 'weathered Kyoto temple stone with moss', size: 512}};
scene.add(wall);
</script>
</three-live>The compiler never calls an image model. Textures come from a texture pack (
texture-pack="…json",el.texturePack = json, or an inline<script type="application/three-live-texture-pack">), keyed by the prompt, size (256, 512, or 1024), and seed. Normal and roughness maps (up to 512) are derived on-device.With an OpenAI-compatible Images endpoint configured (
ai-image-endpoint/ai-image-model, orel.aiImageProvider), missing textures are generated, cached in IndexedDB, and hot-swapped in. Setai-textures="manual"to generate only when you callawait el.generateTextures().Runtime generation gives each visitor different textures. For consistent results, save
await el.exportTexturePack()and ship it with the scene. Exported.glb/.usdzfiles already contain the final textures; GLB nodes showing an AI texture carry its pack key inextras.xr.material.textureKey.Android (
ThreeLiveAITextures), iOS (AITextures), the CLI (three-live-cli textures bake), and MCP (three_live_bake_textures) use the same packs and give the same pixels. On Android and iOS, auto generation works like the Web once a provider is set (sceneLoaded, oreditor.textures).
Related MCP server: threejs-devtools-mcp
Install packages and bundles
Package installation
1. Android (JitPack, GitHub Packages Maven, prebuilt release AAR, or source):
JitPack (
https://jitpack.io, no authentication required): Addmaven("https://jitpack.io")tosettings.gradle.kts, then add:dependencies { implementation("com.github.google.three-live:compiler:v1.5.0") // Host-JS-engine apps (zero bundled Boa): use :runtime + :kernels instead of :compiler // Optional adapters: :filament, :firebase-ai, :detect-mlkit, :hands-androidxr, :hands-mediapipe }GitHub Packages Maven (
https://maven.pkg.github.com/google/three-live): Configure the repository insettings.gradle.ktsand addimplementation("com.google.threelive:compiler:1.5.0")(plus optional:filament,:firebase-ai,:detect-mlkit,:hands-androidxr,:hands-mediapipe).Prebuilt AAR: Download
three-live-compiler-release.aar(includesarm64-v8a,armeabi-v7a, andx86_64JNI.solibraries) and optional adapter AARs (three-live-filament-release.aar, etc.) from GitHub Releases intoapp/libs/and addimplementation(files("libs/three-live-compiler-release.aar")).Maven Local (
com.google.threelive:compiler:1.5.0): Run./gradlew :mobile:android:publishReleasePublicationToMavenLocaland addimplementation("com.google.threelive:compiler:1.5.0").From source: Run
make android(orbash scripts/build_android_aar.sh).
2. iOS, macOS, and visionOS (Swift Package Manager):
.package(url: "https://github.com/google/three-live.git", from: "1.0.0")Swift Package Manager automatically resolves the prebuilt, checksum-pinned
ThreeLiveCompiler.xcframework.ziparchive from GitHub Releases—no local Rust or Node.js toolchain is required.3. Rust CLI (
three-live-cli) and library crate (Crates.io, prebuilt binaries, or source):Crates.io (library & CLI):
cargo add three-live-compiler # Or install the standalone CLI binary from Crates.io: cargo install three-live-compiler --bin three-live-cliPrebuilt binaries: Download standalone binaries for macOS (
arm64andx86_64), Linux (x86_64andaarch64), and Windows (x86_64.exe) from GitHub Releases.From source: Run
make rust(npm run build && cargo build --manifest-path compiler/Cargo.toml --release --bin three-live-cli).
4. Web (npm, CDN, prebuilt release, or source):
npm:
npm install three-live xr-liveHosted ES module (
jsDelivror GitHub Pages CDN): Loadhttps://cdn.jsdelivr.net/npm/three-live/dist/three-live.min.jsorhttps://google.github.io/three-live/dist/three-live.min.js.Prebuilt bundle archive: Download
three-live-web-dist.zipfrom GitHub Releases.From source: Run
git clone https://github.com/google/three-live.git && cd three-live && npm install && npm run build.
Why Three-Live and XR-Live
Native mobile and headset AR/XR from Three.js
In practice, browser WebXR (navigator.xr) only covers part of the device
landscape:
Android System
WebView, iOS Safari, and iOSWKWebViewdon't support WebXR. A WebXR-only app can't run inside an embeddedWebVieworWKWebViewin a native Android or iOS app, and can't enter AR in Safari on iPhone or iPad.Static OS handoffs (
Scene ViewerandAR Quick Look) strip interactivity. Exporting a static.glbor.usdzfile to the OS previewer works for viewing a model, but drops Three.jsanimate()loops, 60 Hz physics, custom state, and interactive plugins.Browser WebXR doesn't use native spatial compositors. On Android, browser WebXR renders WebGL2 in the browser process rather than using Google Filament or Jetpack XR SceneCore's
HomeSpaceshared space. On visionOS, browser WebXR runs in an isolated fullscreen VR session without camera passthrough or SwiftUI Shared Space integration.
Three-Live solves this by compiling the same Three.js code on-device and running it natively on each platform's own engine:
Target environment | What happens with browser WebXR or static AR handoff | What you can do with Three-Live and XR-Live |
Android phones and tablets (native Compose or View app) |
| Compile Three.js over JNI and render natively in Google Filament and ARCore ( |
Android XR and Apple Vision Pro headsets | Browser WebXR is isolated in a fullscreen WebGL session | Attach native Jetpack XR SceneCore ( |
iPhone and iPad (native SwiftUI app) |
| Run live Three.js scenes, |
Mobile and headset web browsers | Standard WebXR works on Android Chrome and headsets; iOS Safari has no WebXR | Run 6DoF WebXR where supported, with automatic Stereo SBS, gyroscope, and in-memory |
Compare <three-live> and <xr-live>
The following table compares the two runtime tiers across Android, iOS, and Web:
Capability |
|
|
Primary use case | 3D product viewers, parametric CAD/CSG, skeletal animation, and 1-tap AR handoff | Interactive 6DoF XR, native mobile AR/XR, spatial UI cards, depth physics, hand tracking, and 60 Hz simulations |
Three.js JIT compiler | Yes (sandboxed Rust | Yes (inherits |
Android & iOS runtime | Google Filament ( | Native Android ( |
Spatial interaction | Orbit controls, mesh picking, 3D surface hotspots, | Declarative |
Web bundle budget |
|
|
HTML attribute compatibility with <model-viewer>
On the web, <three-live> supports the core HTML attributes used by
<model-viewer> (src, poster,
camera-controls, camera-orbit, camera-target, min-camera-orbit,
max-camera-orbit, field-of-view, auto-rotate, auto-rotate-delay,
rotation-per-second, ar, ar-modes, ar-scale, ar-placement, exposure,
shadow-intensity, shadow-softness, shadow-maps, tone-mapping,
environment-image, skybox-image, autoplay, animation-name,
variant-name, and slot="hotspot-*"). It also accepts a CAD section-plane
cut ("y:2.8", "-z:0.5", "none") that clips the color and shadow passes on
WebGL2 and WebGPU without requiring <xr-live>.
If you have existing <model-viewer> HTML markup and want to add procedural
Three.js scripts, native Android/iOS runtime targets, or CLI/MCP scene
validation without renaming tags, call ThreeLiveElement.defineModelViewer()
(or defineModelViewer()) to register <three-live> under the <model-viewer>
custom element name when @google/model-viewer is not loaded.
Dimension |
| |
Primary focus | Displaying pre-authored | Compiling and running procedural Three.js scripts, parametric CAD/CSG, and |
Scene inputs | Static | Static |
Target platforms | Web Custom Element ( | Native Android SDK ( |
Post-processing & effects | Provided via the companion | Built-in HTML attributes ( |
Interactivity & simulation | Camera orbit/pan/zoom, animation playback, material variants, hotspots, and scene-graph material API. | Includes the above plus glTF |
Web bundle size (gzipped) | Full Three.js renderer + glTF pipeline (~250 KB gz). | Modular tiers: |
Modular plugins across Android, iOS, and Web
Every capability works on both prebuilt .glb, .usdz, and .spz assets and
live Three.js scenes:
Compact core (
< 36 KBto< 101 KB gzon Web): The 3D viewer (three-live-viewer.min.js) is< 36 KB gz(< 89 KB gzwith the live Three.js compiler inthree-live.min.js), and the WebXR viewer (xr-live-viewer.min.js) is< 63 KB gz(< 101 KB gzwith the live Three.js compiler inxr-live.min.js).Core 3D, CAD, procedural, animation, and WebGPU plugins (
three-live, 20 plugins): Optional domain bundles (three-live-studio.min.jsat< 36 KB gz,three-live-cad.min.jsat< 20 KB gz,three-live-procedural.min.jsat< 30 KB gz,three-live-animation.min.jsat< 11 KB gz,three-live-ai.min.jsat< 35 KB gz,three-live-webgpu.min.jsat< 24 KB gz, andthree-live-tsl.min.jsat< 19 KB gz, or< 244 KB gzcombined inthree-live-full.min.js) addKHR_interactivitybehavior graphs, PBR Next materials,KHR_materials_variants,EXT_meshopt_compression, HDRI and spherical-harmonics lighting, contact shadows, multi-light depth shadow maps (shadow-maps/shadowMapsPlugin), 3D hotspots, post-processing (bloomandoutline), automatic multi-tier Level-of-Detail (lod/THREE.LOD/MSFT_lod), 2DShape/ExtrudeGeometry, 3DSweepGeometry,HelixGeometry, multi-profileLoftGeometry, declarativePatternInstancerarrays, 3DCSGBooleans, 3D vectorTextGeometry, 64-joint GPU skeletal skinning, morph targets, keyframe cross-fading, two-bone / FABRIK inverse kinematics (ik), loop-freeTHREE.TSLprocedural node materials (tslPlugin/extras.tsl), LLM scene editing, andGPURenderBundleWebGPU scene acceleration (renderer="auto | webgpu | webgl2"). Five optional a la carte domain kits (three-live-kit-{mechanical,architecture,industrial,science,electronics}.min.js,12–30 KB gzeach, or the all-in-onethree-live-kits.min.js,< 82 KB gz, intentionally excluded fromthree-live-full.min.js) add 57 watertight 2-manifold parametric parts acrossTHREE.Mechanical,THREE.Architecture,THREE.Industrial,THREE.Science, andTHREE.Electronics(seedocs/kits-gallery.md).Hardware XR sensors (
xr-live-sensors.min.js,< 10 KB gz): Adds hardware XR depth occlusion (XRDepthManager), analytical heightfield physics (XRHeightfieldPhysics), 25-joint hand gesture classification (XRHandGestureClassifier), the desktop 6DoF keyboard/mouse simulator (XRDesktopSimulator), HRTF spatial audio earcons, and WebMCP agent tools.Spatial computing plugins (
xr-live-spatial.min.js, 15 plugins,< 65 KB gz): Each advanced spatial capability inxr-live-spatial.min.jsis a standalone, zero-dependency plugin (~2 to 5 KB gzeach) with a matching native implementation in the Android and iOS SDKs.Simulation and scenario plugins (
xr-live-sim.min.js, 6 plugins,< 30 KB gz): Six plugins for games, training drills, and safety walkthroughs add a controllable character, autonomous steering agents, deterministic 60 Hz rigid-body physics and mechanical joints (rigid-body/joint:hinge,slider,spring,ball), integrity and trigger zones, checklist objectives with scoring and timers, and procedural audio cues across Android, iOS, and Web.Opt-in WebGPU Gaussian Splatting accelerator (
xr-live-webgpu.min.js,< 13 KB gz): Offloads.splat/.spzdepth sorting (deterministic 2-pass 8-bit tiled radix sort) and Degree 1–3 fp16 Spherical Harmonics to WGSL@computeshaders, rendering oriented anisotropic eigenvector quads viadrawIndirect(splat-renderer="auto | webgpu | hybrid | webgl2") and automatically switching to a double-bufferedmapAsyncWebGL2 coprocessor during WebXR stereo sessions or mixed glTF + splat Z-occluded scenes.
Core 3D, CAD, TSL, and animation plugins (three-live)
The following table lists the modular 3D, CAD, TSL, AI, WebGPU, and animation plugins:
Plugin | Attribute or Three.js API | What it adds |
|
| Compiles and executes glTF |
|
| PBR Next material properties ( |
|
|
|
|
| Zero-WASM decoder and encoder for |
|
| Procedural studio environment lighting, HDRI skyboxes, and 9-band spherical-harmonics diffuse irradiance. |
|
| Soft ground-plane contact shadows and dynamic shadow-map updates matching scene bounds. |
|
| Real-time multi-light depth shadow maps (up to 4 directional, spot, and point lights in a |
|
| 3D surface-anchored annotations with normal-facing visibility culling and SVG leader lines. |
|
| Zero-server runtime |
|
| Dual-Kawase mipmap bloom, selection/hover silhouette outlines, and |
|
| Distance-based multi-tier Level-of-Detail switching with hysteresis, far-distance culling, automatic vertex-clustering mesh decimation ( |
|
| 2D |
|
| A la carte domain kit ( |
|
| A la carte domain kit ( |
|
| A la carte domain kit ( |
|
| A la carte domain kit ( |
|
| A la carte domain kit ( |
|
| Extended 3D bounding-volume helpers ( |
|
| 64-joint GPU vertex skinning and skeletal hierarchy evaluation. |
|
| GPU morph-target vertex displacement and weight blending. |
|
| Linear, step, and cubic-spline ( |
|
| Analytic two-bone (arm/leg with pole vector) and multi-joint FABRIK inverse kinematics chains. |
|
| Loop-free procedural node materials ( |
|
| Bring-your-own-LLM sandboxed scene editing, image-to-scene reconstruction with spatial priors, Tap & Speak / Talk-to-Select, and content-addressed AI PBR texture packs. |
|
|
|
Spatial perception, splat, audio, and multimodal AI plugins (xr-live)
The following table lists the eight perception, rendering, audio, and AI plugins across Android Filament, iOS RealityKit, and WebXR:
Plugin | Attribute or | What it adds across Android Filament, iOS RealityKit, and WebXR |
|
| Lazy HUD head or hand follow with an angular deadzone and critically damped spring, plus 3D satellite orbits. |
|
| Four top-corner uniform scale handles and a bottom pedestal yaw-rotation bar that emit |
|
| Real-world plane and mesh tracking, surface-normal gaze reticle, |
|
| Real-time bidirectional WebSocket vision and 16/24 kHz PCM voice streaming, barge-in cancellation, live transcription, and press-and-hold mesh queries. |
|
| Pinch-to-paint 3D Catmull-Rom spline strokes extruded as twist-free parallel-transport tubes with |
|
| GPU-friendly |
|
| Streams |
|
| 3D positional and directional spatial audio emitters with 8 zero-asset ambient loop presets ( |
CAD review, spatial layout, locomotion, and co-presence plugins (xr-live)
The following table lists the seven CAD, layout, locomotion, and multi-user plugins across Android Filament, iOS RealityKit, and WebXR:
Plugin | Attribute or | What it adds across Android Filament, iOS RealityKit, and WebXR |
|
| Live |
|
| Magnetic socket snapping with |
|
| Hands-free eye and head gaze raycasting with EMA smoothing, |
|
| Multi-part CAD assembly explosion with staggered layers, dashed leader lines, two-hand spread gesture, and GPU cross-section slicer. |
|
| Three-tier pose persistence across reloads and sessions via shareable |
|
| Ballistic parabolic teleport arc with walkable and blocked surface validation, thumbstick snap-turn or smooth glide, and a |
|
| Zero-dependency multi-user co-presence ( |
Interactive simulation, agent, and scenario plugins (xr-live-sim)
The following table lists the six simulation plugins across Android Filament, iOS RealityKit, and Web:
Plugin | Attribute or | What it adds across Android Filament, iOS RealityKit, and Web |
|
| Capsule kinematics with floor and slope stepping, jump with coyote time, keyboard, gamepad, and touch-joystick input, and |
|
| Autonomous kinematic agents ( |
|
| Deterministic 60 Hz Sequential Impulse rigid-body solver ( |
|
| Part and target |
|
| Ordered or unordered checklist objectives ( |
|
| Zero-asset procedural audio synthesis ( |
JavaScript bundles and enforced size budgets (Web)
Every web bundle targets es2020, strips full license blocks
(--legal-comments=none), and emits a single four-line SPDX header:
Family | Bundle file | Enforced budget ( | Included capabilities |
|
|
| Lean |
|
| Standard | |
|
| Add-on plugin: PBR Next extensions, HDRI and SH irradiance, multi-light depth shadow maps ( | |
|
| Add-on plugin: 2D | |
|
| A la carte domain kit ( | |
|
| A la carte domain kit ( | |
|
| A la carte domain kit ( | |
|
| A la carte domain kit ( | |
|
| A la carte domain kit ( | |
|
| All-in-one domain kits roll-up bundle registering all 5 domain kits ( | |
|
| Add-on plugin: | |
|
| Opt-in bring-your-own-LLM scene editing & image-to-scene synthesis: | |
|
| Add-on plugin: 64-joint GPU skeletal skinning, morph targets, animation cross-fading, and two-bone / FABRIK inverse kinematics ( | |
|
| A la carte host add-on ( | |
|
| Opt-in WebGPU | |
|
| Opt-in Loop-Free | |
|
| All-in-one 3D engine bundle ( | |
|
| Self-contained headless host-JS compiler bundle ( | |
|
|
| Lean |
|
| Standard | |
|
| Add-on plugin: Hardware XR sensors ( | |
|
| Add-on plugin bundle registering all 15 spatial plugins ( | |
|
| Add-on simulation plugin bundle registering all six simulation plugins ( | |
|
| Opt-in WebGPU Gaussian Splatting compute and render accelerator ( | |
|
| All-in-one 3D, XR, simulation, TSL, and WebGPU bundle ( |
Safe execution & capability-based security for live, AI-generated Three.js
Because LLMs already know Three.js, an agent or backend can generate a complete
interactive 3D or XR scene in 15 to 30 lines of JavaScript without external
binary assets. Three-Live executes Three.js scripts inside a sandboxed Rust
Boa/QuickJS VM on Android and iOS, and inside a dedicated Web Worker or
opaque-origin <iframe sandbox="allow-scripts"> (connect-src 'none') on the
web—with network and storage globals removed, Object.prototype frozen, CPU
instruction fuel limits, and scene geometry memory quotas.
In addition, all sensitive host capabilities default to off: embedders opt
in explicitly via capabilities="..." on <three-live> / <xr-live> and
ThreeLiveCapabilities on Android / iOS (scripts, network,
remote_content, camera, microphone, sensors, storage, ai, and
external_handoff, plus presets viewer and all and origin allowlists like
network:https,wss@https://cdn.example.com). Author-controlled userData.xr
traits cannot escalate host privileges, and three-live-cli validate statically
checks HTML files for undeclared capabilities (TL401 / TL403).
Project status
Three-Live is in Beta. Its core 3D, mobile AR/XR, and spatial computing
runtime, versioned userData.xr trait schema (schemaVersion: 1), sandboxed
JIT compiler, and three-target parity across Android XR, Apple RealityKit, and
Web are feature-complete and ready for integration and evaluation.
Prebuilt distributions: The Android release AAR (
three-live-compiler-release.aar), the Apple XCFramework (ThreeLiveCompiler.xcframework.zip), nativethree-live-clibinaries for macOS, Linux, and Windows, and standalone web JavaScript bundles (three-live-web-dist.zip) are published on GitHub Releases.Package registries: Published on JitPack / GitHub Packages Maven, Swift Package Manager, Crates.io (
three-live-compiler), npm (three-live), npm (xr-live), GitHub Releases, and the jsDelivr / GitHub Pages CDNs (see Install packages and bundles).Release notes: See
CHANGELOG.mdfor release history and architectural notes.
Documentation guide
The following guides cover the native mobile SDKs, spatial plugins, web components, and LLM authoring workflows:
Guide | Audience | Contents |
All developers & evaluators | Architectural rationale, technical capabilities specific to Three-Live, comparison across 3D/XR approaches, and trade-offs. | |
Android, iOS, and XR developers | Complete spatial and native SDK guide: Android ( | |
Mobile and web developers | Complete 3D reference: Three.js authoring, | |
All developers & designers | Visual thumbnail catalog of all 57 watertight parametric constructors across | |
All developers | Copy-pasteable Three.js recipes for e-commerce configurators, precision manipulation handles, Gemini Live spatial assistants, 3D spatial paint, CAD exploded views and measurements, magnetic snapping and persistent anchors, multi-user co-presence, and interactive training and simulation drills ( | |
LLMs and agents | Copy-paste system prompt snippet, canonical | |
Coding agents | Repository rules, three-target cross-platform parity contract, build and test commands, bundle budgets, and security invariants. | |
Agent skills | Progressive-disclosure | |
LLM context feeds | Single-file concise index ( | |
All users | Release notes and architectural summary for Three-Live releases. |
Build and run demos
Run make (or make help) from the repository root to build packages, run tests, or open the interactive studio demos:
$ make doctor # Check installed toolchains (Android NDK, Xcode, Rust, Node)
$ make android-demo # Build JNI .so slices and debug Compose APK, and open Android Studio
$ make ios-demo # Build XCFramework, generate .xcodeproj, and open in Xcode (macOS)
$ make test # Run full Android, iOS, Rust compiler, and Web parity test suites
$ make web # Compile all <three-live> and <xr-live> JS bundles and embedded engine
$ make web-demo # Launch web playgrounds at http://localhost:8888/three/ and /xr/Security
Untrusted client Three.js script execution is disabled by default on the web
(allow-client-scripts required) and always runs inside an isolated QuickJS/Boa
VM on Android and iOS or a sandboxed Worker / opaque-origin <iframe>
(connect-src 'none') on Web—with network and storage globals stripped,
Object.prototype frozen, CPU instruction fuel limits, and geometry memory
quotas.
To report a vulnerability, please follow the instructions in
SECURITY.md.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md and
CODE_OF_CONDUCT.md before submitting a pull request.
License
Licensed under the Apache License, Version 2.0.
Available Tools
10 toolsthree_live_bake_texturesA
Generate the AI textures a scene asks for (mesh.userData.xr = { material: { preset, prompt, size: 256 | 512 | 1024, seed } }) through an OpenAI-compatible Images endpoint and save them in a texture pack. Use it last, after geometry and presets look right: it needs a configured image endpoint and costs money per texture. Returns a preset-vs-AI comparison image and the bake report. Pass the pack to three_live_render / three_live_convert (texturePack / texturePackPath) and ship it with the scene (<three-live texture-pack=...>).
Inputs: code, only, force, inputPath, +5 more.
three_live_convertAIdempotent
Compile a Three.js script, HTML document, or .glb into a binary glTF 2.0 (.glb) or Apple 64-byte-aligned Universal Scene Description (.usdz) asset for Android (Filament / Jetpack XR SceneCore), iOS/visionOS (RealityKit / Quick Look), and Web.
Inputs: code, format, inputPath, outputPath, +2 more.
three_live_from_imageA
Reconstruct a Three.js scene script from a reference image (local PNG/JPEG/WebP file path, data:image/...;base64 URI, or https:// URL) using a multimodal Chat Completions endpoint, with automatic sandbox + spatial linter (TL100-TL502) repair, optional closed-loop 50/50 overlay + 4-up visual refinement (visualTurns: 0..5), and optional metric spatial priors (AISpatialPriors). Also returns a rendered REFERENCE | RENDER | OVERLAY | SILHOUETTE DIFF comparison sheet (or 4-up contact sheet) when includeContactSheet is true.
Inputs: image (required), priors, prompt, aiModel, +7 more.
three_live_gym_closeARead-onlyIdempotent
End a gym episode and free its session (sessions are also evicted, oldest first, beyond 16).
Inputs: sessionId (required).
three_live_gym_resetARead-only
Start a closed-loop agent gym episode: compile a scene with userData.xr traits (character controllers, objectives, hit zones, agents, joints, physics) and return a sessionId plus the t = 0 observation (body positions, health, score, scenario state). Then call three_live_gym_step repeatedly to act, observe, and react, like a reinforcement-learning environment. The simulation is deterministic at 60 Hz.
Inputs: code, view, watch, width, +3 more.
three_live_gym_stepARead-only
Advance a gym episode: apply actions now (or at seconds into the step), simulate ticks 60 Hz ticks, and return the new observation with reward (score gained this step), events, audioCues, and newObjectives fired during the step, and done when the scenario reaches victory or defeat or the episode hits its 120 s / 240-step limit. moveCharacter actions last the whole step unless duration is given.
Inputs: sessionId (required), view, ticks, watch, +4 more.
three_live_linkARead-onlyIdempotent
Validate a Three.js scene script and return a web playground link that opens it on any desktop or phone browser (with View in AR on iPhone and Android). The scene rides in the URL fragment (raw DEFLATE + base64url), so nothing is uploaded. Optionally returns the link as a QR code (terminal text and SVG) for the user to scan with a phone. Fails, listing the errors, when the scene does not compile.
Inputs: qr, base, code, inputPath.
three_live_renderAIdempotent
Render a Three.js script, HTML document, or .glb headlessly (zero GPU required) into a 4-up orthographic/camera contact sheet PNG (CAMERA, FRONT +Z, TOP +Y FRUSTUM, ISO 45 deg), single viewport PNG, or temporal filmstrip / 360-degree turntable GIF. Returns the base64 image directly to vision-capable agents along with spatial diagnostics. Pass reference (a photo, product shot, mockup, sketch, or blueprint as a PNG/JPEG path or data URI) to get a REFERENCE | RENDER | OVERLAY | SILHOUETTE DIFF comparison sheet rendered at the reference's aspect ratio, plus silhouette IoU, aspect-ratio error, and guidance for matching its proportions.
Inputs: code, grid, view, width, +11 more.
three_live_simBIdempotent
Simulate interactive KHR_interactivity behavior graphs, orbit/explode traits, and 60 Hz xr-live-sim rigid-body physics, mechanical joints (hinge, slider, spring, ball), character controllers, steering agents, hit zones, and objectives deterministically at 60 Hz.
Inputs: code, actions, duration, inputPath, +5 more.
three_live_validateARead-onlyIdempotent
Validate a Three.js script (.js), HTML document (/), or .glb binary and run the 3D spatial, camera frustum, grounding, AABB collision, lighting, and 3D/XR accessibility linter (TL100-TL606).
Inputs: code, cameraFov, inputPath, texturePack, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct stage of the 3D/XR asset pipeline: convert, validate, render, simulate, bake, link, reconstruct, and a gym lifecycle trio. The only mild overlap is three_live_link and three_live_validate, both of which validate scenes, but their outputs (playground URL/QR vs. lint report) are clearly different.
All ten tools use the three_live_ snake_case prefix followed by a verb or verb_noun phrase (convert, render, validate, bake_textures, from_image, gym_reset/step/close). The gym lifecycle group is internally consistent and predictable.
Ten tools is well within the sweet spot for a scene-authoring/asset-conversion server, and each tool covers a distinct capability (validation, rendering, conversion, simulation, RL gym, image reconstruction, texture baking). No tool feels redundant or trivial.
The surface covers the full scene lifecycle: create (from_image), validate, render, simulate, convert, bake textures, link/share, and a complete gym reset/step/close loop. Minor gaps exist around asset/session management (no list or delete for texture packs or active gym sessions), but nothing blocks core workflows.
Maintenance
Related MCP Connectors
3D avatar/asset foundry: text/image -> rigged, validated, engine-ready GLB via x402.
Build 3D web apps: physics, audio, music, Blender import. Live edits, undo, versions, publishing.
Blender and GLB/FBX/USD/STL rendered on cloud GPUs for AI agents: product shots, turntables, MP4
3D avatars, embeds, glTF tools, agent memory, and on-chain agent identity from three.ws.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect and modify live Three.js scenes in real time through 59 tools covering objects, materials, shaders, textures, animations, performance monitoring, memory diagnostics, and code generation. Works with vanilla Three.js, React Three Fiber, and any framework without changing your project, using an injected browser bridge and in-page devtools overlay.6,808 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect a running Three.js scene in the browser and try out live edits to objects, materials, shaders, lights, camera and animation without touching project files. Every change is recorded and can be exported as ready-to-paste vanilla Three.js or React Three Fiber code, alongside performance audits and frame capture.6,808 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect and edit Three.js scenes, materials, shaders, lights, textures, animation, performance, and memory in real time, with live previews convertible into vanilla Three.js or React Three Fiber code. Also supports website audits, video frame capture, and Playwright/Puppeteer workflows.6,808 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect Three.js scenes in real time and try changes live in the browser — objects, materials, shaders, textures, lights, animation, performance and memory — then turn those previews into ready-to-paste vanilla Three.js or React Three Fiber code without altering the project. It also supports website audits, video frame capture and Playwright helpers.6,808 npmMIT

