threlte-mcp
Supports analysis, optimization, and validation of GLTF/GLB 3D models, as well as export to Svelte components.
Provides tools for generating Threlte/Svelte components from GLTF models and works with Svelte-based Threlte scenes.
Enables real-time inspection and manipulation of Three.js/Threlte 3D scenes, including object transformation, material application, physics control, and camera presets.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@threlte-mcpshow me the current scene hierarchy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Threlte MCP
An MCP (Model Context Protocol) server that enables AI agents to inspect and manipulate Three.js/Threlte scenes in real-time.
✅ Compatible With
Claude Desktop - Anthropic's desktop app
Antigravity - Google's AI IDE
Claude Code - CLI tool for Claude
Cursor - AI-powered code editor
Windsurf - Codeium's AI IDE
Continue - VS Code AI extension
Any MCP-compatible client
See detailed compatibility guide →
Related MCP server: threejs-devtools-mcp
Features
🔍 Scene Inspection - View the full 3D scene hierarchy, find objects by name/type
🎯 Object Manipulation - Move, rotate, scale, show/hide objects
🎨 Materials & Assets - Apply materials, load GLTF models, change environment
🧪 Asset Analysis - Inspect GLTF structure and validate performance
dYZ+ Asset Optimization - Simplify meshes, compress textures, prune unused data
dY"? Svelte Export - Generate Threlte/Svelte components from GLTF
dYZ? Camera Presets - Save, load, and animate camera views
⚡ Physics Control - Add physics bodies, apply impulses, set gravity
🎭 Vibe Presets - Apply mood presets (cozy, spooky, neon, etc.)
Installation
npm install threlte-mcpQuick Start
1. Install the package
npm install threlte-mcp2. Configure your IDE (one-time setup)
npx threlte-mcp setupThis auto-detects your IDE (Antigravity, Cursor, Claude Desktop) and creates the MCP config.
3. Add the component to your Threlte app
Requires Svelte 5 for the MCPBridge component.
<script>
import { MCPBridgeComponent } from 'threlte-mcp/client';
</script>
<!-- Add inside your <Canvas> -->
<MCPBridgeComponent />That's it! The AI can now inspect and manipulate your scene.
If npx threlte-mcp setup doesn't work for your IDE, manually add to your config:
{
"mcpServers": {
"threlte-mcp": {
"command": "npx",
"args": ["-y", "threlte-mcp"]
}
}
}Config file locations:
Antigravity:
~/.gemini/antigravity/mcp_config.jsonCursor:
~/.cursor/mcp.jsonClaude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json(Mac)
import { MCPBridge } from 'threlte-mcp/client';
import { useThrelte } from '@threlte/core';
const { scene } = useThrelte();
// Create bridge (auto-connects in dev mode)
const bridge = new MCPBridge(scene, {
url: 'ws://127.0.0.1:8082', // default
autoConnect: true, // default in dev
reconnectDelay: 60000, // 1 minute
});
// In render loop
bridge.update();
// Get scene state
bridge.getSceneState();
// Find objects
bridge.findObjects({ nameContains: 'player' });Option B: Per-Scene (Simple for prototyping)
<script lang="ts">
import { onMount, onDestroy } from 'svelte';
import { useThrelte } from '@threlte/core';
const { scene } = useThrelte();
let ws: WebSocket | null = null;
onMount(() => {
ws = new WebSocket('ws://localhost:8082');
ws.onopen = () => {
console.log('[MCPBridge] Connected');
// Send initial scene state
ws?.send(JSON.stringify({
type: 'sceneState',
data: serializeScene(scene)
}));
};
ws.onmessage = (event) => {
const command = JSON.parse(event.data);
handleCommand(command);
};
});
onDestroy(() => {
ws?.close();
});
function serializeScene(obj: THREE.Object3D, depth = 0, maxDepth = 3) {
if (depth > maxDepth) return null;
return {
name: obj.name,
type: obj.type,
position: obj.position.toArray(),
rotation: obj.rotation.toArray().slice(0, 3),
scale: obj.scale.toArray(),
visible: obj.visible,
children: obj.children.map(c => serializeScene(c, depth + 1, maxDepth)).filter(Boolean)
};
}
function handleCommand(cmd: any) {
const { action, requestId, ...params } = cmd;
let result;
switch (action) {
case 'getFullSceneState':
result = { data: serializeScene(scene, 0, params.maxDepth || 3) };
break;
case 'moveSceneObject':
const obj = scene.getObjectByName(params.name || params.path);
if (obj && params.position) {
obj.position.set(...params.position);
result = { success: true };
}
break;
// Add more handlers as needed
}
if (requestId) {
ws?.send(JSON.stringify({ ...result, requestId }));
}
}
</script>3. Run your app and start using MCP tools
Once both the MCP server and your Threlte app are running, AI agents can:
"Get the scene state"
"Find all objects named 'Player'"
"Move the 'Camera' to position [0, 5, 10]"
"Apply the 'neon' vibe to the scene"Available Tools
Scene Inspection
Tool | Description |
| Get full scene hierarchy |
| Search by name, type, or userData |
| Get position of specific object |
| Export positions for code |
Camera
Tool | Description |
| Set camera position, lookAt, and lens settings |
| Save current camera view as a preset |
| Load a saved camera view |
| List all saved camera presets |
| Delete a saved camera preset |
| Animate through a sequence of presets |
Hierarchy Management
Tool | Description |
| Create primitive (box, sphere, etc.) |
| Remove object from scene |
| Set object position |
| Set position, rotation, scale |
| Show/hide object |
| Rename object |
| Clone object |
Physics
Tool | Description |
| Add physics body |
| Remove physics body |
| Apply force |
| Set global gravity |
Asset Processing
Tool | Description |
| Inspect GLTF/GLB structure |
| Validate GLTF/GLB for issues |
| Optimize GLTF/GLB assets |
| Generate Threlte/Svelte component |
Materials & Assets
Tool | Description |
| Load GLTF/GLB model |
| Set material |
| Set skybox/environment |
Atmosphere
Tool | Description |
| Apply mood preset |
| Check connection status |
Configuration
WebSocket Connection
The server uses port 8082 by default for WebSocket communication.
Environment Variables
The MCPBridge auto-connects in development mode. For production, you can enable it via environment variable:
# Add to .env file:
VITE_MCP_ENABLED=trueThis is useful for:
Testing in production builds
Demo environments
Debugging production issues
Note: Auto-enabled in development mode (npm run dev), no configuration needed.
Development
# Clone the repo
git clone https://github.com/RaulContreras123/threlte-mcp.git
cd threlte-mcp
# Install dependencies
npm install
# Run in development
npm run dev
# Build for production
npm run buildContributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
MIT © Raul Contreras
Links
Built with Claude 🤖
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceMCP server for Spline.design code generation and asset management.Last updated4BSD 3-Clause
- AlicenseAqualityBmaintenanceMCP 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.Last updated6014881MIT
- Alicense-qualityFmaintenanceA Three.js MCP server for designing 3D brick constructions, enabling AI or interactive placement of bricks through natural language and providing tools to manage and export scenes.Last updated20MIT
- Flicense-qualityCmaintenanceAn unofficial MCP server for inspecting and diagnosing Viam robotics fleets. It is currently in early development and not yet functional.Last updated
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
MCP server for understanding Javascript internals from ECMAScript specification.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SerifeusStudio/threlte-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server