cocos-mcp-server

v0.1.0
@atomicmicrotech/cocos-mcp-server Checked 2 days ago Published 1 month ago

MCP server for Cocos Creator 3.8 LTS (requires the cocos-mcp editor extension)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

editor_status Editor status

Report Cocos Creator connection status: editor version, project, access mode and bridge health.

editor_capabilities Editor capabilities

List editor packages/messages discovered by the Phase 0 message inventory plus the scene-script methods available.

ParameterTypeDescription
filterstringCase-insensitive substring filter on package or message names.
includeMessagesbooleanInclude every message name per package (can be large).

editor_inventory Message inventory

Read the local Phase 0 message inventory (~/.cocos-mcp/messages.json) written by the editor extension via cocos-mcp:dump-messages.

ParameterTypeDescription
includeMethodsboolean
limitinteger
querystringCase-insensitive substring match on package or message name.

editor_raw_query Raw editor query

Call any editor message. Read-only messages work in every mode; destructive messages (delete/apply/revert/publish/…) are refused with CONFIRMATION_REQUIRED — call again with the returned confirmationToken to proceed. Use for Phase 0 API verification and for messages without a dedicated tool.

ParameterTypeDescription
message *stringMessage name, e.g. "query-assets".
package *stringEditor package name, e.g. "asset-db".
argsarrayPositional arguments.
confirmationTokenstringToken from a previous CONFIRMATION_REQUIRED response. Must be replayed with identical package/message/args.

bridge_set_mode Set access mode

Change how much the AI may do: "read-only" (reads only), "safe-write" (default; destructive calls need confirmation), "full" (unrestricted). Prefer leaving it at safe-write.

ParameterTypeDescription
mode *string

bridge_audit Read audit log

Return the most recent bridge calls (tool, arguments preview, duration, confirmation) from ~/.cocos-mcp/audit.log.

ParameterTypeDescription
limitinteger
onlyDestructiveboolean
onlyFailuresboolean

extension_reload Reload the bridge extension

Ask the editor to reload the cocos-mcp extension, then VERIFY that it actually happened by comparing the bridge capabilities before and after. Cocos Creator 3.8.8 has no working package-reload API, so this usually returns reloaded:false — in that case the editor must be restarted to pick up a new dist/. WARNING: a reload discards unsaved scene changes; call scene_save first.

ParameterTypeDescription
timeoutSecintegerHow long to watch for the reload to take effect.

extension_reload_check Check whether the bridge extension can reload itself

Ask the bridge whether the editor exposes a package-reload API. Returns ok:false with the available Editor.Package surface on Cocos Creator 3.8.8, in which case a reload must be done from the Extension Manager.

editor_focus_node Focus the scene camera on a node

Frame one or more nodes in the Scene view so a screenshot actually shows them — the "look at this node" half of the visual feedback loop. Accepts uuid, path or name (ambiguity is rejected). Omit `node` to focus the current selection. Purely a view change: it does not touch the scene, does not dirty it, and is not undoable.

ParameterTypeDescription
nodestringNode uuid, path ("Canvas/Player") or name. Omit to focus the selection.
nodesarrayAdditional node references to frame together with `node`.

editor_view_mode Read or change the Scene view 2D/3D mode

Read or change the Scene view 2D/3D mode. In 3D (perspective) a flat 2D layout such as a Canvas looks skewed, which makes screenshots hard to judge; 2D gives a clean top-down view. With no arguments it only reports the current mode. This is editor state — it does not modify the scene or its dirty flag.

ParameterTypeDescription
modestring"query" only reports; "2d"/"3d" switches the Scene view.

editor_grid Show, hide or query the editor grid

Show, hide or query the Scene view grid. The grid adds visual noise to screenshots, so hide it before visual inspection; omit `visible` to only read the current state.

ParameterTypeDescription
visiblebooleantrue/false to set, omit to query the current state.

editor_open_panel Open the cocos-mcp panel

