> MCP + Skills

Publish AI browser games from your coding agent

Install the workflow once, connect the hosted AIGameShare MCP server, and tell your agent “publish it”. Claude Code, Cursor, or any MCP client can ship the game to a shareable URL, then keep iterating with plays, likes, and a leaderboard already attached.

Looking for the guided flow? Start at Publish Game. This page is the detailed MCP/API reference.

1 · Get your API token

Everything below authenticates with one personal token. Create it once, keep it secret — it publishes under your account.

2 · Connect MCP + your publishing skill

AIGameShare is a hosted MCP server built for agent skills and workflows. Add it once and your agent gains five tools: two guides it reads first (create_game_guide, upload_game_guide), then publish_game, update_game, and list_my_games.

Add the server (one command, any project):

claude mcp add --transport http aigameshare https://www.aigameshare.com/mcp --header "Authorization: Bearer ags_YOUR_TOKEN"

Then just tell Claude:

“Use the AIGameShare skill and publish this game with a good title and description.”

Your skill should read the game, write the metadata, call publish_game and reply with the live play URL. Iterate with “update the published game with this new version”.

The two guides your agent reads first

Both are MCP tools that take no arguments and need no token, so your agent or skill can pull them mid-build. Same guidance is summarized in Reference below — point the agent at them before it writes features or publishes.

  • create_game_guideRead before building. The sandbox rules (no external network, localStorage does not persist) and the window.AIGameShare SDK you build against: leaderboards, cloud save, and 2–8 player multiplayer.
  • upload_game_guideRead before publishing. Every field publish_game accepts (required vs. optional), size limits, leaderboard config, and a pre-publish checklist.
“Use the AIGameShare MCP server: call create_game_guide before you build, and upload_game_guide before you publish.”

3 · Verify it worked

A successful publish returns a playUrl that is live immediately — open it, or pull your list:

curl https://www.aigameshare.com/api/v1/games -H "Authorization: Bearer ags_YOUR_TOKEN"

Reference

MCP tools

  • create_game_guide — sandbox rules + the window.AIGameShare SDK (leaderboards, cloud save, multiplayer). Read before building. No auth.
  • upload_game_guide — every publish_game field, size limits and a pre-publish checklist. Read before publishing. No auth.
  • publish_game — title + description + game source → live play URL. Optional: slug, category, tags, controls, ai_model, ai_tool, device_support, leaderboard_*.
  • update_game — game_id + any of html / zip_base64 / title / description / controls / tags. Plays, likes and leaderboards survive updates.
  • list_my_games — ids, titles, play URLs, plays and likes for your account.

Game SDK (window.AIGameShare, auto-injected)

  • Leaderboards (on by default): submitScore(key, value, { playerName, meta }). The key must match leaderboard_key. Speedruns: leaderboard_value_type "time_ms" + sort asc, submit ms.
  • Cloud save (on by default): cloudSave.set / get / list / delete for durable per-player JSON. Needs the player signed in — handle err.authenticated, pass { promptAuth: true } to prompt login.
  • Multiplayer (2–8 players): multiplayer.createRoom / joinRoom return a room handle with on() / send() / setState() / start() / finish() / leave(). Make the host authoritative.
  • Also track(event, props) analytics, unlockAchievement(key) (off by default), setState(state). Feature-detect window.AIGameShare first.

What to send in publish_game

  • Required: title (≤120), description (≤1000), and exactly ONE of html (single file, ≤2MB) or zip_base64 (zip with index.html, ≤30MB).
  • Recommended: thumbnail (base64 PNG/JPEG/WebP cover, 640×960 2:3 poster, ≤2MB, content-moderated), slug, category (Arcade · Action · Adventure · Puzzle · Board · Card · Words · Educational · Sports · Racing · Strategy · Simulation · Creative · Skill · Experimental · World Cup), tags (≤100; 12–30 focused tags is usually plenty), controls, device_support [desktop|mobile], ai_model, ai_tool, aspect_ratio. Model tags are added automatically from ai_model.
  • Leaderboard: leaderboard_enabled, leaderboard_key (must match submitScore), leaderboard_name, leaderboard_value_type, leaderboard_sort_direction.

REST endpoints

  • POST /api/v1/games — publish (JSON or multipart)
  • PUT /api/v1/games/{gameId} — update build / metadata
  • GET /api/v1/games — list your games
  • POST https://www.aigameshare.com/mcp — MCP (Streamable HTTP)

Limits & sandbox rules

  • Payload limits: html is 2MB max; zip_base64 is 30MB max.
  • Games run in a sandboxed iframe with an opaque origin: external network requests are blocked and localStorage does NOT persist between sessions.
  • Persist through the SDK above, not localStorage — submitScore for scores, cloudSave for progress. Bundle every asset; runtime CDN/API calls are blocked.
  • Keep it family-friendly. Broken or abusive uploads get unpublished.

Troubleshooting

  • 401 → the Authorization header is missing/wrong. Format: Authorization: Bearer ags_...
  • 409 → that game id already exists. Omit gameId (we generate one) or use update_game to iterate.
  • 413 → over the size limit. Minify, compress assets, or send a bundle payload.
  • Redirects → always call https://www.aigameshare.com (the www host) directly.

> faq

Quick answers

Can Claude Code publish an AI game directly to the web?

Yes. Add the hosted AIGameShare MCP server with a personal token, then let Claude Code call publish_game or update_game.

Can Cursor publish games to AIGameShare?

Yes. Cursor or any MCP client that supports authenticated HTTP MCP connections can publish playable HTML5 games through AIGameShare.

Can I upload a ChatGPT-generated HTML5 game?

Yes. Publish a self-contained HTML file or zip bundle with the MCP tool or REST API, then use the public game page as the share URL.

What does my agent need to know before building and publishing?

Two MCP tools answer that. create_game_guide returns the sandbox rules and the window.AIGameShare SDK (leaderboards, cloud save, multiplayer) to build against. upload_game_guide returns every publish_game field and the pre-publish checklist. Both take no arguments and need no token.

> why this matters

MCP is the unfair advantage

Upload forms are normal. Agent publishing is the useful bit: a coding agent reads two built-in guides — one for the in-game SDK, one for the publish fields — then packages an AI-made HTML5 game, publishes it, updates it, and keeps the public page metadata in sync without leaving the build session.