Three.js DevTools MCP

v0.2.1
io.github.DmitriyGolub/threejs-devtools Checked 3 days ago Published 8 months ago

Inspect and edit Three.js scenes, materials, shaders, lights in real time from any AI agent

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

scene_tree

List all objects in the Three.js scene tree. Returns compact text tree by default (saves tokens). Set compact=false for full JSON.

ParameterTypeDescription
compactbooleanCompact text tree (default: true). Set false for full JSON with positions/geometry.
depthnumberMax tree depth (default: 3)
maxChildrennumberMax children per node (default: 15 compact, 100 JSON)
typesarrayFilter by type: Mesh, Light, Group, etc.

object_details

Get detailed info about a specific object by name, uuid, or path

ParameterTypeDescription
namestringObject name (first match)
pathstringDot path: "Scene.MyGroup.MyMesh"
uuidstringObject UUID

material_list

List all materials in the scene with type, color, transparency

material_details

Get full properties of a material: color, maps, uniforms, defines

ParameterTypeDescription
namestringMaterial name
uuidstringMaterial UUID

shader_source

Get compiled vertex/fragment shader source and uniforms for a material

ParameterTypeDescription
materialNamestringMaterial name
materialUuidstringMaterial UUID

shader_list

List all compiled shader programs with their material associations

texture_list

List all textures: size, format, wrap, filter settings

texture_details

Get detailed info about a specific texture

ParameterTypeDescription
namestringTexture name
uuidstringTexture UUID

renderer_info

Get renderer stats: draw calls, triangles, memory, capabilities

set_material_property

Set a material property (color, roughness, wireframe, etc.). IMPORTANT: This is a runtime-only preview (lost on reload). Before calling, ASK the user whether they want a runtime preview or a persistent code change. Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
property *stringProperty name: color, emissive, roughness, metalness, opacity, transparent, wireframe, visible, side, depthWrite, depthTest, alphaTest, flatShading, fog
namestringMaterial name
uuidstringMaterial UUID
valueNew value (hex string for colors, number for scalars, boolean for flags)

set_uniform

Set a shader uniform value on a ShaderMaterial — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
uniform *stringUniform name (e.g. uHorizonColor, uOpacity)
namestringMaterial name
uuidstringMaterial UUID
valueNew value: hex string for Color, {x,y,z} for Vector3, number for float

set_object_transform

Set position, rotation, scale, or visibility of a scene object — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
namestringObject name
positionarray[x, y, z]
rotationarray[x, y, z] in radians
scalearray[x, y, z]
uuidstringObject UUID
visiblebooleanShow/hide object

set_light

