TutorialStefan VaskevichStefan Vaskevich

Local LLM + Unreal Engine 5.8 MCP: A Free AI Builds a Complete Game

No cloud, no API key, $0.00 per task: Qwen3.6-27B served by llama.cpp, wired into UE 5.8's native MCP through Cline, builds a playable game in 17 prompts.

Last time, Claude built a world inside Unreal Engine 5.8 through the new native MCP - and the top comment under that video was, by far: “Okay, but can you do this with a local, free, open-source AI?” Fair question. Claude is brilliant, right up until you look at the bill.

So this time: no cloud, no API key, no subscription. Qwen3.6-27B - 27 billion parameters, about seventeen gigabytes sitting on one consumer GPU - wired straight into the live Unreal Editor through the same native MCP. Seventeen prompts, and every single one is a fresh chat: the model remembers nothing between steps. Thinking mode is off. And every task in the Cline history ends with the same number in the corner: $0.00.

The stack in one line
Qwen3.6-27B (open weights, served locally by llama.cpp) + Cline in VS Code as the agent harness + Unreal Engine 5.8’s native MCP server driving the live editor. Total API cost for the whole game: $0.00. (GPU sold separately.)
BurgerTower gameplay in Unreal Engine 5.8: the food tower climbing at 8,902 meters on a PERFECT! x26 streak, with the giant mouth waiting at the top of the panorama - built entirely by a local LLM
The end result: an x26 perfect streak at 8,902 meters, climbing toward the giant's open mouth at the top of the backdrop. Every Blueprint, widget, and effect behind this frame was authored by a 17 GB local model.

The real question was never “can it open the editor.” It was whether a local model can survive a real project: author the Blueprints, build a 28-widget HUD, wire an input system, and hunt down its own bug in the engine’s guts - or fall apart on the first tool call. As far as we can tell, nobody had published a successful local-LLM build through UE’s native MCP before this one; the only public attempt we found ended in failure on launch day. Here is the exact setup, what it built, and the honest verdict.

1. The model: Qwen3.6-27B, and the hardware it actually needs

The pick is Qwen3.6-27B - a dense open-weights model that currently sits near the top of the agentic-coding benchmarks among open models, with tool-calling improvements baked into this generation. The exact build used here is the unsloth GGUF repo with the UD-Q4_K_XL quant (UD = Unsloth Dynamic) - roughly 17 GB of weights.

Benchmark charts comparing Qwen3.6-27B against other open-source models and Claude across SWE-bench, Terminal-Bench, and agentic coding tests
Why this model: Qwen3.6-27B leads the dense open-source pack on agentic coding benchmarks - the exact skill an editor-driving agent needs.
Hardware reality check
The 17 GB quant plus a 40k-token KV cache wants a 24 GB GPU - an RTX 3090, 4090, or 5090 all clear it - or an Apple Silicon Mac with 32 GB+ unified memory. Less VRAM? Drop the context size or pick a smaller quant from the same repo; the setup below stays identical. To be precise about the claim: the API bill is $0.00 - the model is open-weights, the tooling is open source, and Unreal is free to install (Epic’s standard royalty terms apply to shipped games).

2. Serve it locally with llama.cpp (the flags are the whole game)

Install llama.cpp with one command - on Windows that is winget install llama.cpp - and launch the server. The -hf flag pulls the exact quant straight from Hugging Face on first run, so there is no separate download step:

winget install llama.cpp   # macOS/Linux: curl -LsSf https://llama.app/install.sh | sh

llama serve -hf unsloth/Qwen3.6-27B-GGUF:UD-Q4_K_XL -a Qwen3.6-27B \
  --host 127.0.0.1 --port 1235 \
  -ngl 99 -fa on -c 40960 \
  --cache-type-k q8_0 --cache-type-v q8_0 \
  --jinja --reasoning off \
  --temp 0.7 --top-p 0.80 --top-k 20 --min-p 0.0 \
  --presence-penalty 1.5 --repeat-penalty 1.0

What each block is doing, because every one of them earned its place:

