Editing the project
Under the editor and full profiles the server changes the project. Every change is a journaled transaction with the same rules, whatever it changes.
The rules every write follows
- It names what it replaces. Replacing, patching, moving or deleting a file takes the file's current SHA-256 as
expectedSha256; read it withproject.files.listorfile.get. Creating a file needs the path to be free. A stale hash answersconflictand writes nothing, so an edit made against an old copy can never overwrite a newer one. - It is journaled first. The intent is durable before the effect starts, and the outcome after it ends. A process that dies in between is settled at the next start: the change either provably happened, provably did not, or the transaction is quarantined and writes stay blocked until it is repaired (Recovery).
- It can be repeated safely. Every write carries an
idempotencyId; repeating the call returns the recorded result instead of writing again. - It can be previewed.
dryRun: truevalidates the change and returns its diff without writing anything. - It stays in the project. A path that leaves the project root, crosses a symbolic link or reaches into the server's own
.godot-mcp/state is refused before anything happens.
Files and scripts
| Tool | Does |
|---|---|
file.get | Reads one file with its SHA-256 |
file.create, script.create | Create a file or a GDScript script at a free path |
file.patch, script.patch | Change a file by exactly one of: a whole replacement, line edits, or a unified diff |
file.move, file.delete | Move or delete a file, each against its SHA-256 |
script.create and script.patch also parse the result: a script with parse errors is refused unless the call sets allowParseErrors, and the diagnostics come back either way. Nothing is executed; script.check asks the engine.
Scenes and resources
scene.create, scene.batch.apply, resource.create and resource.batch.apply change text scenes and resources through a headless Godot process, so they need a Godot build; resource.update re-saves a resource the way Godot writes it. A batch is a list of typed operations — add, instance, remove, rename, move or duplicate a node, set or clear a property, attach a script, connect or disconnect a signal, add a group, set a sub-resource — applied in order as one transaction: if any operation is refused, nothing is published. A node is named by its path from the scene root or by the handle that scene.tree.get gave it; a handle from older bytes is refused as a conflict. Property values are tagged {type, value} objects, so a Vector2 or a Color is never confused with a string.
When the scene is open in an editor connected through the add-on, the same call runs in the editor and becomes one undoable action there (The editor add-on).
project.batch.apply takes one such batch for each of several existing scenes and resources, up to 16 files, each with its own expectedSha256. One Godot process applies every batch, and the files are published as one transaction: every file changes or none does. An operation refused in one file refuses them all and the answer names that file; a file that changed on disk refuses them all before Godot starts; and when a later file cannot be written, the files already written get their earlier bytes back. Each file is edited as it is on disk, so a scene that instances another file of the same batch sees the new content only once both are written. A file open in the connected editor is refused; change an open scene with scene.batch.apply, which goes through the editor. dryRun answers every file's diff and tree and writes nothing.
Common setups — a 2D or 3D physics body, lights with a sky and a camera, 2D or 3D particles from six presets, 2D or 3D navigation, a sound, a shader material, a HUD, a grid map, an on-screen joystick, an AnimationTree state machine or blend space — go into a scene by name with scene.recipe.apply, with their parameters: the server turns the recipe into one batch like the ones above, or, for a scene your editor holds, into one undoable action, and answers every value it used. resource.create makes a theme or a 3D material from a recipe the same way. The recipes reference shows each recipe's call and the operations it becomes, and What it covers lists the tools for each part of a project. godot-mcp 0.7.0 and earlier have no recipe for 3D particles, 3D navigation, a 3D sound or an AnimationTree, and make a theme from its operations, sent to resource.create with classTheme.
Settings and assets
project.settings.patch changes project.godot through typed operations: the main scene, autoloads, input actions with their events, plugins, a short list of common settings with plain JSON values (set_value), and any other setting with a tagged value (set_setting, with clear_setting to go back to Godot's default). project.settings.get answers a typed view, and with settings or prefix also each selected setting's text in the file and its tagged value, such as every layer_names/ entry. asset.put writes a binary asset, in chunks when it is large, against the SHA-256 of the whole file; asset.status and asset.delete read and remove one. project.uid.update registers or repairs the UID of one text resource through a Godot re-save.
When the editor holds the file
A headless write refuses, with conflict, a path the connected editor holds: any open scene, and an open script whose editor buffer differs from its file. Save or close it in the editor first, or change a scene through scene.batch.apply, which goes through the editor.