Modify light properties: color, intensity, position, shadows — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
castShadowbooleanEnable/disable shadows
colorstringLight color (#RRGGBB)
groundColorstringGround color for HemisphereLight (#RRGGBB)
intensitynumberLight intensity
namestringLight name
positionarray[x, y, z]
uuidstringLight UUID

highlight_object

Highlight an object for debugging (wireframe or visibility toggle). Runtime only — for visual inspection, not persisted. Debug only — page reload will reset. No code changes needed.

ParameterTypeDescription
enabledbooleanEnable/disable highlight (default: true)
modestringHighlight mode (default: wireframe)
namestringObject name
uuidstringObject UUID

run_js

Execute arbitrary JavaScript with access to scene, renderer, camera. Returns the result. Runtime only (lost on reload). If the code mutates scene state, ASK the user first: runtime preview or persistent code change? Debug only — page reload will reset. No code changes needed.

ParameterTypeDescription
code *stringJavaScript code. Available vars: scene, renderer, camera, gl. Use return for results.

performance_snapshot

Get detailed performance analysis: draw calls, triangles, instanced meshes, object counts by type

instanced_mesh_details

Inspect an InstancedMesh: count, max instances, geometry, sample transforms, custom attributes, instance colors

ParameterTypeDescription
namestringInstancedMesh name
sampleCountnumberNumber of instances to sample (default: 5, max: 20)
startIndexnumberFirst instance index to sample (default: 0)
uuidstringInstancedMesh UUID

set_instanced_mesh

Modify InstancedMesh properties: count, visibility, frustumCulled — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
countnumberNumber of visible instances
frustumCulledbooleanEnable/disable frustum culling
namestringInstancedMesh name
uuidstringInstancedMesh UUID
visiblebooleanShow/hide entire mesh

camera_details

Get active camera properties: type, position, FOV, near/far, aspect

set_camera

Modify camera: position, rotation, FOV, near/far, zoom — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
aspectnumberAspect ratio (PerspectiveCamera)
bottomnumberBottom plane (OrthographicCamera)
farnumberFar clipping plane
fovnumberField of view (PerspectiveCamera)
leftnumberLeft plane (OrthographicCamera)
nearnumberNear clipping plane
positionarray[x, y, z]
rightnumberRight plane (OrthographicCamera)
rotationarray[x, y, z] in radians
topnumberTop plane (OrthographicCamera)
zoomnumberZoom factor

fog_details

Get scene fog settings: type (Fog/FogExp2), color, near/far or density

set_fog

Modify scene fog: color, near/far (Fog) or density (FogExp2), background color — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
backgroundstringScene background color (#RRGGBB)
colorstringFog color (#RRGGBB)
densitynumberFog density (FogExp2 type)
farnumberFog far distance (Fog type)
nearnumberFog near distance (Fog type)

renderer_settings

Get renderer configuration: toneMapping, exposure, colorSpace, shadowMap, pixelRatio

set_renderer

Modify renderer: toneMapping, exposure, colorSpace, shadows — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
localClippingEnabledbooleanEnable local clipping planes
outputColorSpacestringOutput color space (srgb, srgb-linear)
pixelRationumberDevice pixel ratio
shadowMapEnabledbooleanEnable shadow mapping
shadowMapTypenumberShadow map type (0=Basic, 1=PCF, 2=PCFSoft, 3=VSM)
sortObjectsbooleanSort objects before rendering
toneMappingnumberTone mapping algorithm (0-7)
toneMappingExposurenumberExposure level

animation_details

List all AnimationMixers, their actions, clips, weights, and playback state

set_animation

Control animation: mixer timeScale, action play/stop/pause/weight. Runtime only — for testing. Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
actionPausedbooleanPause/unpause action
actionTimeScalenumberAction time scale
actionWeightnumberAction weight (0-1)
clipNamestringTarget action by clip name
mixerIndexnumberMixer index (default: 0)
playbooleanPlay the action
stopbooleanStop the action
timenumberMixer current time
timeScalenumberMixer global time scale

skeleton_details

List all skeletons/bones from SkinnedMesh objects in the scene

geometry_details

Inspect geometry: vertices, attributes, indices, bounding box, morph attributes

ParameterTypeDescription
namestringObject name (owning mesh)
uuidstringObject UUID (owning mesh)

morph_targets

List all meshes with morph targets, their target names and current influence values

set_morph_target

Set morph target influence on a mesh — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
influence *numberInfluence value (0-1)
indexnumberMorph target index
namestringMesh name
targetNamestringMorph target name (from dictionary)
uuidstringMesh UUID

raycast

Cast a ray from camera through screen coordinates and return hit objects

ParameterTypeDescription
x *numberNormalized device X coordinate (-1 to 1, 0 = center)
y *numberNormalized device Y coordinate (-1 to 1, 0 = center)
maxHitsnumberMaximum hits to return (default: 10)

layer_details

Show camera layer mask and objects with non-default layer assignments

set_layers

Set layers on an object or camera — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
enabledbooleanEnable or disable the layer
layernumberLayer number (0-31) to enable/disable
masknumberSet layer mask directly (bitmask)
namestringObject name
targetstring"camera" to target the camera
uuidstringObject UUID

add_helper

Add a visual debug helper to a scene object. Types: box, axes, skeleton, arrow, grid, polar_grid, camera, directional_light, spot_light, point_light, hemisphere_light, plane Debug only — page reload will reset. No code changes needed.

ParameterTypeDescription
colornumberColor as hex number (default: 0x00ff00)
directionarray[x, y, z] direction for ArrowHelper/PlaneHelper
divisionsnumberGrid divisions (GridHelper, default: 10)
lengthnumberArrow length (ArrowHelper, default: 1)
originarray[x, y, z] origin for ArrowHelper
sizenumberSize for AxesHelper/GridHelper/LightHelpers (default: 1)
targetstringTarget object name
targetUuidstringTarget object UUID
typestringHelper type (default: box)

remove_helper

Remove a previously added debug helper Debug only — page reload will reset. No code changes needed.

ParameterTypeDescription
helperId *stringHelper ID returned by add_helper

set_texture

Modify texture properties: wrap, filter, anisotropy, repeat, offset, colorSpace — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
anisotropynumberAnisotropic filtering level (1-16)
colorSpacestringColor space (srgb, srgb-linear)
flipYbooleanFlip texture vertically
magFilternumberMag filter (1003=Nearest, 1006=Linear)
minFilternumberMin filter (1003=Nearest, 1006=Linear, 1008=LinearMipmapLinear)
namestringTexture name
offsetarray[x, y] offset
repeatarray[x, y] repeat
rotationnumberRotation in radians
uuidstringTexture UUID
wrapSnumberWrap S mode (1000=Repeat, 1001=ClampToEdge, 1002=Mirrored)
wrapTnumberWrap T mode

shadow_details

Inspect shadow maps: global settings, per-light shadow config (bias, mapSize, camera frustum), cast/receive objects

set_shadow

Modify shadow settings — runtime-only preview (lost on reload). ASK the user first: runtime preview or persistent code change? Runtime preview — lost on page reload. You MUST ask the user first: runtime preview only, or also update source code?

ParameterTypeDescription
biasnumberShadow bias (light only, e.g. -0.0001)
blurSamplesnumberShadow blur samples (light only)
cameraBottomnumberShadow camera bottom (DirectionalLight)
cameraFarnumberShadow camera far plane
cameraLeftnumberShadow camera left (DirectionalLight)
cameraNearnumberShadow camera near plane
cameraRightnumberShadow camera right (DirectionalLight)
cameraTopnumberShadow camera top (DirectionalLight)
castShadowbooleanEnable/disable shadow casting
mapSizearray[width, height] shadow map resolution
namestringObject/light name
normalBiasnumberShadow normal bias (light only)
radiusnumberShadow blur radius (light only)
receiveShadowbooleanEnable/disable shadow receiving
uuidstringObject/light UUID

scene_background

Inspect scene background, environment map (IBL), color management, backgroundBlurriness/Intensity

find_objects

Search scene objects by type, material, visibility, name pattern, or custom property. Returns matching objects with details.

ParameterTypeDescription
hasGeometrybooleanFilter objects with/without geometry
limitnumberMax results (default: 50, max: 200)
materialstringMaterial name or type to filter by
minChildrennumberMinimum number of children
namePatternstringRegex pattern to match object names
propertystringCustom property name to check on the object
typestringObject type: Mesh, Group, InstancedMesh, Light, etc.
valueExpected value for the custom property
visiblebooleanFilter by visibility

memory_stats

Detailed GPU memory analysis: geometry buffers, texture VRAM, instance data, top textures by size

dispose_check

Find potential memory leaks: orphaned geometries/textures not in scene but tracked by renderer, hidden objects with geometry

toggle_wireframe

Toggle wireframe on all materials or a specific object. Runtime only — for visual debugging. Debug only — page reload will reset. No code changes needed.

ParameterTypeDescription
enabledbooleantrue=wireframe on, false=restore original, omit=toggle
namestringObject name (omit for whole scene)
uuidstringObject UUID

bounding_boxes

Show/hide axis-aligned bounding boxes for scene objects. Runtime only — for debugging frustum culling and object bounds. Debug only — page reload will reset. No code changes needed.

ParameterTypeDescription
clearbooleanRemove all bounding boxes
colornumberBox color as hex (default: 0x00ff00)
enabledbooleantrue=show (default), false=remove all
limitnumberMax boxes to add (default: 50)
namestringTarget object name (omit for all meshes)
onlyVisiblebooleanOnly visible objects (default: true)
recursivebooleanInclude children of target
uuidstringTarget object UUID

env_map_details

Inspect environment maps: scene.environment, scene.background, per-material envMap, IBL settings

scene_diff

Compare scene state over time. First call saves a snapshot, second call shows what changed (added/removed/modified objects, transforms, materials, lights).

ParameterTypeDescription
actionstringsnapshot=save state, diff=compare with saved, auto=snapshot if none saved, diff if exists (default: auto)

postprocessing_list

List post-processing passes from EffectComposer: render passes, shader passes, effects (bloom, SSAO, etc.)

gltf_to_r3f

Convert a GLTF/GLB file to a ready-to-use React Three Fiber component (like gltfjsx)

ParameterTypeDescription
filePath *stringAbsolute or relative path to the .glb or .gltf file
preloadbooleanAdd useGLTF.preload() call (default: true)
typescriptbooleanGenerate TypeScript (default: true)

take_screenshot

Capture a screenshot of the current Three.js scene

ParameterTypeDescription
heightnumberHeight in pixels
widthnumberWidth in pixels

bridge_status

Check bridge connection and proxy status

set_dev_port

Change the dev server port the proxy forwards to

ParameterTypeDescription
port *numberThe dev server port (e.g. 3000, 5173, 8080)