{
  "markdown": "<p align=\"center\">\n  <h1 align=\"center\">Funplay MCP for Unity</h1>\n  <p align=\"center\">\n    <strong>The Most Advanced MCP Server for Unity Editor</strong>\n  </p>\n  <p align=\"center\">\n    <a href=\"#\"><img src=\"https://img.shields.io/badge/Unity-2022.3%2B-black?logo=unity\" alt=\"Unity 2022.3+\"></a>\n    <a href=\"#\"><img src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License: MIT\"></a>\n    <a href=\"#\"><img src=\"https://img.shields.io/badge/MCP-Compatible-green\" alt=\"MCP Compatible\"></a>\n    <a href=\"#\"><img src=\"https://img.shields.io/badge/Platform-Editor%20Only-orange\" alt=\"Editor Only\"></a>\n  </p>\n  <p align=\"center\">\n    <a href=\"./README_CN.md\">中文</a> | English\n  </p>\n  <p align=\"center\">\n    <img src=\"./Documentation~/Text%2BLogo.png\" alt=\"The Most Advanced MCP Server for Unity\" width=\"100%\">\n  </p>\n</p>\n\n> 💖 If you find this project useful, please consider giving it a Star. It helps more Unity developers discover it and supports ongoing development.\n\n---\n\nFunplay MCP for Unity is an MIT-licensed Unity Editor MCP server that lets AI assistants like Claude Code, Cursor, Kimi Code, LM Studio, Windsurf, Codex, and VS Code Copilot operate directly inside your running Unity project.\n\nDescribe your game in one sentence — your AI assistant builds it in Unity through Funplay MCP for Unity's 157 built-in tools for scene creation, script generation, runtime validation, input simulation, performance analysis, and editor automation.\n\n> *\"Build a snake game with a 10x10 grid, food spawning, score UI, and game-over screen\"*\n>\n> Your AI assistant handles it through Funplay MCP for Unity: creates the scene, generates all scripts, sets up the UI, and configures the game logic — all from a single prompt.\n\n<p align=\"center\">\n  <img src=\"./Documentation~/demo.gif\" alt=\"Funplay MCP for Unity — 16s demo\" width=\"100%\">\n</p>\n<p align=\"center\"><em>16-second demo — AI generates a 3D model and integrates it into the scene end-to-end. <a href=\"https://github.com/FunplayAI/funplay-unity-mcp/raw/main/Documentation~/demo.mp4\">Watch HD MP4</a>.</em></p>\n\n## Quick Start\n\nIf you just want to get connected fast, do these three things:\n\n- Install the Unity package from the Git URL\n- Start `Funplay > MCP Server`\n- Use the built-in one-click client configuration\n\n### 1. Install via UPM (Git URL)\n\nIn Unity, go to **Window → Package Manager → + → Add package from git URL**:\n\n```\nhttps://github.com/FunplayAI/funplay-unity-mcp.git\n```\n\n> 💡 Before you clone or install, a quick ⭐ on GitHub would be greatly appreciated.\n\n### Optional: Install via OpenUPM\n\nIf you want Unity Package Manager to show registry-backed package version history and allow version selection, install from OpenUPM instead of Git.\n\nUsing the OpenUPM CLI:\n\n```bash\nopenupm add com.gamebooom.unity.mcp\n```\n\nOr add the scoped registry manually in `Packages/manifest.json`:\n\n```json\n{\n  \"scopedRegistries\": [\n    {\n      \"name\": \"OpenUPM\",\n      \"url\": \"https://package.openupm.com\",\n      \"scopes\": [\n        \"com.gamebooom\"\n      ]\n    }\n  ],\n  \"dependencies\": {\n    \"com.gamebooom.unity.mcp\": \"0.6.7\"\n  }\n}\n```\n\nIf you installed from a Git URL before, remove the Git dependency first, then install from OpenUPM. Git-installed packages only show the resolved Git version in Unity and do not get the registry-backed Version History list.\n\n### 2. Start the MCP Server\n\n**Menu: Funplay → MCP Server** to start the server.\n\nA new project gets its own port, derived from the project path, so two editors opened on different projects never fight over one port. The MCP Server window shows the exact URL (`http://127.0.0.1:<port>/`); the one-click configuration writes that URL for you. Type a port in **Server Port** to pin a fixed one (CI, a firewall rule) and **Use Per-Project Port** to derive one instead.\n\nUpgrading from an earlier version changes nothing: the project keeps the port it was already using, recorded as a pin, so existing client configs keep working. Click **Use Per-Project Port** when you want that project to run beside another editor. See [Running Several Unity Projects at Once](Documentation~/multi-project-setup.md) for the full setup guide.\n\nIf the window reports a fallback port, do not use a client entry that still targets the occupied stable port; it could reach the process that owns that port. One-click configuration stays blocked until you click **Use Per-Project Port** or **Pin Current Port** and the server finishes restarting.\n\nDirect in-process HTTP is the default transport. If you need stronger connection continuity across Unity script recompiles or Play Mode domain reloads, enable **Experimental Broker Mode** in the MCP Server window. It runs a tiny local broker with Unity's bundled Mono, keeps the same `127.0.0.1` port for MCP clients, and requires no client config change.\n\nOpen **Funplay → Tool Exposure** if you want to edit the exact tools exposed by `core` or `full`.\n\nOpen **Funplay → MCP Settings** if you need to adjust `execute_code` safety defaults or plugin debug logging.\n\n### 3. Configure Your AI Client\n\nUse the built-in **One-Click MCP Configuration** in the `Funplay > MCP Server` window first.\n\nSelect your target client, click **Configure**, and the package writes the recommended MCP config entry for you.\n\nFor Claude Code, Cursor, Codex, OpenCode, and DeepSeek Harness, click **Configure + Skills** to also install both built-in project skills.\n\nIf you want project-specific AI guidance for the current Unity project, open **Funplay → Project Skills** to choose supported platforms and install the built-in `unity-mcp-workflow` and `unity-ui-composition` skills. The UI skill covers responsive portrait and landscape uGUI work.\n\nIf you prefer to edit config files manually, use the examples below as fallback references. Replace `<project>` with this project's entry name and `<port>` with its port -- the MCP Server window shows both:\n\n<details>\n<summary>Claude Code / Claude Desktop</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"funplay-<project>\": {\n      \"type\": \"http\",\n      \"url\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>Cursor</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"funplay-<project>\": {\n      \"url\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>LM Studio</summary>\n\nLM Studio's `mcp.json` location can vary by version and platform. Prefer **Program > Install > Edit mcp.json** in LM Studio. Funplay's one-click Configure button opens LM Studio's `lmstudio://add_mcp` link and only updates an existing config file if one is already present, instead of creating a guessed path.\n\n```json\n{\n  \"mcpServers\": {\n    \"funplay-<project>\": {\n      \"url\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>VS Code</summary>\n\n```json\n{\n  \"servers\": {\n    \"funplay-<project>\": {\n      \"type\": \"http\",\n      \"url\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>Trae</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"funplay-<project>\": {\n      \"url\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>Kiro</summary>\n\n```json\n{\n  \"mcpServers\": {\n    \"funplay-<project>\": {\n      \"type\": \"http\",\n      \"url\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>Kimi / Kimi Code</summary>\n\nCurrent Kimi Code releases load project-level MCP servers from `.kimi-code/mcp.json` ([official MCP documentation](https://moonshotai.github.io/kimi-code/en/customization/mcp.html)). Funplay's one-click Configure target writes there so the current Unity server is only visible to Kimi sessions started in this project. If the machine only has the legacy Kimi CLI data directory, it writes the compatible user-level `~/.kimi/mcp.json` instead. Start a new Kimi session from the Unity project root after configuring; on first use, review the loopback URL and trust the workspace. The generated project file contains this machine's local port, so normally keep it uncommitted unless the team deliberately shares one pinned port.\n\n```json\n{\n  \"mcpServers\": {\n    \"funplay-<project>\": {\n      \"url\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>Codex</summary>\n\n```toml\n[mcp_servers.funplay-<project>]\nurl = \"http://127.0.0.1:<port>/\"\n```\n\n</details>\n\n<details>\n<summary>OpenCode</summary>\n\nWritten to the repository's own `.opencode/opencode.json` (not the global config), so only OpenCode sessions started inside this repo see this editor's tools.\n\n```json\n{\n  \"mcp\": {\n    \"funplay-<project>\": {\n      \"type\": \"remote\",\n      \"url\": \"http://127.0.0.1:<port>/\",\n      \"enabled\": true\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>DeepSeek Harness</summary>\n\nWritten as a delimited managed block into every DeepSeek Harness profile's `~/.dsh/profiles/<profile>/cordis.patch.yml`, because DSH composes its plugins per launch through `--profile` and exposes no single active profile to target from outside. Anything outside the block is preserved on reconfigure, and deleting the block by hand uninstalls the entry.\n\n```yaml\n# >>> funplay-mcp:funplay-<project> begin (managed by Funplay MCP -- reconfigure from Unity > Funplay > MCP Server)\n# Funplay Unity MCP endpoint served by this editor; tools appear as mcp__funplay-<project>__<tool>.\n- insert:\n    - id: mcp-funplay-<project>\n      name: '@deepseek-ai/dsh-mcp-client'\n      config:\n        serverName: funplay-<project>\n        transport: streamable-http\n        url: http://127.0.0.1:<port>/\n# <<< funplay-mcp:funplay-<project> end\n```\n\n</details>\n\n<details>\n<summary>Antigravity</summary>\n\nWritten to the workspace-local `.agents/mcp_config.json` with `mcpServers` entries using `serverUrl` for Funplay's Streamable HTTP endpoint. This keeps the server out of unrelated workspaces. Use a current Antigravity version supporting [workspace MCP configuration](https://antigravity.google/docs/mcp/), then reload its MCP servers.\n\nThe workspace root is the nearest ancestor containing `.git` (including a worktree's `.git` file), or the Unity project directory when it is outside Git. Open that directory as the Antigravity workspace. **Configure + Skills** places `.agents/mcp_config.json`, `.agents/skills/`, and the managed `AGENTS.md` block at this same root, including when the Unity project is nested inside a repository. Other clients retain their existing instruction locations and share the block when paths coincide.\n\nExisting Funplay entries in `~/.gemini/config/mcp_config.json` or the older `~/.gemini/antigravity/mcp_config.json` are reported in the panel and left unchanged. Review them after configuring each workspace; the one-click action does not fall back to global configuration. Multiple Unity projects in the same repository share a workspace: their MCP entries remain separately named, while Project Skills refuses to replace another project's managed workspace guidance.\n\n```json\n{\n  \"mcpServers\": {\n    \"funplay-<project>\": {\n      \"serverUrl\": \"http://127.0.0.1:<port>/\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary>Windsurf</summary>\n\nUse the same JSON structure as Cursor unless your local Windsurf version requires a different MCP config format.\n\n</details>\n\n### 4. Verify the Connection\n\nOpen your AI client and try a few safe requests first:\n\n- \"Call `get_scene_info` and tell me what scene is open.\"\n- \"Read `unity://project/context` and summarize the current editor state.\"\n- \"Use `execute_code` to return the active scene name.\"\n\nIf those work, the MCP server, resources, and primary execution tool are connected correctly.\n\n### 5. Start Building\n\nOpen your AI client and try: *\"Create a 3D platformer level with 5 floating platforms\"*\n\n## Before You Start\n\n- This package is **Editor-only**. It does not add runtime components to your built game.\n- The MCP server port is derived per project (range 20000-29999) for new projects, or pinned — projects upgraded from an earlier version keep their existing port as a pin, and any port you type is a pin. The MCP Server window shows where the port came from and the active URL. A project's client-config entry is named after the project directory (for example `funplay-love-town`), so configuring several projects no longer overwrites one shared `funplay` entry. Two projects that share a product name would resolve to the same entry name; the second one configured appends a project hash automatically, so nothing is overwritten and no setting has to be turned on.\n- Local MCP server settings are stored in `UserSettings/FunplayMcpSettings.json`.\n- The package defaults to the `core` MCP tool profile to reduce tool-list noise for AI clients. `core` currently exposes 35 high-signal tools centered on `execute_code`, play mode control, input simulation, screenshots, performance inspection, logs, compilation checks, structured object and component editing, field-level prefab asset editing, editor selection / prefab-stage state, and `execute_menu_item` as a low-friction fallback. Switch to `full` in the MCP Server window if you want all 157 tools exposed.\n- `execute_code` safety checks and the stricter filesystem guard are enabled by default from **Funplay > MCP Settings**. The guard blocks obvious destructive snippets, broad `System.IO` writes, raw file streams, and absolute/user/system/traversal paths, but it is not a complete sandbox. Clients may still override the default per call with the optional `safety_checks` argument.\n- Plugin debug logging is off by default and can also be enabled from **Funplay > MCP Settings**. Warnings and errors are always written to the Unity Console.\n- All exposed MCP tools run directly. There is no extra approval toggle.\n- **Menu: `Funplay > Check for Updates`** can refresh Git installs in place or download and import the latest `unitypackage` automatically.\n\n## Why This Project\n\n- **`execute_code` First** — Optimized around one in-memory C# execution tool for rich editor/runtime orchestration. See [`execute_code`: In-Memory C# Execution](#execute_code-in-memory-c-execution) below for details.\n- **Default Safety Checks** — `execute_code` now has persistent default-on safety toggles, including a stricter filesystem guard for clients that do not expose per-call arguments clearly\n- **Play Mode Automation** — Enter play mode, simulate keyboard/mouse input, capture screenshots, inspect logs, and validate behavior from the same MCP session\n- **Project Context Built In** — Exposes live resources for project state, active scene, selection, compilation, console output, and MCP interaction history\n- **Focused by Default, Full When Needed** — `core` exposes a compact high-signal toolset; `full` exposes all 157 tools\n- **Single Unity Package** — No extra approval UI, no external daemon to click through, and no Python requirement for the Unity-side plugin itself\n- **Extensible** — Add custom tools with attribute-based discovery, or connect Unity to external MCP services when needed\n\n## Highlights\n\n- **157 Built-in Tools** — Scene editing, assets, scripts, play mode control, screenshots, performance analysis, prompts, resources, structured object location, SerializedObject-based component editing, editor-state inspection, menu-item fallback, and editor automation across 36 modules\n- **Structured Returns + `instanceId` Chaining** — Tools return `{success, message, data}` JSON with stable `instanceId` fields so agents can chain `by_id` calls reliably instead of re-resolving by name\n- **`IFunplayCommand` for `execute_code`** — New snippet template with auto-Undo (`ctx.RegisterObjectCreation/Modification/DestroyObject`), structured logs (`ctx.Log/LogWarning/LogError`), and a tracked changelog returned to the agent\n- **Resources & Prompts** — Live project context, scene/selection/error resources, resource templates, and reusable workflow prompts\n- **Input Simulation + Screenshots** — Drive play mode with keyboard/mouse simulation and verify results with game/scene captures\n- **Built-in Updating** — Check for updates from the Unity menu and either re-pull the Git package or auto-import the latest `unitypackage`\n- **One-Click Client Configuration** — Generate MCP config entries for Claude Code, Cursor, Kimi, LM Studio, VS Code, Kiro, Trae, Codex, OpenCode, DeepSeek Harness, Antigravity, and similar clients directly from the Unity window\n- **Tool Exposure Control** — Edit the exact tools exposed by `core` and `full`\n- **Project Skills Manager** — Configure project-level skills for supported AI clients, with built-in `unity-mcp-workflow` and `unity-ui-composition` guidance\n- **MCP Settings** — Adjust `execute_code` safety defaults and enable verbose plugin debug logging when troubleshooting MCP connections or tool execution\n- **Vendor Agnostic** — Works with any AI client that supports MCP: Claude Code, Cursor, Kimi Code, LM Studio, Windsurf, Codex, VS Code Copilot, etc.\n\n## `execute_code`: In-Memory C# Execution\n\n`execute_code` is the heart of Funplay MCP for Unity. It lets an AI write a C# snippet, compile it through a Roslyn-first in-memory flow, and run it on the editor thread — the agent gets the full Unity Editor and runtime API surface without writing any project files to disk.\n\n- **Zero project footprint compilation** — Snippets are compiled with Unity's bundled Roslyn csc first while preserving the in-memory compilation/execution flow. No `.cs` files are written under `Assets/`, no domain reload is triggered, no project state is touched beyond what the snippet itself does.\n- **Editor-ready before it runs** — Each call refreshes the AssetDatabase and waits for any pending compilation to settle before compiling the snippet, so external file edits are picked up automatically without a separate `request_recompile`.\n- **Auto-Undo + structured logs (recommended template)** — Implement `IFunplayCommand` and use the injected `ExecutionContext` so every created / modified / destroyed object participates in editor Undo, and the changelog is returned to the agent.\n\n```csharp\nusing UnityEngine;\nusing UnityEditor;\nusing Funplay.Editor.Tools.Helpers;\nusing Funplay.Editor.Tools.Scripting;\n\npublic class CommandScript : IFunplayCommand\n{\n    public void Execute(ExecutionContext ctx)\n    {\n        var go = GameObject.CreatePrimitive(PrimitiveType.Cube);\n        ctx.RegisterObjectCreation(go);          // auto-Undo + tracked\n        ctx.Log(\"Created {0}\", go.name);\n        ctx.ReturnValue = GameObjectSerializer.Describe(go, includeComponents: false);\n    }\n}\n```\n\nThe response carries `{ logs, created, modified, destroyed, returnValue }`, so the agent can verify exactly what changed without re-querying the scene.\n\nThe legacy template (`public static string Run()`) is still supported — useful for one-off inspection snippets where structured tracking is overkill.\n\n**When to reach for `execute_code` vs a specialized tool** — `execute_code` shines for multi-step orchestration, novel reads, and situations where chaining 5–10 narrow tool calls would be noisier than one snippet. For single-field component edits, simple selection changes, or anything covered by an existing tool, prefer the dedicated tool — it is cheaper for the LLM to call and easier to verify.\n\n## Comparison With Coplay\n\nThe table below compares this repository with the publicly documented behavior of Coplay's open-source `unity-mcp` repository on GitHub.\n\n| Area | Funplay MCP for Unity | Coplay `unity-mcp` |\n|------|--------------------------|--------------------|\n| Unity-side architecture | Embedded Unity Editor package with built-in HTTP MCP server | Unity bridge plus local Python MCP server |\n| Extra local prerequisites | Unity package only for core workflows | Unity + Python 3.10+ + `uv` according to the public quick start |\n| Primary workflow style | `execute_code` first, then focused helper tools | Broad `manage_*` tool families exposed through the bridge |\n| Default tool exposure | Compact `core` profile with optional `full` expansion | Public docs emphasize a broad always-available tool surface |\n| Built-in context model | Project resources, resource templates, workflow prompts, interaction history | Public README emphasizes tool families and bridge/server workflow |\n| Play mode validation | Built-in play mode control, screenshots, logs, and input simulation in the package | Public README emphasizes broad Unity management and automation tools |\n| Positioning | Lightweight, direct, MIT-licensed Unity MCP server for AI-driven editor control | Full-featured Unity bridge maintained by Coplay with Python-backed server setup |\n\nSource for Coplay column: [CoplayDev/unity-mcp](https://github.com/CoplayDev/unity-mcp)\n\n## Comparison With Unity AI Assistant\n\nThe table below compares this repository with Unity Technologies' official `com.unity.ai.assistant` package (v2.7.0-pre.2 as of 2026-05).\n\n| Area | Funplay MCP for Unity | Unity AI Assistant |\n|------|--------------------------|--------------------|\n| Minimum Unity version | 2022.3 | 6000.3 (Unity 6 only) |\n| License | MIT, open source | Unity Terms of Service, proprietary |\n| Deployment | Local HTTP MCP server in Editor, no cloud | Editor + native Relay subprocess + Unity Cloud backend |\n| Billing | Free, user brings their own AI client | Credits-based (Unity Dashboard) |\n| Tool exposure | 157 tools across 36 modules, `core` (35) / `full` profiles | ~15 MCP tools (mostly `Manage*` families) |\n| Generic escape hatch | `execute_code` — Roslyn-first in-memory compile, `IFunplayCommand` + Undo, no sandbox (client-side approval) | `RunCommand` — namespace blacklist sandbox |\n| Play mode validation | Full loop: enter / simulate input / capture / read logs / exit | Enter/Exit only; no input simulation |\n| Asset generators | Not built-in (compose external APIs via `execute_code`) | Native Image / Mesh / PBR / Sound / Animation generators |\n| Primary client model | BYO any MCP client (Claude Code / Cursor / Kimi / LM Studio / Codex / VS Code) | Built-in chat window + ACP for Claude/Gemini via Gateway |\n| Offline-capable | Yes for tool calls (inference depends on chosen client) | No (inference requires Unity Cloud) |\n\nFor a long-form comparison of the two approaches see [Funplay Unity MCP vs Unity AI Assistant detailed comparison](https://blog.csdn.net/m0_62670368/article/details/161039766) (Chinese).\n\n## MCP Capabilities\n\nThe current open-source package exposes four high-value capability layers:\n\n- **Tools** — 157 total tools in `full`, 35 focused tools in `core`\n- **Primary execution** — `execute_code` for rich editor/runtime orchestration\n- **Prompts** — parameterized workflow prompts: `edit_prefab_safely`, `verify_compilation`, `enter_play_and_recover`, `wire_serialized_references`, `create_playable_prototype`. Projects can add their own through `mcp-prompts/*.md` files in the project root.\n- **Resources** — project context, scene summaries, selection state, compile errors, console errors, MCP interaction history, plus resource templates for scene objects, components, and asset paths\n\n### Project Prompts\n\nProject prompt files use a small, dependency-free front-matter format followed by the workflow body:\n\n```markdown\n---\nname: validate_activity\ndescription: Open and validate a project activity.\narguments: activity_key(required), theme_id\n---\nOpen activity {activity_key} with theme {theme_id}, then validate its runtime state.\n```\n\nNames and argument names must match `[a-z][a-z0-9_-]{0,63}`. Required, unknown, and non-string arguments are rejected by `prompts/get`; omitted optional placeholders become empty strings. Definitions are cached when the MCP server starts, so restart the server or trigger a Unity domain reload after changing a prompt file.\n\n## Built-in Tools\n\nFunplay MCP for Unity currently ships with **157 tool functions** across 36 modules:\n\n| Category | Tools |\n|----------|-------|\n| **GameObject** | `create_primitive`, `create_game_object`, `delete_game_object`, `find_game_objects`, `get_game_object_info`, `set_transform`, `duplicate_game_object`, `rename_game_object`, `set_parent`, `add_component`, `set_tag_and_layer`, `set_active` |\n| **Hierarchy** | `get_hierarchy` |\n| **Components** | `get_component_properties`, `list_components`, `set_component_property`, `set_component_properties` |\n| **Component Batch** | `copy_component`, `paste_component_values`, `add_component_to_many` |\n| **Scripts** | `create_script`, `edit_script`, `patch_script` |\n| **Assets** | `create_material`, `assign_material`, `find_assets`, `delete_asset`, `rename_asset`, `copy_asset` |\n| **Asset Import** | `get_asset_import_settings`, `set_asset_import_settings` |\n| **References** | `find_references`, `find_broken_references` |\n| **Mesh** | `get_mesh_info` |\n| **Materials** | `get_material_properties`, `set_material_property` |\n| **Files** | `read_file`, `write_file`, `search_files`, `list_directory`, `exists` |\n| **Scene** | `get_scene_info`, `list_scenes`, `load_scene_additive`, `unload_scene`, `list_dirty_scenes`, `save_all_scenes`, `save_scene`, `open_scene`, `create_new_scene`, `enter_play_mode`, `exit_play_mode`, `set_time_scale`, `get_time_scale` |\n| **Physics** | `physics_raycast`, `physics_overlap`, `physics2d_overlap_point` |\n| **Particles** | `particle_control` |\n| **Lighting** | `get_lighting_settings`, `set_lighting_settings`, `bake_lightmaps` |\n| **Timeline** | `director_evaluate` |\n| **Prefabs** | `create_prefab`, `instantiate_prefab`, `unpack_prefab`, `open_prefab_stage`, `save_prefab_stage`, `close_prefab_stage`, `set_prefab_property`, `set_prefab_properties` |\n| **ScriptableObject** | `create_scriptable_object`, `get_scriptable_object`, `set_scriptable_object_properties` |\n| **UI** | `create_canvas`, `create_button`, `create_text`, `create_image`, `raycast_at_point` |\n| **Animation** | `create_animation_clip`, `create_animator_controller`, `assign_animator`, `get_animator_state`, `set_animator_parameter`, `play_animator_state` |\n| **Camera** | `get_camera_properties`, `set_camera_projection`, `set_camera_settings`, `set_camera_culling_mask` |\n| **Screenshot** | `capture_game_view`, `capture_simulator_view`, `capture_scene_view`, `capture_multiview`, `capture_editor_window` |\n| **Video** | `record_game_view` |\n| **Script Execution** | `execute_code`, `get_execute_code_history`, `replay_execute_code`, `clear_execute_code_history` |\n| **Input Simulation** | `simulate_key_press`, `simulate_key_combo`, `simulate_mouse_click`, `simulate_mouse_drag` |\n| **Performance** | `get_performance_snapshot`, `analyze_scene_complexity` |\n| **Profiler** | `profiler_start`, `profiler_stop`, `profiler_status`, `get_frame_timing`, `get_counters`, `get_object_memory`, `get_top_memory_objects`, `memory_take_snapshot`, `memory_list_snapshots`, `memory_compare_snapshots`, `frame_debugger_enable`, `frame_debugger_disable`, `frame_debugger_get_events` |\n| **Memory Snapshot** | `memory_take_full_snapshot`, `memory_list_full_snapshots`, `memory_open_snapshot_in_profiler`, `memory_query_top_objects`, `memory_query_references` |\n| **Packages** | `install_package`, `remove_package`, `list_packages` |\n| **Compilation** | `wait_for_compilation`, `request_recompile`, `get_compilation_errors`, `get_reload_recovery_status` |\n| **Testing** | `run_tests`, `get_test_job`, `cancel_test_run` |\n| **Editor State** | `get_editor_state`, `get_selection`, `set_selection`, `get_prefab_stage`, `get_active_tool`, `set_active_tool`, `get_windows`, `get_tags`, `add_tag`, `remove_tag`, `get_layers`, `add_layer`, `get_build_settings` |\n| **Project Settings** | `get_project_settings` |\n| **Undo** | `undo`, `redo`, `get_undo_state` |\n| **Menu Items** | `execute_menu_item`, `validate_menu_item` |\n| **Visual Feedback** | `select_object`, `focus_on_object`, `ping_asset`, `log_message`, `show_dialog`, `get_console_logs` |\n\n> 📊 See [PROFILER_TOOLS.md](PROFILER_TOOLS.md) for the full Profiler tool reference, implementation notes, known limitations, and test report.\n\n### Recording Game View video\n\nUse `record_game_view` (included in `core`) to review UI animations, transitions, and multi-step interactions in a short **silent MP4**. It uses Unity's built-in [MediaEncoder](https://docs.unity3d.com/2022.3/Documentation/ScriptReference/Media.MediaEncoder.html); no Recorder package or external encoder is required.\n\n1. Enter Play Mode, wait for reload recovery, and open the Game tab so it renders.\n2. Call `record_game_view` with `{\"action\":\"start\",\"duration_seconds\":10,\"fps\":15,\"max_dimension\":1280}`. Keep its `recording_id`.\n3. Perform the interactions while recording. Start returns immediately, and the duration limit stops recording automatically.\n4. Poll with `{\"action\":\"status\",\"recording_id\":\"<id>\"}`. To end early, use `action:\"stop\"`, then poll until finalization finishes.\n5. When `ready:true`, read the returned `path` as a local video file. Video bytes are not embedded in the MCP response; remote clients need separate access to the Unity machine's files.\n\nClips receive unique filenames under `<UnityProject>/Library/FunplayMcp/Recordings/` and are retained until you remove them. Start accepts 1–120 seconds, 1–60 target FPS, and a maximum dimension of 128–1920 pixels; it preserves the aspect ratio without upscaling and uses even encoding dimensions. State includes actual frame count, elapsed time, stop reason, file size, and errors. Pass the recording ID when polling/stopping to avoid accidentally controlling a newer clip.\n\nCurrently supports graphics-enabled **macOS and Windows Editors in Play Mode**, with no audio track. It captures the rendered Game View, including overlay UI, without re-rendering scene cameras. Keep the Game tab rendering and do not resize it during capture: hiding/closing the tab or changing its render resolution stops recording with an error instead of silently capturing stale or stretched frames. Exiting Play Mode finalizes the clip; a script/domain reload finalizes it early and preserves an `interrupted` receipt in the editor session. Only consume a file with `ready:true`. Slow frames keep their real timestamps, but recording adds overhead: this is visual evidence, not frame-accurate performance profiling.\n\n## Adding Custom Tools\n\nCreate your own tools with simple attribute annotations:\n\n```csharp\nusing System.ComponentModel;\n\n[ToolProvider(\"MyTools\")]\npublic static class MyCustomTools\n{\n    [Description(\"Spawns enemies at random positions in the scene\")]\n    public static string SpawnEnemies(\n        [ToolParam(\"Number of enemies to spawn\", Required = true)] int count,\n        [ToolParam(\"Prefab path in Assets\")] string prefabPath)\n    {\n        // Your implementation here\n        return $\"Spawned {count} enemies\";\n    }\n}\n```\n\nMethods are automatically discovered, converted to snake_case (`spawn_enemies`), and exposed via MCP with JSON Schema definitions.\n\n## Architecture\n\n```\nMCP Server (HTTP JSON-RPC 2.0)\n    └─ MCPRequestHandler (protocol handling)\n        └─ MCPExecutionBridge\n            └─ FunctionInvokerController (reflection-based invocation)\n                └─ Tool Functions (157 built-in tools across 36 modules)\n```\n\n```\nExternal AI Client → HTTP Request → MCPRequestHandler → MCPExecutionBridge → FunctionInvokerController → tool method\n```\n\n## Requirements\n\n- Unity 2022.3 or later\n- .NET / Mono with `Newtonsoft.Json`\n\n## Contributing\n\nContributions are welcome! Please read the [Contributing Guide](CONTRIBUTING.md) before submitting a PR.\n\n## License\n\n[MIT](LICENSE) — Free to use, modify, distribute, and integrate into commercial or open-source projects.\n",
  "bytes": 31467,
  "sha": "f0a150e4012a33632d91a7d7ffae9c607c99e807ec2d239f96ff3ffd1dccfc70",
  "repo_slug": "funplayai/funplay-unity-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_funplayai_funplay_unity_mcp_d8c9d862/readme"
}