Three.js DevTools MCP

io.github.DmitriyGolub由 GitHub 账号 DmitriyGolub 发布v0.2.1更新于 Oct 26, 2026

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

概览

AI 生成的概览

本地 MCP 服务器,让 AI 助手实时查看并即时修改浏览器中的 Three.js 场景,再把改动转成代码。

可以做什么
  • 查看运行中 Three.js 场景的场景树、对象、材质、着色器、纹理、灯光与相机
  • 实时预览材质属性、灯光、相机等改动,并给出改动前后代码与回滚
  • 调试可视化:线框、包围盒、辅助对象,以及浏览器内开发者面板
  • 审计网站的画布、纹理、阴影、色彩空间与绘制调用问题,并录制帧序列用于视频
  • 把改动导出为原生 Three.js 或 React Three Fiber 代码,并可在 Playwright 或 Puppeteer 测试中驱动场景
适用场景
适合在开发 Three.js 或 React Three Fiber 项目时使用:让助手排查模型不可见、交互式调整外观、审计渲染性能,或录制宣传短片,而无需先改动项目代码。
运行要求
通过 npx(Node.js)以 stdio 在本地运行。需要先启动 Three.js 开发服务器,端口从 package.json 自动检测或用 DEV_PORT 指定。默认会在桥接端口(BRIDGE_PORT,默认 9222)自动打开浏览器,可用 BROWSER 设为 none 关闭;CHROME_PATH 与 HEADLESS 为可选项。使用期间浏览器标签页必须保持打开。
安装前请注意
服务器会打开浏览器并向页面注入桥接脚本;当你要求保留改动时,工具会把修改写入源码文件。实时预览的改动在刷新后会丢失,除非已应用。仅支持桌面端,关闭浏览器标签页后工具即失效。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Three.js DevTools MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

threejs-devtools-mcp

[npm version] [license] [build] [MCP Registry]

MCP server for inspecting Three.js scenes in real time, trying changes live in the browser, and turning them into code. 69 tools cover objects, materials, shaders, textures, animation, performance and memory, plus website audits, video frame capture and Playwright helpers.

Zero changes to your project. Works with vanilla Three.js and React Three Fiber, on WebGLRenderer and WebGPURenderer.

[Annotated screenshot]

Setup

1. Add the MCP server

Claude Code
bash
claude mcp add threejs-devtools-mcp -- npx threejs-devtools-mcp
Claude Desktop

Add to claude_desktop_config.json:

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

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

json
{  "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:

json
{  "mcpServers": {    "threejs-devtools-mcp": {      "command": "npx",      "args": ["-y", "threejs-devtools-mcp"]    }  }}
VS Code (Copilot)

Add to .vscode/mcp.json:

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

Add to opencode.json in your project:

json
{  "$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?""try the car in red"          ← live preview, nothing saved"keep it"                     ← written into your code"audit this site for mobile""record a 5-second clip at 60 fps"

Look now vs. change the code

Every tool is labelled, so you and the AI always know what touches your files:

ToolsYour code
Inspectscene_tree, material_details, web_audit, screenshots…untouched
Live previewset_material_property, set_light, set_camera…untouched; lost on page reload
Debug visualwireframe, bounding boxes, helpers, overlayuntouched; never needed in code
For codepending_changes, gltf_to_r3fthe AI writes this into your source

Every live-preview change is recorded. pending_changes returns each one as before → after with ready-to-paste code (vanilla Three.js and React Three Fiber) and where to find it in your project. revert_changes undoes them in the browser.

For websites and videos

  • web_audit: checks for a blurry canvas (pixel ratio, missing resize), battery drain (rendering while idle or off-screen), heavy textures (oversized, not KTX2), expensive shadows, wrong color space and too many draw calls. Each finding comes with the fix.
  • capture_frames: records a frame sequence for promo clips and reels. Time is virtualised, so the output is perfectly smooth at 30/60 fps even if your scene renders slowly. You get the ffmpeg command for MP4/WebM.

Skills

Ready-made workflows show up as slash commands in Claude Code, Cursor and other clients: inspect-scene, try-look, apply-to-code, web-perf-audit, prepare-video, debug-invisible, playwright-setup.

Playwright & Puppeteer

Three ways to connect, same tools in all of them: your own browser (default), a Chrome launched by the server (HEADLESS / CDP_PORT, shareable with Playwright MCP), or your own tests:

ts
import { attachDevtools, waitForScene, threeCall } from 'threejs-devtools-mcp/playwright';
await attachDevtools(context, { connect: false });await page.goto('http://localhost:5173');await waitForScene(page);expect((await threeCall(page, 'object_details', { name: 'Car' })).visible).toBe(true);

See Browsers, Puppeteer & Playwright.

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:

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

Documentation

License

MIT

来源:README.md,提交 8151443

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分