Performance flags
-ngl 99 puts every layer on the GPU (99 just means “all of them”). -fa on enables flash attention. -c 40960 is Qwen3’s native context maximum - lower it if VRAM is tight. The q8_0 K/V cache flags compress the attention cache to 8 bits: memory nearly halves, quality barely moves.
Agent flags
-a Qwen3.6-27B names the model in the API - the exact string you will type into Cline later. --reasoning off disables thinking mode: an agent loop needs one fast tool call per turn, not a monologue - lower latency, no wasted tokens.
Qwen’s official no-think sampling preset
Temp 0.7 (Qwen explicitly warns against zero - greedy decoding drives the model into repetition loops), top-p 0.80, top-k 20, min-p 0.0 (some frontends default it non-zero and break output), presence-penalty 1.5 straight from the model card - and --repeat-penalty 1.0, which means off. llama.cpp defaults it to 1.1, and that old-style penalty actively hurts Qwen.
The one flag that makes or breaks everything: --jinja
--jinja forces llama.cpp to use the model’s native chat template. Without it the server cannot parse the tags Qwen uses to format tool calls - and Cline will never see a single tool call. The model looks alive, chats happily, and does absolutely nothing to your editor. If your local agent “talks but never acts,” this flag is the first thing to check.
Windows PowerShell running llama serve with the full flag set: Qwen3.6-27B downloads from Hugging Face, loads, and listens on 127.0.0.1:1235
One command in PowerShell: llama.cpp pulls the 17 GB quant from Hugging Face, loads it onto the GPU, and starts listening on 127.0.0.1:1235.

3. Point Cline at your own server

Cline is the agent harness - a free, open-source VS Code extension. llama-server exposes an OpenAI-compatible endpoint, so Cline talks to your GPU exactly as if it were a cloud API:

1

API Configuration

Provider OpenAI Compatible; Base URL http://127.0.0.1:1235/v1 (the /v1 path is mandatory); Model Qwen3.6-27B - must match the -a flag exactly; API Key - any non-empty string (the server never checks it, but Cline requires the field). Context Window 40960, kept in sync with the server. Reasoning Effort None, matching --reasoning off.

2

Features that matter for an Unreal agent

Native Tool Call ON - use the model’s real tool-calling format instead of prompt hacks. Parallel Tool Calling OFF - you cannot work the Unreal Editor in parallel anyway; it is one operation at a time. Auto Compact OFF - one chat is one task here, so there is never a long history to compress.

3

Yolo Mode ON (optional, but this is the point)

Yolo Mode auto-approves every tool call - the local equivalent of bypass-permissions. With a cloud agent every “proceed?” costs you attention and money; here the model is yours, so let it run.

Cline API Configuration in VS Code: OpenAI Compatible provider, Base URL http://127.0.0.1:1235/v1, Model Qwen3.6-27B, Context Window 40960
The whole cloud replacement is one settings page: OpenAI Compatible provider, your localhost URL, and the model name matching the -a flag.

4. Bridge it into Unreal Engine 5.8

The Unreal side is the same native MCP server we covered in the previous chapter - enable the plugin, turn on Auto Start Server, and the editor listens on http://127.0.0.1:8000/mcp. (The MCP plugin is still marked Experimental, and it shows sometimes - more on that below.) The only new piece is telling Cline about it, in cline_mcp_settings.json:

