Publish from your editor
The Fifth Door MCP server lets you build a game in your own editor with your own coding agent, then sign in and publish it to Fifth Door. It runs locally so it can read your project, and it talks to Fifth Door over HTTPS as your account. Works with Cursor, Claude Code, Codex, and any MCP-compatible client.
Once installed, the same server is how you manage a game after publishing: put it on Discover, record its gameplay preview, enter it in a jam, and read the Platform SDK docs. New tools land here as the platform grows; the @latest tag in the install config means each session runs the newest version.
Install
Cursor
Add to Cursor, or add to .cursor/mcp.json:
{
"mcpServers": {
"fifth-door": {
"command": "npx",
"args": ["-y", "@fifth-door/mcp@latest"]
}
}
}Claude Code
claude mcp add fifth-door -- npx -y @fifth-door/mcp@latestCodex
codex mcp add fifth-door -- npx -y @fifth-door/mcp@latestOther clients
Most MCP clients take the same JSON as Cursor under mcpServers. VS Code and GitHub Copilot read .vscode/mcp.json with a servers key instead:
{
"servers": {
"fifth-door": {
"command": "npx",
"args": ["-y", "@fifth-door/mcp@latest"]
}
}
}Sign in
Ask your agent to run the login tool. It returns a short code and a link. Open the link in a browser where you are signed in to Fifth Door, approve, and the agent is connected. The session is cached on your machine, so this happens once per computer. whoami shows which account is signed in; logout clears it.
For CI or scripting, create an API key on your account page and set it as FIFTH_DOOR_TOKEN in the MCP config instead of signing in interactively:
{
"mcpServers": {
"fifth-door": {
"command": "npx",
"args": ["-y", "@fifth-door/mcp@latest"],
"env": {
"FIFTH_DOOR_TOKEN": "fd_your_key"
}
}
}
}With Claude Code or Codex, pass it as --env FIFTH_DOOR_TOKEN=fd_your_key before the --.
Publish a game
Tell your agent to publish and it calls publish_game. A game is a static web bundle:
- An
index.htmlat the root of the directory you publish, plus the files it references. Any framework or none. Assets are referenced by relative path. - If the game has a build step, publish the build output (for example
dist/) and pointsourceDirectoryat the project root. - Up to 200 files and 300 MB per game.
- A
slug: a stable lowercase identifier you choose. Publishing the same slug again updates that game and keeps its play URL. - A
playTarget:mobile(portrait phone, the default),mobile_landscape,desktop(wide frame with keyboard and mouse), oreverywhere(fills whatever rectangle the host has). The host sizes the game to the target you pick, so build for that one. - Cover art inside the bundle, passed as
coverPath. Cards show the cover in a landscape 4:3 box (1200×900 works well) with no title text of their own, so draw the game's title into the artwork and keep it out of the corners.
You get back a play URL. New games are unlisted: the link works, but the game is not on Discover until you make it public.
Generate game art
Ask your agent for art. Files land in the assets/ folder of your game.
- Matching a style. Every generation tool takes an optional
styleReference: an image in your game to match. Pass the same one to assets that should look alike, or a different one where you want a different look.create_style_referencedraws a sample image in a style you describe, to use as that reference. - Single images.
create_imagedraws one prop, pickup, obstacle, or icon (transparent: true), a full-screen background (orientation: "tall"), or a seamless texture to tile in code (tileable: truewith atileRolesuch assurfacefor ground orparallaxfor a sky). A transparent cutout gets a.jsonbeside it with itsrestbox. - Characters.
create_characterdraws the character from every needed direction and writes one standing still per facing (assets/hero/down.png, ...).animate_spriteturns one of those stills into one motion (walk,run,attack,jump,idle,hurt,die, or a motion you describe). - Sets.
create_image_setdraws related items that share a frame (card faces, tiles, badges) against one anchor image so they match. - Changes.
edit_imagechanges the look of an image, a sprite sheet, or a whole character in place. Editing a character updates every facing and every animation.
The tools upload only the files they need: the style reference you pass and the folder being worked on.
Sprite format. An animation is a folder with one sheet.png (every frame packed into a grid) and a frames.json describing it:
frameWidth,frameHeight,cols,rows,count,padding: frames run left to right, top to bottom, withpaddingpixels between cells. Frameistarts at x =(i % cols) * (frameWidth + padding), y =floor(i / cols) * (frameHeight + padding). In Phaser,load.spritesheet(key, url, { frameWidth, frameHeight, spacing: padding }).fpsandloop: playback speed, and whether the motion cycles or plays once.rest: the subject's visible bounds in its resting pose. Size the sprite and stand it on the ground by this box, not the frame rectangle, which includes empty margin.
A character still has a one-frame .json beside it with the same rest box. Games built from the Fifth Door devkit can use lib/sprites.js, which reads frames.json directly.
Long jobs. A tool waits up to about 45 seconds. Animations and character edits take longer, so the tool returns a job id instead. Call get_asset_job with that id and the same gameDir to write the files once the job is done. Without an id it lists recent jobs.
Daily budget. Each account gets 250 units a day, reset at midnight UTC. A style reference or single image costs 1, an image set 1 per item plus 1 for a new set, a character 2, an animation 5, and an edit 1 plus 2 per animation sheet it touches. Audio draws on the same budget: a music track costs 3, a sound effect 1 per take, a spoken line 1, and a dialogue scene 2. Failed jobs cost nothing. get_asset_job without an id shows what is left.
Generate game audio
Ask your agent for music, sound effects, and voice. Files are MP3s in the assets/ folder of your game. The audio tools upload nothing from your project.
- Music.
create_musicwrites a looping instrumental track,assets/background-music.mp3by default. It is generated without an intro or ending, so it loops cleanly. - Sound effects.
create_sound_effectswritesassets/sfx/<name>.mp3for every sound in one call. Describe each sound physically ("a thin coin landing on stone"). LeavedurationSecondsoff for short hits.loop: truemakes a seamless ambience bed (rain, an engine hum) instead of a one-shot.variantswrites numbered takes (step-1.mp3,step-2.mp3) for a sound that fires constantly. - Speech.
create_speechwrites one file per line,assets/voice/<name>.mp3, for lines the game plays on its own: narration, barks, announcements. - Dialogue.
create_dialoguewrites a whole conversation between characters as one file. The scene is performed together, so the timing between speakers sounds natural. It plays as a unit, so lines the game triggers one at a time belong increate_speech.
Voices. Every speech item and dialogue line names its voice, one of a fixed set of voices such as elder or sidekick (the tool lists them). Pass the same voice for a character every time to keep it sounding the same.
Playing it. Every take is leveled to the same loudness, so set each sound's volume relative to the others in code. For a game whose only sound is one music track, the SDK's window.FifthDoorPlatform.playMusic("./assets/background-music.mp3") loops it and starts on the first tap. Otherwise use your engine's audio (Phaser's sound manager, Howler, or Web Audio); loop ambience beds with Web Audio buffer sources rather than <audio loop>, which leaves a gap. Games running on Fifth Door go silent automatically when the player mutes or leaves the tab, so you do not need to handle that.
Editing a take. Process the MP3 locally with ffmpeg and write to a new file rather than regenerating, which gives a different take. Starting points: an old radio -af "highpass=f=300,lowpass=f=3000,acrusher=bits=8:mix=0.3", a telephone -af "highpass=f=400,lowpass=f=3400", underwater -af "lowpass=f=700,aecho=0.8:0.6:60:0.3". Join dialogue scenes with ffmpeg's concat demuxer.
What happens to your source
Publishing uploads your game's authored source alongside the playable bundle. Fifth Door stores it with the game and uses it to run the platform: reviewing games for safety and quality, classifying and tagging them for Discover, and powering creator tools such as gameplay previews. Public games can be remixed by other creators, which copies the game into their own Studio; keep a game unlisted if you do not want that.
Publishing also creates a page for the game in Studio, Fifth Door's in-browser editor, where you can edit its listing and see how it is being played. Nothing is generated or changed there unless you ask.
After publishing
- Discover.
set_game_visibilitywithpubliclists the game on Discover;unlistedtakes it back to link-only. Going public also queues a gameplay preview recording if the game has none. - Gameplay previews. Discover loops a short muted clip on a game's card.
generate_game_previewrecords one from the published game (an agent plays it and a worker records the liveliest six seconds; allow several minutes and pollget_game_preview_status).set_game_previewuses a video you already have, trimmed to its first eight seconds.clear_game_previewgoes back to the cover. - Game jams.
list_jamsshows this week's jam and its theme.enter_jamenters a public game that first went public during the jam week;withdraw_from_jamtakes it out while entries are open. - Your games.
list_my_gameslists what the account has published and flags games missing a cover or a preview.
Platform features
The Platform SDK is optional. A plain static game publishes and runs without it. When a game needs saved progress, shared records, multiplayer rooms, presence, in-game LLM calls, daily puzzles, notifications, or a shop, the SDK provides them so you do not build them yourself. A shop sells the items your game declares for keys, the Fifth Door currency: the platform shows the price and the confirm, and the keys players spend go to your account to spend on Fifth Door. They cannot be cashed out. Your agent can read the docs for one SDK release with list_sdk_services and get_sdk_docs without signing in, or you can read them at /docs/sdk.
Tools
Account
| Tool | What it does |
|---|---|
login | Sign in to Fifth Door. |
whoami | Show which Fifth Door account this MCP is signed in as. |
logout | Sign out of Fifth Door on this machine by deleting the cached session token. |
Publish
| Tool | What it does |
|---|---|
publish_game | Publish a static web game directory to Fifth Door and get its play URL. |
Game art and audio
| Tool | What it does |
|---|---|
create_style_reference | Generate a style reference: a sample screenshot drawn in the art style you describe. |
create_image | Generate one static image: a prop, pickup, obstacle, or icon (transparent: true), a full-screen background (orientation 'tall'), or a seamless repeating texture (tileable: true) such as ground, a wall, or a parallax sky. |
create_image_set | Generate a set of related static images that share one frame or layout: a deck of cards, board tiles, matched HUD badges, collectible variants. |
create_character | Establish a character's look: draws one turnaround model sheet (the same character from every needed direction) and writes a standing reference still per facing at <dir>/<facing>.png, each with a one-frame .json carrying its rest box. |
animate_sprite | Animate an existing image into a sprite sheet: a walk cycle, an attack, a spinning coin. |
edit_image | Change the appearance of generated art from a plain-language instruction ('make the cape red'), editing files in place. |
create_music | Generate a looping instrumental background-music MP3. |
create_sound_effects | Generate sound effects and looping ambience beds as MP3s, written to <dir>/<name>.mp3. |
create_speech | Generate spoken lines as MP3s, one file per line at <dir>/<name>.mp3, each in one voice: narration, barks, announcements the game plays on its own. |
create_dialogue | Generate a conversation between two or more characters as ONE MP3 at <dir>/<name>.mp3. |
create_video | Generate a video clip, such as a cut scene, intro, or ending, and write the mp4 into the game. |
get_asset_job | Finish an asset job that outlived its tool call: with a jobId, writes the files into gameDir once the job is done, or reports that it is still running. |
Your games
| Tool | What it does |
|---|---|
list_my_games | List the games published by the signed-in Fifth Door account: slug, title, visibility, and play URL. |
set_game_visibility | Set a published game's visibility: "public" lists it on Fifth Door's Discover feed, "unlisted" makes it playable by link only. |
Gameplay previews
| Tool | What it does |
|---|---|
generate_game_preview | Record a gameplay preview for a published game without supplying a video: an agent reads the game's source and writes a controller that plays it, a worker records the run, and the liveliest 6 seconds become the clip Discover loops on the game's card. |
get_game_preview_status | Check on a gameplay preview recording started by generate_game_preview (or queued automatically when the game went public): whether it is queued, running, done, or failed, and the clip's URL once it is ready. |
set_game_preview | Attach a gameplay clip you already have to a published game, replacing whatever the card loops today. |
clear_game_preview | Remove a published game's gameplay preview. |
Game jams
| Tool | What it does |
|---|---|
list_jams | Show this week's Fifth Door weekly jam: its theme, deadline, and entry count. |
enter_jam | Enter one of the signed-in account's published games into this week's jam. |
withdraw_from_jam | Withdraw one of the signed-in account's games from a game jam. |
Platform SDK docs
| Tool | What it does |
|---|---|
list_sdk_services | List what the Fifth Door platform can do for a game, as the docs index of one SDK library release: saved progress and shared records (collections), play-time LLM and image generation, multiplayer (realtime, presence, claims), game servers that run the rules once per room (real-time action, hidden information), daily games, camera and microphone input, share and invite, background audio, notifying players after they leave (turn came round, results landed, a timer ran down), selling items to players (in-game purchases for keys), plus the setup guide for a project outside Studio. |
get_sdk_docs | Read one Fifth Door SDK doc by topic id from an exact library release: platform-sdk for the core reference, a capability id as listed by list_sdk_services for the same release, or a guide id (setup). |
Configuration
Everything the server needs arrives through environment variables in the MCP client config.
| Variable | Default | Purpose |
|---|---|---|
FIFTH_DOOR_TOKEN | none | An API key from your account page. Skips login; for CI and scripting. |
FIFTH_DOOR_API_URL | https://api.beta.fifthdoor.com | API origin. |
FIFTH_DOOR_WEB_URL | https://play.fifthdoor.com | Web origin, used in the play URLs it prints. |
Credentials from login are cached in ~/.config/fifth-door/credentials.json.
