Skip to main content
Glama

PartBuilder

MCP server for generating 3D models from images using SAM 3D Objects by Meta. Designed for AI agents to request 3D parts from images and receive Three.js-compatible models.

Features

  • Image to 3D: Generate 3D Gaussian Splats from a single image

  • MCP Integration: Works with Claude, GPT, and any MCP-compatible agent

  • Dual Backend: Switch between cloud GPU (RunPod) and self-hosted Linux

  • Three.js Ready: Automatic PLY to GLTF conversion for web rendering

  • Flexible Output: Get PLY (Gaussian Splat), GLTF, or both

  • Claude Code Skills: Guided workflows for interactive 3D generation

Related MCP server: cpu3d

Claude Code Skills

PartBuilder includes skills for guided 3D generation workflows:

Skill

Description

/generate-3d

Full guided workflow: image input → analysis → generation → Three.js code

/partbuilder-status

Check backend health and configuration

/switch-backend

Switch between cloud_gpu and remote_linux backends

Example: Generate 3D Model

> /generate-3d ./photo.png

Step 1: Analyzing image...
- Dimensions: 1024x768
- Subject: A wooden chair with curved armrests

Step 2: Backend Status
- Type: cloud_gpu
- Status: healthy

Step 3: Generating 3D model...
[Progress indicator]

Step 4: Complete!
- PLY: ./output/chair.ply
- GLTF: ./output/chair.glb

Three.js code provided for both formats.

Quickstart

1. Install

git clone https://github.com/darland6/partbuilder.git
cd partbuilder
pip install -e .

2. Configure

cp .env.example .env
# Edit .env with your backend settings

3. Run MCP Server

partbuilder
# Or: python -m partbuilder.server

4. Add to Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "partbuilder": {
      "command": "partbuilder",
      "env": {
        "PARTBUILDER_BACKEND": "cloud_gpu",
        "PARTBUILDER_CLOUD_GPU__API_KEY": "your_key",
        "PARTBUILDER_CLOUD_GPU__ENDPOINT_ID": "your_endpoint"
      }
    }
  }
}

Backend Setup

Option A: Cloud GPU (RunPod)

Best for: Getting started quickly, no local GPU required.

  1. Create a RunPod account

  2. Deploy a serverless endpoint with SAM 3D Objects

  3. Set your API key and endpoint ID in .env

PARTBUILDER_BACKEND=cloud_gpu
PARTBUILDER_CLOUD_GPU__API_KEY=your_runpod_api_key
PARTBUILDER_CLOUD_GPU__ENDPOINT_ID=your_endpoint_id

Option B: Remote Linux (Self-Hosted)

Best for: Production use, cost control, privacy.

Requirements:

  • Linux 64-bit machine

  • NVIDIA GPU with 32GB+ VRAM (A100, RTX 4090, etc.)

  • CUDA 12.1

On your Linux server:

# Clone and set up SAM 3D Objects
cd partbuilder/sam-3d-objects
mamba env create -f environments/default.yml
mamba activate sam3d-objects

# Install dependencies
export PIP_EXTRA_INDEX_URL="https://pypi.ngc.nvidia.com https://download.pytorch.org/whl/cu121"
pip install -e '.[dev]'
pip install -e '.[p3d]'
export PIP_FIND_LINKS="https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.5.1_cu121.html"
pip install -e '.[inference]'

# Download model weights (requires HuggingFace access)
pip install 'huggingface-hub[cli]<1.0'
hf auth login
hf download --repo-type model --local-dir checkpoints/hf-download --max-workers 1 facebook/sam-3d-objects
mv checkpoints/hf-download/checkpoints checkpoints/hf

# Run inference server
pip install fastapi uvicorn
python scripts/inference_server.py --host 0.0.0.0 --port 8000

On your local machine:

PARTBUILDER_BACKEND=remote_linux
PARTBUILDER_REMOTE_LINUX__HOST=your-server-ip
PARTBUILDER_REMOTE_LINUX__PORT=8000
PARTBUILDER_REMOTE_LINUX__API_KEY=optional_api_key

MCP Tools

generate_3d_from_image

Generate a 3D model from an image.

{
  "image_base64": "...",
  "mask_index": 0,
  "seed": 42,
  "output_format": "both"
}

Parameters:

Parameter

Type

Description

image_base64

string

Base64 encoded PNG/JPEG

image_path

string

Alternative: path to image file

mask_base64

string

Optional mask image

mask_index

int

Which auto-mask to use (default: 0)

seed

int

Random seed for reproducibility

output_format

string

ply, gltf, or both

output_name

string

Base filename for output

Returns:

  • Path(s) to generated PLY and/or GLTF files

  • Inference metadata

check_backend_status

Check if the backend is healthy.

switch_backend

Switch between cloud_gpu and remote_linux at runtime.

Output Formats

PLY (Gaussian Splat)

Native SAM 3D Objects output. Best quality, but requires specialized viewer.

Three.js usage:

import { GaussianSplats3D } from '@mkkellogg/gaussian-splats-3d';

