Skip to content
Back to search

cocos-creator-mcp

MCP server plugin for Cocos Creator 3.8+ — Enables AI assistants to interact with Cocos Creator Editor

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/harady--cocos-creator-mcp/badge.svg)](/listings/harady--cocos-creator-mcp)

HTML

<a href="/listings/harady--cocos-creator-mcp"><img src="/api/listings/harady--cocos-creator-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. Install

Copy or symlink this extension into your Cocos Creator project's `extensions/` directory:

# Windows (Junction — no admin required)
mklink /J "your-project\extensions\cocos-creator-mcp" "path\to\cocos-creator-mcp"

# macOS / Linux
ln -s /path/to/cocos-creator-mcp your-project/extensions/cocos-creator-mcp

2. Build

cd cocos-creator-mcp
npm install
npm run build

3. Enable in Cocos Creator

1. Open your project in Cocos Creator 2. Go to **Extension > Extension Manager** 3. Enable **Cocos Creator MCP** 4. Open the panel: **Extension > Cocos Creator MCP > Open Panel** 5. Click **Start Server** (or set `autoStart: true` in config)

4. Connect from Claude Code

Pick one of the two transports below.

Option A — stdio bridge (recommended for Claude Code VSCode extension)

The Claude Code VSCode extension currently has a bug where it unconditionally tries OAuth Dynamic Client Registration for HTTP-type MCP servers and fails with `SDK auth failed` (see upstream issues [#26917](https://github.com/anthropics/claude-code/issues/26917), [#38102](https://github.com/anthropics/claude-code/issues/38102), [#29697](https://github.com/anthropics/claude-code/issues/29697)). To avoid it entirely, use the bundled stdio bridge. It speaks JSON-RPC on stdin/stdout and forwards to the HTTP server internally.

{
  "mcpServers": {
    "cocos-creator-mcp": {
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO>/cocos-creator-mcp/client/stdio-bridge.js"
      ]
    }
  }
}

Optional env var: `COCOS_MCP_URL` (default `http://127.0.0.1:3000/mcp`).

Option B — direct HTTP

Works with Claude Code CLI, Cursor, Cline, and other clients that don't force OAuth on HTTP MCP. The server ships minimal dummy OAuth endpoints (`/.well-known/oauth-*`, `/oauth/register|authorize|token`) so OAuth-requiring clients can still complete a pro-forma flow on localhost.

{
  "mcpServers": {
    "cocos-creator-mcp": {
      "type": "http",
      "url": "http://127.0.0.1:3000/mcp"
    }
  }
}

> The dummy OAuth endpoints will be removed once upstream issues > ([#26917](https://github.com/anthropics/claude-code/issues/26917), > [#38102](https://github.com/anthropics/claude-code/issues/38102)) > are resolved or real authentication is introduced.

5. Verify

curl http://127.0.0.1:3000/health
# {"status":"ok","tools":64}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 460 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Cocos Creator MCP
  2. [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server extension for Cocos Creator 3.8+.
  3. AI assistants like Claude can control Cocos Creator editor through this extension — creating nodes, editing scenes, managing prefabs, building projects, and more.
  4. ## Features (v2.0.0)
  5. - **~73 Tools** organized as `category_action` patterns — token-efficient for LLM clients
  6. - **12 MCP Resources** (`cocos://`) — read-only data exposed via URI, separate from tools
  7. - **`execute_editor_script`** — escape hatch for arbitrary editor-side JavaScript (async/await supported)
  8. - **`read_console`** — unified Editor/Scene/Game console reader (captures compile errors, runtime errors, console.log)
  9. - **Transparent value references** — `db://` asset paths, `{path}`/`{guid}` objects, enum names, `cc.Vec3/Color/Size` plain objects all auto-resolved
  10. - **Streamable HTTP (SSE)** — Native MCP transport
  11. - **JSON-RPC 2.0** — Standard MCP protocol
  12. - **Prefab Property Persistence** — Component properties preserved across saves
  13. - **Preview in Editor** / **Screenshot** / **Video Recording** / **Game Command Control**
  14. - **Client Scripts** — Drop-in TypeScript files for game preview integration (`client/`)
  15. - **Auto Start** / **Tool Call Logging** / **i18n** (en/ja/zh)
  16. - **357+ Regression Test Assertions** — all real-invocation + side-effect verification
  17. ## Quick Start
  18. ### 1. Install
  19. Copy or symlink this extension into your Cocos Creator project's `extensions/` directory:
  20. ```bash
  21. # Windows (Junction — no admin required)
  22. mklink /J "your-project\extensions\cocos-creator-mcp" "path\to\cocos-creator-mcp"
  23. # macOS / Linux
  24. ln -s /path/to/cocos-creator-mcp your-project/extensions/cocos-creator-mcp
  25. ```
  26. ### 2. Build
  27. ```bash
  28. cd cocos-creator-mcp
  29. npm install
  30. npm run build
  31. ```
  32. ### 3. Enable in Cocos Creator
  33. 1. Open your project in Cocos Creator
  34. 2. Go to **Extension > Extension Manager**
  35. 3. Enable **Cocos Creator MCP**
  36. 4. Open the panel: **Extension > Cocos Creator MCP > Open Panel**
  37. 5. Click **Start Server** (or set `autoStart: true` in config)
  38. ### 4. Connect from Claude Code
  39. Pick one of the two transports below.
  40. #### Option A — stdio bridge (recommended for Claude Code VSCode extension)
  41. The Claude Code VSCode extension currently has a bug where it unconditionally
  42. tries OAuth Dynamic Client Registration for HTTP-type MCP servers and fails
  43. with `SDK auth failed` (see upstream issues
  44. [#26917](https://github.com/anthropics/claude-code/issues/26917),
  45. [#38102](https://github.com/anthropics/claude-code/issues/38102),
  46. [#29697](https://github.com/anthropics/claude-code/issues/29697)).
  47. To avoid it entirely, use the bundled stdio bridge. It speaks JSON-RPC on
  48. stdin/stdout and forwards to the HTTP server internally.
  49. ```json
  50. {
  51. "mcpServers": {
  52. "cocos-creator-mcp": {
  53. "command": "node",
  54. "args": [
  55. "<ABSOLUTE_PATH_TO>/cocos-creator-mcp/client/stdio-bridge.js"
  56. ]
  57. }
  58. }
  59. }
  60. ```
  61. Optional env var: `COCOS_MCP_URL` (default `http://127.0.0.1:3000/mcp`).
  62. #### Option B — direct HTTP
  63. Works with Claude Code CLI, Cursor, Cline, and other clients that don't force
  64. OAuth on HTTP MCP. The server ships minimal dummy OAuth endpoints
  65. (`/.well-known/oauth-*`, `/oauth/register|authorize|token`) so OAuth-requiring
  66. clients can still complete a pro-forma flow on localhost.
  67. ```json
  68. {
  69. "mcpServers": {
  70. "cocos-creator-mcp": {
  71. "type": "http",
  72. "url": "http://127.0.0.1:3000/mcp"
  73. }
  74. }
  75. }
  76. ```
  77. > The dummy OAuth endpoints will be removed once upstream issues
  78. > ([#26917](https://github.com/anthropics/claude-code/issues/26917),
  79. > [#38102](https://github.com/anthropics/claude-code/issues/38102))
  80. > are resolved or real authentication is introduced.
  81. ### 5. Verify
  82. ```bash
  83. curl http://127.0.0.1:3000/health
  84. # {"status":"ok","tools":64}
  85. ```
  86. ## Available Tools (~64)
  87. The post-v2.0.0 layout. Each category is consolidated into a single tool that switches behavior via the `category_action` pattern (a 61% reduction from v1's 166 tools).
  88. <details>
  89. <summary><strong>Scene (12)</strong></summary>
  90. - `scene_manage(open/save/close/list/current/hierarchy)`
  91. - `scene_clipboard(copy/paste/cut)`
  92. - `scene_undo(snapshot/snapshot_abort/begin/end/cancel)`
  93. - `scene_array(move/remove)`
  94. - `scene_reset(transform/property/component/restore_prefab)`
  95. - `scene_query(dirty/ready/classes/components/component_has_script/nodes_by_asset/scene_bounds)`
  96. - `scene_create`, `scene_save_as`, `scene_set_parent`, `scene_soft_reload`
  97. - `scene_execute_script`, `scene_execute_component_method`
  98. </details>
  99. <details>
  100. <summary><strong>View (3)</strong> — Scene view (gizmo / settings / camera)</summary>
  101. - `view_gizmo(set_tool|get_tool|set_pivot|get_pivot|set_coordinate|get_coordinate)`
  102. - `view_settings(set_mode|get_mode|set_grid|get_grid|set_icon3d|get_icon3d|set_icon_size|get_icon_size|status|reset)`
  103. - `view_camera(focus_on_nodes|align_with_view|align_view_with_node)`
  104. Note: Editor APIs not supported on 3.8.x degrade to a graceful no-op (returning a `note`).
  105. </details>
  106. <details>
  107. <summary><strong>Node (10)</strong></summary>
  108. - `node_manage(create/delete/duplicate/move)`
  109. - `node_create_tree` — build a node hierarchy in a single call
  110. - `node_set_property`, `node_set_transform`, `node_set_active`, `node_set_layout`
  111. - `node_get_info`, `node_find_by_name`, `node_get_all`, `node_detect_type`
  112. </details>
  113. <details>
  114. <summary><strong>Component (3)</strong></summary>
  115. - `component_manage(add/remove/available/enum)`
  116. - `component_set_property` — Reflection-based. Supports asset path / `{path}` / `{guid}` / enum name / `cc.Vec3`/`Color`/`Size` plain object forms (see Value Reference Forms section)
  117. - `component_auto_bind` — auto-match `@property` fields to descendant nodes by name
  118. </details>
  119. <details>
  120. <summary><strong>Prefab (7)</strong></summary>
  121. - `prefab_edit(open/close)`
  122. - `prefab_create(mode: simple/replace/from_spec)` — extract / extract-and-replace / build-from-spec all unified
  123. - `prefab_instantiate`, `prefab_update`, `prefab_revert`, `prefab_duplicate`, `prefab_validate`
  124. </details>
  125. <details>
  126. <summary><strong>Asset (2)</strong></summary>
  127. - `asset_manage(create/delete/move/copy/save/reimport/import/save_meta/open_external)`
  128. - `asset_query(path/uuid/url/details/dependencies/users/missing/ready/generate_url)`
  129. </details>
  130. <details>
  131. <summary><strong>Project (6)</strong></summary>
  132. - `project_refresh_assets`, `project_get_asset_info`, `project_find_asset`
  133. - `project_get_settings`, `project_set_settings`, `project_query_scripts`
  134. For project name / path / engine info, use the `cocos://project/*` resources.
  135. </details>
  136. <details>
  137. <summary><strong>Debug (15)</strong></summary>
  138. **Console / scripts:** `read_console`, `execute_editor_script`, `debug_execute_script`, `debug_list_messages`.
  139. **Logs / extension / record:** `debug_logs(get/search/info)`, `debug_extension(list/info/reload)`, `debug_record(start/stop)`.
  140. **Editor / preview:** `debug_validate_scene`, `debug_clear_code_cache`, `debug_wait_compile`, `debug_query_devices`, `debug_open_url`, `debug_preview`, `debug_screenshot(target: window/pages)`, `debug_game_command`.
  141. </details>
  142. <details>
  143. <summary><strong>Preferences / Builder / Server (3)</strong></summary>
  144. - `preferences_manage(get/set/get_all/reset)`
  145. - `builder_manage(open_panel/get_settings/query_tasks/run_preview/stop_preview)`
  146. - `server_status(get/ips/port/build_hash/connectivity/interfaces/code_sync)`
  147. </details>
  148. <details>
  149. <summary><strong>Reference Image (3)</strong></summary>
  150. - `refimage_manage(add/remove/clear_all/switch/refresh)`
  151. - `refimage_set(position/scale/opacity)`
  152. - `refimage_query(list/current)`
  153. </details>
  154. ## Available Resources (12)
  155. MCP resources are read-only data sources exposed via URI, separate from tools. Listed via `resources/list` and `resources/templates/list`, fetched via `resources/read`.
  156. | URI | Returns |
  157. |---|---|
  158. | `cocos://scene/current` | Current scene name + uuid |
  159. | `cocos://scene/list` | All .scene files |
  160. | `cocos://scene/hierarchy` | Current scene's node tree |
  161. | `cocos://node/{uuid}` | Full property dump of a node |
  162. | `cocos://node/{uuid}/components` | Component summary list |
  163. | `cocos://component/{uuid}` | Full property dump of a component |
  164. | `cocos://prefab/list` | All prefabs |
  165. | `cocos://prefab/{uuid}` | Prefab asset info |
  166. | `cocos://project/info` | Project name + path |
  167. | `cocos://project/engine` | Engine version + path |
  168. | `cocos://editor/info` | Cocos Creator editor info |
  169. | `cocos://asset/{uuid}` | Asset details |
  170. ## Client Scripts
  171. The `client/` directory contains TypeScript files for runtime communication between the game preview and the MCP server. Since the extension is installed in `extensions/`, these files can be imported directly — no copying needed.
  172. ### McpConsoleCapture
  173. Captures `console.log/warn/error` from the game preview and sends them to the MCP server.
  174. ```typescript
  175. // Import from extensions/ (adjust relative path as needed)
  176. import { initMcpConsoleCapture } from "../../extensions/cocos-creator-mcp/client/McpConsoleCapture";
  177. initMcpConsoleCapture();
  178. ```
  179. ### McpDebugClient
  180. Enables AI-driven game control: screenshots, node clicking, and custom commands.
  181. ```typescript
  182. import { initMcpDebugClient } from "../../extensions/cocos-creator-mcp/client/McpDebugClient";
  183. initMcpDebugClient({
  184. customCommands: {
  185. // Add project-specific commands
  186. state: () => ({ success: true, data: { dump: MyDb.dump() } }),
  187. navigate: async (args) => {
  188. await MyRouter.goTo(args.page);
  189. return { success: true };
  190. },
  191. },
  192. });
  193. ```
  194. **Built-in commands** (no setup needed):
  195. - `screenshot` — Capture game screen via RenderTexture
  196. - `click` — Click a node by name
  197. **Custom commands** (project-specific):
  198. - Register any handler via `customCommands` option
  199. - Called via `debug_game_command` MCP tool
  200. Both scripts silently ignore when the MCP server is not running, so they are safe to leave in development builds.
  201. ## Console Log Capture (Details)
  202. `read_console` captures logs from three sources (`editor` / `scene` / `game`):
  203. ### Scene Process Logs (automatic)
  204. Console output from scene scripts (`console.log/warn/error` in the scene renderer process) is automatically captured. No setup required.
  205. ### Game Preview Logs (opt-in)
  206. Game code runs in a browser during preview, which is a separate process. To capture game preview logs, your game code needs to send logs to the MCP server's `/log` endpoint.
  207. **Setup:**
  208. Add a console capture script to your game project:
  209. ```typescript
  210. const MCP_LOG_URL = "http://127.0.0.1:3000/log";
  211. const FLUSH_INTERVAL = 500;
  212. let buffer: Array<{ timestamp: string; level: string; message: string }> = [];
  213. function hook(level: string, original: (...args: any[]) => void) {
  214. return function (...args: any[]) {
  215. original.apply(console, args);
  216. buffer.push({
  217. timestamp: new Date().toISOString(),
  218. level,
  219. message: args.map(a => typeof a === "string" ? a : JSON.stringify(a)).join(" "),
  220. });
  221. };
  222. }
  223. console.log = hook("log", console.log);
  224. console.warn = hook("warn", console.warn);
  225. console.error = hook("error", console.error);
  226. setInterval(() => {
  227. if (buffer.length === 0) return;
  228. const entries = buffer.splice(0, 50);
  229. fetch(MCP_LOG_URL, {
  230. method: "POST",
  231. headers: { "Content-Type": "application/json" },
  232. body: JSON.stringify(entries),
  233. }).catch(() => {}); // silently ignore if MCP server is not running
  234. }, FLUSH_INTERVAL);
  235. ```
  236. **`POST /log` format:**
  237. ```json
  238. [
  239. { "timestamp": "2026-03-26T12:00:00.000Z", "level": "log", "message": "Hello" },
  240. { "timestamp": "2026-03-26T12:00:01.000Z", "level": "error", "message": "Something failed" }
  241. ]
  242. ```
  243. Editor / scene / game entries are merged chronologically when retrieved via `read_console(action="get")`. Each entry includes a `source` field (`"editor"` / `"scene"` / `"game"`). Filter via `types: ["error", "warn"]`, `sources: ["scene"]`, `count`, `since`, `search`, or `includeStacktrace`. Clear with `read_console(action="clear")`.
  244. ## Configuration
  245. Settings are stored in `{project}/settings/cocos-creator-mcp.json`:
  246. ```json
  247. {
  248. "port": 3000,
  249. "autoStart": true
  250. }
  251. ```
  252. | Option | Default | Description |
  253. |--------|---------|-------------|
  254. | `port` | `3000` | HTTP server port |
  255. | `autoStart` | `false` | Start server automatically when extension loads |
  256. ## Testing
  257. Scene creation and resource URI compatibility checks (no running editor required):
  258. ```bash
  259. npm run build
  260. npm run test:compat
  261. ```
  262. These checks also run with the Node 14.16 runtime embedded in Creator 3.8.3.
  263. For resource templates, percent-encode UUID values (for example,
  264. `cocos://node/${encodeURIComponent(uuid)}/components`): Cocos short UUIDs can contain `/` and `+`.
  265. ```bash
  266. node test/regression.mjs # default port 3000
  267. node test/regression.mjs 3001 # custom port
  268. ```
  269. ## Version History
  270. - **v0.1** — MCP server + scene/node tools (13 tools)
  271. - **v0.5** — Component, prefab, project, debug tools (27 tools)
  272. - **v1.0** — Full tool coverage (145 tools, 13 categories, 224 test assertions)
  273. - **v1.1** — Console log capture (scene process auto-capture + game preview via `/log` endpoint)
  274. - **v1.2** — AI autonomous development: Preview in Editor, screenshot capture, game command control, code cache clear, scene save fix. Client scripts for game preview integration (`client/`)
  275. - **v1.3** — `scene:set-property` for prefab save support, prefab_create overwrite guard, param alias (`component` → `componentType`)
  276. - **v1.5** — `prefab_create_and_replace`, batch `set_property`, `prefab_open`
  277. - **v1.6** — `debug_batch_screenshot`, widget support in `create_tree`, `component_query_enum`, `server_check_code_sync`
  278. - **v1.8.0** — Preview Recorder panel: `debug_record_start` / `debug_record_stop` (MediaRecorder via canvas.captureStream, MP4/WebM, quality presets)
  279. - **v1.8.1** — Fix: `component_set_property` cc.Asset references (cc.Font etc.) falling back to cc.Node when type is unspecified
  280. - **v1.8.2** — Preview Recorder: screenshot button (webp/png toggle, max width), section-based UI layout
  281. - **v1.9.0** — Preview Recorder auto-archive of old recordings + preflight "preview not running" check
  282. - **v1.10.0** — `scene_create` asset-db fallback, stringified args preventive validation, test coverage expansion
  283. - **v1.11.0** — HTTP MCP OAuth workaround (stdio bridge + dummy OAuth endpoints for Claude Code VSCode upstream bug) + dialog prevention for scene switching tools (`force` param, `ensureSceneSafeToSwitch`, `safeSaveScene`) + regression tests for both
  284. - **v1.12.0** — Prefab authoring efficiency: `component_auto_bind` (auto-match `@property` fields to node names), `debug_wait_compile` (wait for TS compile to finish), `prefab_create_from_spec` (create node tree + auto-bind + prefab_create in one call)
  285. - **v1.13.0** — `nodeName` parameter on component/get_components/auto_bind (no UUID required), `screenshot` auto-return option on `component_set_property` / `node_set_layout`, `node_set_layout` unified tool (UITransform + Widget + color/opacity in one call), dialog auto-response for untitled+dirty scenes, shared screenshot / node-resolve utilities
  286. - **v1.14.0** — Widget `_alignFlags` auto-recalc bug fix: `setProperty` / `setProperties` / `node_set_layout` now re-query `isAlign*` values from scene and rebuild `_alignFlags` bitmask after isAlign updates (Editor bug where bitmask was not updated automatically, causing prefabs to save with `_alignFlags: 45` stuck state). Also `node_create` component addition now waits for editor reflection (`waitForComponent`) to fix flaky tests
  287. - **v2.0.0** (BREAKING) — Major tool topology refactor: 166 → ~64 tools (-61%).
  288. - New: `read_console` (Editor + Scene + Game console with type/source filters, compile error detection via project.log fallback), `execute_editor_script` (escape hatch for arbitrary editor JS), 12 MCP Resources (`cocos://scene/*`, `cocos://node/{uuid}`, `cocos://component/{uuid}`, `cocos://prefab/*`, `cocos://project/*`, `cocos://editor/info`, `cocos://asset/{uuid}`).
  289. - Enhanced `component_set_property`: transparent value references — `db://...` asset paths, `{path}` / `{guid}` objects, enum names, `cc.Vec3/Vec2/Vec4/Color/Size` plain objects all auto-resolved.
  290. - Aggregated tools into `category_action` patterns: `scene_manage`, `scene_clipboard`, `scene_undo`, `scene_array`, `scene_reset`, `scene_view_*`, `node_manage`, `component_manage`, `prefab_edit`, `asset_manage`, `asset_query`, `view_gizmo/settings/camera`, `refimage_manage/set/query`, `preferences_manage`, `builder_manage`, `server_status`, `debug_logs/extension/record`.
  291. - Fixed `prefab_create_from_spec` asset-ref serialization bug — properties are now reapplied via Editor API after node tree build, so asset refs serialize as `{__uuid__, __expectedType__}` correctly. The post-processing workaround is no longer needed.
  292. - Removed: read-only tools that have resource equivalents (`scene_query_node`, `scene_query_node_tree`, `scene_query_component`, `component_get_components`, `component_get_info`, `prefab_list`, `prefab_get_info`, `project_get_info`, `project_get_engine_info`, `debug_get_editor_info`) and v2 deprecated (`debug_get_console_logs`, `debug_clear_console`).
  293. - See [MIGRATION.md](./MIGRATION.md) for the v1 → v2 mapping table. See [CHANGELOG.md](./CHANGELOG.md) for the full change log.
  294. ## Development
  295. ```bash
  296. npm run watch # Watch mode
  297. npm run build # One-time build
  298. ```
  299. After building, reload the extension in Cocos Creator:
  300. - **Extension Manager** — disable then re-enable
  301. - **Developer > Reload** — reloads main process
  302. - **Full restart** — required for scene script or new category changes
  303. ## Requirements
  304. - Cocos Creator 3.8+
  305. - Node.js 18+ for building the extension and running the HTTP regression client. The installed extension runs inside Creator's embedded Node runtime (including Node 14.16 in Creator 3.8.3).
  306. ## Value Reference Forms (v2.0.0)
  307. `component_set_property` accepts multiple convenient forms for asset references, node references, enums, and structured value types. The MCP server resolves each to the correct Editor dump format internally.
  308. ### Asset references
  309. ```jsonc
  310. // All four forms are equivalent for a SpriteFrame field:
  311. { "value": "<uuid>" } // raw UUID
  312. { "value": "db://assets/textures/foo.png" } // asset path string
  313. { "value": { "path": "db://assets/textures/foo.png" } } // {path}
  314. { "value": { "guid": "<uuid>" } } // {guid}
  315. ```
  316. ### Node / component references
  317. ```jsonc
  318. // Resolves to a node by descendant path under the active scene root:
  319. { "value": "@path:Canvas/Background" }
  320. // Or pass a node UUID directly — the property type is inferred from the schema:
  321. { "value": "<node-uuid>" }
  322. ```
  323. ### Enum values
  324. ```jsonc
  325. // Name (v2.0.0) — looked up against the property's enumList:
  326. { "value": "HORIZONTAL" }
  327. // Numeric (still supported):
  328. { "value": 1 }
  329. ```
  330. ### Structured value types (v2.0.0)
  331. ```jsonc
  332. // cc.Vec3 / cc.Vec2 / cc.Vec4 — pass plain coordinates:
  333. { "value": { "x": 100, "y": 50, "z": 0 } }
  334. // cc.Color — RGBA in 0-255 range:
  335. { "value": { "r": 255, "g": 0, "b": 0, "a": 255 } }
  336. // cc.Size — width/height (or x/y) are both accepted:
  337. { "value": { "width": 200, "height": 100 } }
  338. ```
  339. These also work inside `prefab_create_from_spec`'s `spec.properties` because the asset-ref serialization bug was fixed in v2.0.0 (properties are now reapplied via the Editor API after the node tree is built).
  340. ## Known Limitations
  341. - **`scene_create`**: On Creator 3.8.x, where `scene:new-scene` is unavailable, the tool creates a minimal 2D scene through the asset database. Both explicit paths and the automatically generated path are supported. The tool verifies that the created scene opened successfully; a failed open returns an error while leaving the created asset available for inspection. See [#13](https://github.com/harady/cocos-creator-mcp/issues/13) for background.
  342. - ~~**`prefab_create_from_spec` — asset refs are saved as raw UUID strings**~~ **(fixed in v2.0.0)** — Properties in `spec.properties` are now reapplied via the Editor API (`component_set_property`) after `buildNodeTree` completes, so asset refs serialize as `{__uuid__, __expectedType__}` correctly. The old workaround of post-processing `.prefab` files is no longer needed.
  343. ## License
  344. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.