Find what slows your Godot game. Fix it. Prove it.

An MCP server and CLI for coding agents. It reads your project, finds what holds the frame rate, memory and load times back, applies the fix, and checks it with a benchmark and a screenshot comparison. Every change can be undone. In CI, it fails the pull request that breaks a performance budget.

  • MIT
  • Node 20+
  • Zero dependencies
  • Godot 4.3+ (built on 4.7.2)
  • Claude Code · Codex · Cursor · VS Code · Gemini CLI
Try it, no Godot needed
# a heavy open world to try it on
npx -y github:laaielichter/godotwright-gameoptimizer demo ./world
# what holds it back, and the plan
npx -y github:laaielichter/godotwright-gameoptimizer audit ./world
# where in the world it is slow
npx -y github:laaielichter/godotwright-gameoptimizer costmap ./world

One command, a ranked list of problems

The audit reads scenes, models, textures, audio, import files, project settings, export presets, scripts and shaders. It needs no Godot and took under a second on this demo world of nearly 20 000 nodes. Every finding names its fix, or what to change by hand.

Terminal output of gameoptimizer audit: score 7/100, four high findings such as 16k identical meshes as separate nodes and 260 lights that never fade out, each with a fix command, and a plan.

Real output on gameoptimizer demo, trimmed to the headlines. The full report gives evidence per finding.

New in 0.3.0

Budgets and SARIF for CI, 50 new rules, a verdict on what bounds each frame, a floating origin and streaming for worlds built from code. It also installs as a Claude Code plugin or a Gemini CLI extension.

check

Budgets and SARIF for CI

Budgets in gameoptimizer.json, each judged pass or fail; exit code 1 on a fail. --save-baseline and --new-only let an old project adopt budgets. --sarif puts the findings on the pull request through GitHub code scanning.

audit

50 new rules

Scripts that do work every frame, audio imports, materials, screen effects, 2D, physics and navigation, load time, export presets, and rules per target hardware.

bench · compare

What bounds each frame

Every frame is split into script, physics, CPU rendering and GPU time. The bench says per station what limits the frame; compare says which part a fix moved.

fix origin

A floating origin

GOOrigin moves the world back by whole cells in one physics frame once the camera is more than 2 km from the origin. Bodies keep their velocity, streamers keep what they loaded.

GOStreamer

Streaming for worlds built from code

A generator source (register_source) asks your code for a cell's nodes on a worker thread, with the same frame budget, radii and prediction as chunk scenes.

5 new tools

For agents and pull requests

status gives the next call, history every run against the baseline, report a Markdown page for a pull request, check the budgets, unused the files nothing refers to.

Everything that changed in the CHANGELOG

How it works

The agent works in a loop: read, measure, change one thing, measure again, keep it or undo it. optimizer_status says where the loop stands and what to call next.

1 · audit

Read the project

Findings with evidence and a plan of fixes in order. No Godot needed.

2 · bench

Measure a baseline

Frame times, hitches, draw calls, memory and a screenshot per station, on a route through the predicted hotspots, and what bounds each frame.

3 · fix

Change one thing

Settings, textures, audio, lights, visibility ranges, instancing, world streaming, physics interpolation, the shader baker, a floating origin. Dry run first if you like.

4 · compare

Keep it or undo it

Better, same or worse, whether the picture changed and which part of the frame moved. undo restores every byte.

5 · check

Keep it fast

Budgets in gameoptimizer.json fail the pull request that breaks them, with the findings as SARIF for code scanning.

Tuned for the hardware you ship on

Set target in gameoptimizer.json, or pass it to audit, check and fix settings. The rules and the recommended settings follow it. The default is desktop, which adds no rules of its own.

  • desktop
  • mobile
  • web
  • steamdeck
  • vr

Mobile

The renderer phones really run, ETC2/ASTC texture import, textures larger than 2048 pixels, and meshes reached by more lights than the renderer applies.

Web

The web build runs the Compatibility renderer only, and occlusion culling does not exist there. The audit says which effects then do nothing.

Steam Deck

3D drawn at the full 1280x800 with no upscaler. GOQuality's tiers set scale and upscaler together.

VR

Temporal anti-aliasing in a headset, the renderer the XR docs recommend, and OpenXR foveation that MSAA turns off on PC.

Where is it slow? Ask the map.

You normally find out by flying around. The world cost map predicts triangles, draw calls and shadowed lights per cell from the files, finds the hotspots and writes a benchmark route through them.

  • Cells of 128 m, weighted by what is in view
  • Hotspots become benchmark stations
  • The same route is flown before and after every fix
Heat map of a 2.4 km demo world in 16 by 16 cells, hot in the town centre, with eight numbered benchmark stations connected by a dashed route. Worst view 4.8 million triangles.

