cc-mvp
A Cocos Creator 3.8 editor extension that exposes scene, node, component, prefab, preview, build, asset, and debug operations as MCP tools for AI clients like Codex and Claude Code.
README
cc-mvp
cc-mvp is a Cocos Creator 3.8 editor extension that exposes scene, node, component, prefab, preview, build, asset, and debug operations as MCP tools.
It is designed for AI clients such as Codex and Claude Code:
- Cocos Creator keeps the real editor state and executes the actual operations.
cc-mvpstarts a local HTTP bridge athttp://127.0.0.1:17321.dist/mcp-server.jsis a stdio MCP adapter that forwards MCP tool calls to that local bridge.
What it provides
Main capability groups:
- Scene tools: get current scene, list scenes, open scene, save scene, create scene, inspect hierarchy
- Node tools: create, read, find, move, duplicate, delete, update transforms and active state
- Component tools: add, remove, inspect, set properties, mount custom script components
- Prefab tools: list, inspect, open, instantiate, create, export scene nodes to real prefab assets
- Preview tools: browser preview, GameView start/pause/step/stop
- Build tools: query platforms/tasks, trigger real Creator builds, AI-friendly build helpers
- Asset/debug/environment tools: asset CRUD, logs, scene JS execution, stats, validation, preferences, server info
AI-oriented high-level tools include:
ai_preview_browser_with_sceneai_build_web_desktop_defaultai_build_web_mobile_defaultai_build_web_mobile_and_waitai_export_selected_nodes_to_prefabsai_export_nodes_by_name_to_prefabs
Architecture
source/main.ts: extension main process, HTTP bridge, MCP-style JSON-RPC routing, project/build/asset/log toolssource/scene.ts: scene script for real scene/node/component/prefab/GameView operationssource/mcp-server.ts: stdio MCP server that forwards tohttp://127.0.0.1:17321
Install
Place the extension in your project:
YourProject/
├─ assets/
├─ extensions/
│ └─ cc-mvp/
│ ├─ source/
│ ├─ dist/
│ ├─ package.json
│ └─ ...
└─ ...
Install and build:
cd E:\CocosWorkspace\Test33\extensions\cc-mvp
npm install
npm run build
Then in Cocos Creator:
- Open the project.
- Enable or refresh the
cc-mvpextension. - Keep Creator open while your AI client uses MCP.
Verify the bridge
After the extension loads, the bridge should be available at:
http://127.0.0.1:17321
Quick health check:
Invoke-RestMethod `
-Method Get `
-Uri "http://127.0.0.1:17321/health"
Expected result:
- HTTP 200
- JSON containing the extension name, version, and project path
MCP endpoints
cc-mvp exposes three practical entry points:
- Stdio MCP server
node E:/CocosWorkspace/Test33/extensions/cc-mvp/dist/mcp-server.js
- HTTP JSON-RPC MCP endpoint
POST http://127.0.0.1:17321/mcp
- Simplified HTTP tool endpoint
POST http://127.0.0.1:17321/tool
Other useful routes:
GET /healthGET /toolsPOST /messagePOST /crud
Use with Codex
Codex CLI and the Codex IDE extension share the same MCP configuration. OpenAI documents that MCP servers can be added either with codex mcp add or through ~/.codex/config.toml / project .codex/config.toml. See the official docs: Model Context Protocol – Codex and Advanced Configuration – Codex.
Option A: add from the CLI
Run this once:
codex mcp add cc-mvp -- node E:/CocosWorkspace/Test33/extensions/cc-mvp/dist/mcp-server.js
Then verify inside Codex:
- Run
codex mcp --helpfor MCP management commands - Run
/mcpinside the Codex TUI to see whethercc-mvpis connected
Option B: add to .codex/config.toml
For this project, create or edit:
E:\CocosWorkspace\Test33\.codex\config.toml
Example:
[mcp_servers.cc-mvp]
command = "node"
args = ["E:/CocosWorkspace/Test33/extensions/cc-mvp/dist/mcp-server.js"]
cwd = "E:/CocosWorkspace/Test33"
startup_timeout_sec = 20
tool_timeout_sec = 600
enabled = true
If you prefer user-wide setup, put the same block in:
~/.codex/config.toml
How to prompt Codex
Once the server is connected, you can ask Codex to call the tools naturally. Examples:
Use cc-mvp to get the current Cocos scene and summarize the node hierarchy.Open db://assets/scene.scene and start browser preview with cc-mvp.Export the currently selected nodes to db://assets/prefabs/selected using cc-mvp.Run a web-mobile build with cc-mvp and wait until it finishes.
Typical tool sequence:
scene_get_current_scenescene_get_hierarchynode_find_nodes_by_nameornode_create_nodeproject_preview_startorai_preview_browser_with_sceneproject_buildorai_build_web_mobile_and_wait
Use with Claude Code
Anthropic documents local stdio MCP servers with claude mcp add --transport stdio <name> -- <command> [args...]. See the official docs: Connect Claude Code to tools via MCP.
Option A: local scope
This is the simplest setup and only affects your current project on your machine:
claude mcp add --transport stdio cc-mvp -- node E:/CocosWorkspace/Test33/extensions/cc-mvp/dist/mcp-server.js
Option B: project scope
If you want the MCP server config written into .mcp.json for the repo:
claude mcp add --transport stdio cc-mvp --scope project -- node E:/CocosWorkspace/Test33/extensions/cc-mvp/dist/mcp-server.js
Anthropic currently distinguishes these scopes:
local: stored in~/.claude.jsonfor the current project onlyproject: stored in repo.mcp.json, intended for team sharinguser: stored in~/.claude.json, available across all projects
Equivalent .mcp.json example
If you want to write the project config manually:
{
"mcpServers": {
"cc-mvp": {
"command": "node",
"args": [
"E:/CocosWorkspace/Test33/extensions/cc-mvp/dist/mcp-server.js"
],
"env": {}
}
}
}
Check server status
Useful Claude Code commands:
claude mcp list
claude mcp get cc-mvp
Inside Claude Code:
/mcp
How to prompt Claude Code
Examples:
Use the cc-mvp MCP server to inspect the current Cocos scene.Use cc-mvp to open db://assets/scene.scene and launch browser preview.Use cc-mvp to export nodes named Enemy into db://assets/prefabs/enemies.Use cc-mvp to build web-mobile and wait for completion.
Direct HTTP usage
If you are building your own client, you can call the bridge directly.
Simplified /tool call
{
"name": "scene_get_current_scene",
"arguments": {}
}
PowerShell:
$body = @{
name = "scene_get_current_scene"
arguments = @{}
} | ConvertTo-Json -Depth 20
Invoke-RestMethod `
-Method Post `
-Uri "http://127.0.0.1:17321/tool" `
-ContentType "application/json" `
-Body $body
MCP JSON-RPC call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "scene_get_current_scene",
"arguments": {}
}
}
Recommended first tool calls
When connecting a new AI client, these are good first checks:
scene_get_current_scenescene_get_scene_listscene_get_hierarchyproject_get_infoenv_get_environment_info
Then move on to real actions:
ai_preview_browser_with_sceneprefab_export_node_to_prefabai_export_selected_nodes_to_prefabsai_build_web_mobile_and_wait
Practical examples
Open a scene and preview in browser
Use the high-level helper:
{
"name": "ai_preview_browser_with_scene",
"arguments": {
"scene": "db://assets/scene.scene"
}
}
Trigger a web-mobile build and wait
{
"name": "ai_build_web_mobile_and_wait",
"arguments": {
"debug": true,
"buildPath": "project://build/web-mobile",
"timeoutMs": 600000,
"pollMs": 1500
}
}
Export a scene node to a real prefab asset
{
"name": "prefab_export_node_to_prefab",
"arguments": {
"nodeUuid": "YOUR_NODE_UUID",
"url": "db://assets/prefabs/Enemy.prefab"
}
}
Notes
- The stdio MCP server depends on the local Creator bridge, so Cocos Creator must stay open.
dist/mcp-server.jsdoes not operate on project files directly. It forwards requests to the running editor.- Browser preview is usually the most stable path for automated preview flows.
- GameView controls are implemented and tested, but Creator UI state can still affect timing.
- Build tools trigger real Creator build tasks, not just panel navigation.
- Resource paths should use Creator
db://URLs whenever possible.
Troubleshooting
If Codex or Claude Code cannot use the tools:
- Confirm Creator is open with
E:\CocosWorkspace\Test33. - Confirm
cc-mvpis enabled. - Confirm
http://127.0.0.1:17321/healthreturns success. - Rebuild the extension:
cd E:\CocosWorkspace\Test33\extensions\cc-mvp
npm run build
- Refresh or restart Cocos Creator.
- Re-run
codex mcp add ...orclaude mcp add ...if the client still points to an old path.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。