Discover how Edgegap works

Discover how Edgegap works

AI-Built Games

Deploy to Edgegap

AI-Built Games: How to take a game you made with AI online, with one dedicated server per match and Matchmaking

Published

Published

Last reviewed for accuracy

Last reviewed for accuracy

ChatGPT logo: Edgegap integration guide for multiplayer games built with ChatGPT.

This guide shows you how to take a game you made with AI online: a browser game built with Claude Code, Cursor, Codex, ChatGPT, Lovable, Bolt, v0, Replit, Websim, fal.ai or any other tool, played against bots in the page. You'll give it online matches with one dedicated game server per match, near the players in it, and matchmaking so strangers can press one button and play together. Solo play keeps working.

Edgegap doesn't care which tool made your game. It runs any game server packed in a Linux container (a "custom runtime", in our Docker documentation): you push an image, Edgegap starts a copy of it for each match, from a simple API call, in one of 615+ locations, and the server stops itself when the match ends. You pay only while people play.

This guide covers:

  1. Getting your game's code into a repo, and an Edgegap account

  2. Connecting your coding agent to Edgegap

  3. Moving the game's rules into one file the page and the server share

  4. Building the server and packing it in a container

  5. Testing it, then deploying one test server

  6. Adding matchmaking (optional)

  7. Putting your game's page online

  8. Testing the full loop in two browser tabs

You can do it two ways, and mix them:

  • With a coding agent. Connect Claude Code, Cursor, Codex or another agent to the Edgegap MCP server and its agent skills. The agent splits the game, writes the server and the Dockerfile, tests it, deploys it and writes the matchmaker configuration. You handle the Edgegap dashboard, the secrets, and playtest. You don't need to know servers, Docker or certificates.

  • By hand. Every step below also works without an agent.

Built with Manus or fal.ai? Their guides cover each tool's own steps. Built a Three.js, Phaser or Babylon.js game by hand? Start from Browser Games. Made it as one HTML file in a Claude chat? See Claude.

No credit card required. Free tier includes the resources to deploy a real game server.

No credit card required. Free tier includes the resources to deploy a real game server.

Will my game work online?

Online, a key press travels to the server and back before it shows on screen: about one round trip, plus up to 50 ms. Some games hide that easily, some don't. Check yours before you start:

Feels fine online

Needs care

Change the design, or expect lag

Slippery or floaty movement (ice, hover, drifting cars), pushing and bumping, party games, collecting, arenas with slow projectiles, turn-based

Fast top-down shooters, sports with a ball, racing with tight corners

Precise platforming, rhythm games, fighting games with frame timing, instant-hit aiming

For a game in the right column, ask your agent for a design change (a bit of slide, slower projectiles, a wind-up before hits) rather than trying to hide the delay.

Our samples were picked to fit the left column: Thin Ice Tussle, an ice brawler for 4 made with Claude Code, plays fine on mobile data because the ice is slippery anyway.

Step-by-Step Guide

Detailed Integration Steps

1. Before you start

  • A free Edgegap account. Verify your email. No credit card is needed to test.

  • Your game's code in a folder and a git repo. Made in a coding agent (Claude Code, Cursor, Codex): it already is. Made in Lovable, Bolt, v0 or Replit: connect the project to GitHub, or download it; these projects are usually React + Vite, and the steps are the same, the files move. A single HTML file (a Claude artifact, a ChatGPT or Gemini Canvas game, a Websim page): keep it as one file. The edgegap-chat-canvas skill has the prompt and the script that copy its rules out for the server.

  • A way to build a container. Docker Desktop on your computer, or no install at all: GitHub Actions can build the server image for you.

  • For the agent path: an Edgegap API token, from Dashboard → User Settings → Tokens. It is organization-wide, so treat it like a password: never put it in your game, your repo or a chat.

2. Connect your coding agent to Edgegap

Skip this step if you're doing everything by hand.

The Edgegap MCP server lets your agent create apps and versions, deploy servers, read logs and write matchmaker configurations on your account. The agent skills give it the tested workflow: edgegap-vibe-coded for a game made with AI, edgegap-threejs for the server and page templates.

Claude Code: install the Edgegap plugin. It adds both the MCP server and the skills, and asks for your API token during install:

/plugin marketplace add edgegap/llm-agent-skills, then /plugin install edgegap@edgegap. Restart the session.

