Make a multiplayer game with your AI

You write the game on your own computer with Claude Code, Codex or another coding AI, using the moddio SDK. modd.io gives it servers, netcode, accounts, saves and players. You publish with one command.

1. Start a game

Create one on the site (Create, then pick a template), or start from the command line:

npx moddio@latest create my-game --template arena
cd my-game
npm install

Node 22 or later. Templates: arena (top-down shooter), soccer (Rapier physics), legacy (Planck physics), marble (3D Rapier physics). If you created the game on the site, its page shows the command with --game, which ties the folder to that game. The SDK is one npm package, moddio; in a folder of your own, npm i -D moddio.

2. Connect the CLI to your account

npx moddio login

For a site other than www.modd.io, add --site <address> or set MODDIO_SITE.

It opens this site; you check the code shown in your terminal and allow it. The CLI gets a token that can publish your games and nothing else.

3. Build it with your AI

Tell your AI to read /llms.txt first: it is the whole SDK in one file. Then describe the game. Try it with two players on your machine:

npx moddio dev

4. Publish

npx moddio test
npx moddio publish

moddio test checks the sim in V8; npx moddio engines adds JavaScriptCore and SpiderMonkey to the check.

moddio publish checks the bundle, uploads it with the game folder’s source (not node_modules, build output, .env files or what its .gitignore leaves out), and starts the automatic review: bots play it in a browser while every network attempt, page error and CPU spike is recorded. The review publishes it, holds it for a person, or rejects it, and the game’s page on this site shows why. Deploying restarts the rooms on older versions, and their players join the new one.

5. Make it public

A new game is private: only you can play it. Press Publish on the game’s page (My games) once, or run npx moddio publish --public. From then on anyone with the link can play it, up to 200 players a day.

It is listed on modd.io (home page and game list) when a version has passed review, your account is at least 7 days old, and your email is verified, and the game is more than an unchanged template.

6. Sell items

List products in moddio.json and call buy(id) from @moddio/client/browser. Players pay with their modd.io tokens in modd.io’s purchase dialog. Your sim gets a purchased event and answers it: it accepts once the player has the item, or declines with a reason (a full bag, say), and the player gets their tokens back. You get 90% of each sale the game accepts, paid 7 days later. The Shop section of /llms.txt has the details.

7. Servers and regions

Servers run in North America, South America, Europe and Asia. Play puts each player in a server in their nearest region, starting one there if none has room. Your game’s own server menu lists every region and server with pageRooms() (its regions, and each server’s region), joins a region with switchRoom('region', { region: 'asia' }) and starts a server with switchRoom('new', { region: 'eu' }), both from @moddio/client/browser. The Servers section of /llms.txt has the details.

A game whose first screen is its own menu sets "menu": true in moddio.json. It then opens in no server: nobody sees the player, no seat is taken, and the page shows no player list or chat until the menu joins one with joinRoom(). leaveRoom() goes back to the menu, and atMenu() says where the game started (a link to a server still starts in it).

modd.io Docs: Make a Multiplayer Game with Your AI (SDK and CLI)