Make your game multiplayer with an AI coding agent
Updated 2026-11-23
Short answer: for a game that runs in a web browser, the easiest way is to let your coding agent add Joinable. You paste one prompt into Claude Code, Cursor, Codex, GitHub Copilot or any agent that can read a web page and edit files. The agent reads Joinable's kit at getjoinable.com/AGENTS.md, picks the pattern for your game's genre, adds an async script tag and a few hooks, and proves it works with npx getjoinable test, which plays a round in two real browsers. There's no server to write or run: Joinable's hosted relay runs the rooms. No account and no key while the game runs on your own machine.
Why agents get this wrong without help
Ask an agent to "make my game multiplayer" with no guide, and it usually writes a Node server with Socket.IO, a lobby screen and its own netcode. That's a lot of code to review, a server you have to host forever, and netcode that rarely suits the genre. Joinable's kit tells the agent the opposite: never write server code, WebSocket code or a lobby. Its job is to read your game and connect the game's real state and inputs to the SDK.
The prompt
Run your agent from the game's folder and paste this. It's the same text as on the home page.
Make this web game multiplayer using Joinable. Read
https://getjoinable.com/AGENTS.md first and follow it exactly: it says how
to pick the right pattern for this game's genre, what to change, and how to test
with two browser tabs. Start with the smallest change that works (usually one
script tag), test it with two tabs, and only go further if the doc's checks fail
for this game. Don't write any server code: Joinable's hosted relay does all of
that. No key is needed on localhost. If the doc's self-test applies (full rounds),
run it with `npx getjoinable test <the game's local URL>` until it passes. When
you're done, tell me which pattern you used, what you changed, and anything that
doesn't sync.
The steps for each tool:
- Claude Code
- Cursor
- OpenAI Codex
- GitHub Copilot in VS Code
- Lovable, Bolt, Replit, v0 and other AI app builders
- Vibe coding a multiplayer game, if you don't write code yourself
What the agent does
- Reads the game first: the object the game draws from, the loop, the inputs and the genre.
- Picks a pattern from the kit's table:
| Your game | Pattern |
|---|---|
| Racer, time trial, runner | Full rounds, race |
| Anything with a score or a time | Full rounds, score |
| Board, card, puzzle, clicker, builder, drawing | Pattern A: one shared world, often one attribute |
| Platformer, top-down, party game with an avatar each | Pattern B |
| Turn-based | Pattern A plus a turn check |
| RTS, strategy, hundreds of units | Lockstep |
| Fighting game, competitive shooter | Not supported yet: the agent should tell you so |
- Adds the script tag,
async, so the game starts at once even if Joinable never arrives:
<script async src="https://relay.getjoinable.com/sdk.js" data-connect="invite"></script>
- For full rounds, wires four hooks in
Joinable.game():start(begin a round from a shared seed),local(report your player),remote(draw the others) and a call toJoinable.finish()when a player finishes. Joinable then draws the play-online sheet, invites, quick match, waiting room, 3-2-1, live standings, one podium and rematch. - Keeps solo play working. Every call is guarded (
window.Joinable?.), and the Online button only shows once Joinable has loaded. - Tests it and tells you which pattern it used and what doesn't sync.
How you know it works
For full rounds, the agent runs the self-test against the game's local address:
npx getjoinable test http://localhost:5173/
It opens two headless browsers, puts them in one room by invite link, and checks that start ran on both with one seed, each sees the other live, both get one result, and a rematch starts round 2. Add --players 4 (up to 8) to test a bigger room. If Chromium for Playwright isn't installed, run npx playwright-core install chromium first. The package is getjoinable, one word. Never run npx joinable: that's someone else's package.
Then play one round yourself: open the game in two browser windows side by side, press Play online, invite, open the link in the other window, and press Ready in both. After that, try a phone and a laptop on different networks.
For shared worlds (Pattern A and B) there's no automated test yet: the agent checks with two windows, and so should you.
Going live
On localhost, 127.0.0.1 and names ending .local, .test or .localhost, Joinable needs no key, is free, never counted, and rooms hold up to 8 players. A real site needs a key:
- Sign up free at getjoinable.com/app and add your game.
- Add the address where players will play (for example
https://mygame.com) to the game's sites. - Put the key in the tag:
data-key="pk_…". Public keys aren't secrets; the site list protects them.
On the free Sandbox plan a live site gets rooms of 4 and 100 player-hours a month. Starter is $9.99 a month for 3,000 player-hours and rooms of 8. See pricing.
The MCP server
Agents that speak MCP can also call Joinable's tools directly: the kit, a pattern picker, the exact snippet for your pattern, the steps to go live, and (locally) the self-test. One command runs it on your machine:
npx -y getjoinable mcp
Or connect https://getjoinable.com/mcp as a remote server: nothing to install, everything but the self-test. Each tool page above has the config for that client. The MCP server is optional; the prompt alone is enough.
Where it stops working
- Web games only. Anything that runs in a browser page works, including engines that export to the web, like Godot. Native desktop, console and mobile app builds aren't supported.
- Fighting games and competitive shooters need rollback or a trusted server, which Joinable doesn't have yet.
- Cheating. One player's device runs shared worlds, and players report their own scores. Fine for friends and casual leaderboards, not for ranked play with prizes.
- The agent can be wrong. It's still your game: read the diff, and play a real round before you ship.
Three games on etheria.games run on Joinable today: Turbo Rally, Sky Isle Karts and Firestorm, a 4v4 real-time strategy game on lockstep.
FAQ
What's the easiest way to make my web game multiplayer with AI?
Give your coding agent Joinable's prompt from your game's folder. The agent reads the kit, adds an async script tag and a few hooks, and runs a two-browser self-test. You don't write or host a server, and nothing needs an account until the game goes on a real site.
Do I need a server for multiplayer?
No. Joinable's hosted relay on Cloudflare runs the rooms, invites, quick match and messages. The kit tells your agent never to write server or WebSocket code.
Which coding agents work?
Any agent that can read a web page and edit your files: Claude Code, Cursor, Codex, GitHub Copilot's agent mode, Windsurf and others. Agents that support MCP can also connect Joinable's MCP server.
Is it free?
Building and testing are free, with no key on your own machine. On a real site, the free Sandbox plan gives 100 player-hours a month in rooms of 4; paid plans start at $9.99 a month.
What if Joinable doesn't load for a player?
The game still plays solo. The script loads async, every call is guarded, and the Online button stays hidden until Joinable arrives.