* feat(game-static-play): add 274-template R2 zip packaging, cookieless static play deploy, and verification pipeline * feat(game-skill): port 21-section OpenGame skill with dual-mode workflow and fast-play path * feat(onboarding): upgrade Cloud MCP install guide and add shared OpenGame prompt builders * feat(game-catalog): sync 274 official templates, 4 kits, downloads manifest, and game contract * feat(cloud-mcp): add read-only game catalog, free asset search, guest catalog API, redirects, and Docker packaging * feat(opengame): enable Stage 1 Game Studio routing, feature flags, and analytics * feat(opengame): add Stage 1 market, multi-client modal, Cursor HTTP fix, SuperAgent prompt, and i18n * fix(opengame): align nullable GameCardWithMeta fields and add opengame-catalog MCP capability * test(mcp-onboarding): update registered public tool count from 22 to 24 for Stage 1 game tools * chore(game-catalog): register 26 verified live R2 in-repo template bundles in game-downloads.json * fix(opengame): address Stage 1 review feedback and failing CI lanes - Send no play URL when GAME_PLAY_PUBLIC_ORIGIN is unset instead of a main-site path that no route serves; Studio falls back to bundled in-repo templates - Keep legacy-host 301 redirects on the configured origin for network-path inputs - Correct the BlenderKit page host in the asset search allowlist - Reuse the shared withdrawn list, TOP earning tag, curated order and comparator in Studio - Remove the unused shared prompt module; the shipped builders stay covered by Studio tests - Drop the blurred launch backdrop and the in-dialog copy notices in favour of Toasts - Describe the shipped read-only Game Studio boundary and 24-tool MCP contract in the architecture - Schedule the game skill and static play suites in CI and budget the three OpenGame events * fix(game-static-play): retry stalled template bundle downloads before failing the run * fix(game-asset-search): size the pagination cursor limit for every supported query A 200-unit query with non-ASCII, control or lone-surrogate characters produced a cursor longer than the 512-character limit, so nextCursor was rejected by both the decoder and the public schema. Share one limit derived from the worst-case JSON/base64url expansion and add a round-trip test for maximum-length queries. * fix(game-asset-search): accept BlenderKit pages on www.blendkit.com and guide licence checks www.blenderkit.com now redirects to www.blendkit.com and the upstream catalog returns that host, so requiring www.blenderkit.com dropped every BlenderKit result. Restore the live host, pin a real upstream row in tests, and tell Agents to confirm the licence on the source page when a source omits it. * fix(deploy): forward game play origin and legacy redirect hosts to the API deploy/.env.example and deploy/k8s/configmap.yaml declared GAME_PLAY_PUBLIC_ORIGIN and APP_REDIRECT_FROM_HOSTS, but neither the compose api service nor the reference api Deployment passed them to the process. Wire both and assert that every reference ConfigMap key is read by a workload. * Address review: keep legacy-host writes, enforce play-origin isolation, share catalog constants - Legacy-host redirects answer GET/HEAD with 301 and every other method with 308, so MCP and API writes keep their method and body. - parseConfig rejects a GAME_PLAY_PUBLIC_ORIGIN that is not https (loopback http excepted), carries a path, or shares or sits under the APP_PUBLIC_ORIGIN host. - The template id pattern, bundle key prefix, withdrawn set and TOP tag predicate live in shared/game-contract.ts; static play, deploy/verify scripts and the catalog service reuse them and the shared bundle URL builder. - Remove unused game-contract and model-catalog exports. - Update the MCP contract, AGENTS.md, README and docs to the 24-name phase-one surface and document the read-only OpenGame tools and guest catalog routes. * fix(game-static-play): make the full play-site upload resumable Upload through the S3 SDK instead of one aws CLI process per file, skip objects whose ETag already matches the local MD5, retry each request with backoff, and write assets before entry pages and the manifest. Give large bundle downloads time for a slow link. Record the provisioned bucket, domain and remaining header rule in the runbook. * feat(game-static-play): harden live play verification and add manual R2 publish workflow * fix(opengame): raise prompt/remix maxLength for >4k OG-13 test and reset notes on target change * fix(mcp): register resources/templates/list handler for Codex MCP compliance * chore(game-catalog): register uploaded tidebreaker bundle for 274/274 R2 CDN parity --------- Co-authored-by: heggria <bshengtao@gmail.com>
33 KiB
Connect OpenGame & OpenMotion (Cloud MCP)
OpenGame and OpenMotion share one hosted Streamable HTTP MCP service with OAuth 2.1 authentication (plus Personal Access Token fallback for non-OAuth clients). Do not install an npm package, clone this repository, or start a local Studio, Docker container, Chromium, or FFmpeg process.
- MCP Endpoint (Streamable HTTP):
{{ORIGIN}}/mcp - Authentication: OAuth 2.1 (auto-discovered via
{{ORIGIN}}/.well-known/oauth-protected-resource/mcp; Personal Access Tokenom_pat_*fallback for non-OAuth or PAT-preferred clients) - OpenGame Studio:
{{ORIGIN}}/studios/game(also reachable via{{ORIGIN}}/game) - Cloud Template Library (Video):
{{ORIGIN}}/?templates=1
Origin discovery & override:
- When this guide is served from a live deployment (
<ORIGIN>/install.md), every endpoint below is already bound to that deployment's origin ({{ORIGIN}}).- When reading the unrendered source file directly from GitHub (the
ORIGINplaceholder has not been expanded yet) and the user has not specified a staging, test, or self-hosted origin, fetchhttps://releases.open-design.ai/open-motion/desktop/config/stable.jsonand readpayload.studioUrlas<ORIGIN>, then fetch<ORIGIN>/install.md(or substitute<ORIGIN>for the placeholder everywhere below).- If the user explicitly asks to connect to a staging, test, or self-hosted origin, substitute that exact origin everywhere below. Never guess a host URL or silently switch environments.
Agent rules
- Derive
LANGfirst from the user's latest message (supported:zh,en,ja,ko,fr,es,pt; normalizezh-CN→zh, defaulten). - Auto-branch on connection state & Detect Mode A (pure setup) vs Mode B (task-driven handoff):
- Connected vs disconnected auto-branching:
- Already connected (active
openmotionMCP entry uses Streamable HTTP pointing to the exact target{{ORIGIN}}/mcp, has no conflicting legacy localstdioserver or local plugin, and tools are authorized): skip Steps 1–2 completely and jump straight into the user's task (or Mode A reply if pure setup). - Disconnected or stale local config (missing
openmotionMCP, still using legacy localstdio/ local plugin, or pointing to another origin): silently clean up the stale local registration in Step 1, add{{ORIGIN}}/mcp, trigger web OAuth login (or PAT fallback) in Step 2, and branch directly into Mode B or Mode A in Step 3.
- Already connected (active
- Mode A (pure setup): the user only asked to connect or install OpenGame / OpenMotion (no specific game brief, game template remix ID, community game reference,
projectId,templateId,skillId, reference video, or creative brief). Finish with Installation-success reply (or, if the user explicitly asked for standalone OpenGame setup with no video request, confirm connection and invite their game brief / template choice without forcing video starter cards). - Mode B (task-driven handoff — including ALL OpenGame tasks): the user's message already carries a game brief, official game template remix ID, community game inspiration link, game asset search, or a video
projectId,templateId,skillId, reference video, or creative brief. After connecting and authorizing against the exact target<ORIGIN>/mcp, auto-skip/api/onboarding/prepareand the three video starter template onboarding cards and go straight into the user's current game task (openmotion://workflow/game/start) or video task directly.
- Connected vs disconnected auto-branching:
- Verify transport and origin before reusing: do not skip Steps 1–2 just because
openmotion_get_projectoropenmotion_*tools are visible in this session—a legacy localstdioOpenMotion MCP server or local Codex plugin exposes overlapping tool names. Confirm the activeopenmotionentry uses Streamable HTTP (streamable_http/http) pointing to the exact target URL{{ORIGIN}}/mcpbefore skipping Steps 1–2. If it uses localstdio, comes from a legacy localopenmotionplugin, or points to a different origin, migrate/replace it in Step 1 first. - Never install a local runtime: do not run
git clone,npm install,npx @openmotion/app,docker compose, or local stdiomcp.ts. - Configure only the current host: preserve local project files, local game directories, exported videos, unrelated MCP servers, Skills, and settings. Never mention setup steps for unrelated clients in user-facing replies.
- Never narrate internal onboarding mechanics: never tell the user you are running "onboarding / 引导 / 中文模板引导", opening the template library, fetching three templates, or using a visualization skill to build preview cards—neither while waiting for authorization nor in progress updates before the final reply. Execute those steps silently and deliver only the final welcome and cards cleanly.
- Keep this guide internal to the Agent. Never show
/install.mdin user-facing replies or handoff messages. After authorization succeeds, tell the user how to start creating (games or videos). If the user needs a setup help link, share {{ORIGIN}}/mcp-setup.
Step 1: Add the Cloud MCP server
Before adding: remove legacy local stdio OpenMotion MCP or plugin (if present)
If this machine previously used local OpenMotion or local OpenGame, an old local stdio MCP entry or local plugin can conflict with or shadow the Cloud MCP endpoint. Inspect the current host first and remove only the legacy local MCP/plugin registration (never delete local game directories, local project directories, exported videos, standalone Skills, or unrelated MCP servers/plugins):
- Codex:
- Distinguish standalone
stdioMCP entries from legacy local plugins—never wipe unrelated local Skills, projects, or games (OPEND-5856). - Check
codex mcp list --jsonfor anopenmotionentry (or legacymotionentry) whosetransport.typeis"stdio"or whosetransport.urldiffers from{{ORIGIN}}/mcp. If found, remove only that stale MCP entry withcodex mcp remove openmotion(andcodex mcp remove motiononly when it is a legacy local OpenMotionstdioserver). - Check installed Codex plugins (for example
codex plugin list --json) for a legacy localopenmotionplugin bundling.mcp.jsonstdio(such asopenmotion@openmotion-localor a local-pathopenmotionplugin). If present, remove only that conflicting local plugin withcodex plugin remove <plugin@marketplace>so its bundled localstdioserver does not shadow Cloud MCP (keep all unrelated local Skills and files intact).
- Distinguish standalone
- Claude Code:
- Check
claude mcp list/claude mcp get openmotion. Ifopenmotionusesstdioor another origin, runclaude mcp remove openmotion(matching its scope such as-s useror-s local). If a repository.mcp.jsonstill registers localstdioopenmotion, warn the user instead of editing unrelated repository files.
- Check
- WorkBuddy:
- Inspect
~/.workbuddy-ai/mcp.json(or${WORKBUDDY_CONFIG_DIR}/mcp.json— WorkBuddy 5.9+ reads~/.workbuddy-ai/mcp.json, not~/.workbuddy/mcp.json). Replace any legacy localstdio"openmotion"entry with the remote Streamable HTTP endpoint{{ORIGIN}}/mcp.
- Inspect
- Cursor / Claude Desktop / Other MCP clients:
- Replace any legacy local
stdio"openmotion"entry with the remote Streamable HTTP endpoint (in Claude Desktop, remove any legacystdio"openmotion"entry fromclaude_desktop_config.jsonbefore adding the Custom Connector so both do not coexist).
- Replace any legacy local
- DeepSeek Harness (DSH):
- Replace the
mcp-openmotiontransport: stdioentry withtransport: streamable-httppointing to{{ORIGIN}}/mcp, and disable or remove any legacy localstdioOpenMotion plugin adapter.
- Replace the
Use only the row matching the current host (skip if openmotion is already configured as Streamable HTTP pointing to {{ORIGIN}}/mcp with no conflicting local plugin):
| Host | Add MCP server | Auth method & notes |
|---|---|---|
| Codex (default) | codex mcp add openmotion --url '{{ORIGIN}}/mcp' |
OAuth 2.1 (host OAuth RPC, codex mcp login --no-browser openmotion, or codex mcp login openmotion) |
| Claude Code (CC) | claude mcp add --transport http --scope user openmotion '{{ORIGIN}}/mcp' |
OAuth 2.1 (claude mcp login openmotion); supports full local game file authoring |
| DeepSeek Harness (DSH) | Cordis plugin YAML (transport: streamable-http, url: "{{ORIGIN}}/mcp", Authorization: "Bearer ${OPENMOTION_TOKEN}") — see snippet below |
Personal Access Token (om_pat_*) from {{ORIGIN}} → Settings → Account → Personal Access Tokens (never commit or echo raw tokens) |
| Cursor | One-click HTTP deeplink cursor://anysphere.cursor-deeplink/mcp/install?name=openmotion&config=<base64({"url":"{{ORIGIN}}/mcp"})> or add {"mcpServers":{"openmotion":{"type":"http","url":"{{ORIGIN}}/mcp"}}} to .cursor/mcp.json / ~/.cursor/mcp.json |
OAuth 2.1 (or PAT header fallback below); supports full local game authoring |
| WorkBuddy | Write Streamable HTTP server openmotion ({{ORIGIN}}/mcp) to ~/.workbuddy-ai/mcp.json (or ${WORKBUDDY_CONFIG_DIR}/mcp.json; not ~/.workbuddy/mcp.json), then open MCP 服务管理 → openmotion → 信任 (first-time trust confirmation is required or the connector stays gray/off) |
OAuth 2.1 primary + prominent PAT fallback: after clicking 信任, complete OAuth login; if WorkBuddy's OAuth callback fails, immediately switch to PAT header Authorization: Bearer <om_pat_*> (generate at {{ORIGIN}} → Settings → Account → Personal Access Tokens) so local game creation is never blocked. Verify with a read-only tool call (openmotion_game_catalog or openmotion_get_project). |
| 豆包工作 (Doubao Work) | Register remote Streamable HTTP MCP endpoint {{ORIGIN}}/mcp |
Auth checklist: ① confirm Streamable HTTP transport (POST/GET /mcp), ② verify OAuth 2.1 discovery ({{ORIGIN}}/.well-known/oauth-protected-resource/mcp) and callback approval or configure PAT Authorization: Bearer <om_pat_*>, ③ verify tools/list exposes openmotion_game_catalog, openmotion_game_asset_search, and multimodal tools |
| Claude Desktop / Claude.ai | Settings → Connectors → Add custom connector → {{ORIGIN}}/mcp |
OAuth 2.1. Local-write limitation (Stage 1 OpenGame): Claude Desktop has no local disk write permission by default and cannot write/serve local game source files — recommend Codex, Claude Code, or Cursor for local OpenGame development |
| Other MCP clients (VS Code / Windsurf / generic) | Add {"mcpServers":{"openmotion":{"type":"http","url":"{{ORIGIN}}/mcp"}}} (VS Code also supports vscode:mcp/install?{"name":"openmotion","type":"http","url":"{{ORIGIN}}/mcp"}) |
OAuth 2.1 (or PAT header Authorization: Bearer ${OPENMOTION_TOKEN}) |
| ChatGPT | Settings → Connectors → Add MCP Server → {{ORIGIN}}/mcp |
OAuth 2.1 (Video / Cloud projects only; Stage 1 local game authoring is hidden in Game Studio until Stage 2 cloud-hosted games launch) |
Client configuration templates
-
DeepSeek Harness (DSH — PAT Streamable HTTP YAML):
- insert: - id: mcp-openmotion name: '@deepseek-ai/dsh-mcp-client' config: serverName: openmotion transport: streamable-http url: "{{ORIGIN}}/mcp" headers: Authorization: "Bearer ${OPENMOTION_TOKEN}" failOnStartupError: true toolCallTimeoutMs: 180000 -
WorkBuddy (
~/.workbuddy-ai/mcp.json) / Generic PAT fallback JSON (when OAuth 2.1 is unavailable or blocked by the client; in WorkBuddy remember to open MCP 服务管理 → openmotion → 信任):{ "mcpServers": { "openmotion": { "type": "http", "url": "{{ORIGIN}}/mcp", "headers": { "Authorization": "Bearer ${OPENMOTION_TOKEN}" } } } } -
Optional entry Skill (non-blocking): you may install the lightweight
openmotionSkill once vianpx --yes skills@1.9.0 add nexu-io/openmotion --skill openmotion --global --agent <codex|claude-code|universal> --copy --yes(skip if already installed,OPENMOTION_SKIP_PUBLIC_SKILL=1, or if network/permissions fail). Detailed workflows — including all 21 OpenGame sections (openmotion://workflow/game/*) and video workflows — are served dynamically from the cloud MCP viaresources/read(openmotion://workflow/*).
Step 2: Authorize via OAuth 2.1
- Skip login if already authorized:
- In Codex, if
codex mcp list --jsonconfirmsopenmotionhas"transport": { "type": "streamable_http", "url": "{{ORIGIN}}/mcp" }(transport.type === "streamable_http"andtransport.url === "{{ORIGIN}}/mcp") and already reports"auth_status": "o_auth"(with no conflicting legacy localopenmotionplugin), skip login and go straight to Step 3. - In Claude Code, run
claude mcp get openmotion— if transport is HTTP pointing to{{ORIGIN}}/mcpand status is alreadyConnected, skip login and go straight to Step 3.
- In Codex, if
- Run login (prefer the host's built-in browser when available):
- Hosts with a built-in browser (e.g., Codex Desktop / CUA):
- Prefer completing OAuth inside the host's built-in browser (such as
open_in_codexwithplacement: "right",target: { type: "browser", url: authorizationUrl }, or CUA IAB) so the user signs in and approves access in the same browser that will later display the cloud editor:- Host-managed OAuth RPC (preferred — survives across turns): when the host exposes an OAuth RPC returning
authorizationUrl(such as Codex Desktopconfig/mcpServer/reload+mcpServer/oauth/loginwith{ "name": "openmotion", "timeoutSecs": 300 }), call it and prefer openingauthorizationUrldirectly inside the host's built-in browser. Because the host owns the callback listener, you may send the short login prompt and end your turn to wait for the user. - CLI login (
codex mcp login --no-browser openmotion) — process-bound callback listener: only use this when no host OAuth RPC exists and the current shell can keep the CLI process alive (180–300stimeout) inside an interactive PTY / persistent shell with stdin kept open (do not close stdin with< /dev/null) until it exits0. It suppresses the default system browser launch, prints the authorization URL, and listens onhttp://127.0.0.1:<port>/callbackonly while the CLI process stays running—capture the printed URL, open it in the host's built-in browser, and wait for exit0in the same turn. Never launchcodex mcp loginin an Agent shell and end your turn (or let a short shell timeout expire) while waiting for the user to click Allow / 同意授权, or the loopback listener will terminate and the callback URL will fail withERR_CONNECTION_REFUSED. - If the host lacks an OAuth RPC and cannot keep a shell login process alive while waiting for user approval: skip shell-launched CLI login and immediately use Step 2.3 Fallback below so the user runs
codex mcp login openmotionin their own persistent local terminal (or clicks Connect / Log in in the client UI).
- Host-managed OAuth RPC (preferred — survives across turns): when the host exposes an OAuth RPC returning
- Send only a brief prompt to sign in and click Allow / 同意授权 (and share the clickable link if needed; never mention onboarding, templates, or internal verification), then wait for completion.
- If
--no-browseris unsupported by the local CLI, the host cannot open the URL in a built-in browser, or sign-in/callback is blocked inside the built-in browser (for example, third-party OAuth restrictions or localhost callback blocking), fall back to runningcodex mcp login openmotionin the shell (timeout180–300s), which opens the user's system browser and listens for the callback:- Exit
0: authorization succeeded — proceed immediately to Step 3 without asking the user to confirm. - Non-zero exit (e.g., user clicked Deny / 拒绝 or canceled): report briefly that authorization was not completed and stop.
- Exit
- Prefer completing OAuth inside the host's built-in browser (such as
- CLI hosts without a built-in browser (Codex CLI / Claude Code):
- Codex CLI: run
codex mcp login openmotiondirectly in the shell with a generous timeout (180–300s). It automatically opens the user's system browser and listens for the OAuth callback (continue on exit0; report briefly and stop on non-zero exit). - Claude Code: run
claude mcp login openmotiondirectly with a generous timeout (180–300s). If the shell reports stdin is not a terminal, launch it inside a PTY and poll the log until authentication completes (if the browser did not open, share the printed authorization URL):- macOS:
script -qF /tmp/openmotion-login.log claude mcp login openmotion < /dev/null > /dev/null 2>&1 & - Linux:
script -qfc "claude mcp login openmotion" /tmp/openmotion-login.log > /dev/null 2>&1 & - Once authenticated (
Authenticated with/ exit0), proceed immediately to Step 3. If denied/failed, report briefly and stop.
- macOS:
- Codex CLI: run
- Hosts with a built-in browser (e.g., Codex Desktop / CUA):
- Fallback when shell cannot open a browser or bind localhost (sandboxed / remote / headless):
- If the host exposes a non-blocking OAuth RPC (e.g. Codex Desktop
config/mcpServer/reload+mcpServer/oauth/loginwith{ "name": "openmotion", "timeoutSecs": 300 }), call it to getauthorizationUrl, open it in the built-in browser when available or send only the clickable link with a brief note to sign in / click Allow / 同意授权 and reply when done (never mention onboarding, templates, or internal verification), and end your turn to wait. - Otherwise, stop and tell the user in plain language (
LANG) using only their host's single action:- Run
claude mcp login openmotion/codex mcp login openmotionin their local terminal (add--no-browserover SSH; in Claude Code they can also use/mcp→openmotion→ Authenticate; in GUI clients, click Connect / Log in). - Sign in to their OpenDesign account (skipped if already signed in) and click Allow / 同意授权.
- Ask them to reply once authorized to continue (e.g., "授权完成后告诉我一声即可。" / "Let me know once you've authorized."). Never mention verification details, onboarding, template library, or recommended templates in this waiting message.
- Run
- If the host exposes a non-blocking OAuth RPC (e.g. Codex Desktop
Silent browser-session context (do NOT mention proactively to the user): A host's built-in browser uses an isolated profile and does not share login cookies with the user's system browser (Chrome/Safari/etc.); sessions in the two browsers stay independent. Never bring this up unprompted during setup, authorization, or normal project opening. Use this knowledge only if the user asks why their built-in browser and system browser show different sign-in states, or if an opened project hits the Studio sign-in or workspace-mismatch gate after authorization happened in a different browser (in which case, concisely guide them to sign in or switch to the same OpenDesign account and workspace in that browser).
HARD GATE — Never run Onboarding while login is still pending: If the user still needs to sign in or approve access in the browser, end your turn after sending the short login guidance and wait for their reply. Do NOT call
/api/onboarding/prepare, do NOT claim OpenMotion is connected (🎉 OpenMotion 连接好啦), and do NOT mention or print the welcome message or template recommendations in the same reply as a pending login prompt.
Step 3: Verify connection & Continue (Mode A Onboarding / Mode B Task)
Run this section only after authorization is complete (already "o_auth" / Connected, mcp login exited 0, or the user confirmed authorization). In Mode A (pure setup), run verification, /api/onboarding/prepare, template-library opening, and card preparation silently—do not send progress commentary announcing "I will open the template library", "I will show three onboarding templates", or "I will use a visualization skill to make preview cards". In Mode B (task-driven handoff), skip onboarding completely and resume the user's task directly.
- If
openmotion_*tools (such asopenmotion_get_projector the OpenGame catalog tools) are already available in this session:- Mode A (pure setup):
- If the user asked specifically to connect OpenGame (standalone game setup with no video request): confirm the cloud MCP connection is live, mention they can browse
{{ORIGIN}}/studios/gameor send any game brief / template remix request, and stop — do not run video starter template onboarding. - Otherwise (general OpenMotion / video setup): call
openmotion_get_project({})once to verify workspace access (an authorized OAuth client can access all of your projects in the selected workspace), then proceed directly to Installation-success reply in this conversation.
- If the user asked specifically to connect OpenGame (standalone game setup with no video request): confirm the cloud MCP connection is live, mention they can browse
- Mode B (task-driven handoff — including ALL OpenGame tasks): do not run
/api/onboarding/prepareor show generic video onboarding template cards — for game creation, official template remix, community inspiration remake, or 2D/3D game asset search, readopenmotion://workflow/game/startviaresources/readand continue the game task immediately; for video tasks, callopenmotion_get_project(oropenmotion_get_template/openmotion_get_skillas requested) and continue directly.
- Mode A (pure setup):
- If registration and authorization succeeded, but this installation session has not loaded
openmotion_*tools yet:- Confirm registration/auth (
codex mcp list --jsonshowing"auth_status": "o_auth", orclaude mcp get openmotion). Do not reinstall or restart the host. - Auto-handoff to a ready session when the host supports creating and switching conversations (e.g. Codex Desktop) — skip this if the current conversation was already started as a handoff:
- Discover host thread tools via
tool_search(or scan visible tools) forcreate_thread,send_message_to_thread,navigate_to_codex_page,set_thread_title, andlist_projects. - Preserve the current workspace/project container (use the same project/workspace target if this chat is project-scoped; stay projectless if projectless).
- Create a new conversation (optional title:
OpenMotion) and send the handoff message inLANGso the new session loads allopenmotion_*tools (make sure the new thread actually contains this message—ifcreate_threaddoes not take an initial message, callsend_message_to_threadimmediately):- Mode A (pure setup):
zh:OpenMotion 已连接并授权。请先静默调用 openmotion_get_project({}) 验证工作区访问,打开模板库并调用 {{ORIGIN}}/api/onboarding/prepare?lang=zh-CN 展示欢迎语和 3 张精选模板推荐卡片(不要输出内部验证细节或安装指南链接),等待用户发送具体创作需求后再创建项目。en(or localize toLANG):OpenMotion is connected and authorized. Silently call openmotion_get_project({}) to verify workspace access, open the template library, and call {{ORIGIN}}/api/onboarding/prepare?lang=en to deliver the localized welcome copy and 3 template preview cards (without internal verification notes or installation guide links). Wait for the user's creative brief before creating a project.
- Mode B (task-driven handoff): forward the user's complete original task/prompt verbatim (preserving game brief, official game template ID, community inspiration link,
projectId,templateId,skillId, URLs, and all requirements) prefixed with one short status line (e.g.OpenGame / OpenMotion 云端 MCP({{ORIGIN}}/mcp)已连接完成,请直接继续以下任务(跳过视频模板新手引导):/OpenGame / OpenMotion Cloud MCP ({{ORIGIN}}/mcp) is connected. Continue directly with the task below (skip video template onboarding cards):). Never drop the user's task context during auto-handoff.
- Mode A (pure setup):
- Call
navigate_to_codex_page(or the host's switch tool) to move the user straight into the new conversation. - In this installation conversation, briefly confirm authorization and the switch. For Mode A, invite the user to send their creative request in the new chat. For Mode B, tell them their original request is already there. Show onboarding cards only in the new chat if applicable.
- Discover host thread tools via
- Fallback when the host cannot create or switch chats, or handoff fails. Confirm authorization and give the next action in
LANG. In Codex, sayOpenMotion is connected and authorized. Open a new Codex chat and send your creative request there.In Chinese, sayOpenMotion 已连接并授权。请打开一个新的 Codex 聊天,并在那里发送你的创作需求。For Mode B, ask the user to resend their original request there. In another MCP client, refer to a new conversation in that client.
- Confirm registration/auth (
Installation-success reply
Run this section only in Mode A (pure setup) after authorization is complete and the current conversation has the OpenMotion tools. Use the fallback above if the tools have yet to load.
Output purity rule. Emit the exact maintained welcome copy returned by
/api/onboarding/prepareverbatim. Keep verification details and the Agent installation guide out of the welcome.
1. Prepare frozen 3-of-4 recommendations from the cloud API
Call the stateless cloud onboarding endpoint once with LANG:
curl -fsSL "{{ORIGIN}}/api/onboarding/prepare?lang=${LANG}"
It returns:
templateIds: three distinct curated IDs sampled without replacement fromshared/onboarding-templates.ts(keep this exact order across every surface and retry; pass&templates=id1,id2,id3on retry so the selection never redraws).libraryUrl:{{ORIGIN}}/?templates=1.welcomeMarkdown,fallbackWelcomeMarkdown,noSidebarWelcomeMarkdown, andnoSidebarTextWelcomeMarkdown: localized maintained welcome copy inLANG.inlineHtmlUrl,inlineHtmlSha256, andinlineHtmlBytes: self-contained< 1,000,000-byte HTML card fragment with embedded silent VP9 WebM previews and JPEG posters.cardPresentation: exact arguments foropenmotion_show_template_recommendations.dshCardPresentation: exactpropose_actionarguments formatted for DSH'sdetailsSchema(id,title,description, videopreviewUrl,posterUrl,duration).templates: ordered metadata (position,templateId,title,summary,durationSeconds,previewUrl,posterUrl,videoUrl) for text fallback.
Never substitute built-in examples (product-promo, nyt-graph, decision-tree) for the curated onboarding pool unless the user explicitly asks for them.
2. Open the cloud template library once (without creating a project)
- Call
openmotion_open_preview({ "target": "templates", "action": "open" })to obtainpreviewUrland useprepare.libraryUrl({{ORIGIN}}/?templates=1) if needed. - On hosts with a right-hand browser pane (such as Codex Desktop
open_in_codexwithplacement: "right", CUAcua.createBrowserTab('iab', url, { visible: true }), or DSH workspace view), open or reuse that tab once. Do not run extra snapshots, screenshots, inventory, layout, or playback audits. - On CLI hosts without a right-hand browser pane (such as Claude Code terminal), do not claim a right-hand library opened—provide the clickable
libraryUrlusingnoSidebarWelcomeMarkdown/noSidebarTextWelcomeMarkdown. - Never create a placeholder project during onboarding.
3. Deliver the localized welcome and three template preview cards
Choose the best supported card surface for the current host (host identity alone is not a reason to downgrade to text):
- Native MCP App (when
openmotion_show_template_recommendationsis natively discovered):- Call
openmotion_show_template_recommendationswithprepare.cardPresentation.arguments({ templateIds, language, onboarding: true }) when the right-hand library opened (the component renders the welcome above the three interactive cards—do not duplicate it in text). - If the host has no right-hand pane or library opening failed/is unconfirmed, pass
prepare.cardPresentation.cardsOnlyArguments(onboarding: false) and emitprepare.noSidebarWelcomeMarkdownin reply text.
- Call
- Self-contained HTML visualization cards (Codex default when the native MCP App is unavailable):
- Download into the current chat's explicitly permitted visualization directory:
curl -fsSL "<prepare.inlineHtmlUrl>" -o "<HOST_VISUALIZATION_DIR>/openmotion-welcome.html" - Verify SHA-256 matches
prepare.inlineHtmlSha256and size is< 1,000,000bytes. - Emit
prepare.welcomeMarkdownverbatim (when the right-hand library opened) orprepare.noSidebarWelcomeMarkdown(otherwise), followed immediately by:visualize{"path":"<HOST_VISUALIZATION_DIR>/openmotion-welcome.html"} - Do not summarize the welcome or replace it with a technical status report.
- Download into the current chat's explicitly permitted visualization directory:
- DSH conversation cards:
- Load
prepare.dshCardPresentation.skill(openmotion-template-recommendations) and callpropose_actionwithprepare.dshCardPresentation.arguments(settingdetails.libraryOpened: trueonly after confirmed library opening). Do not pass rawprepare.templatesdirectly: DSH expectsid,description,duration, and video-streampreviewUrl(videoUrl), whichprepare.dshCardPresentation.arguments.details.templatesalready supplies.
- Load
- Text fallback (CLI / hosts without card UI, or when card rendering fails):
- Emit
prepare.fallbackWelcomeMarkdown(if a right-hand library opened) orprepare.noSidebarTextWelcomeMarkdown(otherwise), then list the exact three items fromprepare.templatesin order with title, summary, and clickablepreviewUrl, and briefly note that this client does not render interactive preview cards.
- Emit
Welcome copy reference
When the right-hand library opened, the maintained Chinese welcome is:
🎉 OpenMotion 连接好啦,右侧就是模板库!
我是你的开源视频创作搭档,我有丰富的高水准视频模板,也支持从参考视频或一个灵感出发,和你一起创作精彩的视频。
模板库支持搜索,也可以随意浏览,找到喜欢的点击「复刻模板」就能开始你的创作!
不想自己找?先看看我挑的这 3 个 👇
When there is no right-hand browser pane (or opening failed/is unconfirmed), replace only the first line with a truthful heading plus the clickable library link (e.g. 🎉 OpenMotion 连接好啦!模板库:{{ORIGIN}}/?templates=1), keeping the rest unchanged.
Completion boundary and next turn
- Do not create or export a video unasked. Stop after onboarding and wait for the user's choice or creative brief.
- If the user later submits a brief in the same installation conversation and native
openmotion_*tools are still not exposed: do not fall back to authoring local HTML without OpenMotion MCP—only then briefly ask the user to paste their brief into a new conversation where the OpenMotion tools are loaded. - Accepted template selection: when the user chooses a card and submits a brief, call
openmotion_get_templatewith that exacttemplateId. Reuse the editable project (openmotion://workflow/template/start) whenhasHtmlProjectistrue; useopenmotion://workflow/recreate/startonly when it has no editable project. Never silently swap templates. - Cloud media import: local host paths (
sourcePath) are unsupported in cloud mode—useopenmotion_import_assets(prepare_upload→ presigned PUT →upload_ticket, public HTTPSurl, or workspacelibrary_asset).
Troubleshooting
- OAuth callback timeout (
ERR_CONNECTION_REFUSEDon127.0.0.1:<port>/callback):127.0.0.1:<port>/callbackis the MCP client's temporary OAuth PKCE loopback listener (not a local OpenMotion server). This error happens when the CLI login command timed out or was killed when the Agent ended its turn before Allow / 同意授权 was clicked. Re-run the host OAuth RPC—or have the user runcodex mcp login openmotion/claude mcp login openmotionin their own persistent local terminal—and approve promptly while that process stays running. - Legacy local OpenMotion still responds or conflicts with Cloud MCP: verify the active
openmotionMCP entry usesstreamable_http/httppointing to{{ORIGIN}}/mcp, remove any legacy localstdioopenmotionentry (codex mcp remove openmotion/claude mcp remove openmotion) and any legacy local Codex plugin (codex plugin remove <plugin@marketplace>), re-add the cloud endpoint, and open a new conversation. 401 Unauthorizedon/mcp: token expired or revoked—re-run OAuth login (or create a fresh PAT in Settings → Account → Personal Access Tokens).PROJECT_NOT_FOUNDfor an existing web project: check that your connected MCP server URL matches the exact origin of the project URL (for example{{ORIGIN}}/mcpvs a staging/test origin) and that you selected the matching workspace during OAuth login. Re-run OAuth login to switch workspaces if needed.- Built-in browser asks to sign in or shows "Project not in current workspace" while MCP works: the host's built-in browser keeps separate cookies from the system browser. Have the user sign in (or switch account/workspace in Account settings) inside the built-in browser using the same OpenDesign account and workspace authorized for MCP.