Skip to main content
Glama
Verge3D MCP Server
by sanky369
README.md
# Verge3D MCP Server (`verge3d-mcp`)

A comprehensive **Model Context Protocol (MCP)** server for **Verge3D** (tested with Verge3D 4.14.0 & Blender 5.3), enabling AI agents (Claude, Cursor, Antigravity, Codex, etc.) to inspect, create, configure, script, optimize, preview, package, and publish Verge3D WebGL/WebXR applications end-to-end.

## Architecture

`verge3d-mcp` connects cleanly to every layer of Verge3D:

1. **Verge3D App Manager Server (`localhost:8668` / `8669` / `8670`)** — Full async HTTP integration for app creation, deletion, engine/template updates, application settings (SEO, preloader, annotations, PWA), image uploads, service workers, ZIP import/export, Puzzles saving/backups/libraries/plugins, Electron/Cordova native builds, SCORM LMS packages, Asset Store demos, and Verge3D Network CDN publishing.
2. **Blender ↔ Verge3D Engine** — Works out-of-the-box via **headless Blender CLI** (`blender --background`), AND optionally connects to your **live open Blender viewport** via the bundled [`blender_addon/verge3d_mcp_bridge.py`](blender_addon/verge3d_mcp_bridge.py) add-on (`127.0.0.1:9877`).
3. **Asset & Scene Pipeline** — Native `.gltf`/`.glb`/`.xz` scene inspector (with full `S8S_v3d_*` extension decoding), Verge3D-compatible LZMA `.xz` compression, GPU texture KTX2 compression via Verge3D's bundled `toktx`, single-file `.html` bundling, and iframe/WordPress/Shopify integration helpers.

---

## Tool Coverage (42 Tools + 6 Resources + 3 Prompts)

### 1. App Manager Server & Global Settings
| Tool | Description |
|---|---|
| `verge3d_server_status` | Ping App Manager, check version/flavor/paths/engine/preview dir, Blender CLI, `toktx`, and live bridge status |
| `verge3d_server_control` | `start`, `stop`, or `restart` the local App Manager server |
| `verge3d_server_logs` | Read recent log lines from `/log` |
| `verge3d_global_settings` | `get` or `update` App Manager global settings (`settings.json` / `/settings/save`) |
| `verge3d_activate_license` | Activate a Verge3D license key (`/enterkey`) |

### 2. Application Lifecycle & Files
| Tool | Description |
|---|---|
| `verge3d_list_apps` | List all local Verge3D applications with files, Puzzles links, and preview URLs |
| `verge3d_get_app_info` | Deep inspection of an app (template metadata, installed modules, backups, PWA status, sizes) |
| `verge3d_list_templates` | List available app templates (`Standard Light`, `Standard Dark`, `Blank Scene`, `Code-Based`, custom) |
| `verge3d_create_app` | Create a new Verge3D app with optional `opentype.js`, `ammo.wasm` physics, and `basis_transcoder` KTX2 modules |
| `verge3d_delete_app` | Safely delete an app to the OS Trash / Recycle Bin |
| `verge3d_update_app` | Check or apply engine module & template updates for a single app or `ALL` apps |
| `verge3d_export_app_zip` | Export an app as a ZIP archive via App Manager and optionally download to disk |
| `verge3d_import_app_zip` | Import an application ZIP archive into the local applications folder |
| `verge3d_app_files` | Sandboxed `list`, `read`, `write`, or `delete` on files inside a Verge3D app |

### 3. App Branding, Preloader, Annotations & PWA
| Tool | Description |
|---|---|
| `verge3d_get_app_settings` | Parse all app settings (SEO, OpenGraph, Twitter Card, favicons, preloader, UI icons, annotations, WebGL errors, PWA) |
| `verge3d_update_app_settings` | Update any subset of app settings via `/app_settings/save` |
| `verge3d_upload_app_image` | Upload PNG/JPEG/WebP/SVG images into an app's `media/` folder |
| `verge3d_update_service_worker` | Regenerate & bump `v3d_pwa_cache.js` offline cache |

