MCPcopy Index your code
hub / github.com/DmitriyGolub/threejs-devtools-mcp

github.com/DmitriyGolub/threejs-devtools-mcp @v0.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.1 ↗ · + Follow
327 symbols 826 edges 89 files 17 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

threejs-devtools-mcp

npm version license build MCP Registry

MCP server for inspecting and modifying Three.js scenes in real time — 59 tools for objects, materials, shaders, textures, animations, performance monitoring, memory diagnostics, and code generation.

Zero changes to your project. Works with vanilla Three.js, React Three Fiber, and any framework.

Annotated screenshot

Setup

1. Add the MCP server

Claude Code

claude mcp add threejs-devtools-mcp -- npx threejs-devtools-mcp

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "threejs-devtools-mcp": {
      "command": "npx",
      "args": ["-y", "threejs-devtools-mcp"]
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project:

{
  "mcpServers": {
    "threejs-devtools-mcp": {
      "command": "npx",
      "args": ["-y", "threejs-devtools-mcp"]
    }
  }
}

Or use the HTTP transport — see Cursor setup guide.

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "threejs-devtools-mcp": {
      "command": "npx",
      "args": ["-y", "threejs-devtools-mcp"]
    }
  }
}

VS Code (Copilot)

Add to .vscode/mcp.json:

{
  "servers": {
    "threejs-devtools-mcp": {
      "command": "npx",
      "args": ["-y", "threejs-devtools-mcp"]
    }
  }
}

OpenCode

Add to opencode.json in your project:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "threejs-devtools-mcp": {
      "type": "local",
      "command": ["npx", "-y", "threejs-devtools-mcp"],
      "enabled": true
    }
  }
}

2. Start your dev server and open the browser

Start your Three.js dev server as usual (npm run dev). The MCP server auto-detects the port from package.json and opens a browser at localhost:9222 with the devtools bridge injected.

Keep the browser tab open. The MCP server talks to your scene through a WebSocket bridge. Close the tab = tools stop working.

3. Ask the AI about your scene

"show me the scene tree"
"why is my model invisible?"
"make the car red"
"check for memory leaks"
"what's my FPS?"
"generate a React component from character.glb"

In-browser overlay

A built-in devtools panel with live performance stats, interactive scene graph, material editor, and 3D object preview. Activated automatically or via the toggle_overlay tool.

Overlay panel

Tip: name your objects

Unnamed objects show as (unnamed) in the scene tree. Named objects are easier to find and modify:

// Three.js
mesh.name = "player";
// React Three Fiber
<mesh name="player" geometry={geometry} material={material} />

Documentation

License

MIT

Extension points exported contracts — how you extend this code

LaunchResult (Interface)
(no doc)
src/browser.ts
BridgeRequest (Interface)
(no doc)
src/types/scene.ts
BridgeRequest (Interface)
(no doc)
src/bridge/types.ts
GltfNode (Interface)
(no doc)
src/server/gltf-to-r3f.ts
BridgeResponse (Interface)
(no doc)
src/types/scene.ts
BridgeResponse (Interface)
(no doc)
src/bridge/types.ts
GltfMesh (Interface)
(no doc)
src/server/gltf-to-r3f.ts
SceneNode (Interface)
(no doc)
src/types/scene.ts

Core symbols most depended-on inside this repo

ok
called by 284
tests/test-runner.mjs
toolOk
called by 103
tests/test-runner.mjs
bridgeTool
called by 52
src/server/tool-helper.ts
getCaptured
called by 30
src/bridge/discovery/state.ts
serializeVector3
called by 24
src/bridge/serializers/vector.ts
readColorHex
called by 23
src/bridge/handlers/color-utils.ts
skip
called by 16
tests/test-runner.mjs
close
called by 14
src/bridge/server.ts

Shape

Function 284
Interface 22
Method 19
Class 2

Languages

TypeScript100%

Modules by API surface

src/bridge/server.ts26 symbols
src/bridge/handlers/diagnostics.ts16 symbols
src/bridge/handlers/inspect.ts15 symbols
tests/test-mutations.mjs12 symbols
src/server/gltf-to-r3f.ts12 symbols
src/bridge/handlers/overlay/helpers.ts12 symbols
src/bridge/handlers/mutate.ts12 symbols
tests/test-diagnostics.mjs9 symbols
src/bridge/handlers/overlay/preview.ts8 symbols
src/bridge/handlers/overlay/index.ts8 symbols
src/types/scene.ts7 symbols
src/bridge/serializers/scene-node.ts7 symbols

For agents

$ claude mcp add threejs-devtools-mcp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page