Cursor, VS Code, Codex and other clients that send headers: add https://mcp.edgegap.com/mcp with the header Authorization: token YOUR_EDGEGAP_API_TOKEN, and install the skills with npx skills add edgegap/llm-agent-skills --skill "*".

Check it works:

"List my Edgegap apps."

An empty list is fine.

3. Move the game's rules into one file

Don't rewrite your game for the server. Move its rules (movement, hits, scores, bots) into one file that both the page and the server run. The page keeps drawing the game and reading input; solo mode keeps running the rules in the page, exactly as before.

With your agent:

"Load the edgegap-vibe-coded skill. Check whether my game holds up online, then move its rules into client/rules.js with no window, document, rendering, audio or timers in it, so a server can run the same file. Keep solo mode working against bots."

Check: solo plays exactly as before. In Thin Ice Tussle, the rules file didn't change at all when the game went online.

4. Build the server and pack it in a container

The server runs your rules file for one match, at a fixed tick rate, and talks to the page over WebSockets. It follows a few rules so it fits Edgegap:

  • One WebSocket port, for example 7777, with TLS Upgrade on, so pages served over https:// connect with secure wss:// without you buying certificates. Browsers can't use raw UDP.

  • Bots fill empty seats, so a lone player still gets a match.

  • It stops itself when the match ends or empties, by calling the ARBITRIUM_DELETE_URL Edgegap gives every deployment. An idle server keeps billing until its maximum duration.

  • It logs to stdout, never prints the environment, and holds no secret.

Then it goes in a container, like any custom runtime:

  • Build for Edgegap's platform, linux/amd64, even on a Mac: docker build --platform linux/amd64 -t registry.edgegap.com/<project>/<game>:<tag> .

  • Copy only the server and the rules file into the image. Art, models and sounds stay with the page.

  • Push to the Edgegap Container Registry with a new tag for every build, never latest. No Docker on your computer? A GitHub Actions workflow builds and pushes the image from your repo.

Then create the application and its version in the dashboard: your image and tag, registry credentials, port 7777 WS named gameport with TLS Upgrade on, restart policy Never, and a maximum duration of 30 minutes as a backstop.

With your agent:

"Load the edgegap-threejs skill. Build an authoritative Node.js WebSocket server that runs client/rules.js for one match, fills empty seats with bots and stops itself when the match ends. Write a Dockerfile for linux/amd64 that copies only the server and rules.js, then create the Edgegap app version: port 7777 WS named gameport with TLS Upgrade, restart policy never, max duration 30 minutes."

5. Test it, then deploy one test server

Locally first: run two headless players against the server on your computer, then the container itself with docker run, the same way the Docker documentation tests an image. Your agent runs both and fixes what fails.

Then on Edgegap:

"Deploy my latest Edgegap version near me, wait until it's ready, and give me the wss:// address to connect to."

Open your page in two browser tabs and connect both to that address. When the deployment is Ready, your server can still need a few seconds to start, so the page retries for up to a minute.

Leave the match: the server stops itself, and the deployment disappears from the dashboard. The free tier runs one deployment at a time.

6. Add matchmaking

So strangers can press Find Match and play together, Edgegap's matchmaker groups players, starts a server near them and gives every page its address.

  1. Have your agent write the configuration: "Write an Edgegap matchmaker configuration for my app version: 2 to 4 players, a lone player gets a match with bots after 20 seconds, and allow my page's origins." Browsers can't send the latency pings desktop games use, so the matchmaker places the server from the players' locations.

  2. In the dashboard, open Matchmaker, select Create Matchmaker, upload the file and select Create and Start. Copy the API URL and Auth Token. The Auth Token is safe to put in your page; the Edgegap API token never is.

  3. Your agent adds Find Match, Cancel and a queue timer to the page with the Edgegap JavaScript SDK. Solo stays one click away.

Every address your page is served from must be in the matchmaker's allowed origins, or Find Match fails with a CORS error.

7. Put your game's page online

Your page is static files, so any host works: GitHub Pages, itch.io, Netlify or your AI tool's own hosting. Add its address to the matchmaker's allowed origins.

Leaving it public? Only the matchmaker runs all the time; every match server stops within seconds of its match ending. Before you share the link:

  • Scan the repo for secrets. The only one allowed in the page is the matchmaker's Auth Token.

  • The free tier's matchmaker stops about 3 hours after each start, and runs one match at a time. A demo that must stay up needs a paid tier: see pricing.

