webgl-lighthouse-mcp
Profiles any WebGL/WebGL2 scene by URL with zero app code changes, returning estimated GPU VRAM (textures, buffers, MSAA renderbuffers), uncompressed 4K texture bloat with KTX2/Basis savings estimates, per-frame draw-call/instanced-draw/triangle counts, median and 1% low FPS, and synchronous shader compile/link stall time; supports budget checks, baseline-vs-candidate comparisons, and optional synthetic camera orbit.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
webgl-lighthouse
Give AI coding agents (Claude Code, Cursor, Antigravity) eyes into WebGL VRAM, draw calls, and 4K texture bloat.
AI agents can write Three.js / React Three Fiber / Babylon.js / Cesium code and even inspect screenshots, yet they are completely blind to GPU state: they have no idea they just allocated 250 MB of VRAM with an uncompressed 4K PNG or broke instancing and jumped from 20 to 500 draw calls.
webgl-lighthouse is a zero-code-change WebGL / WebGL2 profiler (built on greggman/webgl-memory-style byte accounting injected via Playwright addInitScript) packaged as an MCP Server, CLI, and GitHub Action.
MCP Server Setup (Cursor / Claude Code / Claude Desktop)
Add to your MCP config (~/.cursor/mcp.json, claude_desktop_config.json, or Claude Code MCP settings):
{
"mcpServers": {
"webgl-lighthouse": {
"command": "npx",
"args": ["-y", "-p", "webgl-lighthouse", "webgl-lighthouse-mcp"]
}
}
}Or run directly from GitHub before npm install:
{
"mcpServers": {
"webgl-lighthouse": {
"command": "npx",
"args": ["-y", "-p", "github:damonphilipross/webgl-lighthouse", "webgl-lighthouse-mcp"]
}
}
}Exposed MCP Tools
profile_webgl_scene(url, budget_vram_mb?, budget_draw_calls?, budget_triangles?, budget_bloated_textures?, orbit_camera?)Profiles any local dev server (http://localhost:5173) or live URL with zero changes to your app. Returns a Markdown summary + structured JSON with:Estimated GPU VRAM (MB) split by textures (per-level
generateMipmapchains +compressedTexImage2DKTX2/Basis byte sizes), buffers, and MSAA renderbuffers.Uncompressed Texture Bloat Detector: Flags non-compressed 8-bit color textures
> 1024px(ignores depth/float render targets) with estimated KTX2/Basis VRAM savings and source URLs when available.Per-frame draw metrics: Median & peak draw calls, instanced draws (
drawArraysInstanced,drawElementsInstanced,ANGLE_instanced_arrays), triangles, vertices, and median / 1% low FPS.Shader compile stalls:
compileShader,linkProgram, and synchronousCOMPILE_STATUS/LINK_STATUSstall time in ms.
compare_webgl_scenes(baseline_url, candidate_url)Profiles two URLs and returnsbefore -> afterVRAM, draw-call, triangle, shader-stall, and newly introduced bloated texture deltas so the agent can verify that its optimization actually worked.
Related MCP server: threejs-devtools-mcp
Real-World Output (Zero App Code Changes)
Engine / Public Demo | Total VRAM | Draw Calls / Frame | Triangles / Frame | Notable Finding |
Three.js Littlest Tokyo ( | 117.65 MB | 79 | 142,381 | Caught 1x |
Three.js Car Configurator ( | 82.33 MB | 103 | 708,626 | 45.70 MB renderbuffers, 22.21 MB textures |
CesiumJS Sandcastle ( | 103.89 MB | 13 | 134,514 | 43 textures (74.71 MB), 39.0 ms sync shader stall |
Babylon.js Playground ( | 0.10 MB | 2 | 4,626 | 59.9 FPS median, 2.7 ms sync shader stall |
CLI Usage
# Profile a local dev server or public URL with budgets (exits non-zero on violation)
npx webgl-lighthouse http://localhost:5173 --budget-vram 150 --budget-calls 150
# Compare a PR preview against a baseline URL
npx webgl-lighthouse https://pr-42.preview.example.com \
--compare https://prod.example.com \
--budget-vram 150 \
--markdownFlag | Description |
| Exit non-zero if total estimated GPU VRAM exceeds |
| Exit non-zero if median draw calls/frame exceeds |
| Exit non-zero if median triangles/frame exceeds |
| Exit non-zero if shader compile/link stall exceeds |
| Exit non-zero if uncompressed color textures >1024px exceeds |
| Exit non-zero if median FPS drops below |
| Profile baseline URL and output PR delta table |
| Perform a synthetic mouse orbit drag on the canvas |
| Wait after load before sampling (default: |
| Steady-state sampling window (default: |
| Output JSON or GitHub PR Markdown |
GitHub Action
Runs on standard Ubuntu runners or GitHub's native NVIDIA T4 GPU runners and posts a sticky PR comment with before -> after deltas:
name: WebGL Budget
on: [pull_request]
jobs:
webgl-lighthouse:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: damonphilipross/webgl-lighthouse@main
with:
url: ${{ env.PREVIEW_URL }}
baseline-url: https://prod.example.com
budget-vram: 150
budget-calls: 150
budget-bloated: 0Experimental: 2 KB Production RUM Prototype (rum/webgl-rum.ts)
Also includes an experimental ~2 KB browser beacon (rum/webgl-rum.ts) for capturing real-user UNMASKED_RENDERER_WEBGL, 1% low FPS, webglcontextlost, live texture VRAM, and suspected iOS Safari Jetsam OOM tab kills (heartbeat without clean pagehide).
Credits & License
Byte-accounting formulas and WebGL2 prototype-wrapping approach are inspired by Gregg Tavares's webgl-memory.
MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Website checker for AI coding agents. Measures your site in a real browser, with evidence.
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
Find UI bugs, verify fixes and run tests on your web app from your AI coding agent.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to drive Chrome/Chromium to capture live WebGPU frames, profile performance, inspect shaders, buffers, and textures, and diagnose rendering issues.21MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect and edit live 3D scenes, materials, shaders, and lights in the browser without touching project code, then turn any previewed change into ready-to-paste source. Also provides performance and mobile audits, video frame capture, and Playwright helpers.6,808 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect and modify Three.js scenes live in the browser—objects, materials, shaders, textures, animation, lights and performance—then turn those previewed changes into code. Also supports website audits, video frame capture with Playwright and Puppeteer.6,808 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect and tweak live 3D scenes in the browser — objects, materials, shaders, textures, lights, animation, performance and memory — with zero changes to your project, then convert previewed edits into ready-to-paste vanilla Three.js or React Three Fiber code. It also supports website performance audits, video frame capture, an in-browser devtools overlay, and Playwright/Puppeteer workflows.6,808 npmMIT