# protocol

Part of the [scripting reference](index.md), written by the engine so it matches your `frost`. Start with [your first game](../start/first-game.md) if you are new.

Use when inspecting or driving a running game through MCP or JSON-RPC, debugging a dark pixel, profiling, or testing agent edits.

## Read, drive and inspect

`frost dev game.toml` plays and exposes a local protocol port. `frost serve game.toml`
serves JSON-RPC, one object per line on standard input/output; `frost mcp game.toml`
serves the same catalogue as MCP tools. Join an editor's session with
`frost mcp --join-file PATH`. A planning hand can read documentation without changing
its game. Use the join file the editor supplies; tokens belong to that session.

`frost protocol` lists commands; `frost protocol world.get` describes one.
`frost reference protocol.world.get` fetches the same declaration. Inside the editor:
`reference.read {name: "protocol.world.get"}`. Script names and protocol names can
differ: `get` is a script call, `protocol.world.get` is the protocol declaration.

Start with `game.info`, `world.entities`, `world.components`, `world.get` and
`script.state`. `input.set` holds actions and `game.step` advances; `game.seek`
replays the project's recording. `frame.capture` takes a picture; `frame.at` picks
what is there. `game.check` checks files. `game.snapshot` and `game.restore` support
trials. `blame.on`, `blame.value` and `profile.steps` explain writes and time.
Fetch each declaration before using it: required fields, trust and limits are there.

## Command names

- `protocol.reference.read`
- `protocol.reference.search`
- `protocol.game.info`
- `protocol.game.check`
- `protocol.game.step`
- `protocol.game.seek`
- `protocol.game.time`
- `protocol.game.reset`
- `protocol.game.snapshot`
- `protocol.game.restore`
- `protocol.game.forget`
- `protocol.game.try`
- `protocol.tuning.set`
- `protocol.input.set`
- `protocol.input.keys`
- `protocol.input.history`
- `protocol.stream.read`
- `protocol.world.entities`
- `protocol.world.get`
- `protocol.world.bone`
- `protocol.world.series`
- `protocol.world.query`
- `protocol.world.set`
- `protocol.world.spawn`
- `protocol.world.move`
- `protocol.world.despawn`
- `protocol.world.insert`
- `protocol.world.remove`
- `protocol.world.apply`
- `protocol.world.components`
- `protocol.world.checksum`
- `protocol.change.test`
- `protocol.copy.make`
- `protocol.copy.list`
- `protocol.copy.drop`
- `protocol.copy.land`
- `protocol.copy.rebase`
- `protocol.copy.landed`
- `protocol.copy.queue`
- `protocol.copy.flush`
- `protocol.copy.events`
- `protocol.copy.claim`
- `protocol.copy.diff`
- `protocol.copy.park`
- `protocol.copy.give`
- `protocol.scene.load`
- `protocol.script.reload`
- `protocol.script.state`
- `protocol.save.list`
- `protocol.save.set`
- `protocol.project.add`
- `protocol.project.remove`
- `protocol.project.refs`
- `protocol.project.rename`
- `protocol.project.undo`
- `protocol.project.redo`
- `protocol.frame.capture`
- `protocol.frame.at`
- `protocol.frame.in`
- `protocol.frame.view`
- `protocol.render.passes`
- `protocol.events.read`
- `protocol.events.since`
- `protocol.physics.read`
- `protocol.ground.at`
- `protocol.ui.tree`
- `protocol.ui.focus`
- `protocol.blame.on`
- `protocol.blame.value`
- `protocol.blame.entity`
- `protocol.blame.gone`
- `protocol.blame.pixel`
- `protocol.audio.requests`
- `protocol.assets.from`
- `protocol.assets.sources`
- `protocol.assets.cooked`
- `protocol.assets.picture`
- `protocol.script.reloads`
- `protocol.debug.attach`
- `protocol.debug.detach`
- `protocol.debug.breakpoints`
- `protocol.debug.pause`
- `protocol.debug.continue`
- `protocol.debug.step`
- `protocol.debug.state`
- `protocol.debug.stack`
- `protocol.debug.scope`
- `protocol.debug.expand`
- `protocol.debug.evaluate`
- `protocol.log.since`
- `protocol.graph.uses`
- `protocol.script.complete`
- `protocol.profile.frame`
- `protocol.profile.frames`
- `protocol.profile.steps`
- `protocol.session.hello`
- `protocol.session.hands`
- `protocol.session.writes`
- `protocol.session.mode`
- `protocol.session.token`
- `protocol.net.host`
- `protocol.net.join`
- `protocol.net.run`
- `protocol.net.condition`
- `protocol.net.status`
- `protocol.net.desync`
- `protocol.net.leave`
