Docs/MCP reference

game_publish

Write

Publish a game build as a new preview of the project.

POST/api/agent/game/publish

Behavior

Publish a game build as a new preview of the project. Over the stdio server give dir: an absolute local directory holding index.html (or a folder that contains it); the files are uploaded straight to the games worker with a signed ticket and checked there. Over the remote MCP give files inline (text, or base64 with encoding; small builds only), or use game_upload_ticket (its upload_url, or its command when it returns one).

Run game_check first. Either way the build must meet the game rules (index.html at the root, no server code, 2 GB total, 1,000 files, no wallet or seed-phrase prompts, no page redirects) or it is refused with the reasons. Every publish is an immutable version and a preview: only the creator plays it, signed in, on the preview page (preview_url in the result), with its rooms, saves and scores kept apart from the public ones; the agent cannot open it for them.

Nothing is public on the project's own address (hostname in site_status) until the token launches, and the launch page releases the build the creator picks; after the launch a new build goes out with site_release. A verified score needs a round minted by POST /_looping/api/round and the input tape engine-core's recorder wrote; the build then ships sim.js (export simulate(args): the headless round the platform replays to check a score) and pins full engine versions in the import map (/_looping/engines/<pkg>@<x.y.z>/src/index.js, which every game host serves on the game's own origin, in every environment): keep both in the build and never replace the pin with an @major.minor alias, or every score of the game stays player-reported.

Paid content lives under paid/<sku>/ and is served only with a content ticket (rooms.paidUrl in the SDK; the looping-fairplay skill), so any other paid/ layout is refused. note is what changed in this build. Returns the version and label, preview_url, public, the released version, whether the game is listed, and the launch page URL when no token exists yet.

Input parameters

dirOptional
string
  • Min. length: 1
  • Max. length: 400
filesOptional
object[]
  • Min. items: 1
  • Max. items: 1000
Nested schema
{
  "minItems": 1,
  "maxItems": 1000,
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "minLength": 1,
        "maxLength": 400
      },
      "content": {
        "type": "string",
        "maxLength": 6000000
      },
      "encoding": {
        "type": "string",
        "enum": [
          "utf-8",
          "base64"
        ]
      }
    },
    "required": [
      "path",
      "content"
    ],
    "additionalProperties": false
  }
}
noteOptional
string
  • Max. length: 280

The descriptions above include conditional requirements. The full schema below shows structural validation; runtime checks also apply.

JSON Schema

Input schema · draft-7
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "dir": {
      "type": "string",
      "minLength": 1,
      "maxLength": 400
    },
    "files": {
      "minItems": 1,
      "maxItems": 1000,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          },
          "content": {
            "type": "string",
            "maxLength": 6000000
          },
          "encoding": {
            "type": "string",
            "enum": [
              "utf-8",
              "base64"
            ]
          }
        },
        "required": [
          "path",
          "content"
        ],
        "additionalProperties": false
      }
    },
    "note": {
      "type": "string",
      "maxLength": 280
    }
  },
  "additionalProperties": false
}
Calling this tool

Use its name in your connected MCP client. For the HTTP API, the route is relative to your Convex site URL and requires your agent key as a bearer token. Keep the key on the agent side, outside a game build.