Open the extension status panel in the editor (bridge port, mode, token preview, connected clients, audit tail). Useful to hand control back to the user.

scene_get_tree Get scene tree

Read the active scene hierarchy from the engine runtime. Returns node names, paths, transforms and component class names. Editor scaffolding (grid, gizmos, editor camera) is excluded by default. For UUIDs use scene_get_editor_tree.

ParameterTypeDescription
depthintegerMaximum depth below each root child.
includeEditorNodesbooleanInclude editor-only nodes (Editor Scene Foreground/Background, grid, gizmos, editor camera).
maxNodesintegerMaximum number of nodes returned.

scene_get_stats Scene statistics

Summarize the active scene: user node count, component counts, engine version and frame count. Editor scaffolding counts are reported separately so an empty scene does not look heavy.

ParameterTypeDescription
includeEditorNodesbooleanMerge editor node/component counts into the main totals.

scene_find_nodes Find nodes

Find nodes in the active scene by name substring, exact path, or component class name. Editor scaffolding is excluded by default.

ParameterTypeDescription
componentstringComponent class name substring, e.g. "Sprite".
includeEditorNodesbooleanInclude editor-only nodes in the results.
maxResultsinteger
namestringCase-insensitive name substring.
pathstringExact hierarchy path relative to the scene root, e.g. "Canvas/Player".

scene_get_node Get node detail

Read one node by path, name or uuid, including transform, component list and simple component properties. Accepts a uuid, which is the only way to read one of several nodes that share a path. On failure the error lists the paths that do exist, so a stale path is self-correcting.

ParameterTypeDescription
nodestringNode uuid, path or unique name. Prefer this over `path`.
pathstringHierarchy path, e.g. "Canvas/Player".

scene_get_info Get scene info

Basic information about the active scene (name, node count, engine version).

scene_get_editor_tree Get editor node tree (with UUIDs)

Read the hierarchy from the editor itself. Unlike scene_get_tree (engine runtime), every node and component includes its UUID, which is required by write operations. Prefer this tool when you plan to modify the scene.

ParameterTypeDescription
includeComponentsbooleanKeep component entries (type + value uuid) per node.
maxDepthintegerTrim the returned tree to this depth (editor returns the whole tree).

scene_get_current Get current scene state

Active scene UUID, dirty flag and ready state. Use the UUID with scene_open or to correlate editor events.

node_create Create node

Create an empty node under a parent. `parent` accepts a node path ("Canvas"), a node name, or a uuid; omit it to create at the scene root. Returns the new node uuid. Nodes are created on the DEFAULT layer unless `layer` is given — UI nodes under a Canvas normally need UI_2D (33554432).

ParameterTypeDescription
name *stringNew node name.
dryRunbooleanReturn the exact editor call instead of executing it.
layerintegerLayer bitmask for the new node. Use 33554432 (UI_2D) for UI nodes, 1073741824 (DEFAULT) for 3D.
parentstringParent node path, name or uuid. Omit — or pass "scene"/"/" — for the scene root.

node_delete Delete node (destructive)

Delete one or more nodes by path/name/uuid. This is destructive: in safe-write mode it returns CONFIRMATION_REQUIRED with a token that must be replayed with identical arguments via editor_raw_query, or by calling this tool again with the token.

ParameterTypeDescription
confirmationTokenstringToken from a previous CONFIRMATION_REQUIRED response.
dryRunbooleanReturn the exact editor call instead of executing it.
nodestringSingle node path, name or uuid.
nodesarrayMultiple node references.

node_duplicate Duplicate nodes

Duplicate one or more nodes (copy with a new uuid).

ParameterTypeDescription
dryRunbooleanReturn the exact editor call instead of executing it.
nodestringSingle node path, name or uuid.
nodesarrayMultiple node references.

node_move Move / reparent nodes

Reparent one or more nodes under a new parent. `parent` accepts a path, name or uuid. Use "scene" to move to the scene root.

ParameterTypeDescription
parent *stringNew parent path/name/uuid, or "scene" for the scene root.
dryRunbooleanReturn the exact editor call instead of executing it.
nodestringSingle node path, name or uuid.
nodesarrayMultiple node references.

node_rename Rename node

Rename a node by path/name/uuid.

ParameterTypeDescription
name *stringNew node name.
node *stringNode path, name or uuid.
dryRunbooleanReturn the exact editor call instead of executing it.

node_set_active Set node active

Activate or deactivate a node (equivalent to the Inspector checkbox).

ParameterTypeDescription
active *boolean
node *stringNode path, name or uuid.
dryRunbooleanReturn the exact editor call instead of executing it.

node_set_transform Set node transform

Set position, euler rotation and/or scale of a node. Omitted fields are left untouched. Rotation is in degrees (euler angles), matching the Inspector.

ParameterTypeDescription
node *stringNode path, name or uuid.
dryRunbooleanReturn the exact editor call instead of executing it.
positionobject
rotationobjectEuler angles in degrees.
scaleobject

node_set_layer Set node layer

Set the node integer layer bitmask (e.g. 1073741824 = DEFAULT, 33554432 = UI_2D).

ParameterTypeDescription
layer *integerLayer bitmask value.
node *stringNode path, name or uuid.
dryRunbooleanReturn the exact editor call instead of executing it.

node_set_property Set node property

Set an arbitrary node-level property using the Inspector property name (e.g. "mobility"). The value type is read from the editor dump, so nested vector properties work too.

ParameterTypeDescription
node *stringNode path, name or uuid.
property *stringNode property name, e.g. "mobility".
value *New value (JSON).
dryRunbooleanReturn the exact editor call instead of executing it.

component_types List component class names

List every class the editor knows (scene.query-classes), filtered by an optional substring. Use it to discover a valid class name before calling component_add, or to recover from an INVALID_PROPERTY error.

ParameterTypeDescription
filterstringCase-insensitive substring, e.g. "sprite", "label", "physics".
limitinteger
refreshbooleanIgnore the 60s cache and re-query the editor.

component_get Get component (editor dump)

Read a component exactly as the Inspector sees it (types, defaults, enums), unlike scene_get_node which reads simple values from the engine runtime.

ParameterTypeDescription
node *stringNode path, name or uuid.
componentstringComponent class name (e.g. "Sprite") or component uuid. Defaults to the first component.

component_add Add component

Add a component to a node by class name, e.g. "cc.Sprite" or "cc.UITransform". Idempotent: if the node already has that component the tool returns alreadyPresent instead of asking the editor to add a duplicate (Cocos logs "Can't add component ... already contains the same component"). Note: creating a node under a UI hierarchy (Canvas) makes the editor add cc.UITransform automatically, so adding it again is unnecessary. Set allowDuplicate: true only for components that support multiple instances (e.g. colliders).

ParameterTypeDescription
component *stringComponent class name, e.g. "cc.Sprite".
node *stringNode path, name or uuid.
allowDuplicatebooleanAttempt to add even when the node already has this component type.
dryRunbooleanReturn the exact editor call instead of executing it.

component_remove Remove component (destructive)

Remove a component from a node. Destructive: needs a confirmation token in safe-write mode.

ParameterTypeDescription
component *stringComponent class name (e.g. "Sprite") or component uuid.
node *stringNode path, name or uuid.
confirmationTokenstringToken from a previous CONFIRMATION_REQUIRED response.
dryRunbooleanReturn the exact editor call instead of executing it.

component_set_property Set component property

Set one component property using the Inspector property name (e.g. "string", "color", "enabled"). The property type is read from the editor dump so the correct serialized form is sent. Asset references accept a uuid.

ParameterTypeDescription
component *stringComponent class name (e.g. "Sprite") or component uuid.
node *stringNode path, name or uuid.
property *stringProperty name, e.g. "string" or "enabled".
value *New value (JSON).
dryRunbooleanReturn the exact editor call instead of executing it.