{
  "mcpServers": {
    "unreal-mcp": {
      "type": "streamableHttp",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

First task, in a fresh chat: “check mcp connection to unreal engine.” The very first execute_python_code call failed with an AttributeError - a bad Python API call. And this was the first genuinely encouraging moment: the model read the traceback, concluded on its own that the connection was fine and only its code was wrong, and retried with corrected code. Eight milliseconds later: “MCP connection to Unreal Engine: SUCCESSFUL.”

Cline in VS Code next to the empty BurgerStudio level in Unreal Engine 5.8, with the MCP connection check task and $0.00 cost labels on every task
The chain confirmed: Qwen (localhost:1235) - Cline - MCP (localhost:8000) - live Unreal Editor. Note the running gag in the task list: every task ends at $0.00.
Download the project rules file (the real time-saver)

A local model with no memory between tasks lives or dies by its rules file. This one - BurgerTower_SystemPrompt.md - carries the project conventions, the editor-API notes, the compile discipline, and the engine traps that would otherwise eat a prompt each (floats must be declared as type real or they silently become ints; one system per tool call; compile twice to clear the default-value warning). Drop it into your project and adapt.

5. The stress test: a complete game in 17 prompts

The project is BurgerTower - a one-button arcade stacker. A piece of food swings over a growing tower; tap to drop it. Clean landing scores a bonus and a splash of meat juice; a leaning tower topples and ends the run. Every floor climbs the camera higher - city, clouds, stratosphere, space. The project ships art only: eight food meshes, a panorama texture, an empty studio map. Every Blueprint, graph, widget, input asset, material, and effect is the model’s to author, live in the editor, through Python.

The assets came from Tripo (the art is not the AI agent's job)
The eight ingredient meshes - sesame bun, beef patty, tomato, lettuce, donut, blueberry waffle, pancake stack, pepperoni pizza - were generated in Tripo from images, HD mode, with a poly budget per piece. Tripo currently tops the top3d.ai leaderboard - and this split of labor is the pattern that works: a generation tool makes the art, the agent builds the systems around it.
Tripo asset manager showing the generated food meshes: lettuce, tomato slice, donut, buns, pizza, pancake stack, and blueberry waffles
The entire art budget of the game: eight food meshes out of Tripo. Everything else in BurgerTower is authored by the local model in code.

And one rule that makes this a real benchmark rather than a demo: every prompt is a brand-new Cline task with a clean context. The model remembers nothing between steps - the prompts themselves carry the continuity, like commissions handed to a contractor who wakes up with amnesia every morning. Seventeen commissions total.

Prompts 1-6: the whole skeleton, without pressing Play once

The first six prompts build every part separately and verify by compilation only: the falling-piece actor with its physics profile and mesh pool (the mesh must BE the root component - physics simulates the root, and a mesh hanging under an empty root tears off the moment physics wakes); its event graph, where a triple-filtered Hit event turns a physics touch into exactly one “I landed” signal; a Niagara burst duplicated from an engine template; the camera pawn with 19 state variables; and the HUD.

The first prompt pasted into Cline: create BP_Ingredient with a StaticMeshComponent root, PhysicsActor profile, bLanded and MeshPool variables - next to the empty Unreal project
Prompt 1 of 17, in a fresh chat: the falling-piece actor, specified down to why the mesh must be the root. Auto-approve: YOLO.

The HUD deserves its own sentence: 28 widgets - score card, a gold BEST pill, PERFECT!/COMBO callouts, an altitude gauge with CITY/CLOUDS/STRATOSPHERE/SPACE marks, and a full death screen with a RETRY button - laid out, anchored, colored, and styled entirely in code, in two tool calls, without a single click in the UMG designer. The second call was one continuous code block the local model streamed for about two and a half minutes. It compiled clean.

Prompts 7-13: wiring it together, first Play, first game over

Episode two connects the parts in dependency order: the landing receiver on the pawn first, then the Tick heartbeat (swing sine, smooth camera climb, per-frame HUD updates, a physics-driven fail check), Enhanced Input assets, the BeginPlay bootstrap, and the game mode - including the subtle trap that after setting the default pawn the game mode must be recompiled, or Play keeps spawning the engine’s stock pawn. The model recompiled and read the value back to verify. First Play of the entire series comes only after prompt 11: pawn spawns, HUD comes up at zero, a piece swings over the base bun.

The first Play-In-Editor smoke run: SCORE 0, HEIGHT 0 m, the altitude gauge with SPACE/STRATOSPHERE/CLOUDS marks, and a swinging bun over the tower base
The first time Play is pressed - after 11 prompts of pure construction. HUD at zero, altitude gauge in place, one bun swinging on its sine.

Prompt 12 is the drop button - judge the perfect at the moment of the press, wake the piece’s physics, ratchet the camera, spawn the next piece - and the biggest code block of the series: about three minutes of streaming, then three and a half minutes of the engine compiling the graph. Mid-task, the MCP endpoint dropped the session; Cline resent the exact same call by itself and the build continued. Delivery failures like this happened three times across the project, and the agent self-healed every one on camera. Then: Play, first drop, a “PERFECT! x4” streak, a leaning tower, a topple at 5,316 meters, GAME OVER, RETRY - the entire game loop works. Prompt 13 is the classic feel pass: widen the swing, speed it up, open the FOV from 70 to 80.

BP_BurgerPawn opened in the Blueprint editor: EventGraph with BeginPlay, Tick, and OnPieceLanded events plus 19 typed variables, all authored through Python
What the model actually wrote: BP_BurgerPawn's event graph and its 19-variable state block, inspected after the fact. Built through BlueprintService calls, not clicks.

Prompts 14-15: a shader built from a formula, then the release pass

Prompt 14 is the flex: build the backdrop material in code - about 18 material nodes via MaterialEditingLibrary - mapping a tall panorama texture in screen space, with the visible window sliding upward in sync with the camera climb. Pure shader math, dictated as a formula in the prompt, transcribed into node wiring by the model. This task also produced the only real snag of the series: a response was lost in transit, the retry collided with the asset the first call had already created, and Unreal threw overwrite dialogs. The model did not loop - it concluded the material existed and moved on to part two. Prompt 15 is the release pass: connect the one exec wire that had been deliberately left unwired since prompt 7 (the perfect-hit burst, parked behind its gate), recolor the effect meat-juice brown, and run a roll call - eight assets, all compiling clean.

The release-pass verification run: the tower at 469 meters against the cloud panorama, with Cline's task summary reporting every asset compiles clean
Release pass: the parked burst is wired in, all eight assets report BS_UP_TO_DATE, and the panorama backdrop pans with the climb - authored as ~18 material nodes from a formula.

Prompt 16: the real bug - and the moment that answers the title

After the release pass, the perfect splash still rendered white in game - even though the tool reports were green and the color values were verifiably in the asset. Prompt 16 hands the model the mystery: figure out why the color never reached the screen. The diagnosis it produced is the single smartest moment of the project: Niagara compiles systems in the background, and the game had been playing the old compiled copy of the effect all along. Its fix: re-set the color on all three emitters, save, and force a rebuild by opening the system in the editor. Next Play: two perfects, dark-brown splashes with sparks. That is not pattern-matching a tutorial - that is reasoning about the engine’s asset pipeline.

Prompt 17 is dessert: import a new panorama - a giant chomping head over a burger city - and repoint the material’s sampler at it. One import, one repoint; the pan math lives in scalar parameters that never touch the texture, so the backdrop swapped live in the viewport, mid-session.

The art swap task in Cline: the new chomping-head panorama texture applied to the backdrop material, visible live in the Unreal viewport behind the tower base
Prompt 17: one import and one sampler repoint, and the new sky is live in the viewport - material recompiles are synchronous. Every task in the sidebar: $0.00.

6. The honest verdict

Where it shone, and where it fought back
  • It survived a real project. Seventeen fresh-context prompts, every system compiling clean, one genuine engine-level bug diagnosed and fixed. The skeleton of the game was built without pressing Play once.
  • It is slower than a cloud frontier model. The big code blocks stream for two to three minutes on a single consumer GPU, and the heaviest graph took another ~3.4 minutes of engine compile time. Budget a calm evening, not a lunch break.
  • The harness does real work. Cline resent dropped MCP calls three times; the model recovered from its own bad API call and from an asset-collision retry. Expect the Experimental-grade MCP endpoint to hiccup - and expect the loop to absorb it.
  • The prompts carry the intelligence you are not paying for. Precise, one-system-at-a-time briefs plus a rules file are what make a no-memory local model act senior. Vague prompts will not survive contact.
  • Does it replace Claude? For a structured build like this - genuinely, at $0.00 in API costs, it did the job. For messy, open-ended work, a frontier model still buys you slack that a 27B local model does not have. Pick per project, not per ideology.
BurgerTower final gameplay: PERFECT! x22 combo at 6,910 meters, score 133, food tower climbing through the cartoon sky
The final demo: x22 perfect streak at ~7 km and climbing. The best run topped out at 17,736 meters - past the 15,000 m SPACE mark. 17 prompts, ~17 GB of model, 17.7 km of burger.

And yes, the numerology checks out: 17 prompts, a ~17 GB model, and a final tower 17.7 kilometers tall - past the edge of space, inside a giant’s open mouth, with a proper game over screen. Every step of it billed at $0.00.

What you actually get

A $0.00-per-task agent stack
llama.cpp serving Qwen3.6-27B on your GPU, Cline as the harness, UE 5.8’s native MCP as the hands - no API key anywhere in the chain.
A flag set that actually works
--jinja for tool calls, --reasoning off for the agent loop, Qwen’s official sampling preset, and the repeat-penalty gotcha neutralized.
A complete, playable game
Physics stacking, perfect-hit combos, a 28-widget HUD, procedural backdrop, effects, input, and a game over screen - in 17 fresh-context prompts.
Proof it can debug the engine
The stale-Niagara-compile diagnosis is the moment a local model stopped looking like a toy - it reasoned about the asset pipeline and forced the rebuild.

That is the whole pipeline: one llama.cpp command, one Cline settings page, one MCP entry - and a local model driving the same editor the cloud agents drive. The generation tools that feed projects like this keep changing; when new ones land, they go straight into the Arena so you can compare them blind before committing. For the earlier chapters of this story, see Unreal Engine 5.8 Native MCP + Claude and Claude Code + Unreal Engine 5.

Watch the full build

The whole setup and all 17 prompts, start to finish, on YouTube.

Want to compare these tools yourself?

Local LLM + Unreal Engine 5.8 MCP: A Free AI Builds a Complete Game | Top 3D AI