# Platform services Everything the platform gives a web game and the agent that builds it, how each service works, how to reach it, its limits, and what the platform does not provide. Read this before you plan a game that needs more than hosting, so you use what is already here instead of building it yourself. The live version of this list, with the numbers this platform is set to, is the `platform_services` tool (or the `gcp://services` resource). Limits shown here as "default" can be changed by the platform's administrators; `platform_services` and `get_started` under `account.limits` always show the current values. ## How the services reach a game ``` player's browser the platform (Cloudflare) ┌──────────────────────────────┐ ┌──────────────────────────────────────────┐ │ game page (its own origin) │ files │ game host gcp-- │ │ index.html + your files ◄──┼───────────────────┤ serves the version from R2, checks the │ │ window.GCP (injected SDK) │ │ play session, injects the SDK │ │ │ GCP.server() │ server/index.js (optional, sandboxed) │ │ ├──────────────────►│ ── env.store ─┐ │ │ GCP.save / playerStats / │ HTTPS │ platform Worker /api/rt/* ▼ │ │ shared / leaderboard / ├──────────────────►│ saves, stats, shared data, scores (D1) │ │ playRecord / friends │ │ │ │ GCP.room(name) │ WebSocket │ GameRoom Durable Object │ │ GCP.match.find() ├──────────────────►│ one per game, environment and room name; │ │ │ │ matchmaker and match Durable Objects │ └──────────────────────────────┘ └──────────────────────────────────────────┘ the agent ── MCP tools (this server) ──► projects, versions, game_data, game_room, get_stats ``` - **The game** reaches services through `window.GCP`, which the platform injects at the top of every page. Never import or bundle it. There are no keys to configure: every call carries the player's signed play session, and the platform takes the game, the environment (preview or live) and the player from it, never from the request. - **The agent** reaches services through this MCP server: tools to deploy and publish, and tools to look inside and manage a game's data, rooms and numbers. - **Preview and live are separate.** Each has its own address, its own saves, stats, shared data, leaderboards and rooms. Testing a preview never touches live players. ## The catalog | Service | Status | Game uses | Agent uses | Guide | | --- | --- | --- | --- | --- | | Game hosting and delivery | available | `GCP.env`, `GCP.version` | `create_project`, `upload_files`, `create_upload_url`, `deploy_preview`, `publish`, `rollback`, `unpublish`, `list_versions` | versions | | Game storage | available | none | `game_storage`, `list_files`, `upload_files`, `list_projects` | storage | | Hosted libraries and import map | available | `import 'three'`, `@gcp/…` | `get_started` (`import_map`) | contract | | SDK and game lifecycle | available | `GCP.ready`, `GCP.progress`, `GCP.fatal` | `get_started` | contract | | Player accounts and play sessions | available | `GCP.player`, `GCP.lang`, `GCP.onLang` | none | saves | | Cloud saves | available | `GCP.save` | `game_data` (summary) | saves | | Player stats | available | `GCP.playerStats` | `game_data` (summary) | saves | | Game jams and festivals | available | none | `jam` | metadata | | Devlogs and patch notes | available | none | `devlog`, `publish` (`patch_notes`) | metadata | | Achievements | available | `GCP.achievements` | `deploy_preview` (checks `gcp.json` `achievements`) | saves | | Player-made levels | available | `GCP.levels`, `GCP.launch.level` | none (gcp.json `levels`) | saves | | Publish to YouTube Playables | available | `GCP.host` | none (the console's Publish elsewhere card) | services | | Play record | automatic | `GCP.playRecord()` | `game_data` (summary) | saves | | Continue playing | automatic | `GCP.launch.continue`, `GCP.resume` | none | saves | | Shared game data | available | `GCP.shared.get` | `game_data` (set, get, list, delete) | saves | | Leaderboards | available | `GCP.leaderboard` | `game_data` (leaderboard, clear_leaderboard) | saves | | Seed of the day and daily challenges | available | `GCP.daily()` | `GET /api/challenges` | saves | | Realtime multiplayer rooms | available | `GCP.room` | `game_room`, `get_stats` | multiplayer | | Server-run matches | available unless switched off | `GCP.match.find` | `upload_files`, `deploy_preview`, `get_stats` | matches | | Matchmaking and ratings | available unless switched off | `GCP.match.find` | `get_stats` | matches | | Friends, invites and presence | available unless switched off | `GCP.friends`, `GCP.presence`, `GCP.launch.join`, `GCP.launch.watch`, `GCP.match.join` | none | multiplayer | | Network smoothing | available | `GCP.smooth` | none | multiplayer | | Game server code | available unless switched off | `GCP.server` | `upload_files`, `deploy_preview` | saves | | Display, fullscreen and devices | available | `GCP.fullscreen`, `GCP.display`, `GCP.setDisplay` | `compatibility` | contract | | Interface scale and the player's UI size | available | `GCP.ui.configure`, `GCP.ui.scale`, `GCP.ui.rect`, `GCP.ui.setSize`, `GCP.ui.onChange` | none | services | | Touch devices | available | gcp.json `controls`, `GCP.controls`, `GCP.device` | `compatibility` | touch | | Compatibility requirements | available | none | `compatibility` | contract | | Verification and test hooks | automatic | `GCP.test.*` | `deploy_preview`, `list_versions`, `debug_preview` | versions | | Preview debugging in a browser | available unless switched off | `GCP.test.onState` | `debug_preview` | versions | | Playtests with real players | available | `GCP.track` | `playtest`, `deploy_preview` | testing | | Creator feedback queue | available unless switched off | `GCP.test.onState` | `creator_feedback` | versions | | Publish checks (originality, content, web only) | automatic | none | `publish`, `list_versions` | versions | | Marketplace listing, ratings and reviews | available | none | `update_project`, `game_metadata` | metadata | | Paid games, free trials and payouts | available unless switched off | none (handled by the platform) | `update_project`, `get_stats` | none | | Discount codes and keys | available unless switched off | none (handled by the platform) | `coupons` | none | | Bundles (complete the set) | available unless switched off | none (handled by the platform) | `bundles` | none | | Review replies and the community board | available | none (handled by the platform) | `community` | none | | Analytics and runtime errors | automatic | `GCP.track(name, value)` (optional) | `get_stats` | none | | Open implementations | available | none | `find_implementations`, `get_implementation`, `build_skill` | none | | Agent access (MCP and OAuth) | available | none | every tool | versions | "Automatic" means the platform does it for every game with no code. ## Hosting and delivery The platform serves every game itself from Cloudflare's network: the files of each version sit in R2, and the game has two addresses of its own, `gcp--preview.hearthcade.app` and `gcp--live.hearthcade.app`. There is nothing to host or scale. A deploy, publish or rollback reaches players within about 10 seconds. A game's optional `server/index.js` runs in an isolated sandbox built for that version, and a game with server-run matches (`server/match.js`) gets a Cloudflare Worker of its own, because each match runs in one of its Durable Objects. - `deploy_preview` freezes the workspace as a numbered, immutable version and deploys it to the preview address. `publish` makes a verified version live; `rollback` points live at an earlier version within seconds; `unpublish` takes the game offline. Every version is kept. - The game host serves every file with its content type, supports range requests (large audio, video and models stream), caches live files for 5 minutes and revalidates preview files. `index.html` is only served with a valid play session; players start one by pressing Play on the game page. - Upload text files with `upload_files`. For big or binary files, or a whole folder (an engine's web export), use `create_upload_url` and curl: the URL is valid for 30 minutes, `PUT …?path=` sends one file and `POST …/zip` a zipped folder. - There is no build step on the platform. Upload what the browser runs. Limits (defaults): 300 files per game, 50 MB of storage per game, 20 MB per file, 50 projects per creator. ## Game storage Every game has a storage limit: how much all its files may add up to (50 MB by default; the platform can set a different amount for one game), plus the largest file (20 MB) and the number of files (300). - **Enforced on the server.** `upload_files`, the upload URL and zip uploads refuse a change that would take the game over its storage; the whole call is checked first, deletions included, and only growth is refused, so deleting or shrinking files always works. `deploy_preview` refuses a workspace that is over, and `publish` refuses a new version that is over (a rollback to a version that was live before is allowed). - **Visible all the time.** Every upload, `list_files`, `list_projects {project}` and `deploy_preview` answer has `storage`: used, storage, free and percent used, with a `warning` from 80% used. `game_storage {project}` shows what uses the space and every way to save it. Tell the developer about the limit when planning the game, not at upload time. - **Keep games small.** Generate meshes, terrain, textures, sound and music from code at boot; load large or optional content at run time from a host the developer controls (any HTTPS host that sends CORS headers, with plain GET requests); compress what ships. Platform-hosted Three.js and `@gcp/` modules do not count. - **More when needed.** `game_storage {project, action: "request", megabytes, reason}` asks for more for one game (up to 200 MB by default). An admin reviews each request unless the platform approves small ones automatically. Ask the developer first. `get_started {topic: "storage"}` is the long form. ## Hosted libraries and the import map Unless your `index.html` has its own `