### 4. Puzzles Visual Logic, Libraries & Plugins
| Tool | Description |
|---|---|
| `verge3d_puzzles_read` | Summarize `visual_logic.xml` (tabs, variables, procedures, init settings, block counts), backups, and optional raw XML/JS |
| `verge3d_puzzles_save` | Validate and save `visual_logic.xml` via `/storage/xml` (auto-backs up previous XML). Leaves `visual_logic.js` untouched unless `js_content` is given; re-save in the Puzzles editor to recompile |
| `verge3d_puzzles_restore_backup` | Restore a timestamped backup from `v3d_app_data/puzzles_backup/` |
| `verge3d_puzzles_library` | Browse built-in `puzzles/library.xml` or manage user `my_library.xml` snippets |
| `verge3d_puzzles_plugins` | List installed Puzzles plugins, read `.plug`/`.block` source, or scaffold custom plugins |

### 5. Blender ↔ Verge3D Authoring & Export
*(Every tool supports both `.blend`/`app_name` headless CLI mode AND `use_live_blender=True` live GUI mode.)*
| Tool | Description |
|---|---|
| `verge3d_blender_inspect_scene` | Inspect all Verge3D properties (`v3d_export`, `scene.v3d` GTAO/outline, `world.v3d`, collections, cameras, objects, materials, lights, light probes, images) |
| `verge3d_blender_export` | Export to Verge3D `.gltf`, `.glb`, or standalone `.html` with full `V3DExportSettings` overrides |
| `verge3d_blender_sneak_peek` | Export to App Manager preview dir and return live Sneak Peek URL |
| `verge3d_blender_configure_export` | Configure `v3d_export`, GTAO, Outline effect, World dithering, Eevee shadows, and Collection export flags |
| `verge3d_blender_configure_camera` | Configure Orbit/Flying/First-Person/None camera controls, limits, target, FPS collision material, and pointer lock |
| `verge3d_blender_configure_object` | Configure object animation, render order, frustum culling, shadows, HiDPI, camera-edge fit, visibility breakpoints, and line rendering |
| `verge3d_blender_configure_material` | Configure material blend mode, transparency hack, render side, depth, `gltf_compat`, image KTX2 mode, texture anisotropy, and noise settings |
| `verge3d_blender_configure_light` | Configure light shadow/CSM settings and LightProbe custom influence/intensity/falloff |
| `verge3d_blender_add_clipping_plane` | Create or configure a Verge3D Clipping Plane Empty (with optional filled cross-section) |
| `verge3d_blender_scene_maintenance` | Apply Verge3D's scene compatibility fixes (GGX, node groups, legacy Disable Shadow nodes, sun threshold); batch re-export only with `reexport=True` or `reexport_folder` |

### 6. glTF/GLB Scene Analysis & Asset Optimization
| Tool | Description |
|---|---|
| `verge3d_inspect_gltf` | Inspect `.gltf`, `.glb`, `.gltf.xz`, or `.glb.xz` — exact object/material/camera/light/animation names, `S8S_v3d_*` extensions, texture compression & sizes |
| `verge3d_compress_lzma` | Compress to `.xz` (LZMA) or decompress `.xz` assets |
| `verge3d_compress_ktx2` | Compress PNG/JPEG textures to KTX2 (UASTC or ETC1S + mipmaps) using Verge3D's bundled `toktx` |
| `verge3d_compose_single_html` | Bundle any `.glb` + `v3d.js` runtime into a self-contained single-file `.html` viewer |

