pyxel-mcp
Let AI agents play, watch, and measure Pyxel games. pyxel-mcp is an MCP server that runs a Pyxel script headlessly, feeds it scheduled input, stops when a condition holds, and hands back the facts: screenshots, pixel grids, game state, assets, audio, and frame diffs.
Both images come from one run call against Pyxel's bundled 10_platformer.py: 150 frames, right held from frame 0, jumps scheduled at frames 25, 70, and 110, a video snapshot, and an inline screen_image snapshot.
Why
An agent can write a Pyxel game in seconds, but it cannot open a window, press the arrow keys, or look at the screen. Editor-bound engines solve this with MCP servers that live inside the editor. Pyxel has no editor process to attach to, so pyxel-mcp drives the game itself:
- Headless execution. Every call runs the script in a fresh subprocess with SDL dummy drivers and a frame budget. Set
random_seedto seed Python'srandommodule and Pyxel's random generator. Other randomness, timing, and external state can still affect the frames. - Input as data. Buttons, axes, and mouse position are scheduled per frame, so a playtest is a JSON document the agent can rerun and extend.
- Stop on the event, not the clock.
until="score >= 1"ends the run at the first frame where a game attribute holds, and"frame": "end"snapshots capture that moment. - Facts, not scores. Tools report pixels, values, and measurements. Deciding whether the game is good stays with the agent and the person asking for it.
- See the frame in the result.
inline: truereturns a PNG as MCP image content, so the model looks at the screen without a second file read.






