AI Agents (MCP)
The Estella editor speaks the Model Context Protocol (MCP). Any MCP-capable AI tool — Claude Code, Cursor, or your own agent — can drive the real editor: open or create projects, open scenes, spawn entities from the same Create-menu catalog you use, edit component fields, verify the result in the live engine World, enter play mode, take screenshots to see what it built, and export the finished game — the exact pipelines the UI uses, more than a hundred tools in all.
Connecting an AI tool
Section titled “Connecting an AI tool”One-click add
Section titled “One-click add”Window → Connect AI Tools… (also the “AI agent” mark in the status bar, and the
“Connect an AI tool…” button in Settings) opens the connect dialog. It lists the
Claude Code, Cursor, Claude Desktop and VS Code installed on the machine, each with a
Connect / Disconnect button: connecting writes the editor into that tool’s own MCP
config (only the estella entry; everything else in the file is kept) and opens
“Allow AI agents to connect”. The state is read off the config, so deleting the entry
by hand shows it as not connected. A config file it cannot parse is refused, never
overwritten.
- No Node.js install needed — the entry runs the bundled script on the editor’s own executable.
- What an agent may do is switched in the dialog: Read only / Can edit. It belongs to the editor window you switch it in: it is never saved, so every editor starts read-only, and granting edits in one open editor says nothing of another. The editor decides it live and the entries carry no permission, so a change reaches every connected tool at once, with no restart and no config rewritten.
- Whether it really connected is the line at the bottom: “Last call: Claude Code, 12 s ago”. An entry being written does not mean the tool uses it; that line does.
- Tools the editor cannot write for (Windsurf, Zed, Codex…) get the same entry as text under “Other tools” — JSON, TOML or a command, paths filled in — to copy.
The manual setup below is for tools the switches do not cover.
The MCP server is a small node script that ships inside the editor. It talks MCP over stdio to your AI tool and drives an editor instance for you (spawning one, or attaching to one that’s already open).
Its path inside an installed editor:
- Windows —
%LOCALAPPDATA%\Programs\@estellaeditor\resources\app.asar.unpacked\dist-electron\mcp\editor-mcp.mjs - macOS —
/Applications/Estella Editor.app/Contents/Resources/app.asar.unpacked/dist-electron/mcp/editor-mcp.mjs
claude mcp add estella --env ESTELLA_MCP_ALLOW_WRITES=1 -- \ node "<path-to>/editor-mcp.mjs" --editor{ "mcpServers": { "estella": { "command": "node", "args": ["<path-to>/editor-mcp.mjs", "--editor"], "env": { "ESTELLA_MCP_ALLOW_WRITES": "1" } } }}--editor launches the installed editor with the MCP endpoint enabled. Node.js 20+
must be on your PATH.
The editor is launched by the first tool call, not when your AI tool starts the server: the server answers at once, a
session that calls no tool never starts an editor, and an editor slow to come up cold cannot make the tool give up on the
server. Add --eager to start it in the background as soon as the tool connects, and --hidden to drive it without a
window.
Driving the editor you’re looking at
Section titled “Driving the editor you’re looking at”To let an agent work inside an editor session you already have open, use --attach
instead of --editor:
-
Configure your AI tool with
--attach:"args": ["<path-to>/editor-mcp.mjs", "--attach"] -
Turn on Settings → Editor → Tools and AI → AI Agents → Allow AI agents to connect. The editor opens a local-only port and writes a discovery file
mcp-endpoint.jsoninto its user-data folder, which--attachfinds on its own — pass an explicit path only if you moved it. The row reports the port it is listening on, and the setting is remembered, so an editor you start by double-clicking it is ready from then on.Launching from a terminal with
--mcp(estella-editor --mcp) does the same thing for one session, and outranks the setting while it lasts. -
The agent now drives the same window you see — selections, edits, play mode and all — while you watch and intervene.
Order doesn’t matter: the server resolves the editor per call, so you can start your AI tool first and open the editor later, and restarting the editor mid-session reconnects automatically rather than stranding the agent.
Several editors open at once
Section titled “Several editors open at once”Each editor advertises itself in its own file (mcp-instances/<pid>.json in the user-data folder) with its process id, the project it holds, its port and its own
permission, so an agent can tell them apart. With one editor open the session simply drives it. With two or more, the agent is not left to guess, because a call
that lands in the wrong window changes the wrong project: every tool but two answers with the list until it picks.
list_editorsshows each open editor: pid, project, port, and whether it lets agents change the project.select_editortakes a pid, a port or part of a project name or path. The session then drives that editor and no other, and an editor opened later does not take it over. If that editor closes, the session asks again.- To fix the choice in the tool’s config instead, pass
--instance <pid | project name>to the script or setESTELLA_MCP_INSTANCE.
The permission (Read only / Can edit) belongs to each editor window and starts read-only, so granting one editor never grants another. The connect dialog shows which editor it is: its project, process id and port.
What the agent can do
Section titled “What the agent can do”The everyday tools (about fifty: the scene, Play, opening and saving, screenshots, logs) are listed from the start; the rest are in
groups the agent turns on with enable_tools when it needs them: assets, timeline, prefab, authoring, view, play, render,
project, code and device. A full list handed over before the first call costs every session thousands of tokens and
makes the right tool harder to find; any tool can still be called by name without being listed. Add --all-tools for a client
that cannot follow a change of the tool list. The table below names tools from every group.
Generating models with Tripo AI
Section titled “Generating models with Tripo AI”The tripo group generates a textured 3D model from a sentence or a picture with Tripo AI and imports
it the way a dropped .glb is imported, so the answer names a prefab the agent can place, with Tripo’s preview picture beside it.
It needs a Tripo API key, which you add in Settings > Tools and AI > AI Agents > Tripo API key (keys are made at
developers.tripo3d.ai). Tripo runs a second site for mainland China, tripo3d.com, with its own accounts, keys and
credits: choose it under Tripo site in the same section and add its key below the international one. A generation
already running stays on the site that started it. The key stays in this machine’s keychain: it is never written into the project, and the editor window
never reads it back. Every generation spends the account’s credits; tripo_balance shows what is left.
A generation takes two to five minutes, and the editor keeps it rather than the agent’s call: tripo_generate answers at once
with a task id, the editor polls Tripo and imports the model when it is ready whether or not the agent is still waiting, and
tripo_task waits for a task and answers its prefab without spending again. While generations run, one notice in the corner
shows them (a single one by name and percentage, several as a count with the list behind Details), and the Content Browser
shows a placeholder with progress where each model will land. A generation still running when the editor closes is taken up again
the next time the project opens. The import happens outside the agent’s undo step, so Undo does not remove a generated model:
delete it from the Content Browser.
The rest of Tripo is in the same group. tripo_process works on a model that is already in the project and makes a new one
beside it: retexture it, reduce it to a game’s face count, unwrap its UVs, split it into parts and close them, check whether it
can be rigged (free), rig it, put preset animations on the rig, or convert it to another format. A model Tripo made keeps the id of
the task that made it in its .meta, so the next operation names that task instead of uploading the file; any other model is
uploaded. tripo_image makes pictures from words or from other pictures, and the four sides of a thing, which tripo_generate
takes as images for a model closer to what was meant than one picture gives. Every operation but the rig check spends credits,
and each tool’s description says how many.
Nothing Tripo made is forgotten: the project keeps every job as history, with what was asked, where the result landed and what
it cost, and tripo_history lets the agent look there before it pays for something again. It also lists the models in the
project that Tripo made (from their .meta, so a cloned project has them), and with remote_days: 31 what the Tripo account made
anywhere in the last month. A listed result whose file is gone comes back with tripo_task without spending credits. The same
group can smart-segment a model or a picture into named parts, and turn a picture into a Gaussian splat (a .splat file the
engine does not draw yet).
A tool’s description is kept short enough that a client hands it over whole: some clients cut a long one, and what was past the
cut never reached the model. The tools with the most to teach (model_write, image_write, music_write) keep the rest in
topics, named at the end of their descriptions with what each is for, and the agent reads the ones it needs with tool_guide
before doing what they cover. It is answered from the catalog and starts no editor.
Every tool calls one thing by one name, in what it takes and in what it answers: an entity is entity (a number in the open
scene or the running game), a component field field, search text query, a cap on the answer limit. The names some tools
took before (id, key, match, maxResults) are still read as these. An entity also takes a name, looked up in the world
the tool acts on (the open scene, or the running game for inspect_entity), since the two number the same entity
differently; a name two entities share is refused with their numbers, and in the scene a path such as "HUD/ScoreText" picks
one.
| Area | Tools (excerpt) |
|---|---|
| Observe | get_scene_tree, get_inspector, get_stats, get_diagnostics, capture_viewport (PNG), screenshot (whole window, includes play), world_component (live-World probe), capture_frame / frame_draws / replay_draw (the frame debugger: each draw call, why it started, the entities it drew) |
| Edit scenes | apply_scene_ops (batch authoring), create_entity (the Create-menu catalog via list_entity_templates), set_field, set_entity_xy, set_parent, duplicate_entity, undo / redo |
| Projects & assets | create_project / open_project, open_scene, open_asset (any asset in its own editor), get_document, save_scene, create_scene_file, create_asset, import_assets, list_assets, get_import_settings / set_import_settings |
| Prefabs | create_prefab_from_entity, edit_prefab / exit_prefab_mode (Prefab Mode), apply_prefab, revert_prefab, unpack_prefab, create_prefab_variant |
| Behaviour without code | get_event_bindings / set_event_bindings (wire a button), add_component / remove_component |
| Game code | read_project_file, write_project_file, list_project_files |
| Run & ship | set_play (playing / paused / stopped) + get_play_state, step, play_input, export_game (any target in the Package Project list: web, desktop, wechat, playable, android, …) |
A typical agent loop: open_project → open_scene → list_entity_templates →
apply_scene_ops → get_diagnostics → screenshot to check its work →
save_scene → set_play → screenshot again → export_game.
Editing a prefab
Section titled “Editing a prefab”open_asset on a .esprefab (or edit_prefab on an instance) enters Prefab Mode:
from then on every scene tool acts on the prefab, and save_scene writes the asset
for every instance. get_document says which document is open — check it after opening,
and before assuming a save writes a scene. exit_prefab_mode goes back.
Where a person gets a dialog, an agent gets an answer it can act on: opening something
that would discard unsaved work is refused unless you pass discardChanges, and
apply_prefab — which rewrites the base for every instance — requires confirm: true
instead of the itemized diff a person confirms.
Building scenes at scale
Section titled “Building scenes at scale”set_field writes one field per call, which is fine for a tweak and hopeless for a
scene: a single UI panel is easily a hundred nodes with a dozen fields each.
apply_scene_ops takes a program instead — creates, re-parents, component adds
and field writes, executed in order as one undoable step. Ops address entities
they create by name, so a whole subtree lands in one call:
{ "label": "Build HUD", "ops": [ { "op": "create", "ref": "hud", "name": "HUD", "template": "ui-container" }, { "op": "create", "ref": "coins", "name": "Coins", "template": "ui-text", "parent": "$hud", "fields": { "Text.content": "1440", "Text.fontSize": 28 } } ]}It is atomic: if any op fails, the error names the op that failed (op[7] set: …)
and the whole batch rolls back — entities it had already created included — so a
bad program never leaves a half-built subtree behind.
A field path may name one member of a structural field ("Transform.position.x",
"FlexContainer.gap.y", "UINode.width.value"), which reads and writes back the
rest, so moving a node one axis does not cost a read-modify-write.
Past a few hundred nodes the program itself is the problem — a real panel is
hundreds of KB of JSON, which does not belong in a chat message. Write it with
write_project_file and hand apply_scene_ops the path instead:
{ "opsPath": "assets/scenes/shop.ops.json", "label": "Build the shop" }Wiring a button
Section titled “Wiring a button”A scene can give a button behaviour without any game code — an
Event Binding row says when this event fires, run that
named action. set_event_bindings replaces an entity’s rows in one undo step
(an empty list unwires it), and get_event_bindings reads them back:
{ "entity": 42, "rows": [ { "event": "click", "action": "panel.open", "params": { "prefab": "assets/prefabs/Shop.esprefab" } }] }action is any name in the action registry — an engine built-in (property.set,
ui.setVisible, fsm.fire, …) or one the project registered — and target names
another entity to run it on, resolved nearest-first from this one.
Undo, permissions and progress
Section titled “Undo, permissions and progress”- One call is one undo step. Everything a call changes — the scene edits and the project files it writes — goes back with
one Ctrl/⌘ + Z, and comes forward again with Redo. The step shows in History as AI · tool. A call that only wrote
files does not mark the scene unsaved. The agent’s own
undo/redotools answer once the files are back on disk. Saving, exporting, creating a project and anything done to the running game are not steps: Undo does not take back a save. History draws a rule where each agent run begins (AI run · client · time): clicking the row just above it takes the whole run back. Copies of written files are kept while they fit in 512 MB; a step whose copies had to go is marked files kept, and its Undo takes back only the scene part. - Your client knows what each tool does. Every tool carries MCP annotations: reading tools are marked read-only, and only the ones that leave the project or run code nobody listed (an editor command, a probe in the running game) are marked destructive. A client that asks before such calls asks only before those.
- Long calls say they are still running. A client that asks for progress hears every five seconds which tool is running and for how long — opening a large scene or exporting reads as working, not hung. A call cancelled before it starts does not run, and a composite one stops at its next step; one editor operation already running (an export, a bake) finishes.
- If the editor cannot start, the call says why, in the editor’s own words, and the next call tries again — the connection stays up.
- The agent is told the house rules at connect: tool groups, the open scene versus the running game,
stepinstead of waiting, one call per undo step. A client that does not refresh its tool list can still reach plugin tools withenable_toolsand thepluginsgroup. - Which tools fail, on this machine. The connection notes each call (tool, client, outcome, time, the start of an error —
never the arguments) in
~/.estella/mcp-calls.jsonl.node desktop/scripts/mcp-call-stats.mjslists the tools that fail most and how. Nothing is sent anywhere;ESTELLA_MCP_CALL_LOG=0turns it off.
From the repository (contributors)
Section titled “From the repository (contributors)”In a source checkout, pnpm --filter @estella/editor editor:mcp serves the same
registry against a headless fixtures host (scene tools only), editor:mcp -- --editor
boots the dev editor (add --hidden to keep its window from appearing), and two e2e suites (editor:mcp:e2e,
editor:mcp:editor-e2e) prove the full loop.
See also
Section titled “See also”- The Editor — the visual editor this automation surface drives.
- Scripting — the same scene / component model, from game code.