
shiliyu1991-lang/cocos-mcp-2x
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Cocos Creator 2.4.x의 MCP 브리지 - 묶인 Python FastMCP 서버를 통해 편집기에 MCP 클라이언트 (Claude/Cursor)를 연결합니다. cocos-mcp-3x의 항구.
개요
LLM (Claude Desktop / Cursor 또는 MCP 클라이언트)를 편집기에 연결하는 편집기 확장은 모델을 검사하고 게임 프로젝트를 구동합니다. 읽기 / 쓰기 노드, 자산 및 장면에서 작동하며 콘솔을 읽고 스크립트를 실행합니다. 이것은 cocos-mcp-3x의 2.4.x 포트입니다 ( 크리에이터 3.8.x 버전): , 2.4 편집기 API에서만 다른 확장 측면 통화. 플러그인은 - 파이썬 MCP 서버는 ./server에서 번들이며, 확장은 . Cocos Creator 2.4.15에 대한 개발 및 검증; 전체 2.4.x 라인 대상 (incl. 2.4.9). - Python 측은 WebSocket입니다. Cocos 확장은 패널에서 Connect 버튼을 통해 다이얼입니다. - 각 도구 호출은 JSON envelope를 확장 (main.js)로 전송합니다. 즉, 자산 작업 사용 Editor.assetdb; node/scene-graph 작업은 현장 스크립트 장면으로 전달됩니다.
개요(AI 번역)
English · 한국어
LLM (Claude Desktop / Cursor 또는 MCP 클라이언트)를 연결하는 편집기 확장 Cocos Creator 2.4.x 편집기, 모델을 검사하고 게임 프로젝트를 구동 : 읽기 / 쓰기 노드는 자산과 장면에서 작동하며 콘솔을 읽고 스크립트를 실행합니다.
이것은 2.4.x 포트의 cocos-mcp-3x] ( 창조자 3.8.x 버전): ** 동일
파이썬 MCP 서버 및 WebSocket 프로토콜**, 2.4 편집기 API에서만 확장 측면을 변경
전화. 플러그인은 ** 자체 유지 ** - Python MCP 서버는 ./server과
확장에는 ** npm 의존성 및 빌드 단계가 없습니다 **.
Cocos Creator 2.4.15에 대한 개발 및 검증; 전체 2.4.x 라인 대상 (incl. 2.4.9).
어떻게 작동합니까?
- 파이썬 사이드는 WebSocket 서버입니다. Cocos 확장은 클라이언트 및 다이얼입니다. 패널에 Connect 단추를 통해.
- 각 도구 호출은 JSON envelope를 확장 ([
main.js])로 전송합니다. name: Asset operations useEditor.assetdb; node/scene-graph 작업이 전달됩니다. 장면 스크립트scene.js([T5]]] 씬에서 라이브 그래프를 mutates
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
cocos-mcp-2x
English · 中文
An editor extension that connects an LLM (Claude Desktop / Cursor or any MCP client) to the Cocos Creator 2.4.x editor, letting the model inspect and drive your game project: read/write nodes, operate on assets and scenes, read the console, and execute scripts.
This is the 2.4.x port of cocos-mcp-3x (the Creator 3.8.x version): the same
Python MCP server and WebSocket protocol, differing only in the 2.4 editor APIs the extension side
calls. The plugin is self-contained — the Python MCP server is bundled at ./server — and the
extension has no npm dependencies and no build step.
Developed and verified against Cocos Creator 2.4.15; targets the whole 2.4.x line (incl. 2.4.9).
How it works
MCP client (Claude / Cursor)
│ stdio / http
▼
Python FastMCP server ── server/src/main.py
│ WebSocket bridge 127.0.0.1:6020/cocosmcp
▼
Cocos Creator extension ── main.js (connects in as the WS client)
│
├─ Editor.assetdb / Editor.Ipc assets, scene open/save
└─ Editor.Scene.callSceneScript ──► scene.js (scene process, holds the cc engine runtime)
- The Python side is the WebSocket server; the Cocos extension is the client and dials in via the Connect button on the panel.
- Each tool call sends a JSON envelope to the extension (
main.js), which dispatches by command name: asset operations useEditor.assetdb; node/scene-graph operations are forwarded to the scene scriptscene.js(which mutates the live graph through theccengine in the scene process), then replies{id, success, data|error}.
Differences from the 3.x version
| Concern | cocos-mcp-3x (3.8.x) | cocos-mcp-2x (2.4.x) |
|---|---|---|
| Asset API | Editor.Message.request('asset-db', …) (Promise) |
Editor.assetdb.* (callbacks) |
| Scene-graph ops | Editor.Message.request('scene', …) |
Editor.Scene.callSceneScript() → scene.js |
| Console capture | hook console.* |
hook the Editor.log/warn/error family |
| Extension entry | exports.methods (3.x) |
module.exports = { load, unload, messages } (2.4) |
| Scene files | .scene |
.fire |
Tools provided
| Tool | Purpose |
|---|---|
get_project_info |
Project path, assets root, editor version, scene list, available bridge commands |
manage_scene |
List / open / save / current scene (Cocos 2.x .fire) |
manage_node |
Inspect or modify nodes in the current scene (mostly by uuid) |
manage_asset |
Inspect and manipulate assets under assets/ via the asset-db |
read_console |
Read / clear the log buffer (500-entry ring) — includes both editor logs and the running game’s own logs from the browser preview |
execute_script |
Execute arbitrary JS in the editor main context (Editor.*) or scene context (cc) |
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →