HotRepl

Live Unity automation over WebSocket

Embed in any Unity game via BepInEx or MelonLoader. Inspect the live runtime with C# eval, expose stable typed commands, attach artifact references, and drive everything from SDKs, shell scripts, or MCP-enabled agents.

$ bun add @hotrepl/sdk or npx -y @hotrepl/mcp for the agent server

Inspect the live runtime

Run C# on the game's main thread to inspect objects, diagnose state, and apply one-off repair snippets without rebuilding.

Ship typed commands

Register schema-validated host operations for repeatable exports, tests, and automation that survive beyond an interactive eval session.

Automate from SDKs and agents

TypeScript SDK, C# SDK, CLI, and MCP all speak the same loopback WebSocket protocol and see the same command catalog.

Quickstart

Prerequisite: the BepInEx plugin (Mono) or MelonLoader mod (IL2CPP) is loaded and listening on ws://127.0.0.1:18590. Outcome: connect once, evaluate a live runtime value, then call stable typed commands through the same session.

TypeScript SDK
import { connect } from "@hotrepl/sdk";

const session = await connect();

// Any C# on the game's main thread:
const product = await session.eval<string>(
  "UnityEngine.Application.productName",
);

// Typed, schema-validated game command:
const preflight = await session.run<{
  writable: boolean;
  freeMb: number;
}>("archive.preflight", {});
↳ Returned by the game
// product  →  EvalResponse
{
  hasValue:   true,
  value:      "Ardenfall",
  valueType:  "System.String",
  durationMs: 7,
}

// preflight  →  Result<T>
{
  output: {
    writable: true,
    freeMb:   41213,
  },
  artifacts: {},
}

Same operations, same wire protocol, from your shell:

CLI
$ hotrepl eval 'UnityEngine.Application.productName'
Ardenfall

$ hotrepl run archive.preflight '{}'
{"writable":true,"freeMb":41213}

Or wire the same runtime into your MCP-enabled coding agent:

MCP server config
{
  "mcpServers": {
    "hotrepl": {
      "command": "npx",
      "args": ["-y", "@hotrepl/mcp"]
    }
  }
}
↳ Tools the agent sees
# Eval
hotrepl_eval
hotrepl_complete
hotrepl_reset

# Typed commands
hotrepl_list_commands
hotrepl_describe_command
hotrepl_run

# Inspection
hotrepl_info
hotrepl_read_artifact
hotrepl_journal

Choose your path

All paths use the same runtime and command catalog.

Artifacts are references, not payloads

Typed commands return artifact refs with uri, path, sha256, byteSize, and finalized. Large files stay on disk. Clients receive stable metadata they can verify, stream, or hand to build pipelines.

Real consumers