8. Test the full loop in two browser tabs

  1. Make sure no test deployment is still running.

  2. Open your public page in two tabs and select Find Match in both within 20 seconds.

  3. Both land in the same match, on a server near you.

  4. Leave the match. The deployment stops itself within seconds.

  5. Then play it with a friend on another network: a phone on mobile data is enough.

Next Steps

Next Steps

Frequently Asked Questions

Common questions about taking a game made with AI online with Edgegap's dedicated servers.

Can I make a game I built with AI multiplayer?

Yes. Your agent moves the game's rules into one file, builds a small server that runs it, and Edgegap starts one server per match near the players. Solo play keeps working. Our samples were made with Claude Code and fal.ai this way.

Do I need to know servers or Docker?

No. Your coding agent writes the server and the Dockerfile, and GitHub Actions can build the image, so you don't need Docker on your computer. You create the account, the matchmaker and a token in the dashboard.

Which AI tools does this work with?

Any tool whose code you can put in a git repo: Claude Code, Cursor, Codex, ChatGPT, Gemini, Lovable, Bolt, v0, Replit, Websim, fal.ai or Manus. Edgegap runs the server container, whatever made it.

Which games work well online?

Games with slippery movement, pushing, collecting, slow projectiles or turns. Precise platforming, rhythm games and instant-hit aiming show the network delay; change the design a little, or expect lag.

What keeps costing money when nobody plays?

Only the matchmaker, while it runs. Each match server stops itself seconds after its match ends, and a maximum duration stops any server that doesn't.

Is anything secret in my game's page?

Only the matchmaker's Auth Token, which is made to be public: it gives no access to your account. Your Edgegap API token and registry credentials never go in the page or the repo.

Clients

Learn more from clients who integrated Edgegap

31 case studies are available from studios that moved to Edgegap from another platform.

Key reasons why they chose Edgegap

Discover the impact of Edgegap's automated game server orchestration for a flawless multiplayer experience.

Cost

Pricing

Pricing

Optimize costs and performance with hybrid orchestration

Optimize costs and performance with hybrid orchestration

Optimize costs and performance with hybrid orchestration

Edge Cloud

On-Demand

$0.00115

/ vCPU

/ MINUTE

Billed by the Minute, Only on Usage

Pay only when players play. 0 active servers = $0

Deploy game servers worldwide, per instance, to all 615+ edge cloud locations. Zero commitment.

Simply add a credit card.

Edge Cloud

On-Demand

$0.00115

/ vCPU

/ MINUTE

Billed by the Minute, Only on Usage

Pay only when players play. 0 active servers = $0

Deploy game servers worldwide, per instance, to all 615+ edge cloud locations. Zero commitment.

Simply add a credit card.

Private Fleet (Bare Metal)

Reserved Capacity

$0.0261

/ vCPU

/ HOUR

Billed Monthly, Always On

$280 per host/month (12 mo rate), or $350 monthly

Optimize the cost effectiveness of your game server with egress-free hosting of Private Fleets.

Persistent, available 24/7, exclusive to your studio.

Private Fleet (Bare Metal)

Reserved Capacity

$0.0261

/ vCPU

/ HOUR

Billed Monthly, Always On

$280 per host/month (12 mo rate), or $350 monthly

Optimize the cost effectiveness of your game server with egress-free hosting of Private Fleets.

Persistent, available 24/7, exclusive to your studio.

Your bill varies per rate and usage; which can vary per game type, player count, & more.

Your bill varies per rate and usage; which can vary per game type, player count, & more.

Model your usage with our estimate calculator ->

Model your usage with our estimate calculator ->

Edgegap's features & price: detailed comparison between Edge Cloud & Private Fleets

Edgegap's features & price: detailed comparison between Edge Cloud & Private Fleets

COMPARE

Free Trial

Edge Cloud

Private Fleets

FEATURES

Analytics & Monitoring

Billing Alarms

Click to Expand

28 more rows

Unlocks

Capabilities are unlocked when a credit card is added to the account.

COMPARE

Free Trial

Edge Cloud

Private Fleets

FEATURES

Analytics & Monitoring

Billing Alarms

Click to Expand

28 more rows

Unlocks

Capabilities are unlocked when a credit card is added to the account.

COMPARE

Free Trial

Edge Cloud

Private Fleets

FEATURES

Analytics & Monitoring

Billing Alarms

Click to Expand

28 more rows

Unlocks

Capabilities are unlocked when a credit card is added to the account.