Third-party games and apps
A game is one JSON package: its rules, its state, its board and its GUI. The platform runs the rules on the server (nobody can cheat), draws the GUI in the shared night look on phones, tablets and PCs, and gives every game the same rooms, voice and video, gifts, coins and friends. No uploaded code, no servers to run, nothing to pay. You validate, test in a sandbox, submit; a reviewer approves; it goes live in Community games and the App Center.
Contract: checking…
Your rules are declarative JSON run by the bounded interpreter. A client never settles an outcome; a command either passes your assertions or is refused with a reason.
Players, reviewers, room owners and wallets are the platform's. A game command grants none of those rights; private hands and secrets are projected per player.
Schema, capabilities and compilation on upload; fixed smoke games before review; the sandbox for you. Errors come with JSON paths.
Screens, regions, stacks, tiles, hands, actions: a recursive tree the player renders with the platform's tokens. Every button is a declared command.
One layout, responsive; touch targets of 44 px; strings in English, Chinese and Spanish (the on-device translator covers the rest).
Upload runs bounded smoke games; you play a full round in the sandbox before you submit; reviewers play it again.
PLATFORM_RULES.md §0) are served at /game/api/v1/creator/rules; the authoring guide at /game/api/v1/creator/guide. Both are what the MCP server hands an agent first.GET /game/api/v1/creator/contract links everything: schemas, capabilities, the command registry, starter kits, the pipeline and what is not allowed.GET /game/api/v1/creator/starter-kits/template.counting-race is a complete, valid package. Set manifest.id to pkg.<your username>.<slug>, the slug on every document id, name, description, license and languages.POST /game/api/v1/creator/packages/validate with the package JSON — no account needed — until it returns no errors.POST …/creator/packages, POST …/creator/packages/:id/sandbox, make test players, start a match and play a whole round over /game/api/sandbox/v1/matches/:id/*.POST …/creator/packages/:id/submit. A platform reviewer plays it and approves it; the frozen version goes live in Community games and the App Center. A new version repeats the loop.Write endpoints accept your browser's community cookie or a community.… Bearer token. A signed-in browser gets one from POST /game/api/v1/community/game-session {}; a script with a password account can call POST /game/api/v1/community/auth/login and then the same endpoint. Keep tokens out of package JSON, URLs, logs and git. Guests cannot author.
curl -s https://www.bodhicloud.ai/game/api/v1/creator/starter-kits/template.counting-race > kit.json
# edit kit.json (manifest.id, slug, rules, GUI) …
curl -s -X POST -H 'content-type: application/json' --data @kit.json https://www.bodhicloud.ai/game/api/v1/creator/packages/validate
curl -s -X POST -H "authorization: Bearer $BODHICLOUD_TOKEN" -H 'content-type: application/json' --data @kit.json https://www.bodhicloud.ai/game/api/v1/creator/packages
The same loop as tools, step by step, is the MCP server below (one file you download); the platform's own standalone example, a Tetris that validates, uploads, sandbox-tests and submits, does it over plain HTTP like the lines above.
One JSON document (schema creator-package): a manifest and these documents.
| Document | Defines | Notes |
|---|---|---|
gameType | The listed, joinable game; points at one compiled bundle | status: draft until published |
gameDefinition | Runtime kind (turn-based, real-time session), players, the state machine (phases, allowed commands, timeouts, terminal), projections | Which commands are legal in which phase |
ruleset | State schema and initial state, constants, random requests (dice, shuffles), commands (input schema + assertions), rules (conditions + effects), events, invariants | The game itself; the interpreter is bounded (no loops without limits, no I/O) |
stateSchema | The match state contract | players.<id>.private is that player's; secret is server-only |
topology / board | Regions, spaces, connections, coordinates; a board carries tiles, prices, positions and visuals | Reuse the Monopoly toolkit's board or draw your own |
experience | Theme, settings, the GUI tree, windows, placements, movement profiles, event presentations | Rendered by the shared player; see gui-layout |
presentation | GUI layout per device, asset bindings, characters, arsenal, effects, audio, strings (en, zh-CN, es), piece labels, keyboard controls | Client-side only; never changes legal state |
Ids are <kind>.<slug>…; published versions are immutable (bump manifest.version); a match pins the exact compiled bundle, so old matches replay against the version they started on.
On the website prefix every path with /game. Reads are public; writes need a permanent account (cookie or Bearer token); the sandbox needs an account too but never touches production data. Every response is JSON with an X-Request-ID; validation errors carry JSON paths.
| Call | Purpose |
|---|---|
GET /api/v1/creator/contract | Links to everything below, the GUI theme, what is allowed, the pipeline |
GET /api/v1/creator/guide · /rules | The authoring guide and the platform rules (Markdown) |
GET /api/v1/creator/mcp/bodhicloud-mcp.mjs | The MCP server (one file, Node 18+, no dependencies) |
GET /api/v1/creator/capabilities | Runtime kinds, capabilities, projections, random requests, expression operators, limits |
GET /api/v1/creator/schemas · /schemas/:name | Published JSON Schemas (creator-package, creator-gui, command-envelope, entities, gameplay) |
GET /api/v1/creator/gui-layout | The recursive GUI vocabulary, limits and the starter experience |
GET /api/v1/creator/services | Shared services a game may open (voice/video rooms, recording, P2P files, gifts), permissions and limits |
GET /api/v1/schemas/commands | The live command registry: every command, its parameters, engine mapping and where it runs |
GET /api/v1/creator/starter-kits · /starter-kits/:id | Packages to fork and the platform assets they reference |
GET /api/v1/creator/data/:resource | Read-only projections: game-types, catalog, me, player — nothing else is reachable |
GET /api/v1/apps/catalog | The App Center catalog with the live community games |
| Call | Purpose | Who |
|---|---|---|
POST /api/v1/creator/packages/validate | Validate and compile without storing; errors with JSON paths, or the bundle hash | anyone |
POST /api/v1/creator/packages | Upload a draft (owner = you); runs bounded smoke games | account |
GET /api/v1/creator/packages?mine=1 · /packages/:id · /packages/:id/changes · /packages/:id/commands | Your packages (without mine=1: every published package too), one package with its state and review history (the reviewer's notes), what changed since the last version, the draft's command registry | owner |
POST /api/v1/creator/packages/:id/submit | Ask for review (refused while the package has errors) | owner |
POST /api/v1/creator/packages/:id/approve · /request-changes · /reject · /unpublish | The review; approval compiles, freezes the version and registers it live | reviewer (unpublish: owner too) |
| Call | Purpose |
|---|---|
POST /api/v1/creator/packages/:id/sandbox | Deploy your draft into your isolated sandbox |
GET /api/v1/creator/sandbox | What is deployed and your test players |
POST /api/v1/creator/sandbox/test-players · DELETE …/test-players/:id | Synthetic players that exist only in the sandbox (their tokens play on the sandbox API) |
POST /api/v1/creator/sandbox/matches | A sandbox match: gameTypeId, bots, test players, start, seed |
GET /api/v1/creator/sandbox/matches/:id/play-kit · /debug | An invited player's GUI, strings and commands; the raw state (owner and reviewers) |
GET/POST /api/sandbox/v1/matches/:id/* | The same gameplay API as production, on sandbox matches: snapshot, join, start, connections, commands ({commandId, expectedRevision, commandType, payload}), heartbeats, reconnect. A move needs a connection: POST …/matches/:id/connections once, then send its x-match-connection-id and x-match-reconnect-token headers with every command (the MCP server does this for you) |
| Call | Purpose |
|---|---|
GET /api/v1/game-types | Published games, yours next to the platform's |
POST /api/v1/matches {gameTypeId} · join · start · /matches/:id/commands · snapshot · replay · watch | The match protocol; the shared player uses it in production and in the sandbox |
POST /api/v1/creator/services/games/:gameTypeId/rooms · GET …/services/rooms/:roomId | A private talk/video room for a game's table, with the player's own identity |
The hosted player exposes its command bus: await window.__commands.ready(), window.__commands.list() to find a move by engine.gameTypeId and engine.commandType, window.__commands.dispatch({type, params, origin: "script"}), window.__commands.log(). The server still decides every move.
Your draft runs in an isolated copy of the game server: its own registry, in-memory matches (idle ones deleted after 24 hours), the same accounts looked up read-only, plus synthetic test players. Nothing is copied into production; approval publishes the reviewed package version, never sandbox data. Service rooms are disabled for drafts; everything else — the GUI, commands, private hands, the debug view — is what players will get.
Packages are declarative JSON, so there is no third-party code to contain: the sandbox isolates data, not processes.
Approved games are listed in the App Center under Community games (name, author, description, players, tags) with Play and Add to my apps, in the Games tab, and in GET /api/v1/game-types. Anyone can play free as a guest; a member's My apps follows their account across devices.
The App Center's Get the app row: Android APK, Windows installer, Steam, iPhone and iPad (Safari → Share → Add to Home Screen); the web app installs from the address bar. Every third-party game runs inside it — no separate download.
A game is a package (above). It needs no binary, no store listing and no server of yours: review puts it in the App Center. New versions go through the same loop; old matches keep their version.
Party apps and mini apps that are pages of the platform are listed in the App Center catalog; a third-party app today is a game package or a web page opened in the shared player. Native binaries belong to the platform's own builds (signed and published under /downloads/), not to packages.
An MCP (Model Context Protocol) server exposes everything on this page as tools: Claude Desktop, Claude Code, Cursor, Codex or any MCP client can read the rules, fork a starter kit, validate, upload, play a round in the sandbox and submit — with you deciding the slug, the rules and the look. It is one file with no dependencies (Node 18+): download it from /game/api/v1/creator/mcp/bodhicloud-mcp.mjs and point your client at it.
curl -o bodhicloud-mcp.mjs https://www.bodhicloud.ai/game/api/v1/creator/mcp/bodhicloud-mcp.mjs
node bodhicloud-mcp.mjs --describe # the tool list, to check it runs
{
"mcpServers": {
"bodhicloud": {
"command": "node",
"args": ["/full/path/to/bodhicloud-mcp.mjs"],
"env": { "BODHICLOUD_API": "https://www.bodhicloud.ai/game/api/v1", "BODHICLOUD_TOKEN": "community.…" }
}
}
}
Reading the contracts needs no account. Authoring tools need BODHICLOUD_TOKEN (a game-session token) or the login tool with a password account. Then ask the agent for the make_party_game prompt with your idea. The agent cannot approve its own package: a platform reviewer does.
The other way round: your game stays yours, and BodhiCloud lives inside it as a thin panel — the same screens as the app (the Channel feed, chats, the profile, the gift tiles), laid out by our server for your window, drawn by a small package in your engine. Players tap in your game; our server runs the app's own commands for them. No rules, no words and no colours live in your engine: when the app changes, your game changes with it on the next request.
A UPM package (C#, UGUI, no dependencies). Add it from apps/unity/com.bodhicloud.shell, drop BodhiCloudShell on a GameObject, set the key, press Play.
A C++ plugin (UMG, Blueprint-callable). Copy apps/unreal/BodhiCloudShell into your project's Plugins/, set the key on the subsystem, call Open.
Godot, a web game, a console: GET /game/api/v1/engine/screen gives the screen as rectangles, POST /command runs a tap. Two headers: your key and the player's id.
GET /screen?w=&h= answers the whole screen laid out for that size: every box, text, picture, icon and input with its rect, colour, font and what a tap sends. Pictures are PNG / JPEG addresses from /manifest; icons come from one sprite sheet.POST /command with the node's tap and the inputs' text; the answer carries the next screen. Poll /screen with the last rev at the rate the screen asks for (a chat every 4 s).| Route | Headers | Answer |
|---|---|---|
| GET /game/api/v1/engine/manifest | x-bodhi-app-key your keyx-bodhi-player the player's idx-bodhi-player-name optionalx-bodhi-engine unity / unreal / other | pictures by key → address, the icon sheet and its index, fonts, polling rates |
| GET /game/api/v1/engine/me | the player's BodhiCloud account (guest or linked) | |
| GET /game/api/v1/engine/screen?tab&list&route&id&menu&lang&w&h&rev | the laid-out screen (bodhi-ui@1), or { same: true } when rev still holds | |
| POST /game/api/v1/engine/command | body { type, params, inputs, nav, lang, w, h, requestId } → the next navigation and screen, a toast | |
| POST /game/api/v1/engine/link/start | a code the player types in the app (10 minutes) | |
| GET /game/api/v1/engine/link | who the player is linked as |
Sign in to make a key for your game.
Rules inside a game: words and pictures from the app, text chat and the feed; no wallet, no coins and no purchases inside the panel (a store's own rules for in-app purchases apply to your build, and ours stay in the app); every player text is the app's own, cleaned the same way. Full design: docs/design/ENGINE_SDK.md.