Drive the running Taos Engine editor from a Claude Code terminal: create objects, add
components, set properties — and watch them appear live in the open editor's
viewport. The MCP server joins the editor's collaboration room as a headless peer
("Claude"), so its edits flow through the exact same path human collaborators use
(EditorOps applied to the live binder, no scene reload).
Implementation lives in editor/src/mcp/; design notes and milestone status in TODO/editor-mcp-prompt-editing.md.
How it fits together#
Claude Code terminal ──stdio MCP──> taos-editor server (headless collab peer)
│ ws ws://127.0.0.1:8787/editor
▼
collab host (Share Project)
│ broadcast ops
▼
open editor ── live viewport updateThe MCP server is not the model — Claude Code is. The server only exposes the
editor's capabilities as tools. (The editor's own ai.ts / Anthropic key are
unrelated and uninvolved in this flow.)
Quick start#
- Open your project in the editor and load the scene you want to edit.
- Share Project (the collab host control). This starts the collaboration
server on
ws://localhost:8787and the editor joins its own room — that self-join is what makes edits render live. Or enable "Auto-host for Claude (MCP)" in that control once, and the editor shares automatically whenever you open a scene. - Run Claude Code in this repo. It discovers the server via
.mcp.json. Approve thetaos-editorserver when prompted. - Prompt away: "add a PointLight above the Player and set its intensity to 30."
The server connects lazily and retries, so it's fine to start Claude before or after Share Project, or to re-share after a restart.
Pointing at a different scene / port#
The default targets ws://127.0.0.1:8787 and Main.scene. Override via env in
.mcp.json (or --url / --scene flags):
"env": {
"TAOS_EDITOR_URL": "ws://127.0.0.1:8787",
"TAOS_EDITOR_SCENE": "levels/Level1.scene"
}Run it standalone for debugging: npm --prefix editor run mcp -- --scene Main.scene.
Tools#
Read:
get_connection_status— URL, scene, status, ready, peers.list_objects— flat summaries (id, name, enabled, component types, child count).get_scene_tree— nested hierarchy with component types per node.get_object {id}— full node (transform + component docs).find_objects {query}— name substring match.list_component_types— the addable component catalog.describe_component {type}— default doc + editable props for a type.
Write (broadcast as EditorOps; applied live in every connected editor):
create_object {name, parentId?, position?, rotation?, scale?}→ returnsid.delete_object {id},rename_object {id, name},set_enabled {id, enabled}.set_transform {id, position?, rotation?, scale?}.add_component {objectId, type, props?}→ seeded from schema defaults; returnscomponentId.remove_component {componentId},set_property {componentId, key, value}.
Lifecycle (filesystem; off the collab path — no editor needs to be running):
create_project {name, parentDir?, template?}—templateisbasic(camera + sun, default) orempty. Creates files on disk; does not open the project in a running editor (open it manually).import_asset {sourcePath, projectDir?, destFolder?}— copy an on-disk file intoContent/.list_assets {projectDir?},create_folder {parentFolder, name, projectDir?}.
These default their project to TAOS_EDITOR_PROJECT (set it in .mcp.json env, or
pass projectDir/parentDir explicitly). Richer disk-based templates (geo, Tron)
and the full web bundle build remain editor-only for now (they need Electron).
Component schema#
Write tools seed new components from a node-safe catalog,
editor/src/mcp/component_schema.gen.json,
generated from the renderer's authoritative componentSchema.ts. Regenerate it
when components change:
npm --prefix editor run build:component-schema(The renderer schema imports the engine + .wgsl, so the generator loads it through
Vite SSR — plain Node can't.)
Safety / scope notes#
- The collab host's
wslistener binds all interfaces; today's boundary is "use it on localhost." A token would be needed before exposing it beyond loopback (the collabhellohas no auth yet). - Edits apply last-write-wins; a human and Claude editing the same field race by arrival order, same as human↔human collab.
- Claude's edits currently bypass the editor's local undo stack (they arrive as remote ops). Undo integration is tracked in the TODO.
- Project creation, asset import, and builds are not in this bridge yet (they live off the collab path); see milestone M3 in the TODO.