
caravanglory/cocos-mcp-server 是从 https://github.com/caravanglory/cocos-mcp-server. 导入的 MCP 服务器候选
概览
caravanglory/cocos-mcp-server 是从 https://github.com/caravanglory/cocos-mcp-server. 导入的 MCP 服务器候选
概述(AI 翻译)
适用于 Cocos Creator 3.8.x 的 AI MCP (Model Context Protocol) 服务器插件,让 AI 助手(Claude、Cursor 等)能够直接控制 Cocos Creator 编辑器。
一款针对 Cocos Creator 3.8.x 的 AI MCP(模型上下文协议)服务器插件,使 AI 助手(Claude、光标等)能够直接控制 Cocos Creator 编辑器。
功能特性 / 功能
- MCP 协议 / MCP 协议:基于 JSON-RPC 2.0 的标准 MCP 协议,通过 HTTP 传输 / 基于 HTTP 传输的标准 JSON-RPC 2.0
- 130+ 工具 / 130+ 工具:覆盖场景、节点、组件、预制体、资源、项目等全方位编辑器操作 / 全面覆盖场景、节点、组件、预制件、资产和项目操作
- Vue 3 控制面板 / Vue 3 控制面板:内置服务器控制和工具管理界面 / 内置服务器控制和工具管理界面
- 工具配置管理 / 工具配置:按需启用/禁用工具,保存自定义配置 / 按需启用/禁用工具并保存自定义配置
- 自动启动 / 自动启动:可配置插件加载时自动启动服务器 / 可选择性地在扩展加载时自动启动服务器
- 双语支持 / 双语界面:中文/英文界面 / 英文界面
兼容性 / 兼容性
| Cocos 创造者 | 状态 / 状态 |
|---|---|
| 3.8.x | 完全支持 / 完全支持 |
| 3.7.x | 未测试 / 未测试 |
安装方法 / 安装
方式一:项目级插件 / 选项1:项目级扩展
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Cocos MCP Server
适用于 Cocos Creator 3.8.x 的 AI MCP (Model Context Protocol) 服务器插件,让 AI 助手(Claude、Cursor 等)能够直接控制 Cocos Creator 编辑器。
An AI MCP (Model Context Protocol) server plugin for Cocos Creator 3.8.x, enabling AI assistants (Claude, Cursor, etc.) to directly control the Cocos Creator editor.
功能特性 / Features
- MCP 协议 / MCP Protocol:基于 JSON-RPC 2.0 的标准 MCP 协议,通过 HTTP 传输 / Standard JSON-RPC 2.0 over HTTP transport
- 130+ 工具 / 130+ Tools:覆盖场景、节点、组件、预制体、资源、项目等全方位编辑器操作 / Full coverage of scene, node, component, prefab, asset, and project operations
- Vue 3 控制面板 / Vue 3 Control Panel:内置服务器控制和工具管理界面 / Built-in server control and tool management UI
- 工具配置管理 / Tool Configuration:按需启用/禁用工具,保存自定义配置 / Enable/disable tools on demand and save custom configurations
- 自动启动 / Auto-start:可配置插件加载时自动启动服务器 / Optionally start the server automatically when the extension loads
- 双语支持 / Bilingual UI:中文/英文界面 / English and Chinese interface
兼容性 / Compatibility
| Cocos Creator | 状态 / Status |
|---|---|
| 3.8.x | 完全支持 / Fully supported |
| 3.7.x | 未测试 / Untested |
安装方法 / Installation
方式一:项目级插件 / Option 1: Project-level Extension
将插件目录复制到 Cocos Creator 项目的 extensions 目录下:
Copy the plugin folder into the extensions directory of your Cocos Creator project:
{your-project}/
└── extensions/
└── cocos-mcp-server/
方式二:全局插件 / Option 2: Global Extension
将插件目录复制到全局插件目录:
Copy the plugin folder to the global extensions directory:
~/.CocosCreator/extensions/cocos-mcp-server/
启用插件 / Enable the Extension
- 打开 Cocos Creator 3.8.x / Open Cocos Creator 3.8.x
- 菜单栏 → 扩展 → 扩展管理器 / Go to Extension → Extension Manager
- 在 项目 或 全局 标签页找到
cocos-mcp-server/ Findcocos-mcp-serverunder the Project or Global tab - 点击启用 / Click Enable
开发构建 / Development Build
# 安装依赖 / Install dependencies
npm install
# 编译 TypeScript / Compile TypeScript
npm run build
# 开发模式(文件监听)/ Development mode (file watching)
npm run watch
编译输出位于 dist/ 目录。/ Compiled output is placed in the dist/ directory.
使用方法 / Usage
1. 启动服务器 / Start the Server
插件启用后,通过菜单 扩展 → Cocos MCP Server 打开控制面板,点击"启动服务器"。
After enabling the extension, open the control panel via Extension → Cocos MCP Server, then click Start Server.
默认服务器地址 / Default server address:http://127.0.0.1:3000/mcp
2. 连接 AI 客户端 / Connect an AI Client
Claude Code:
claude mcp add --transport http cocos-creator http://127.0.0.1:3000/mcp
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"cocos-creator": {
"url": "http://127.0.0.1:3000/mcp",
"transport": "http"
}
}
}
Cursor / VS Code:
在 MCP 设置中添加 HTTP 类型服务器,URL 填写 http://127.0.0.1:3000/mcp。
Add an HTTP-type MCP server in your MCP settings and set the URL to http://127.0.0.1:3000/mcp.
工具列表 / Tool Reference
场景工具 / Scene Tools (8)
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"cocos-creator": {
"url": "http://127.0.0.1:3000/mcp",
"transport": "http"
}
}
}