wjrosa

Game Loop MCP — AI skill for Claude Code

AI community

Let an AI agent run your game: MCP server + tiny in-game listener (Unity, Python, any engine) to launch a dev build, run commands on its main thread, wait for states, screenshot, read logs and close i.

How to install Game Loop MCP

This entry records only its repository, not the path inside it, so there is no exact command to give. Open wjrosa/game-loop-mcp and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Game Loop MCP does

Let an AI agent run your game: MCP server + tiny in-game listener (Unity, Python, any engine) to launch a dev build, run commands on its main thread, wait for states, screenshot, read logs and close it safely.

Alternatives in AI

  • Sentrux — Real-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improveme 2.9k ★
  • Session Kit — Close the terminal windows, not the AI coding sessions 649 ★
  • UnityMCP — Drive the Unity Editor from an AI agent or the terminal 346 ★

README

game-loop-mcp

Let an AI coding agent **run your game and look at it**: launch a development build, ask it questions, drive it, wait for a state, screenshot it, read its log and close it. The agent can then check its own change in the real game before handing the work back, instead of editing code and hoping.

agent ──MCP──▶ game-loop-mcp (Node, zero dependencies) ──TCP 127.0.0.1──▶ listener inside your game
                launch · exec · wait · screenshot · log · close            runs commands on the main thread

It grew out of three games we develop with [Claude Code](https://code.claude.com), two online games and a Unity game. Each had a hand-written "drive the running client" MCP server, and they turned out to be the same tool. This is that tool, made generic, with the rules those games taught us built in.

The two halves

**Inside the game, a listener.** A few hundred lines, one file:

  • runs text commands on the game's own thread, so handlers can touch game state;
  • exists only in development builds, and listens only when started with GAME_RPC=1;
  • answers help, ping (pid=, scene=, fps=...), arm, optionally shot, plus whatever commands you register: hp, inventory, teleport 10 0 5, load Level2, spawn goblin, give gold 100...

Ready-made listeners:

file notes
Unity `listeners/unity/GameLoopRpc.cs` drop into Assets/. Compiled only into the Editor and Development Builds. Built in: scene, objects, find, timescale, load, quit, and shot (game view with UI, works covered or minimised)
Python `listeners/python/gameloop_rpc.py` stdlib only. Call rpc.pump() once per frame
anything else `PROTOCOL.md` one command per line, replies end with a . line. Port it to Godot, Unreal, C++, Rust...

**Outside, the MCP server** [`server/game-loop-mcp.js`](server/game-loop-mcp.js).