component_call_method Call component method

Invoke a method on a component (as the Inspector does for preview buttons). Arguments are passed as JSON.

ParameterTypeDescription
component *stringComponent class name or component uuid.
method *stringMethod name.
node *stringNode path, name or uuid.
argsarray

scene_check_ui_setup Check UI rendering setup

Diagnose why 2D/UI nodes might be invisible. Verified on Cocos Creator 3.8.8: creating a Canvas + Sprite through messages produces a working hierarchy that still renders nothing, because (a) new nodes default to the DEFAULT layer, and (b) the default Main Camera visibility mask EXCLUDES UI_2D. Run this after building UI with node_create/component_add.

scene_save Save scene

Save the active scene to disk and report the resulting dirty flag. Every MCP write is undoable (Ctrl+Z) and marks the scene dirty, so save only when the user agrees.

ParameterTypeDescription
dryRunbooleanReturn the exact editor call instead of executing it.

scene_undo Undo

Undo the last scene edit.

scene_redo Redo

Redo the last undone scene edit.

scene_align_node Align nodes inside their parent

Place one or more nodes against an edge of their parent's content box. Unlike node_set_transform this does the layout maths for you: it reads the parent anchor + contentSize and the child anchor, so a "right edge with 20px margin" lands exactly on the right edge regardless of anchor settings. Accepts uuid, path or unique name; a uuid is required when several nodes share a path.

ParameterTypeDescription
alignstringEdge of the parent to align to. "center"/"middle" centre the node; the rest inset from that edge.
marginnumberInset in pixels from the parent edge. Ignored by center/middle.
nodestringNode uuid, path ("Canvas/Player") or unique name.
nodesarrayAdditional nodes to align the same way.

editor_get_selection Read the current editor selection

Node uuids currently selected in the editor. Cocos Creator 3.8.8 exposes no query message for the selection, so this is tracked from the `selection:select`/`selection:unselect` broadcasts: `observed: false` means the user has not changed the selection since the bridge started, so the selection is unknown rather than empty.

scene_call_method Call an allowlisted engine method (opt-in)

Call one of the extension's scene-script methods directly, e.g. "getStats" or "findNodes" with options no dedicated tool exposes. Requires `full` access mode because these run inside the engine and bypass the editor's own validation. Arbitrary JavaScript is deliberately NOT supported — only the fixed method allowlist. Use bridge_capabilities to see the exact list.

ParameterTypeDescription
method *stringScene method name, e.g. "getStats".
argsarrayPositional arguments. Most methods take a single options object.

particle_presets List particle presets

Named 2D particle configurations built from cc.ParticleSystem2D properties (no .plist asset needed). Use the name with particle_create.

particle_create Create a 2D particle effect

Add cc.ParticleSystem2D to a node and configure it from a preset plus overrides, using custom-mode properties (no .plist needed). `spriteFrame` is REQUIRED to be visible — Cocos draws particles with a sprite frame, and the component ships with an empty one, so a particle system without it looks like nothing happened. Every written property is verified by readback.

ParameterTypeDescription
node *stringNode path, name or uuid to attach the effect to.
dryRunbooleanReturn the property writes instead of executing them.
playOnLoadbooleanStart emitting when the scene runs.
presetstringPreset name from particle_presets (fire, smoke, sparkle, explosion, snow).
propertiesobjectExtra cc.ParticleSystem2D properties, e.g. {"totalParticles": 300}.
spriteFramestringdb:// url or uuid of an image to use as the particle texture. Defaults to the built-in db://internal/default_ui/atom.png.

animation_create_clip Create an animation clip asset

Create a cc.AnimationClip (.anim) from the editor's own template shape, optionally with keyframe curves. Times are normalized 0..1 inside the clip. Supported animated properties: position, scale, eulerAngles (vectors) and opacity (number). The clip is imported through AssetDB and read back to confirm the editor kept the curves.