### 7. Packaging, E-Commerce, Asset Store & Verge3D Network
| Tool | Description |
|---|---|
| `verge3d_create_native_app` | Build desktop **Electron** or mobile **Cordova** ZIP packages |
| `verge3d_create_scorm_package` | Build **SCORM 1.2** LMS e-learning ZIP packages |
| `verge3d_network` | Manage Verge3D Network cloud hosting (`status`, `upload`, `download`, `delete`, `progress`, `cancel`) |
| `verge3d_asset_store` | Browse/search Asset Store items for your Verge3D flavor and download/install free demos (pass the item's `download_url`) |
| `verge3d_integration_snippets` | Generate `<iframe>` embed HTML, `ExternalInterface` JS boilerplate, and locate bundled WordPress (`verge3d.zip`) and Shopify Liquid files |

### MCP Resources & Prompts
- **Resources:** `verge3d://status`, `verge3d://apps`, `verge3d://apps/{app_name}`, `verge3d://reference/v3d-js-api`, `verge3d://reference/blender-properties`, `verge3d://reference/puzzles-xml`
- **Prompts:** `create_interactive_configurator`, `optimize_verge3d_scene`, `package_and_deploy`

---

## Quick Start

### 1. Install dependencies with `uv`
```bash
uv sync --extra dev
```

### 2. Run the MCP server (stdio)
```bash
uv run verge3d-mcp
```
Or HTTP/SSE transport:
```bash
uv run verge3d-mcp --transport streamable-http --host 127.0.0.1 --port 8765
```

### 3. Configure in your MCP Client (Claude Desktop / Cursor / Antigravity / Codex)
```json
{
  "mcpServers": {
    "verge3d": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/verge3d-blender-mcp",
        "run",
        "verge3d-mcp"
      ]
    }
  }
}
```

### 4. Environment Variables (Optional — Auto-Detected by Default)
| Variable | Default | Description |
|---|---|---|
| `VERGE3D_FLAVOR` | `BLENDER` | `BLENDER`, `MAX`, `MAYA`, or `ALL` |
| `VERGE3D_HOST` | `127.0.0.1` | App Manager server host |
| `VERGE3D_PORT` | `8668` | App Manager port (`8668` Blender, `8669` Max, `8670` Maya) |
| `VERGE3D_ROOT` | Auto-detected | Path to Verge3D installation directory |
| `VERGE3D_APPS_DIR` | From `settings.json` | Override Verge3D applications directory |
| `BLENDER_EXECUTABLE` | Auto-detected | Path to `blender` / `blender.exe` |
| `VERGE3D_BLENDER_BRIDGE_PORT` | `9877` | Port for optional live Blender GUI bridge add-on |

### 5. Optional: Live Blender GUI Bridge Add-on
Headless Blender CLI mode works immediately with zero setup. If you also want agents to control your **currently open Blender viewport** (`use_live_blender=True`):
1. Open Blender → **Edit → Preferences → Add-ons → Install from Disk**.
2. Select `blender_addon/verge3d_mcp_bridge.py` and enable **Verge3D MCP Bridge**.
3. Open the 3D Viewport sidebar (`N`) → **Verge3D MCP** tab → click **Start Verge3D MCP Bridge**.

> **Security:** while running, the bridge executes any Python code sent to `127.0.0.1:<port>` inside Blender, without authentication. It only listens on loopback, but any program on your computer can use it. Stop it when not needed.

> **Headless edits vs. open files:** headless tools refuse to save a `.blend` that is currently open in the live bridge session (it would be overwritten underneath you). Use `use_live_blender=True` for files you have open.

### Error reporting
All tools report failures as MCP tool errors with a readable message (e.g. missing app, unknown Blender property, App Manager error dialog text), so agents can correct their call.

---

## Running Tests
```bash
uv run pytest -v
```

TDQS

B3.4/5.0

Scored across 42 tools

Disambiguation4/5

Tools are organized into clear domains (server, app lifecycle, settings, puzzles, Blender configuration, export/compression, packaging), and most have distinct resource+action targets. A few boundaries blur — verge3d_update_app vs. verge3d_blender_scene_maintenance batch re-export, and multi-action tools like verge3d_app_files and verge3d_network pack several operations under one name — but an agent can generally pick correctly from the descriptions.

Naming Consistency4/5

Nearly all names follow a verge3d_ prefix with snake_case, and the Blender tools use a coherent verge3d_blender_<verb>_<noun> pattern. Minor deviations exist (verge3d_server_status/server_logs are noun-oriented while most others are verb_noun), but the convention remains readable and predictable.

Tool Count3/5

42 tools is heavy for a single server, and much of the weight comes from seven separate verge3d_blender_configure_* tools that could be consolidated. The breadth of the Verge3D domain (Blender authoring, app management, packaging, CDN) justifies many tools, but the surface is still borderline bloated and raises selection cost.

Completeness4/5

Coverage is broad: app CRUD and updates, settings, puzzles read/save/restore/library/plugins, full Blender scene configuration, export, glTF inspection, compression, native/SCORM packaging, CDN, and asset store. Minor gaps remain (e.g., puzzles plugin has list/read/create but no delete/update, no app rename), but nothing that blocks core workflows.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues