
romarogov/cocos-code-mode
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCPラッパーを搭載したUTCP Serverを搭載したCocos Creator用のAIコードモード拡張
概要
cocos Creator EditorをAI制御可能なツールにします。 シーン操作、アセット管理、プロパティの検査をUTCPプロトコルを介して構造化されたツールコールとして公開するエディタ内で HTTP サーバを実行します。これにより、AI エージェントの構築、検査、および変更が Cocos Creator プロジェクトをUIを介して同じ方法で行います。 これらのツールは、UTCP コード モード環境で組み合わせて、AI エージェントのパフォーマンスとトークン効率を最大限に高め、分離された JS サンドボックスでツールを呼び出すことができます。 1。 Cocos Creatorプロジェクト2に拡張機能をインストールします。 CodeMode MCP Server 3 で拡張機能を統合します。 エージェントのシステムプロンプトを設計するか、提供された例4を使用します。 AIに質問して、学習方法をご覧ください! LLM文脈で常に保持される剛性の高いMCPツールの防御とは対照的に、CodeModeはAIが最も馴染みのある方法でツールを呼び出すのに役立つアプローチです - ツールのTypeScriptの防御に基づいてJavaScriptコードを書くことによって.
概要(AI 翻訳)
コードモードは、Cocos Creator EditorをAI制御可能なツールに変えます。 シーン操作、アセット管理、プロパティの検査をUTCPプロトコルを介して構造化されたツールコールとして公開するエディタ内で HTTP サーバを実行します。これにより、AI エージェントの構築、検査、および変更が Cocos Creator プロジェクトをUIを介して同じ方法で行います。 これらのツールは、UTCP コード モード環境で組み合わせて、AI エージェントのパフォーマンスとトークン効率を最大限に高め、分離された JS サンドボックスでツールを呼び出すことができます。
クイックスタート
- Cocos Creatorプロジェクトに拡張機能をインストール 2。 CodeMode MCP Server で拡張機能を統合
- エージェントのシステムプロンプトの設計や提供例の使用 4。 あなたを助け、それがどのように学ぶかを見るためにAIを尋ねる!
コードモードとは何ですか?
LLM文脈で常に保持される剛性の高いMCPツールの防御とは対照的に、CodeModeはAIが最も馴染みのある方法でツールを呼び出すのに役立つアプローチです - ツールのTypeScriptの防御に基づいてJavaScriptコードを書くことによって.
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Code Mode for Cocos Creator
Code Mode turns the Cocos Creator Editor into an AI-controllable tool. It runs an HTTP server inside the editor that exposes scene manipulation, asset management, and property inspection as structured tool calls via UTCP Protocol — letting AI agents build, inspect, and modify Cocos Creator projects the same way a developer would through the UI. These tools are combined in UTCP Code Mode environment to achieve maximum performance and token efficiency for AI agents, letting them call the tools in isolated JS sandbox.
Quickstart
- Install extension in the Cocos Creator project
- Integrate extension with CodeMode MCP Server
- Design a system prompt for you agent or use provided example
- Ask AI to help you and see how it learns!
What is Code Mode?
In contrast to rigid MCP tool defenitions, which always kept in LLM context, CodeMode is an approach which helps AI to call tools in the most familiar way - by writing JavaScript code based on TypeScript defenitions of tools. This helps AI to keep token consumption low, implement loops and chained calls for complex tasks, organize output in compact form and reuse output from different existing servers and endpoints in one JavaScript execution context, isolating LLM context from unnecessary data. This opens endless possibilities for interaction between different environments. Here is some examples:
- Move scene from blender with Blender MCP, exporting particular objects as FBX straight into Cocos project
- Use Figma MCP to fetch UI layout from figma and implement these layouts in your project in the smart way instead of blindly recreating every panel
- Use Unity Code Mode to perform game porting between engines
- Bring your own examples 🙃
All this becomes possible with community-friendly, flexible and open solution from UTCP team: CodeMode and it’s MCP Server. You can read more about Code Mode concept in papers from Anthropic, Apple and Cloudflare.
Tools
| Category | Tools | Purpose |
|---|---|---|
| Scene | nodeGetTree, nodeGetAtPath, nodeCreate, nodeCreatePrimitive, nodeOperate |
Navigate and build scene hierarchy |
インストール
npx @utcp/code-mode-mcp設定
{
"mcpServers": {
"code-mode": {
"command": "npx",
"args": ["@utcp/code-mode-mcp"],
"env": {
"UTCP_CONFIG_FILE": "~/.utcp_config.json"
}
}
}
}