ParameterTypeDescription
url *stringTarget db://assets/... URL ending in .anim.
dryRunboolean
durationnumberClip length in seconds.
namestringClip name (defaults to the file name).
sampleintegerSample rate (fps).
tracksarrayCurves to write. Omit for an empty clip.
wrapModestringPlayback wrap mode.

animation_assign Attach animation clips to a node

Add cc.Animation to a node and assign clips + defaultClip + playOnLoad. Assigning the clips array is verified by readback: Cocos Creator 3.8.8 applies asset-reference array writes and then raises an internal error, so a naive tool would report failure for a write that worked.

ParameterTypeDescription
clips *array.anim db:// urls or uuids, in order.
node *stringNode path, name or uuid.
defaultClipstringWhich clip to play by default (defaults to the first).
dryRunboolean
playOnLoadbooleanPlay the default clip when the scene starts.

animation_info Inspect animation clips on a node or in the project

Read the cc.Animation setup on a node (clips, defaultClip, playOnLoad) or list .anim assets in the project. Use it to confirm what animation_assign produced.

ParameterTypeDescription
limitinteger
nodestringNode path, name or uuid to inspect.
patternstringAssetDB glob used when `node` is omitted.

asset_get_info Get asset info

Read AssetDB metadata for one asset by uuid or db URL.

ParameterTypeDescription
uuid *stringAsset uuid or db:// URL.

asset_dependencies Asset dependencies

List dependency assets for one asset uuid.

ParameterTypeDescription
uuid *stringAsset uuid or db:// URL.

asset_create Create asset

Create a text asset (script, JSON, effect, …) or folder through AssetDB so the .meta file is generated correctly. Never write asset files directly to disk. Pass content: null to create a folder.

ParameterTypeDescription
url *stringTarget url, e.g. "db://assets/scripts/Player.ts".
contentstring | nullFile contents. Use null to create a folder.
dryRunbooleanReturn the exact editor call instead of executing it.
overwritebooleanReplace an existing file.
renamebooleanOn conflict, create a uniquely named asset instead of failing.

asset_read Read asset text

Read the text contents of a project asset (script, JSON, prefab, scene, .meta). Binary assets are rejected. The file is resolved through AssetDB and must live inside the open project.

ParameterTypeDescription
asset *stringdb:// url or uuid.
maxBytesinteger

asset_save Save asset text

Overwrite the text contents of an existing asset through AssetDB (keeps .meta intact and triggers reimport).

ParameterTypeDescription
asset *stringdb:// url or uuid.
content *stringNew file contents.
dryRunbooleanReturn the exact editor call instead of executing it.

asset_move Move or rename asset

Move or rename an asset or folder. AssetDB rewrites dependent references, so use this instead of moving files on disk. Destructive: needs a confirmation token in safe-write mode.

ParameterTypeDescription
source *stringCurrent db:// url.
target *stringNew db:// url (file name included).
confirmationTokenstringToken from a previous CONFIRMATION_REQUIRED response.
dryRunbooleanReturn the exact editor call instead of executing it.
overwriteboolean

asset_copy Copy asset

Copy an asset or folder to a new url.

ParameterTypeDescription
source *stringSource db:// url.
target *stringDestination db:// url.
dryRunbooleanReturn the exact editor call instead of executing it.
overwriteboolean

asset_import Import external file

Import a file from disk into the project. `source` must be an absolute path outside or inside the project; AssetDB copies it and generates the .meta file.

ParameterTypeDescription
source *stringAbsolute path to the file on disk.
target *stringDestination db:// url, e.g. "db://assets/img/hero.png".
dryRunbooleanReturn the exact editor call instead of executing it.
overwriteboolean
renameboolean

asset_delete Delete asset (destructive)

Delete an asset or folder through AssetDB. Destructive: in safe-write mode the first call returns CONFIRMATION_REQUIRED with a token that must be replayed with identical arguments.

