The Most Advanced MCP Server for Cocos Creator Editor with `execute_javascript`, prompts/resources, screenshots, asset dependency validation, tool profiles, one-click client configuration, and editor automation.
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
claude mcp add funplay-cocos-mcp -- npx -y funplay-cocos-mcp{
"mcpServers": {
"funplay-cocos-mcp": {
"command": "npx",
"args": ["-y", "funplay-cocos-mcp"]
}
}
}MCP Servers overview
<p align="center">
<h1 align="center">Funplay MCP for Cocos</h1>
<p align="center">
<strong>An Embedded MCP Server for Cocos Creator Editor</strong>
</p>
<p align="center">
<a href="#"><img src="https://img.shields.io/badge/Cocos%20Creator-3.8%2B-blue" alt="Cocos Creator 3.8+"></a>
<a href="#"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"></a>
<a href="#"><img src="https://img.shields.io/badge/MCP-Compatible-green" alt="MCP Compatible"></a>
<a href="#"><img src="https://img.shields.io/badge/Platform-Editor%20Only-orange" alt="Editor Only"></a>
<a href="https://store.cocos.com/app/detail/8913"><img src="https://img.shields.io/badge/Cocos%20Store-Install-brightgreen" alt="Install from Cocos Store"></a>
</p>
<p align="center">
<a href="./README_CN.md">中文</a> | English
</p>
</p>
> If this project helps your Cocos workflow, please consider giving it a Star. It helps more developers discover the project and supports ongoing development.
---
Funplay MCP for Cocos is an MIT-licensed Cocos Creator extension that embeds an HTTP MCP server directly inside the editor. It lets AI assistants such as Claude Code, Cursor, Codex, VS Code Copilot, Trae, and Kiro inspect and operate your running Cocos project.
The package follows the same product direction as Funplay MCP for Unity: keep the default tool surface focused, provide a one-click client configuration window, and make one high-flexibility execution tool the primary workflow.
For Cocos, the primary tool is `execute_javascript`:
- `context: "scene"` runs JavaScript in the active Cocos scene/runtime context
- `context: "editor"` runs JavaScript in the Cocos editor/browser context
> *"Create a login page UI with account/password fields and a main login button."*
>
> Your AI assistant can call `execute_javascript`, build the UI hierarchy under the active Canvas, attach Cocos components, inspect the result, and capture a screenshot for validation.
## Quick Start
If you just want to connect quickly, do these three things:
- Install this repository as a Cocos Creator extension
- Open `Funplay > MCP Server`
- Use the built-in one-click MCP client configuration
### 1. Install as a Cocos Creator Extension
Recommended install: use the official [Cocos Store page](https://store.cocos.com/app/detail/8913) and install the extension into your target Cocos Creator project.
For local development or unreleased builds, clone or copy this repository into your Cocos project extension directory:
```bash
cd /path/to/your-cocos-project
mkdir -p extensions
git clone https://github.com/FunplayAI/funplay-cocos-mcp.git extensions/funplay-cocos-mcp
```
Then restart Cocos Creator or reload extensions from the editor.
For a non-git install, download `Funplay.CocosMcp.v<version>.zip` from the GitHub Releases page, unzip it, and move the extracted `funplay-cocos-mcp` folder into your project `extensions/` directory.
You can also install it globally by copying the folder into your Cocos Creator user extensions directory.
### 2. Start the MCP Server
Open the editor menu:
```text
Funplay > MCP Server
```
The server runs on `http://127.0.0.1:8765/` by default.
If the configured port is already occupied, the extension first checks whether the existing listener belongs to the same Cocos project. Same-project listeners are reused safely; unrelated listeners trigger automatic fallback to the next available local port.
The panel is intentionally small:
- Enable or disable the MCP server
- Open focused Tool Exposure, MCP Settings, and Activity windows
- Automatically check the installed version against the latest GitHub release
- Open the release page or install verified release packages from the panel
- Configure AI clients with one click and preview the selected client config
- Keep advanced tool profile editing, transport settings, diagnostics, and logs out of the main server window
- Follow the Cocos Creator interface language automatically, or select Chinese/English per project in MCP Settings
The separate Tool Exposure window uses grouped tool lists with per-tool toggles and category select/clear actions. The Activity window uses a single recent-call stream with `OK` / `ERR` / `INT` badges, matching the simpler Funplay Unity MCP information architecture instead of putting every maintenance workflow into the main server panel.
The extension menu and native panel titles follow the Cocos Creator interface language. Panel controls, tool descriptions, status messages, prompts, and empty states support English and Chinese; open `Funplay > MCP Settings` to follow Creator or set a project-specific content-language override. MCP tool IDs and schemas remain in English so client integrations stay stable.
### 3. Configure Your AI Client
Use the built-in **MCP Client Config** section in the `Funplay > MCP Server` panel first.
Select your target client, click **One-Click Configure**, and the extension writes the recommended MCP config entry for you.
The MCP server name written to clients is:
```text
funplay_cocos
```
If you prefer to edit config files manually, use the examples below as fallback references.
<details>
<summary>Claude Code / Claude Desktop</summary>
```json
{
"mcpServers": {
"funplay_cocos": {
"type": "http",
"url": "http://127.0.0.1:8765/"
}
}
}
```
</details>
<details>
<summary>Cursor</summary>
```json
{
"mcpServers": {
"funplay_cocos": {
"url": "http://127.0.0.1:8765/"
}
}
}
```
</details>
<details>
<summary>VS Code</summary>
```json
{
"servers": {
"funplay_cocos": {
"type": "http",
"url": "http://127.0.0.1:8765/"
}
}
}
```
</details>
<details>
<summary>Trae</summary>
```json
{
"mcpServers": {
"funplay_cocos": {
"url": "http://127.0.0.1:8765/"
}
}
}
```
</details>
<details>
<summary>Kiro</summary>
```json
{
"mcpServers": {
"funplay_cocos": {
"type": "http",
"url": "http://127.0.0.1:8765/"
}
}
}
```
</details>
<details>
<summary>Codex</summary>
```toml
[mcp_servers.funplay_cocos]
url = "http://127.0.0.1:8765/"
```
</details>
### Optional: npm stdio Wrapper
If your MCP client prefers a local `stdio` command, install the npm wrapper after starting the Cocos editor server:
```bash
npm install -g funplay-cocos-mcp
```
Example MCP client entry:
```json
{
"mcpServers": {
"funplay_cocos": {
"command": "funplay-cocos-mcp",
"env": {
"FUNPLAY_COCOS_MCP_URL": "http://127.0.0.1:8765/"
}
}
}
}
```
The wrapper bridges stdio MCP traffic to the embedded Cocos HTTP endpoint. You can also run it with `npx funplay-cocos-mcp --url http://127.0.0.1:8765/`.
### 4. Verify the Connection
Open your AI client and try a few safe requests first:
- "Call `get_project_info` and summarize the current Cocos project."
- "Read `cocos://project/context` and tell me the editor status."
- "Use `execute_javascript` with `context: \"scene\"` to return the active scene name."
- "Use `execute_javascript` with `context: \"editor\"` to return the project path."
If these work, the MCP server, resources, prompts, and primary execution tool are connected correctly.
For local transport debugging, the panel can copy these commands, or you can run them directly:
```bash
curl http://127.0.0.1:8765/health
curl http://127.0.0.1:8765/tools
```
### 5. Start Building
Try a higher-level prompt in your AI client:
> Create a login page UI in the current Cocos scene with account/password fields, a login button, and a guest-login button. Use `execute_javascript` first, inspect the hierarchy, then capture a screenshot.
## Before You Start
- This extension is **Editor-only**. It is meant to automate Cocos Creator, not to add runtime dependencies to your final game build.
- The MCP server listens on `http://127.0.0.1:8765/` by default.
- If the configured port is busy, the server automatically falls back to the next available port and the panel/client config use the actual running port.
- `GET /health` and `GET /tools` are read-only debug endpoints for quick local checks outside an MCP client.
- The default `core` profile exposes 39 high-signal tools. Switch to `full` for all 105 tools, or use `custom` to include/exclude tool categories and individual tools.
- The panel checks GitHub releases automatically and also supports manual checks.
- One-click update downloads the GitHub Release zip, verifies `SHA256SUMS.txt`, backs up the current extension, replaces the package files, and reloads the extension when the Cocos package API supports it. If reload is unavailable, restart Cocos Creator after installation. Git worktree and symlink installs are intentionally left to manual `git pull` or package replacement.
- Streamable HTTP responses follow the MCP transport requirements for `Accept`, `MCP-Protocol-Version`, JSON-RPC notifications/responses, and optional `Mcp-Session-Id` sessions.
- Tool listings include MCP `outputSchema` and `annotations`; structured tool results use a standard envelope with `ok`, `tool`, `callId`, `summary`, `data`, and follow-up `refs`.
- `execute_javascript` safety checks are enabled by default. They block obvious risky filesystem and shell patterns such as delete/truncate calls, raw writable streams, path traversal, user/system absolute paths, and `child_process`. This is a guardrail, not a full sandbox; a call can explicitly pass `safety_checks: false` when you have reviewed the risk.
- All exposed MCP tools execute directly. There is no extra approval toggle inside the Cocos extension.
- File tools and `cocos://asset/path/...` resources are restricted to the active Cocos project root.
- The recommended workflow is `execute_javascript` first, then focused helper tools for screenshots, diagnostics, assets, and inspection.
- If you change the server port or tool exposure in the panel, the extension saves the config and restarts the server when needed.
## Why What people ask about funplay-cocos-mcp
What is FunplayAI/funplay-cocos-mcp?
+
FunplayAI/funplay-cocos-mcp is mcp servers for the Claude AI ecosystem. The Most Advanced MCP Server for Cocos Creator Editor with `execute_javascript`, prompts/resources, screenshots, asset dependency validation, tool profiles, one-click client configuration, and editor automation. It has 107 GitHub stars and was last updated today.
How do I install funplay-cocos-mcp?
+
You can install funplay-cocos-mcp by cloning the repository (https://github.com/FunplayAI/funplay-cocos-mcp) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is FunplayAI/funplay-cocos-mcp safe to use?
+
Our security agent has analyzed FunplayAI/funplay-cocos-mcp and assigned a Trust Score of 79/100 (tier: Trusted). See the full breakdown of passed checks and flags on this page.
Who maintains FunplayAI/funplay-cocos-mcp?
+
FunplayAI/funplay-cocos-mcp is maintained by FunplayAI. The last recorded GitHub activity is from today, with 1 open issues.
Are there alternatives to funplay-cocos-mcp?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy funplay-cocos-mcp to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/funplayai-funplay-cocos-mcp)<a href="https://claudewave.com/repo/funplayai-funplay-cocos-mcp"><img src="https://claudewave.com/api/badge/funplayai-funplay-cocos-mcp" alt="Featured on ClaudeWave: FunplayAI/funplay-cocos-mcp" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface