# gltf-mcp

An [MCP](https://modelcontextprotocol.io/) server that lets AI assistants inspect and render glTF/GLB 3D model files.

## Features

- **Inspect models** - Get triangle counts, bounding boxes, materials, animations, scene hierarchy, and potential issues
- **Render to PNG** - PBR rendering with studio lighting, wireframe, and normal visualization modes
- **Texture overrides** - Swap material textures at render time without modifying the model
- **Full format support** - glTF 2.0, GLB, external textures, Draco, Meshopt, KTX2/Basis

## Quick Start

### Claude Desktop

Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "gltf-mcp": {
      "command": "npx",
      "args": ["gltf-mcp"]
    }
  }
}
```

### Claude Code

Create `.mcp.json` in your project root:

```json
{
  "mcpServers": {
    "gltf-mcp": {
      "command": "npx",
      "args": ["gltf-mcp"]
    }
  }
}
```

## Tools

### `get_gltf_info`

Inspect a glTF/GLB file and return structured metadata.

```
file_path: "/path/to/model.glb"
```

Returns: file size, triangle/vertex counts, bounding box, materials, animations, skins, scene hierarchy, compression state, and potential issues.

### `render_gltf`

Render a glTF/GLB file to a PNG image.

```
file_path: "/path/to/model.glb"
mode: "default" | "wireframe" | "normals"
yaw: 0          # camera rotation in degrees
pitch: 0
roll: 0
resolution: 800 # output size in pixels
```

Returns: PNG image with metadata (normalization info, warnings).

## Requirements

- Node.js 18+
- Puppeteer downloads Chromium (~200MB) on first install

## Documentation

Full documentation: [elixr-games.github.io/gltf-mcp](https://elixr-games.github.io/gltf-mcp/)

## License

[MIT](LICENSE)
