--- name: lucky-engine description: Control Lucky Engine scenes, robots, simulations and recordings through its authenticated API. --- # Lucky Engine external-agent access Base URL: https://web.luckyrobots.com Production host: https://web.luckyrobots.com Use this request origin for a native Cloudflare branch preview; never invent a feature subdomain. ## Discover the application Human tutorial: https://web.luckyrobots.com/tutorial.html (Juniper, learned G1 motions, recordings, advisory Jev, implemented versus planned). Connect: https://web.luckyrobots.com/agents Complete operation registry: https://web.luckyrobots.com/agent/manifest.json HTTP schemas: https://web.luckyrobots.com/agent/openapi.json Workflow index: https://web.luckyrobots.com/agent/workflows.json Executable agent guide: https://web.luckyrobots.com/agent/AGENT-GUIDE.md Motion contract/import guide: https://web.luckyrobots.com/agent/MOTIONS.md Recording reference: https://web.luckyrobots.com/agent/RECORDING.md Task execution: https://web.luckyrobots.com/agent/TASK-EXECUTION.md Behavior APIs: https://web.luckyrobots.com/agent/scripting.json and https://web.luckyrobots.com/agent/SCRIPTING.md Raw bridge tuples: https://web.luckyrobots.com/agent/engine-methods.json The project/snapshot/scene schemas linked from the manifest are generated from actual engine types. ## Authenticate and execute Register with your email and password, then obtain account approval. Sign in to your approved account. In Settings → Agent connections create a named, scoped, expiring personal key; copy it once. Use Authorization: Bearer, never URL parameters. Keys retain current account permissions and policy; revoke in Settings. No inference key is needed for deterministic operations or an imported ONNX policy. Download https://web.luckyrobots.com/agent/lucky.mjs. Set LUCKY_URL and LUCKY_API_KEY in your local environment. Run node lucky.mjs discover. Use execute ''. Cloud operations work without an editor. Create a runtime for an owned project and start node lucky.mjs runner --session . The runner requires installed Playwright/Chromium and executes the actual browser engine. Cloudflare coordinates and stores data; browser workers run physics, ONNX inference and encoding. Runtime operations need sessionId, generation, revision, idempotencyKey. A 202 is queued only. Poll /api/v1/jobs/; inspect actual motion/contacts/task state. Closed/disconnected runtimes never return fabricated success. Cancellation may leave partial physical changes; inspect before retrying. Use project.save to save an authored change with optimistic cloud revision protection. Human edits in another editor can conflict; preserve and export your draft instead of overwriting. ## Imported learned motions Upload bytes as an owned artifact, then asset.import with kind motion for a prepared ONNX/policy ZIP, or kind project for a portable scene. motion.list returns device-local imported models/contracts. motion.attach binds an assetId to a compatible robotId; use assetId null to detach or enabled false to disable. simulation.command play/step awaits inference; reset restores exact entry state. runtime.inspect exposes simulation.motions. recording.run resets and records the rollout. project.save/project.export retain the model in the portable project. Included example: https://web.luckyrobots.com/motions/g1-aiming.lucky.zip. Import as a project. It uses 0.005-second physics ticks and 50 Hz inference (four physics ticks per action); the full clip is 400 physics steps, 100 inferences, and 61 recorded 30 fps frames including frame zero. Request a 3-second recording budget to include the final boundary; it stops at reference completion. A 2-second frame budget holds only 60 samples. Only prepared mjlab fused G1 policies are supported: compatible 29-joint robot/PD actuators, exact observation contract and gains, embedded normalization/reference, declared initial pose/velocity and physics rate. Arbitrary ONNX networks, policy blending, velocity-command walking and in-browser training are unsupported. Disable/detach an enabled policy before another controller drives its robot. finished-reference is not episode success. Recording traces retain physics_hz, raw_ctrl_ticks, motion_trace (observations/actions/hash/inferenceTick), and initial_state. Replay uses these recorded controls without rerunning policy inference. Imported models live on the runtime device; save/export a portable project before closing a disposable runner. ## MCP clients MCP endpoint: https://web.luckyrobots.com/mcp, Streamable HTTP. Configure your client's bearer header. This personal-key mode is not OAuth. Tools use underscored operation names: asset_import, motion_list, motion_attach, simulation_command. Prompts: panda-sweep, juniper-fruit, g1-learned-motion. Codex TOML: [mcp_servers.lucky_engine], url = "https://web.luckyrobots.com/mcp", bearer_token_env_var = "LUCKY_API_KEY". Claude project .mcp.json: {"mcpServers":{"lucky_engine":{"type":"http","url":"https://web.luckyrobots.com/mcp","headers":{"Authorization":"Bearer ${LUCKY_API_KEY}"}}}}. Substitute the environment variable locally; never commit a real key. Official client references: https://developers.openai.com/codex/mcp and https://code.claude.com/docs/en/mcp . Units: meters, seconds, radians; Z up; camera FOV degrees. Project.physicsTimestep defaults to 0.002 seconds and may be 0.005; the compiled model is authoritative. Step counts are physics ticks. Actuator units are model-specific. Action acceptance, reference completion and measured task success are distinct. Jev reviews and assistant routing are optional paid services. Original datasets remain unchanged; labels and confidence are advisory. Automatic weakness mining, camera optimization and runtime AI Decision components remain planned, not available operations.