@fifth-door/mcp

中文文档
0.9.0发布于 2026/10/26MITES Module近 30 天下载 2303

Fifth Door MCP server — sign in and publish games to Fifth Door from any MCP client

原始使用文档
文档目录14 节
  1. Install
  2. Tools
  3. Account
  4. Publish
  5. Game art and audio
  6. Your games
  7. Gameplay previews
  8. Game jams
  9. Platform SDK docs
  10. Cover art
  11. Gameplay previews
  12. Configuration
  13. Server-side counterpart
  14. Release

@fifth-door/mcp

The public Fifth Door MCP server: sign in to Fifth Door and publish games from Cursor, Claude Code, Codex, or any MCP client. Runs locally over stdio so it can read the game directory being published; talks to Fifth Door exclusively over REST with a per-user session token.

Install

Published package (@latest keeps users on the newest version — npx caches otherwise). @latest resolves when the client launches the server, so a running client keeps the version it started with; after a release, restart the MCP server (or the editor) to pick up the new one.

Cursor — one-click: see fifthdoor.com/docs/mcp, 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@latest

Codex:

codex mcp add fifth-door -- npx -y @fifth-door/mcp@latest

From this monorepo (already registered in .mcp.json, pointed at the local dev stack):

bun packages/mcp/src/index.ts

Tools

The tables below, tools.json, and the ## Tools section of docs/publish-from-your-editor.md are written by bun run generate-tools from the registered tools (src/tooling/catalog.ts); catalog.test.ts fails when they are stale. Edit descriptions in src/tools/, not here.

Account

ToolWhat it does
loginSign in to Fifth Door.
whoamiShow which Fifth Door account this MCP is signed in as.
logoutSign out of Fifth Door on this machine by deleting the cached session token.

Publish

ToolWhat it does
publish_gamePublish a static web game directory to Fifth Door and get its play URL.

Game art and audio

ToolWhat it does
create_style_referenceGenerate a style reference: a sample screenshot drawn in the art style you describe.
create_imageGenerate 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_setGenerate a set of related static images that share one frame or layout: a deck of cards, board tiles, matched HUD badges, collectible variants.
create_characterEstablish 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 /.png, each with a one-frame .json carrying its rest box.
animate_spriteAnimate an existing image into a sprite sheet: a walk cycle, an attack, a spinning coin.
edit_imageChange the appearance of generated art from a plain-language instruction ('make the cape red'), editing files in place.
create_musicGenerate a looping instrumental background-music MP3.
create_sound_effectsGenerate sound effects and looping ambience beds as MP3s, written to /.mp3.
create_speechGenerate spoken lines as MP3s, one file per line at /.mp3, each in one voice: narration, barks, announcements the game plays on its own.
create_dialogueGenerate a conversation between two or more characters as ONE MP3 at /.mp3.
create_videoGenerate a video clip, such as a cut scene, intro, or ending, and write the mp4 into the game.
get_asset_jobFinish 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

ToolWhat it does
list_my_gamesList the games published by the signed-in Fifth Door account: slug, title, visibility, and play URL.
set_game_visibilitySet a published game's visibility: "public" lists it on Fifth Door's Discover feed, "unlisted" makes it playable by link only.

Gameplay previews

ToolWhat it does
generate_game_previewRecord 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_statusCheck 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_previewAttach a gameplay clip you already have to a published game, replacing whatever the card loops today.
clear_game_previewRemove a published game's gameplay preview.

Game jams

ToolWhat it does
list_jamsShow this week's Fifth Door weekly jam: its theme, deadline, and entry count.
enter_jamEnter one of the signed-in account's published games into this week's jam.
withdraw_from_jamWithdraw one of the signed-in account's games from a game jam.

Platform SDK docs

ToolWhat it does
list_sdk_servicesList 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_docsRead 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).

publish_game always uploads authored source alongside the playable bundle (required for content rating and later rehydrate). When directory is a build output such as dist/, pass sourceDirectory as the project root. Each publish also creates or updates an idle Studio session so Insights and listing metadata are available in the app; it does not start an agent turn.

The server never writes SDK files into a project. Adding the SDK is the setup guide (get_sdk_docs({ version, topic: "setup" })): pin one release in a script tag or install @fifth-door/platform-sdk, then read the topics from that same release. Releases before 0.4.0 shipped an add_sdk tool that copied the checkout's docs and helpers from /api/prism/devkit.zip and read docs from /api/platform/sdk/index.json; in production those routes answer 410 with a message to upgrade.

The two SDK tools are thin callers of /api/platform/sdk/latest.json, /api/platform/sdk/<version>/index.json, and /api/platform/sdk/<version>/docs/<topic>. The API builds the index from the release's own index.json; this server holds no docs, no frontmatter parsing, and no knowledge base of its own, so the same index and docs are reachable without the MCP (the web docs page reads the same routes). Learning and changing the project are separate: both tools are read-only and need no login, so an agent can assess a capability before touching anything. An exact version is read from that release or fails; it never falls forward to a newer one, because docs for a release the project does not pin describe an API the project does not have. The setup guide ends with a project note the agent leaves (AGENTS.md, CLAUDE.md, or the README) naming the pinned release and these two tools, so a later session reads the release the game was written against rather than the newest.

Cover art

Covers render inside a 4:3 landscape box on every browse surface (GameCard.tsx), with object-contain — so a 16:9 screenshot or a square image shows with bars around it rather than being cropped. Other surfaces reuse the same image at 3:2 (share cards) and 5:1 (banners), and those crop.

  • Letter the game's title into the artwork. A card is the cover plus a creator row — the title is drawn nowhere on it, so a cover without the name ships as an untitled picture. Fifth Door's own cover generator bakes the title in for the same reason (packages/assets/src/generation/cover-art.ts).
  • Export at 4:3: 1200x900, or 1600x1200 for a sharper card.
  • Keep the title and hero subject inside the middle ~70%, out of the corners.
  • publish_game reads the cover's header and warns in its output when the aspect is off or the image is under 800px wide. It cannot see whether the title is on the image, so that part is on the caller.

