stdio bridge for the local Unity Editor MCP server from FunseaAI/unity-mcp.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
The Most Advanced MCP Server for Unity Editor
ไธญๆ | English
๐ If you find this project useful, please consider giving it a Star. It helps more Unity developers discover it and supports ongoing development.
Funplay MCP for Unity is an MIT-licensed Unity Editor MCP server that lets AI assistants like Claude Code, Cursor, LM Studio, Windsurf, Codex, and VS Code Copilot operate directly inside your running Unity project.
Describe your game in one sentence โ your AI assistant builds it in Unity through Funplay MCP for Unity's 156 built-in tools for scene creation, script generation, runtime validation, input simulation, performance analysis, and editor automation.
"Build a snake game with a 10x10 grid, food spawning, score UI, and game-over screen"
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.
16-second demo โ AI generates a 3D model and integrates it into the scene end-to-end. Watch HD MP4.
If you just want to get connected fast, do these three things:
Funplay > MCP ServerIn Unity, go to Window โ Package Manager โ + โ Add package from git URL:
๐ก Before you clone or install, a quick โญ on GitHub would be greatly appreciated.
If you want Unity Package Manager to show registry-backed package version history and allow version selection, install from OpenUPM instead of Git.
Using the OpenUPM CLI:
Or add the scoped registry manually in Packages/manifest.json:
If 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.
Menu: Funplay โ MCP Server to start the server.
A 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.
Upgrading 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 for the full setup guide.
If 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.
Direct 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.
Open Funplay โ Tool Exposure if you want to edit the exact tools exposed by core or full.
Open Funplay โ MCP Settings if you need to adjust execute_code safety defaults or plugin debug logging.
Use the built-in One-Click MCP Configuration in the Funplay > MCP Server window first.
Select your target client, click Configure, and the package writes the recommended MCP config entry for you.
For Claude Code, Cursor, and Codex, click Configure + Skills to also install the default project MCP workflow skill.
If you want project-specific AI guidance for the current Unity project, open Funplay โ Project Skills to choose supported platforms and install the default unity-mcp-workflow skill.
If 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:
LM 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.
Use the same JSON structure as Cursor unless your local Windsurf version requires a different MCP config format.
Open your AI client and try a few safe requests first:
get_scene_info and tell me what scene is open."unity://project/context and summarize the current editor state."execute_code to return the active scene name."If those work, the MCP server, resources, and primary execution tool are connected correctly.
Open your AI client and try: "Create a 3D platformer level with 5 floating platforms"
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.UserSettings/FunplayMcpSettings.json.core MCP tool profile to reduce tool-list noise for AI clients. core currently exposes 34 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 156 tools exposed.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.Funplay > Check for Updates can refresh Git installs in place or download and import the latest unitypackage automatically.execute_code First โ Optimized around one in-memory C# execution tool for rich editor/runtime orchestration. See execute_code: In-Memory C# Execution below for details.execute_code now has persistent default-on safety toggles, including a stricter filesystem guard for clients that do not expose per-call arguments clearlycore exposes a compact high-signal toolset; full exposes all 156 toolsinstanceId Chaining โ Tools return {success, message, data} JSON with stable instanceId fields so agents can chain by_id calls reliably instead of re-resolving by nameIFunplayCommand 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 agentunitypackagecore and fullunity-mcp-workflow skillexecute_code safety defaults and enable verbose plugin debug logging when troubleshooting MCP connections or tool executionexecute_code: In-Memory C# Executionexecute_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.
.cs files are written under Assets/, no domain reload is triggered, no project state is touched beyond what the snippet itself does.request_recompile.IFunplayCommand and use the injected ExecutionContext so every created / modified / destroyed object participates in editor Undo, and the changelog is returned to the agent.The response carries { logs, created, modified, destroyed, returnValue }, so the agent can verify exactly what changed without re-querying the scene.
The legacy template (public static string Run()) is still supported โ useful for one-off inspection snippets where structured tracking is overkill.
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.
The table below compares this repository with the publicly documented behavior of Coplay's open-source unity-mcp repository on GitHub.
| Area | Funplay MCP for Unity | Coplay unity-mcp |
|---|---|---|
| Unity-side architecture | Embedded Unity Editor package with built-in HTTP MCP server | Unity bridge plus local Python MCP server |
| Extra local prerequisites | Unity package only for core workflows | Unity + Python 3.10+ + uv according to the public quick start |
| Primary workflow style | execute_code first, then focused helper tools | Broad manage_* tool families exposed through the bridge |
| Default tool exposure | Compact core profile with optional full expansion | Public docs emphasize a broad always-available tool surface |
| Built-in context model | Project resources, resource templates, workflow prompts, interaction history | Public README emphasizes tool families and bridge/server workflow |
| 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 |
| 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 |
Source for Coplay column: CoplayDev/unity-mcp
The table below compares this repository with Unity Technologies' official com.unity.ai.assistant package (v2.7.0-pre.2 as of 2026-05).
| Area | Funplay MCP for Unity | Unity AI Assistant |
|---|---|---|
| Minimum Unity version | 2022.3 | 6000.3 (Unity 6 only) |
| License | MIT, open source | Unity Terms of Service, proprietary |
| Deployment | Local HTTP MCP server in Editor, no cloud | Editor + native Relay subprocess + Unity Cloud backend |
| Billing | Free, user brings their own AI client | Credits-based (Unity Dashboard) |
| Tool exposure | 156 tools across 35 modules, core (34) / full profiles | ~15 MCP tools (mostly Manage* families) |
| Generic escape hatch | execute_code โ Roslyn-first in-memory compile, IFunplayCommand + Undo, no sandbox (client-side approval) | RunCommand โ namespace blacklist sandbox |
| Play mode validation | Full loop: enter / simulate input / capture / read logs / exit | Enter/Exit only; no input simulation |
| Asset generators | Not built-in (compose external APIs via execute_code) | Native Image / Mesh / PBR / Sound / Animation generators |
| Primary client model | BYO any MCP client (Claude Code / Cursor / LM Studio / Codex / VS Code) | Built-in chat window + ACP for Claude/Gemini via Gateway |
| Offline-capable | Yes for tool calls (inference depends on chosen client) | No (inference requires Unity Cloud) |
For a long-form comparison of the two approaches see Funplay Unity MCP vs Unity AI Assistant detailed comparison (Chinese).
The current open-source package exposes four high-value capability layers:
full, 34 focused tools in coreexecute_code for rich editor/runtime orchestrationedit_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.Project prompt files use a small, dependency-free front-matter format followed by the workflow body:
Names 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.
Funplay MCP for Unity currently ships with 156 tool functions across 35 modules:
| Category | Tools |
|---|---|
| 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 |
| Hierarchy | get_hierarchy |
| Components | get_component_properties, list_components, set_component_property, set_component_properties |
| Component Batch | copy_component, paste_component_values, add_component_to_many |
| Scripts | create_script, edit_script, patch_script |
| Assets | create_material, assign_material, find_assets, delete_asset, rename_asset, copy_asset |
| Asset Import | get_asset_import_settings, set_asset_import_settings |
| References | find_references, find_broken_references |
| Mesh | get_mesh_info |
| Materials | get_material_properties, set_material_property |
| Files | read_file, write_file, search_files, list_directory, exists |
| 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 |
| Physics | physics_raycast, physics_overlap, physics2d_overlap_point |
| Particles | particle_control |
| Lighting | get_lighting_settings, set_lighting_settings, bake_lightmaps |
| Timeline | director_evaluate |
| Prefabs | create_prefab, instantiate_prefab, unpack_prefab, open_prefab_stage, save_prefab_stage, close_prefab_stage, set_prefab_property, set_prefab_properties |
| ScriptableObject | create_scriptable_object, get_scriptable_object, set_scriptable_object_properties |
| UI | create_canvas, create_button, create_text, create_image, raycast_at_point |
| Animation | create_animation_clip, create_animator_controller, assign_animator, get_animator_state, set_animator_parameter, play_animator_state |
| Camera | get_camera_properties, set_camera_projection, set_camera_settings, set_camera_culling_mask |
| Screenshot | capture_game_view, capture_simulator_view, capture_scene_view, capture_multiview, capture_editor_window |
| Script Execution | execute_code, get_execute_code_history, replay_execute_code, clear_execute_code_history |
| Input Simulation | simulate_key_press, simulate_key_combo, simulate_mouse_click, simulate_mouse_drag |
| Performance | get_performance_snapshot, analyze_scene_complexity |
| 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 |
| Memory Snapshot | memory_take_full_snapshot, memory_list_full_snapshots, memory_open_snapshot_in_profiler, memory_query_top_objects, memory_query_references |
| Packages | install_package, remove_package, list_packages |
| Compilation | wait_for_compilation, request_recompile, get_compilation_errors, get_reload_recovery_status |
| Testing | run_tests, get_test_job, cancel_test_run |
| 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 |
| Project Settings | get_project_settings |
| Undo | undo, redo, get_undo_state |
| Menu Items | execute_menu_item, validate_menu_item |
| Visual Feedback | select_object, focus_on_object, ping_asset, log_message, show_dialog, get_console_logs |
๐ See PROFILER_TOOLS.md for the full Profiler tool reference, implementation notes, known limitations, and test report.
Create your own tools with simple attribute annotations:
Methods are automatically discovered, converted to snake_case (spawn_enemies), and exposed via MCP with JSON Schema definitions.
Newtonsoft.JsonContributions are welcome! Please read the Contributing Guide before submitting a PR.
MIT โ Free to use, modify, distribute, and integrate into commercial or open-source projects.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/funseaai-unity-mcp)<a href="https://allmcps.com/mcp/funseaai-unity-mcp"><img src="https://allmcps.com/api/badge/funseaai-unity-mcp?style=directory" alt="FunseaAI Unity MCP on AllMCPs" /></a>