Measured, not promised

Every number here comes from bench and compare on the demo world. The machine is a 4-core container without a GPU: rendering is Mesa's software Vulkan driver (llvmpipe), so milliseconds only compare with each other. Counts and memory are exact.

Before and after: station 2 of a 900 m world

The safe steps only (install settings textures lights ranges), 1280x720, Godot 4.7.2, flown on 28 November 2026. Drag the bar, or focus it and use the arrow keys.

Before: the ground and the tree crowns shimmer with a moire pattern After: mipmapped textures, the ground and the crowns are smooth
Over all 8 stationsBeforeAfterChange
Draw calls (avg)133111-16%
Objects drawn (avg)3 8043 205-16%
Texture memory (max)200 MB177 MB-11%
Video memory (max)221 MB202 MB-8%
Frame time p50 (software renderer)629 ms672 ms+7%

The tool called this run a regression, and it was right. On the software renderer the frame time went up. We have not isolated the cause; texture filtering with mipmaps, which a CPU rasterizer pays for in full, is the likely suspect (the 16x anisotropic level the settings step wrote does not apply to the demo's materials, which use the default filter). The picture changed on purpose: mipmaps end the moire on the ground and in the leaves. On a GPU, measure again and keep what wins there.

The 2.4 km world, 19 371 nodes, flown through headless

MetricBeforeAfter install, settings, textures, lights, ranges, partition
Frame time p50 (CPU side)8.19 ms1.31 ms
Frame time p9919.66 ms5.31 ms
Hitches during the flight665
Nodes in the tree (max)19 3717 877
Static memory91 MB85 MB

Not everything wins. Merging identical meshes into MultiMeshes removed nodes but cost 13% more frame time on the software renderer, so the comparison flagged it and it was undone. That is why the tool measures, and why instancing is marked optional. Measure on your own target hardware and keep what wins there.

What Godot 4 leaves to you

Godot renders beautifully, but a large world runs into the same walls every time. Each card is a problem the engine leaves to you, and what this tool does about it.

No world streaming

partition cuts a world into chunk scenes; GOStreamer loads them around the camera on a thread, within a per-frame budget.

No HLOD

Every chunk gets a stand-in scene: one MultiMesh per mesh, drawn while the chunk is not loaded, so the skyline stays.

Only a far plane

ranges sizes a visibility range from each object's own size on screen and takes tiny objects out of the shadow passes.

No texture streaming

textures sets VRAM compression and mipmaps for 3D textures: 4 to 8 times less GPU memory.

No dynamic resolution

GOQuality has five tiers (low to cinematic); GOGovernor holds a target frame rate by moving the resolution scale.

Shader compile stutter

GOPrewarm draws every material once behind the loading screen; the probe counts pipeline compilations per frame.

Lights that never switch off

lights sets a distance fade from each light's range; optional dual-paraboloid shadows.

Worlds built from code0.3

The live census runs the game, counts the real tree and names the script that built each node. GOWorldPolicy culls it at run time; a GOStreamer generator source streams the cells your code builds.

Far from the origin0.3

32-bit positions jitter from about 8 km. origin adds GOOrigin, which moves the world back by whole cells; bodies keep their velocity, streamers what they loaded.

GPU or CPU?0.3

Every bench splits the frame into script, physics, CPU rendering and GPU time and says per station what bounds it, so you fix the part that limits the frame.

Judder on 120 Hz screens0.3

The audit finds bodies and cameras moved on physics ticks without interpolation; physics turns it on and caps the catch-up steps.

Shaders compiled on first launch0.3

export turns on the shader baker (Godot 4.5+) and binary scripts in your export presets.

Regressions in pull requests0.3

check fails the CI job when a budget breaks and puts the findings on the pull request as SARIF.

Add it to your agent

The server speaks MCP over stdio. One command, no install step. Measuring needs Godot 4.3 or newer (pass godot or set GODOT); the audit, the cost map and every fix work without it. A call without a project uses GAMEOPTIMIZER_PROJECT, else the folder the server runs in.

# the plugin: the server, four skills, a subagent and /gameoptimizer:perf-check
/plugin marketplace add laaielichter/godotwright-gameoptimizer
/plugin install gameoptimizer@godotwright-gameoptimizer

# or the server alone
claude mcp add gameoptimizer -- npx -y github:laaielichter/godotwright-gameoptimizer mcp

The plugin asks for the Godot project folder and the Godot 4 binary; both are optional. Its skills: /gameoptimizer:optimize (the measured loop), /gameoptimizer:stutter (hitches and loading), /gameoptimizer:vram (memory and export size) and /gameoptimizer:ci (budgets and SARIF), plus the game-optimizer subagent. The plugin's README.

On Windows, if npx does not start from the client: "command": "cmd", "args": ["/c", "npx", "-y", ...]. Over MCP the server also offers resources and five prompts: optimize, fix-stutter, reduce-vram, optimize-for-mobile, ci-budget.

16 tools

Every tool is both an MCP tool and a CLI command with --json. Run gameoptimizer tools for their input schemas.

ToolCLIWhat it does
Read the project (no Godot needed)
optimizer_auditauditFindings with evidence and the plan, for desktop, mobile, web, Steam Deck or VR.
optimizer_costmapcostmapPredicted cost per world cell, hotspots, a benchmark route.
optimizer_texturestexturesGPU memory per texture, largest first.
optimizer_unused0.3unusedFiles nothing refers to, by folder and size. Read-only.
optimizer_explainexplainWhy a finding costs performance and how the fix works.
Change it
optimizer_fixfix <name>install, policy, settings, textures, physics, export, origin, audio, lods, lights, ranges, instancing, partition.
optimizer_undoundoTakes a fix back; restores every byte. Refuses to overwrite files edited since, unless forced.
optimizer_demodemoWrites the heavy open-world demo project.
Measure it (Godot 4.3+)
optimizer_benchbenchPercentiles, hitches with cause, monitors, draw calls per pass, screenshots, what bounds the frame.
optimizer_comparecomparePer metric, per station, per screenshot, and which part of the frame moved. Exit code 1 on a regression.
optimizer_censuscensusRuns a scene (or a .pck), counts the live tree, names the script that built it.
optimizer_importimportGodot's import, also on machines without a GPU.
Agents and pull requests
optimizer_status0.3statusWhere the loop stands, and the next call, ready to make.
optimizer_history0.3historyEvery benchmark run, oldest first, against the baseline.
optimizer_check0.3checkBudgets for CI, a findings baseline, SARIF. Exit code 1 on a fail.
optimizer_report0.3reportOne Markdown page for a pull request; --write saves it.

In CI

Budgets live in gameoptimizer.json next to project.godot. Static budgets need no Godot; measured ones read the last benchmark and are skipped without one, never passed (--require-measured makes them fail). A mistake in the file is an error, exit code 2, never a silent default.

gameoptimizer.json

{
  "$schema": "https://raw.githubusercontent.com/laaielichter/godotwright-gameoptimizer/main/gameoptimizer.schema.json",
  "target": "desktop",
  "ignore": [{ "id": "world/no-occluders", "reason": "indoor levels only" }],
  "budgets": { "score_min": 60, "high_max": 0, "texture_vram_mb_max": 1500, "frame_ms_p99_max": 20 }
}

The workflow step

# .github/workflows/performance.yml,
# after checkout and setup-node
- run: npx -y github:laaielichter/godotwright-gameoptimizer check . --new-only --sarif gameoptimizer.sarif
- uses: github/codeql-action/upload-sarif@v4
  if: always()
  with:
    sarif_file: gameoptimizer.sarif
  • check --save-baseline writes gameoptimizer.baseline.json to commit; --new-only then fails only on new findings. Drop --new-only until a baseline is committed.
  • --sarif writes SARIF 2.1.0 with paths from the git repository root, so a Godot project in a subfolder works. The upload step needs security-events: write.
  • Exit code 0: every budget passed. 1: a budget failed. 2: an error in the input or in gameoptimizer.json.

The whole workflow and every budget in the README

Use it with Godotwright

Godotwright is the coding toolkit for Godot agents: the real Godot 4.7 API offline, a scored review of every script that catches Godot 3 habits, scenes that merge in git, and bisect to find the commit that broke it.

Godotwright makes sure what the agent writes is right. The Game Optimizer makes sure it runs well. Both are MCP servers, so one agent uses both: review until the scripts are clean, then audit, measure, fix and compare.

claude mcp add godotwright -- npx -y godotwright mcp

claude mcp add gameoptimizer -- npx -y github:laaielichter/godotwright-gameoptimizer mcp

Limits

  • The audit reads text scenes and resources (.tscn, .tres) and glTF. Binary .scn and .res are counted but not opened.
  • A world built entirely from code has no scene to partition: census, fix policy and a GOStreamer generator source help, the rest is a change in that code.
  • Occluders are not baked for you; the audit says when they are missing.
  • Measuring (bench, census, import, measured budgets) needs Godot 4.3+. The shader baker bakes when you export from the editor.
  • Without a GPU, frame times come from a software renderer and only compare with each other; the bench then says the bound is unknown.

All limits in the README

Make your Godot game faster, and know it is

Add the server to your agent and ask it to optimize your project. Or run the audit yourself first: it needs no Godot and changes nothing.