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.
- π Direct search for Three.js-compatible 3D models via Sketchfab API
- π FastAPI-based server with async support
- β‘ Fast response times with lightweight implementation
- β Automatic filtering for downloadable models only
- π Format information with file sizes for each model
- π OAuth2 authentication for Sketchfab API
- π Automatic token refresh when access tokens expire
- πΎ Credential persistence between sessions
The project aims to expand support for additional 3D model repositories and enhance functionality:
- Integrate with TurboSquid marketplace
- Support for CGTrader API
- Integration with Free3D repository
- Add functionality to preview models directly in Claude
- Create a unified API across all supported 3D repositories
pip install mcp-server-threejsCustomize through environment variables:
- OAuth2 credentials (required for getting download links):
# 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:
- Better Security: OAuth2 is more secure than API key authentication
- Token Refresh: Access tokens can be automatically refreshed when they expire
- Limited Permissions: OAuth2 allows for more granular permission scopes
To use the link retrieval functionality, you'll need OAuth2 credentials from Sketchfab:
- Register an application at https://sketchfab.com/developers/apps
- Set the OAuth redirect URI to a valid endpoint where you can capture the authorization code
- Use the authorization code flow to obtain access and refresh tokens
The tool can store OAuth2 credentials locally in ~/.sketchfab_credentials.json for persistence between sessions. This file contains:
- Access token
- Refresh token
- Client ID
- Client secret
- Token expiry timestamp
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 .- linux/amd64
- linux/arm64
docker pull buryhuang/mcp-server-threejs:latestdocker 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:latestTo use persistent credentials storage with Docker:
docker run \
-v ~/.sketchfab_credentials.json:/root/.sketchfab_credentials.json \
buryhuang/mcp-server-threejs:latestConfigure 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:
- "Find me downloadable car models"
- "Search for realistic human character models"
- "Find low-poly animal models I can download"
- "Get the GLTF URL for the spaceship model with ID abc123"
- 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
This project is licensed under the terms included in the LICENSE file.