the game is not the hard part
A coding agent already knows the basic loop: inspect some state, choose a tool, see what changed, and try again. Give it a screenshot instead of a repository and keyboard controls instead of a shell, and it can technically play a game.
Technically is carrying a lot of weight there.
Games keep moving while models think. A half-second keypress means something different at 20 FPS and 200 FPS. A screenshot can arrive after the player has already fallen off the platform. "The command ran" does not mean "the action worked." Once an agent is allowed to remember things, one bad observation can turn into a permanent fake fact.
I have been exploring this through two setups. The first is a reusable MCP harness wrapped around six small browser games. The second is an early Minecraft agent built around persistent learning. One is a fairly strict test environment. The other is still a pile of sharp edges around an idea I like.
The useful comparison is not which game is harder. It is what each environment lets the agent claim, and how much evidence it requires before believing that claim.
pausing the world while the model thinks
I wrapped local WebGL games in a small MCP server. The game can be Unity, Godot, Three.js, or another browser runtime. The harness does not read engine state. It needs an entrypoint, a canvas selector, a ready signal, and a manifest describing the public controls.
An episode looks like this:
game_startlaunches Chromium and returns the first screenshot.- The complete Chromium process tree is paused with
SIGSTOP. - The agent studies the frozen image and chooses an action.
game_actorgame_pointerresumes Chromium, applies input for a bounded window, captures the result, and pauses it again.- The next model turn starts from that frozen result.
The pause is the important bit. Model-thinking time can take seconds or minutes, but no game time passes during it. An action duration is quantized onto a 50 ms simulation clock, and the harness tracks gameplay time separately from browser-active time, model-thinking time, and total wall time.
This is much closer to a turn-based API than normal computer use, even when the game itself is real-time. The agent still has to understand pixels and control movement, but API latency cannot quietly change the task.
The MCP surface includes named controls such as forward, jump, or fire. Key controls also get persistent _down and _up forms, so the agent can hold one input while applying another. For games that need free mouse control, game_pointer accepts a bounded batch of relative moves, clicks, button-down events, and button-up events.
Every call returns the next image as MCP image content. The agent never gets a browser handle or a path into the game files. In the actual tasks, shell and exec tools are disabled.
testing the harness on six games
To check that this was not tied to one game, I tested the same harness on six free browser games sourced from itch.io. The browser build and webgame.json manifest changed for each game. The harness did not.
I ran the experiment through Codex with gpt-5.6-sol at xhigh reasoning effort. Across the six games, the agent worked for more than an hour of wall-clock time, including the time it spent reasoning. The replays leave those pauses out and contain only the intervals when the browser was active.
Two samples from that experiment are below. Unstable Ship is a complete run. Q1K3 is one continuous spawn-to-death sequence cut from a longer run.
what these tasks actually measure
The six games are examples for a screenshot-matching task. The agent receives four public target frames and has to reach similar states in chronological order.
The rest of the MCP surface exists around that contract:
game_referenceshows one target;game_similaritycompares the latest frozen frame with it without advancing time;game_capturecommits the current frame to one of four slots;game_finishcloses the episode and writes the replay and metadata.
The graded similarity is an equal mix of perceptual hash and spatial edge layout. RGB similarity, SSIM, and SIFT geometry are reported as diagnostics, although SIFT currently has zero weight in the score. The agent can query this feedback repeatedly before committing a frame.
That makes the task measurable, but narrower than "beat the game." The harness does not infer victory or death from pixels. Its own terminal states are runtime states such as timeout or fault. A good run is one that navigates the visual world well enough to reproduce four moments.
This is why I think of the games as test fixtures for the interface. They cover different camera models and control problems, but the environment is the thing being built.
then there is Minecraft
Minecraft changes the shape of the problem. There is no short path to one target frame. A useful agent has to preserve a goal across hundreds of actions, notice causal changes, survive mistakes, and retain knowledge between sessions.
I tried two separate approaches. For the Minecraft tests, I used Inkling by Thinking Machines through OpenRouter.
The screen agent runs Minecraft Java inside Docker on a 1280×720 Xvfb display. Each turn it captures the desktop with scrot, shrinks the frame to a 640×360 JPEG, sends it to a vision model through OpenRouter, and executes the returned keyboard or mouse actions with xdotool. It has tools for walking, looking, aiming at image coordinates, mining, clicking inventory slots, selecting the hotbar, placing blocks, and writing discoveries to memory.
I gave the screen agent a finite mission: collect logs, craft a table, gather materials, build a shelter, go inside, and call complete_mission. The prompt supplies the two recipes needed to make planks and a crafting table. I originally wanted it to learn Minecraft from first principles, but the narrower mission gives the prototype an actual stopping condition.
For the other route, I used Mineflayer. It reads structured state from the Minecraft protocol: health, hunger, coordinates, inventory, nearby entities, and notable blocks. Its actions are also semantic. Pathfinder moves to coordinates, the recipe API crafts items, and block operations use exact positions.
I use that version to explore planning and memory, but it is not the same perception problem. It already knows much more than a player looking at the screen. I have not turned the Minecraft side into an MCP server yet; both implementations are standalone agent loops that call OpenRouter directly.
the idea I want to keep
The solid part is the learning loop:
- observe the current world and memory;
- form one hypothesis;
- take an action;
- measure what changed;
- record a rule only when the result supports it.
I split memory into three layers. action_history.json is short-term context, journal.jsonl is an append-only episode record, and notes.json is meant to hold durable world knowledge. I also use a separate recipe store for the Mineflayer path.
If that loop works, the agent does not need a giant walkthrough in its prompt. It can learn local rules, survive a restart, and stop retrying experiments that already have an answer.
I do not protect the fourth step well enough yet, so the fifth one falls apart.
a keypress is not an outcome
Most tools I gave the screen agent report that input was executed. mine_block, for example, holds the mouse button, steps forward, and returns collected: true. It does not inspect the next frame or inventory before making that claim. write_discovery accepts whatever lesson the model sends and saves it without attaching evidence.
The result is memory that sounds much more successful than the run.
The current journal from my testing has 1,724 entries. Many describe a frozen Ubuntu screen while the model continues to announce that wood was collected, recipes were confirmed, and stone was mined. notes.json contains 52 entries under survival_loop_completion, with repeated claims that the full loop was "permanently verified." The corresponding journal often says there was no Minecraft render.
The finite mission has the same trust problem. I intended complete_mission to be valid only after the shelter was visibly verified, but I did not add a verifier to the tool handler. In my latest saved run, the model calls it at step 64 while the state detector says MENU_SCREEN. The chat attempt is blocked because the agent is on a menu, yet the loop still records mission_complete and exits.
My recordings are less flattering and more useful:
- In the 30-second clip, the agent walks along a coastline, approaches a dirt slope, and spends the final seconds pressed against the block in front of it.
- In the 421-second clip, it starts by looking at grass, opens an almost empty inventory, acquires three dirt blocks, and ends boxed into a dirt hole. The view is effectively unchanged from about the four-minute mark through the end.
Neither recording shows the shelter mission completing. They do show that screen capture, movement, inventory interaction, and recording are connected. That is where the evidence stops.
the environments are answering different questions
| browser MCP harness | Minecraft screen agent | Minecraft protocol agent | |
|---|---|---|---|
| observation | frozen canvas screenshot | live desktop screenshot | structured protocol state |
| action | bounded keys and relative pointer events | keyboard and mouse through X11 | semantic Mineflayer operations |
| time | advances only inside tool calls | keeps moving while the model thinks | normal server time |
| reset | fresh bounded episode | persistent world and memory | persistent server and memory |
| evaluation | four externally scored frames | model declares mission complete | no task-level verifier yet |
| maturity | reusable runtime across six tasks | working prototype with visible failure modes | architectural prototype |
I use the browser harness as an instrument for short-horizon visual control. With Minecraft, I am trying to build a place where an agent can accumulate competence. That requires a stricter evidence model, not just more tools or a larger context window.
what I would change next
The visual agent needs to separate four facts that are currently collapsed:
- the harness sent an input;
- Minecraft received the input;
- the world changed;
- the change satisfied the agent's intention.
Only the last two should create durable knowledge.
In the next version, I want to compute an observation delta after every action, attach that evidence to the journal, and make memory writes cite those observations. Inventory changes need visual verification. Mission completion needs an external check instead of a self-report. Each run needs an episode contract with a seed, task, budget, stop reason, and replay, similar to the browser harness.
I can use the protocol agent without making it the policy. Mineflayer can act as a private verifier for position, inventory, and placed blocks while the agent itself continues to see only screenshots. That would preserve the visual-control problem and give the evaluation a source of truth.
The small games taught me how to freeze time, constrain input, and produce an inspectable trajectory. Minecraft exposed the next problem: an autonomous agent needs an environment that is skeptical of it. Otherwise its memory accumulates confidence instead of knowledge.