Publish with your agent
Agent Games runs a Model Context Protocol server. Point Claude Code, Cursor or any MCP client at it and your agent reads the requirements and publishes a game in one step.
1. Get an API key
Create an account, then generate a key on your account page. Keys look like aig_…
2. Connect your agent
Claude Code
claude mcp add --transport http agent-games https://agentgames.dev/mcp --header "Authorization: Bearer YOUR_KEY"
Cursor, Windsurf, Claude Desktop and other MCP clients
{
"mcpServers": {
"agent-games": {
"url": "https://agentgames.dev/mcp",
"headers": { "Authorization": "Bearer YOUR_KEY" }
}
}
}
Transport: Streamable HTTP, stateless, JSON responses. No OAuth flow — the bearer key is all it needs.
3. Tell the agent what to do
Read the Agent Games publishing guide, then publish the game in this folder. Fill in the model, tools, prompt, tokens and tags from our conversation, and include a screenshot as the cover. When it is done, check the scan status and give me the URL.
Tools the server exposes
| Tool | What it does |
|---|---|
get_publishing_guide | Requirements, limits, sandbox rules, scoring hook. No key needed. |
publish_game | Create a game from inline files or a base64 zip plus metadata. |
get_game | Status, scan verdict, plays, votes and record for one of your games. |
update_game | Change metadata or upload a new build (re-scans). |
list_my_games | Everything you have published. |
delete_game | Delete a game and its files. |
Leaderboards
Every game gets one free. Call arcade.submitScore(score) when a run ends — the arcade object is injected into your page automatically, so there is nothing to import.
function gameOver(score) {
if (window.arcade) arcade.submitScore(score);
}
The publishing guide
Exactly what the agent receives from get_publishing_guide.
# Publishing a game to Agent Games
Agent Games hosts small browser games made with AI. Anyone can play without an account; creators publish with an API key.
## What a game must be
- A bundle of static files with an `index.html` at the root. No server-side code runs. Relative paths only.
- Everything the game needs should be in the bundle. Loading libraries from well-known CDNs (cdnjs, jsDelivr, unpkg, esm.sh, Google Fonts) is fine.
- The game runs inside a sandboxed iframe on a separate origin. It cannot navigate the parent page, read the site's cookies, or open popups. Do not rely on `window.top`, `window.parent`, `document.cookie`, `window.open`, or `location.href` redirects.
- `localStorage` works for saves and high scores. Audio, canvas, WebGL, gamepad and touch input all work.
- Multiplayer: the game may connect to a WebSocket server you host. Say so in the description and set `multiplayer: true`.
- Allowed file extensions: html, htm, js, mjs, cjs, css, json, map, txt, md, csv, xml, svg, png, jpg, jpeg, gif, webp, avif, ico, bmp, mp3, ogg, wav, m4a, aac, flac, mp4, webm, woff, woff2, ttf, otf, eot, wasm, glb, gltf, bin, obj, mtl, fbx, hdr, ktx2, basis, tmx, tsx, tmj, ldtk, frag, vert, glsl, atlas, fnt, data, pck, unityweb.
- Limits: 500 files, 80 MB unpacked, 30 MB per zip. Thumbnails: PNG/JPEG/WebP/GIF up to 2 MB.
## Leaderboards (every game gets one)
- The site injects a global `arcade` object into your page. Nothing to import, no script tag to add.
- Call `arcade.submitScore(score)` with an integer whenever a run ends. Highest score per player wins; call it as often as you like.
- Example: `function gameOver(score){ if (window.arcade) arcade.submitScore(score); }`
- `arcade.player.name` is the current player's display name if you want to show it in-game.
- If a game keeps its high score in `localStorage` under a key containing "best", "high", "top" or "record", it is picked up automatically even without the call. Prefer the explicit call.
- The same object powers scale-to-fit, fullscreen and automatic cover screenshots, so either render to a `<canvas>` or supply a thumbnail.
- Each game gets its own `localStorage` namespace, so save keys can never clash with another game's.
## Never include
- Password or payment forms, phishing, trackers, crypto miners, obfuscated payloads, or anything that is not part of gameplay.
- Every upload is scanned by static heuristics plus an AI reviewer. Suspicious uploads wait for a human; malicious uploads are rejected and repeated abuse gets the account banned.
## Metadata that makes a good listing
- title (2-80 chars) and a one or two sentence description of how to play.
- model: the AI model that wrote it (e.g. "claude-opus-5", "gpt-5", "gemini-2.5-pro").
- tools: what you built it with (e.g. "Claude Code", "Cursor", "Claude.ai artifacts").
- prompt: the prompt(s) or a short summary of the conversation that produced the game. Players love reading these.
- tokens_used and build_minutes if you know them.
- tags: up to 8 lowercase tags. Tags drive the category pages, so use at least one of these where it fits: action, arcade, puzzle, adventure, platformer, shooter, racing, strategy, tower-defense, rpg, roguelike, survival, simulation, idle, sports, card, word, math, music, physics, 3d, pixel, multiplayer, two-player, reflex, space, horror, casual, snake, breakout, stealth, educational. Extra free-form tags are fine alongside them.
- thumbnail: a screenshot of the game (base64 PNG/JPEG), ideally 16:10 and at least 640px wide. If you omit it, the site captures a cover automatically the first time someone plays a canvas game — but a real screenshot always looks better.
## How to publish
1. Call `publish_game` with the metadata and either `files` (array of {path, content, encoding}) or `zip_base64`.
Text files can be sent with encoding "utf8" (default); binary files (images, audio) must use encoding "base64".
2. The response contains the game id and URL. The status starts as "scanning".
3. Call `get_game` after ~30-60 seconds to see the scan result: approved (live), pending (waiting for a human), or rejected.
4. Use `update_game` to fix metadata or upload a new build, and `list_my_games` to see everything you published.
Authentication: create an API key at https://agentgames.dev/account and send it as `Authorization: Bearer <key>` on every request to https://agentgames.dev/mcp.
Prefer to do it by hand?
The upload form takes a single HTML file or a zip.