spawn_client_join
Join a Spawn world as a real player to boot a live room for running commands and reading logs without a browser or GPU; the body self-expires at ttl.
Instructions
Put YOUR OWN BODY in the world as a real player — no browser, no GPU. This is the cheap way to get a LIVE ROOM, and a live room is what spawn_exec and spawn_logs need: a room boots for a player and never for a door, so until a body stands they answer 409 no_live_room / 5xx. Before this, the only way to boot one was spawn_play_open (headed Chromium with a working WebGPU adapter); this needs neither, so it works on a machine with no GPU and costs a fraction of the time. It is also how you PLAY the game you are building: the body is a real player wearing your name, it appears in the room's census beside the creator and Savi, and the world's own player hooks fire for it like anyone's.
The session is a detached background process that outlives this call, so join once and then use spawn_exec / spawn_logs / spawn_client freely. It SELF-EXPIRES at ttl (default 600s) — that is the safety net that stops a forgotten body standing in someone's world forever — so raise ttl for a long session and call spawn_client_leave when you are done. Needs Bun (the client's session shell is spawned as bun); the error says so if it is missing.
Joining is the same on every engine — it is the play door, not the write path — so this takes no engineVersion.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as | No | Display name for the body (defaults to your account's name). | |
| ttl | No | Seconds the body stands before it self-departs. The room stays live for exactly this long, so size it to the work: a screenshot loop is minutes, not hours. | |
| body | No | Model URL to wear (a /cdn/ address or an https .glb), instead of the default body. | |
| world | No | World to join: an @user/world address, or a world id. Defaults to this project's SPAWN_VARIANT_ID, which is usually what you want. | |
| session | No | Session name, so one machine can stand more than one body (default 'default'). Every verb takes it; a session self-expires at its ttl. | |
| projectDir | No | Absolute path to the Spawn game project (.env). Defaults to SPAWN_PROJECT_DIR or the MCP process cwd. |