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 serverInspect 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.
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", {});
// 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:
$ 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:
{
"mcpServers": {
"hotrepl": {
"command": "npx",
"args": ["-y", "@hotrepl/mcp"]
}
}
}
# 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.
@hotrepl/sdk C# SDK .NET build tools and tests HotRepl.Sdk CLI Shell scripts and local workflows @hotrepl/cli MCP Coding-agent tool catalog @hotrepl/mcp Author typed commands Host-side typed automation docs/authoring-commands.md Protocol reference Clients and frame debugging command_callArtifacts 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.