MCP Threejs: Allow creation of animation in Claude Desktop using Three.js
737
This MCP server enables AI assistants like Claude to efficiently find and utilize pre-built 3D models for Three.js scenes. It solves the scalability challenge of coding Three.js applications from scratch by providing direct access to downloadable 3D resources via natural language search. Currently integrated with Sketchfab, it returns only models available for download along with their format details, making it easy to incorporate existing assets into your Three.js projects.
The primary purpose of this tool is to provide directly usable online 3D resources that are compatible with Three.js. By leveraging pre-built 3D models as building blocks, this tool significantly reduces the computational overhead and token consumption that would otherwise be required for coding complex Three.js scenes from scratch. AI assistants can find the most relevant models through natural language queries, enabling rapid prototyping and development of 3D web applications.
The project aims to expand support for additional 3D model repositories and enhance functionality:
pip install mcp-server-threejs
Customize through environment variables:
# All credentials are needed for full functionality
docker run \
-e SKETCHFAB_ACCESS_TOKEN=your_access_token \
-e SKETCHFAB_REFRESH_TOKEN=your_refresh_token \
-e SKETCHFAB_CLIENT_ID=your_client_id \
-e SKETCHFAB_CLIENT_SECRET=your_client_secret \
...
This tool uses OAuth2 for Sketchfab authentication, which provides several benefits:
To use the link retrieval functionality, you'll need OAuth2 credentials from Sketchfab:
The tool can store OAuth2 credentials locally in ~/.sketchfab_credentials.json for persistence between sessions. This file contains:
The server provides the following tools:
Search for downloadable 3D models on Sketchfab that match your query.
Input Schema:
{
"query": {
"type": "string",
"description": "Search term for 3D models (e.g., 'car', 'house', 'character')"
}
}
Response Format:
{
"downloadable_models": [
{
"uid": "model-id",
"name": "Model Name",
"description": "Model description",
"viewerUrl": "https://sketchfab.com/...",
"embedUrl": "https://sketchfab.com/...",
"thumbnailUrl": "https://media.sketchfab.com/...",
"user": "creator_username",
"formats": {
"glb": 12345678,
"gltf": 23456789,
"usdz": 34567890
}
}
]
}
Get direct URL of a GLTF file for a Sketchfab model without downloading it (requires OAuth2 authentication).
Input Schema:
{
"model_id": {
"type": "string",
"description": "The uid of the model returned in the Sketchfab search response."
}
}
Response Format:
{
"model_name": "Example Model",
"model_id": "abc123",
"gltf_url": "https://download.sketchfab.com/models/abc123/gltf/example.gltf"
}
Official images support 2 platforms:
# Build and push using buildx
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 \
-t buryhuang/mcp-server-threejs:latest \
--push .
docker pull buryhuang/mcp-server-threejs:latest
docker build -t mcp-server-threejs .
docker run \
-e SKETCHFAB_ACCESS_TOKEN=your_access_token \
-e SKETCHFAB_REFRESH_TOKEN=your_refresh_token \
-e SKETCHFAB_CLIENT_ID=your_client_id \
-e SKETCHFAB_CLIENT_SECRET=your_client_secret \
buryhuang/mcp-server-threejs:latest
To use persistent credentials storage with Docker:
docker run \
-v ~/.sketchfab_credentials.json:/root/.sketchfab_credentials.json \
buryhuang/mcp-server-threejs:latest
Configure the MCP server in your Claude Desktop settings:
{
"mcpServers": {
"threejs": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SKETCHFAB_ACCESS_TOKEN=your_access_token",
"-e",
"SKETCHFAB_REFRESH_TOKEN=your_refresh_token",
"-e",
"SKETCHFAB_CLIENT_ID=your_client_id",
"-e",
"SKETCHFAB_CLIENT_SECRET=your_client_secret",
"-v",
"~/.sketchfab_credentials.json:/root/.sketchfab_credentials.json",
"buryhuang/mcp-server-threejs:latest"
]
}
}
}
Example prompts:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the terms included in the LICENSE file.
Content type
Image
Digest
sha256:a74ff9f32…
Size
103.6 MB
Last updated
over 1 year ago
docker pull buryhuang/mcp-server-threejs