blog / mcp

A headless Scratch VM over MCP: 117 tools to build and publish Scratch projects

blessed0x · 2026-09-07 · ~6 min read · scratch-unified-mcp ↗

scratch-unified-mcp is the first standalone headless Scratch VM exposed over the Model Context Protocol — 117 tools behind one stdio command that load a .sb3, press the green flag, click sprites, step frames, read every live thread, and watch variables change. No browser attached. Everything reachable from a tool call.

There were already Scratch tool ecosystems — but each one covered a slice. One talked to the Scratch website. One edited blocks with a headless VM. One converted Python to blocks. None covered the whole loop, and switching between three servers with three naming schemes killed momentum. scratch-unified-mcp merges all three behind a single transport: python3 -m scratch_unified.

Why a headless VM is the piece that was missing

Driving Scratch through the website API only gets you so far: you can read a project and write a project, but you can't run it and see what actually happens. The piece that didn't exist anywhere else is a headless TurboWarp scratch-vm you can drive and inspect over MCP — load a project, run it, and get back an ordered timeline of what fired: say bubbles, broadcasts, questions and answers, errors.

The VM tool surface

The sb3_* family (56 tools, proxied to a lazily-spawned Node sidecar running interpreter-mode TurboWarp) is the core of it:

The gaps are patched, not hidden

Running a VM with no renderer means upstream touching always returns false, JIT mode trips false pick random alarms, and clicks never land. The project patches these instead of pretending they don't exist: a distance-based touching fallback, a sprite-click shim, broadcast logging via wrapped startHats, interpreter mode, and a seeded RNG where scratch-vm has none. Deterministic in, deterministic out.

Getting started

Point any MCP client at it:

git clone https://github.com/blessed0x/scratch-unified-mcp
cd scratch-unified-mcp && pip install -e .
# optional: clone the three upstream reference repos (see README)

// MCP client config
{ "mcpServers": { "scratch-unified": {
    "command": "python3",
    "args": ["-m", "scratch_unified"],
    "cwd": "/path/to/scratch-unified-mcp",
    "timeout": 600000
} } }

Every tool is catalogued in one place — the full per-tool reference lives in docs/IDENTIFIERS.md, so you can find the right call without reading the source.

Where this lands

Build a Scratch project, run it headlessly, read the screens, and iterate — then publish. That's the whole loop, and it's open source on github.com/blessed0x/scratch-unified-mcp. No browser in the loop, and every step is a tool call you can script.

→ blessed0x arsenal · more on GitHub