ParameterTypeDescription
asset *stringdb:// url (or uuid) to delete.
confirmationTokenstringToken from a previous CONFIRMATION_REQUIRED response.
dryRunbooleanReturn the exact editor call instead of executing it.

asset_refresh Refresh asset

Refresh one asset from disk (use after editing files outside the editor).

ParameterTypeDescription
asset *stringdb:// url or uuid.
dryRunbooleanReturn the exact editor call instead of executing it.
reimportbooleanUse reimport-asset instead of refresh-asset to force re-import.

asset_open Open asset in editor

Open an asset in its editor (scene, prefab, script, …). Equivalent to double-clicking it in the Assets panel.

ParameterTypeDescription
asset *stringdb:// url or uuid.

asset_meta_get Read asset .meta

Return the parsed .meta JSON for an asset (importer settings, uuid, sub-assets).

ParameterTypeDescription
asset *stringdb:// url or uuid.

asset_meta_save Save asset .meta

Write .meta JSON for an asset. The uuid must be preserved unless you intentionally want to break references.

ParameterTypeDescription
asset *stringdb:// url or uuid.
meta *Meta JSON.
dryRunbooleanReturn the exact editor call instead of executing it.

script_create Create script

Create a TypeScript Component from the editor template (the same result as Assets → Create → TypeScript). Fills the ccclass placeholders with a PascalCase class name. Does not overwrite existing files unless overwrite is true.

ParameterTypeDescription
name *stringFile name without extension, e.g. "PlayerController" or "player_controller".
classNamestringOverride the generated class name (defaults to PascalCase of `name`).
dryRunbooleanReturn the exact editor call instead of executing it.
folderstringDestination folder url, e.g. "db://assets/scripts".
overwriteboolean

asset_types List creatable asset types

List the entries of the Assets panel "Create" menu (script, scene, prefab, material, …) together with their file name and template url.

prefab_create Create prefab from node

Save a scene node as a prefab asset and return the new asset. Verified live on Cocos Creator 3.8.8: the message signature is positional — scene.create-prefab(nodeUuid, prefabUrl) — and it returns the prefab asset uuid.

ParameterTypeDescription
node *stringNode path, name or uuid.
url *stringDestination url, e.g. "db://assets/prefabs/Enemy.prefab".
dryRunbooleanReturn the exact editor call instead of executing it.

prefab_instantiate Instantiate prefab

Insert a prefab asset into the scene under a parent. Cocos Creator 3.8.8 has no public scene message for this (drag & drop uses an internal channel), so it runs through the extension scene script with the engine API (assetManager.loadAny + instantiate). Requires the extension build that ships instantiatePrefab.

ParameterTypeDescription
prefab *stringPrefab db:// url or asset uuid.
dryRunbooleanReturn the exact editor call instead of executing it.
namestringOverride the instance name.
parentstringParent node path. Omit — or pass "scene"/"/" — for the scene root.

build_platforms List build platforms

All platform ids this editor can build for, with which ones are native. Use the id in build_run.

build_get_options Get build options

Return the complete, editor-validated build options for a platform (32 fields: buildPath, outputName, scenes, startScene, debug, md5Cache, bundleConfigs, …). Builds reject partial options, so use this to inspect or seed `overrides` for build_run.

ParameterTypeDescription
overridesobjectShallow overrides merged on top of the completed options.
platformstringPlatform id from build_platforms, e.g. "web-mobile".

build_run Run a build

Start a build as a background job and return its taskId immediately (a web-mobile build takes ~40s, native longer — far beyond the bridge timeout). Poll with build_get_status, or pass wait=true to block until it finishes. The scene must be saved first: unsaved editor changes are NOT included in the build (a warning is returned when the scene is dirty).

ParameterTypeDescription
overridesobjectShallow overrides for the completed options, e.g. {"debug": true}. The editor auto-increments outputName on every build (web-mobile → web-mobile-001 → …), so pass {"outputName": "web-mobile"} to…
platformstringPlatform id from build_platforms, e.g. "web-mobile".
timeoutSecintegerMaximum time to wait when wait=true.
waitbooleanBlock until the build finishes instead of returning immediately.