const viewer = new GaussianSplats3D.Viewer();
viewer.loadSplat('model.ply');

GLTF/GLB

Converted mesh format. Universal compatibility, slight quality loss.

Three.js usage:

import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';

const loader = new GLTFLoader();
loader.load('model.glb', (gltf) => {
  scene.add(gltf.scene);
});

Architecture

┌─────────────────────────────────────────────────────────────┐
│                      MCP Client                              │
│              (Claude, GPT, Custom Agent)                     │
└─────────────────────┬───────────────────────────────────────┘
                      │ MCP Protocol
┌─────────────────────▼───────────────────────────────────────┐
│                   PartBuilder MCP Server                     │
│  ┌─────────────────────────────────────────────────────┐    │
│  │                    server.py                         │    │
│  │  - Tool definitions                                  │    │
│  │  - Request handling                                  │    │
│  │  - Output management                                 │    │
│  └─────────────────────┬───────────────────────────────┘    │
│                        │                                     │
│  ┌─────────────────────▼───────────────────────────────┐    │
│  │              Backend Abstraction                     │    │
│  │  ┌─────────────────┐  ┌─────────────────────────┐   │    │
│  │  │  CloudGPUBackend│  │  RemoteLinuxBackend     │   │    │
│  │  │  (RunPod)       │  │  (Self-hosted)          │   │    │
│  │  └────────┬────────┘  └───────────┬─────────────┘   │    │
│  └───────────┼───────────────────────┼─────────────────┘    │
│              │                       │                       │
│  ┌───────────▼───────────────────────▼─────────────────┐    │
│  │              Utils (conversion.py)                   │    │
│  │  - PLY to GLTF conversion                           │    │
│  │  - Gaussian Splat to mesh                           │    │
│  └─────────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────────┘
                      │
         ┌────────────┴────────────┐
         ▼                         ▼
┌─────────────────┐    ┌─────────────────────────────────────┐
│   RunPod API    │    │      Remote Linux Server            │
│   (Serverless)  │    │  ┌─────────────────────────────┐    │
└─────────────────┘    │  │   inference_server.py       │    │
                       │  │   - FastAPI                  │    │
                       │  │   - SAM 3D Objects model     │    │
                       │  │   - GPU inference            │    │
                       │  └─────────────────────────────┘    │
                       │  ┌─────────────────────────────┐    │
                       │  │   sam-3d-objects/           │    │
                       │  │   (Meta's model)            │    │
                       │  └─────────────────────────────┘    │
                       └─────────────────────────────────────┘

File Structure

partbuilder/
├── src/partbuilder/
│   ├── __init__.py          # Package init
│   ├── server.py            # MCP server implementation
│   ├── config.py            # Configuration management
│   ├── cli.py               # CLI entry point
│   ├── backends/
│   │   ├── __init__.py
│   │   ├── base.py          # Backend interface
│   │   ├── cloud_gpu.py     # RunPod backend
│   │   └── remote_linux.py  # Self-hosted backend
│   └── utils/
│       ├── __init__.py
│       └── conversion.py    # PLY to GLTF conversion
├── scripts/
│   └── inference_server.py  # Server for remote Linux
├── sam-3d-objects/          # Meta's SAM 3D Objects (submodule)
├── output/                  # Generated models (gitignored)
├── pyproject.toml
├── .env.example
├── LICENSE
└── README.md

Requirements

MCP Server (Local)

  • Python 3.10+

  • No GPU required

Inference Backend

  • Linux 64-bit

  • NVIDIA GPU with 32GB+ VRAM

  • CUDA 12.1

  • ~20GB disk space for model weights

Troubleshooting

"Model checkpoints not found"

Download weights from HuggingFace:

hf auth login  # Need access approval first
hf download --repo-type model --local-dir checkpoints/hf-download facebook/sam-3d-objects

"RuntimeError: Not compiled with GPU support"

Build PyTorch3D on a GPU node:

# SSH to GPU machine, then:
mamba activate sam3d-objects
pip install -e '.[p3d]'

Connection refused to remote server

  1. Check firewall allows port 8000

  2. Verify server is running: curl http://your-server:8000/health

  3. Check API key matches

License

MIT License - see LICENSE

Credits

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to build and edit 3D scenes as safe JSON shape recipes over MCP, then render PNG views of their own work on a pure-JavaScript CPU rasterizer with no GPU or browser. Agents can add, update, and remove objects, place them via terrain raycasts, control cameras and environment, and export or import OBJ geometry.
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to inspect and control a live Blender session through MCP tools that create, modify, and delete objects, apply materials, render images, execute Python, and pull PolyHaven assets over a local TCP add-on. It also exposes a provider-agnostic LLM layer that can be pointed at Ollama, LM Studio, llama.cpp, OpenAI-compatible, or Azure endpoints and switched at runtime.
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to turn a single image into a textured 3D mesh (GLB, OBJ with vertex colours, plus a turntable PNG) entirely on local hardware. Exposes capability reporting, dry-run planning, job queuing, and status/result retrieval so quality presets, hardware tiers, and consented model downloads can be driven through natural language.
      3
      Apache 2.0