MCP server for interactively playing PICO-8 carts

MCP server for interactively playing PICO-8 carts

pico8-mcp•bysmartfrog

An MCP server that drives a headless PICO-8 binary in lockstep so an LLM can press buttons, advance frames deterministically, capture pixel-perfect screenshots, and read cart variables.

License: Not specified•Runtime: Awaiting documentation review•Category: ai agents-models

WHAT IT DOES

  • •Boots a cart under lockstep control with game time frozen until stepped, with an optional seed for deterministic rnd().
  • •Holds buttons and advances a specified number of frames, returning a screenshot.
  • •Captures pixel-perfect PNG screenshots of the current frame at adjustable scale, and reads Lua globals by dotted path.
  • •Supports multiple concurrent sessions, session reset from the original file, and a scripted multi-step play call.

BEST FOR

  • •LLM agents and automated testing that need to drive a real PICO-8 game deterministically frame by frame.
  • •Inspecting PICO-8 game state and RAM during playthroughs via global reads and hex dumps.
  • •Watching an LLM play in real time through a local web viewer that streams the game screen.

ABOUT PICO8-MCP

MCP server for interactively playing PICO-8 carts is cataloged as an MCP server attributed to smartfrog. An MCP server that drives a headless PICO-8 binary in lockstep so an LLM can press buttons, advance frames deterministically, capture pixel-perfect screenshots, and read cart variables. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP server for interactively playing PICO-8 carts are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can multiple PICO-8 sessions run at once?

Yes; multiple sessions can run side by side, and session_id defaults to the most recent live one.

How are buttons handled between steps?

Buttons stay held between steps, and btnp() fires only on the first frame of a new press.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 871fa449ddfd · 采集于 2026-11-13 11:22:00 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

pico8-mcp

MCP server that lets an LLM play PICO-8 carts interactively: press buttons, advance frames deterministically, look at pixel-perfect screenshots, and read game variables — against the real PICO-8 binary, headless.

How it works

LLM ⇄ MCP (stdio) ⇄ pico8-mcp ⇄ pipes ⇄ pico8 -x cart_instrumented.p8
  • The cart is copied to /tmp/pico8-mcp/<session>/ and a small Lua harness is injected at the end of its __lua__ section (the original file is never touched). The harness shadows btn/btnp and replaces _update/_update60 with a command loop.
  • Input rides on PICO-8's serial(0x804, …) stdin channel. On desktop PICO-8 (0.2.7) this read has fread semantics: it blocks until exactly len bytes arrive. The driver therefore speaks fixed-size 8-byte packets (<op:1><a:3 hex><b:3 hex>\n), which freezes the engine between commands and gives perfect lockstep — batched frames run at host speed (~600 game frames in <30 ms), not real time.
  • Output rides on printh (text lines prefixed @) and serial(0x805, …) (raw binary: framebuffer + palette dumps), rendered server-side to PNG.

Requirements

  • pico8 on PATH (or PICO8_BIN=/path/to/pico8), version 0.2.x
  • Node.js ≥ 18
  • Carts must use _update/_update60 and read input via btn/btnp (standard carts do; custom flip() main loops are not supported)

Install

npm install && npm run build

opencode config (opencode.json):

{
  "mcp": {
    "pico8": {
      "type": "local",
      "command": ["node", "/path/to/pico8-mcp/dist/index.js"]
    }
  }
}

Claude Desktop and any other MCP host: same command, stdio transport.

Tools

ToolPurpose
pico8_bootStart a cart under lockstep control (game time frozen until you step). Optional seed for deterministic rnd().
pico8_stepHold buttons (left/right/up/down/o/x), advance N frames, get a screenshot.
pico8_playScripted sequence of {buttons, frames} steps in one call.
pico8_screenPixel-perfect PNG of the current frame (scale 1–4).
pico8_readRead Lua globals by dotted path (player.x, objects.1.type…).
pico8_peekHex dump of PICO-8 RAM (0x6000 framebuffer, 0x2000 map…).
pico8_resetKill + restart from the original file (picks up cart edits).
pico8_shutdown / pico8_sessionsLifecycle / listing.
pico8_boot_checkRun the unmodified cart with pico8 -x for N seconds and report boot errors (benchmark-style check).

Multiple sessions can run side by side; session_id defaults to the most recent live one.

Live viewer

The server hosts a small local web page so you can watch the LLM play in real time: open http://127.0.0.1:7864/ in a browser. It shows the game screen (streamed over SSE), the buttons currently held, and a log of every tool call plus the cart's printh output.

pico8-mcp live viewer

  • While a browser tab is connected, batched steps are split into small chunks (default 15 frames) with a screen grab after each, so long pico8_step calls play back like a fast-forward video. With no viewer connected there is zero overhead.
  • Playback runs at the LLM's pace (usually much faster than real time).

Env knobs:

VariableDefaultEffect
PICO8_MCP_VIEWER1set to 0 to disable the viewer entirely
PICO8_MCP_VIEWER_PORT7864listen port (binds 127.0.0.1 only)
PICO8_MCP_VIEWER_CHUNK15frames per intermediate screen grab while spectating

If the port is already in use (e.g. a second MCP host), the viewer is disabled with a warning on stderr and the server keeps working normally.

Semantics worth knowing

  • Buttons stay held between steps; btnp() fires on the first frame of a new press only. To tap twice: step with the button, step with buttons: [], step with the button again.
  • Screenshots are taken post-_draw of the last stepped frame.
  • A runtime error in the cart kills the -x process; the error text is surfaced in the tool result. pico8_reset starts over.
  • The harness uses GPIO memory (0x5f80–0x5fff) as its packet buffer and overrides btn/btnp globals — carts that use GPIO themselves or cache local btn=btn before the harness loads will misbehave.

Development

  • npm run build then node test/mcp-probe.mjs [cart.p8] runs an end-to-end probe through a real MCP client (boot → play → read → shutdown).
  • PICO8_BIN selects an alternative PICO-8 binary.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP server for interactively playing PICO-8 carts from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/pico8-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related ai agents-models MCP Servers

Alternative and complementary servers in the same category

View all in ai agents-models →
Knowledge Graph Memory
@modelcontextprotocol/server-memory•Model Context Protocol

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

create_entitiescreate_relationsadd_observations+6 more
92K
AI & Multi-Agent
Sequential Thinking
@modelcontextprotocol/server-sequential-thinking•Model Context Protocol

Organize problem solving into revisable, branching thought steps through an MCP tool.

sequential_thinking
92K
AI & Multi-Agent

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.

146
AI & Multi-Agent