build_get_status Get build status

State of one build task (state/progress/stage/message/detailMessage), or of the newest task when taskId is omitted. States: processing, success, failure.

ParameterTypeDescription
includeOptionsbooleanInclude the full options object used for the build.
taskIdstringTask id from build_run. Omit for the newest task.

build_history Build history

Recent build tasks, newest first. Use it to check whether anything is still running before starting another build.

ParameterTypeDescription
limitinteger

build_cancel Cancel a build

Interrupt a running build task. Targets the newest processing task when taskId is omitted. The task ends as state "failure" with message "The build task was interrupted", and the editor leaves a partial (often empty) output directory behind.

ParameterTypeDescription
taskIdstringTask id from build_run. Omit to cancel the running task.

build_clear_tasks Remove a build task

Remove one task from the builder task list (does not delete build output). Destructive: the first call returns CONFIRMATION_REQUIRED with a token — replay with confirmationToken.

ParameterTypeDescription
taskId *stringTask id from build_history.
confirmationTokenstringToken from a previous CONFIRMATION_REQUIRED response.

preview_get_status Preview server status

Preview URL, LAN IP, whether the server actually answers over HTTP, and how many game clients are connected. `connectedClients` is NOT a liveness signal — a running preview with no browser open reports 0, so `serving` comes from a real HTTP probe.

ParameterTypeDescription
openbooleanAlso ensure the preview server is running (preview.open).
probebooleanHTTP-probe the preview URL to prove the server is up.

preview_open Open preview

Start (or focus) the preview server so the game can be opened in a browser or on a device. Returns the preview URL. The scene must be saved beforehand — preview loads from disk.

project_config_groups List project settings groups

Config groups editable through project_get_config / project_set_config (project, engine, asset-db, builder, engine-extends), with their settings tabs.

project_get_config Read project settings

Read a project/engine/asset-db/builder setting. Without `path` the whole config group is returned; with a dotted path only that value (e.g. general.designResolution.width → 1280, general.designResolution, layer, sorting-layer).

ParameterTypeDescription
groupstring
pathstringDotted path inside the group, e.g. "general.designResolution.width".

project_set_config Write project settings

Write one project/engine/builder setting by dotted path and verify it took effect. Cheap and non-destructive but project-wide: it changes what every scene and build uses (e.g. general.designResolution.width changes the canvas design size). Read the current value first with project_get_config.

ParameterTypeDescription
path *stringDotted path inside the group, e.g. "general.designResolution.width".
value *New value (JSON). Must match the type the editor expects for that path.
groupstring

editor_windows List editor windows

Enumerate the editor Electron windows (id, title, visible, bounds). Cocos Creator 3.8 runs its whole UI in ONE window (`main.html`) — the Scene view is a panel inside it, so screenshots include the full editor unless a rect is given.

editor_screenshot Screenshot the editor

Capture the editor (Scene view included) as a PNG image the model can look at — the visual feedback loop for "change → look → fix". Use `rect` to crop to just the Scene panel, and `maxWidth` to keep the image small. `scene.snapshot` in Cocos Creator 3.8 is NOT a screenshot (it snapshots scene state for undo), which is why this goes through Electron capturePage.

ParameterTypeDescription
maxWidthintegerDownscale to this width (aspect preserved). 0 disables resizing and returns the native size.
rectobjectCrop rectangle in window pixels, e.g. the Scene panel area.
windowIdintegerWindow id from editor_windows. Defaults to the main editor window.

events_list List forwarded editor events

Names of Cocos Creator broadcasts this bridge forwards (scene, asset, build, programming).

events_recent Recent editor events

Read buffered editor broadcasts (scene ready/close, asset add/change/delete, builder task changes, script build end). Useful to detect what changed since your last call.

ParameterTypeDescription
limitinteger
namestringCase-insensitive substring filter, e.g. "asset" or "builder".