Gameplay previews

Discover loops a short muted clip on a game's card instead of the still cover, when the artifact has one (platform_artifacts.preview_video_url).

Going public queues a recording automatically for any game that has no preview yet (applyArtifactVisibility), so an MCP-published game normally gets one without asking. generate_game_preview exists to record one for a game that is still unlisted, or to replace a bad clip (regenerate: true). It runs an agent over the published source to write a controller, then records that controller under Playwright on a GPU worker — several minutes, so poll get_game_preview_status.

set_game_preview is the manual path: hand it a local video and the server transcodes the first 8 seconds into a card-sized h.264 loop. Trim before uploading.

Configuration

Everything arrives via env vars in the MCP client config — this package never reads monorepo state.

VariableDefaultPurpose
FIFTH_DOOR_API_URLhttps://api.beta.fifthdoor.comAPI origin
FIFTH_DOOR_WEB_URLhttps://play.fifthdoor.comWeb origin (play URLs)
FIFTH_DOOR_TOKEN—Token override for CI/scripting; skips login. Use an fd_ API key generated on the account page (or a raw session token)

Credentials are cached in ~/.config/fifth-door/credentials.json (0600), keyed by API origin.

Server-side counterpart

  • Device flow: better-auth deviceAuthorization plugin (packages/api/src/auth.ts), approval page at /device (packages/web/src/routes/device.tsx), device_code table.
  • API keys: api_tokens table + ApiTokenRepository; minted on the account page (apiTokens RPC router), accepted as bearer tokens by the platform REST routes.
  • Publish + management: POST /api/platform/publish (session or API-key bearer ⇒ owned, slug-guarded publish; session publishes require sourceFiles), GET /api/platform/me, GET /api/platform/me/artifacts, PATCH /api/platform/me/artifacts/:slug/visibility (packages/api/src/routes/platform.ts).
  • Previews: POST/DELETE /api/platform/me/artifacts/:slug/preview (raw video body ⇒ writePlatformPreview transcode), POST/GET /api/platform/me/artifacts/:slug/preview/generation (same queue Studio and the go-public path use). Shared save/clear lives in packages/api/src/lib/artifactPreview.ts.
  • Game jams: GET /api/platform/jams, POST/DELETE /api/platform/me/artifacts/:slug/jam-entries[/:jam] (shared entry rules in packages/api/src/lib/gameJamEntries.ts).
  • User-facing setup guide: docs/publish-from-your-editor.md here, rendered at /docs/mcp (packages/web/src/components/docs/McpDocsPage.tsx).

Release

Publishing is automated by .github/workflows/publish-mcp.yml: bump version in this package.json, merge to main, and CI publishes to npm via trusted publishing (GitHub OIDC) — it no-ops when the version is already on npm.

Every PR that changes the published server (tools, tool descriptions, behavior, defaults) bumps version in this package.json and both version fields in server.json, in the same PR. Without the bump the merge publishes nothing, and creators on @latest never get the change. Minor for new tools or changed behavior, patch for fixes and description edits.

The MCP Registry listing io.github.fifthdoor/mcp is described by server.json and published by hand once the version is on npm: bump both version fields in server.json to match, then from this directory run mcp-publisher login github (any member of the fifthdoor GitHub org) and mcp-publisher publish. The registry verifies npm ownership through mcpName in package.json, which must equal the server name.

Publishes carry no provenance attestation. npm only verifies a sigstore bundle whose source repository is public, and fifthdoor/conduit is private; trusted publishing enables provenance by default, so the workflow sets NPM_CONFIG_PROVENANCE=false to turn it back off. Making the repo public is the only way to get provenance back.

One-time bootstrap (npm requires the package to exist before a trusted publisher can be configured):

  1. Create the fifth-door org on npmjs.com (owns the @fifth-door scope).
  2. First publish manually: cd packages/mcp && npm publish (runs prepublishOnly build; needs npm login).
  3. On npmjs.com → package Settings → Trusted Publisher → GitHub Actions → repository fifthdoor/conduit, workflow publish-mcp.yml. From then on, no tokens anywhere.

bun run build produces dist/index.js (Node-runnable; esbuild stays external because it ships a platform-native binary).

版本与发布记录

@fifth-door/mcp 共发布 18 个版本,首次发布于 2026/08/12;过去 12 个月发布了 18 个版本。

版本发布日期距今
0.9.0latest2026/10/2619 天前
0.8.02026/10/2323 天前
0.7.02026/10/2223 天前
0.6.62026/10/2224 天前
0.6.52026/10/2125 天前
0.6.42026/10/2125 天前

关于 @fifth-door/mcp 的常见问题

@fifth-door/mcp 是什么?

Fifth Door MCP server — sign in and publish games to Fifth Door from any MCP client

如何安装 @fifth-door/mcp?

在项目目录运行 npm install @fifth-door/mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 fifth-door-mcp,可以用 npx fifth-door-mcp 直接运行。

@fifth-door/mcp 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fifth-door__mcp 是否存在。

@fifth-door/mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fifth-door/mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fifth-door/mcp 可以商用吗?

@fifth-door/mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fifth-door/mcp 的下载量有多少?

根据 npm 官方下载统计,@fifth-door/mcp 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,303 次,日均约 77 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fifth-door/mcp 还在维护吗?

最新版本 0.9.0 发布于 2026/10/26(19 天前);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/08/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。