← Back to blog
Apr 20, 2026GuideBy Funplay AI

How to Connect Claude Code to Unity with Funplay MCP in Three Steps

You connect Claude Code to Unity by installing the Funplay Unity MCP package, starting the MCP server inside the Unity Editor, and pointing Claude Code at http://127.0.0.1:8765/. The whole process takes under two minutes if your project already runs on Unity 2022.3 or later.

What Funplay Unity MCP Actually Is

Funplay MCP for Unity is an MIT-licensed Unity Editor MCP server that exposes 79 built-in tools to AI assistants. Those tools cover scene creation, script generation, runtime verification, input simulation, performance analysis, and editor automation. Instead of copying generated scripts into your project by hand, Claude Code calls tools directly on the running Editor through the Model Context Protocol.

The server ships with two tool profiles: core (19 tools) and full (79 tools). The core profile keeps conversations focused on high-frequency tasks like creating GameObjects and running scripts. The full profile adds deeper editor automation, input simulation, and performance profiling. You pick the profile when you start the server.

Funplay Unity MCP supports Claude Code, Cursor, VS Code Copilot, Windsurf, and Codex. This walkthrough focuses on Claude Code because it provides a straightforward stdin transport that pairs well with a local HTTP endpoint.

Why This Matters for Production Work

A traditional AI coding workflow for Unity looks like this: ask the model for a script, copy the output into your Assets folder, switch to Unity, wait for compilation, fix errors, repeat. Funplay MCP collapses that loop. The model writes the script, saves it to the correct path, triggers compilation, reads compiler errors if any exist, and fixes them—all without you leaving the terminal.

For studios evaluating AI tooling, the math is simple. If a developer saves even four context switches per task across dozens of daily tasks, the aggregate time savings compound fast. Funplay MCP does not change your build pipeline or add runtime dependencies. It runs entirely inside the Editor and only when you explicitly start it.

Prerequisites

Before you start, confirm the following:

  • Unity 2022.3 or later installed and activated.
  • A Unity project open in the Editor.
  • Claude Code installed and configured with your Anthropic API key.
  • Network access to 127.0.0.1 on port 8765 (the default; configurable if needed).

No additional Node.js servers, Docker containers, or cloud accounts are required.

Step 1 — Install the Package in Unity

Open your Unity project. In the menu bar, navigate to Window → Package Manager. Click the + button in the top-left corner of the Package Manager window and select Add package from git URL…. Paste the following URL:

https://github.com/FunplayAI/funplay-unity-mcp.git

Click Add. Unity resolves the package and imports it into your project. You will see a new top-level menu item labeled Funplay once the import finishes. If you do not see it, close and reopen the Editor.

Step 2 — Start the MCP Server

In the Unity menu bar, click Funplay → MCP Server. A small editor window opens showing the server status. The server starts on http://127.0.0.1:8765/ by default.

Select your tool profile in this window. Choose core if you want the model to work with 19 essential tools for scene editing and scripting. Choose full if you want all 79 tools, including input simulation and performance analysis. You can switch profiles by stopping and restarting the server.

Leave the server running while you work. The window displays a green indicator when the connection is active and listening.

Step 3 — Configure Claude Code

Claude Code reads its tool configuration from a .claude.json file in your project root. Create or edit that file to include the Funplay MCP server. Here is a minimal configuration:

{
  "mcpServers": {
    "funplay-unity": {
      "type": "sse",
      "url": "http://127.0.0.1:8765/sse"
    }
  }
}

Save the file. Launch Claude Code in your project directory:

claude

Claude Code loads the MCP configuration, connects to the Funplay server, and lists the available Unity tools. You can verify the connection by asking Claude Code to list the tools it has access to or by issuing a simple request like "create an empty GameObject called TestObject in the current scene."

At this point the integration is live. Claude Code can now create and modify GameObjects, generate and compile scripts, read console logs, simulate input, and run performance profilers—all through the MCP connection.

A Concrete Example

Here is a typical interaction you can try right after connecting. Tell Claude Code:

"Create a player capsule at the world origin with a CharacterController, then attach a movement script that moves with WASD at 5 units per second."

Claude Code will call multiple Funplay tools in sequence: create a primitive capsule, rename it, add the CharacterController component, generate a C# script with the movement logic, save it to your Assets folder, attach it to the capsule, and trigger a recompile. You watch the Hierarchy and Inspector update in real time inside the Unity Editor.

Compare that to the manual workflow: write the script in your text editor, save it, switch to Unity, wait for compilation, create the capsule manually, drag the script onto it. The MCP path is not faster because the model thinks faster—it is faster because the round-trip between "intent expressed" and "result visible in Editor" shrinks to seconds.

Gotchas and Limitations

The server only works while the Unity Editor is open and the MCP Server window shows an active status. Closing the Editor or clicking Stop kills the connection, and Claude Code will fail on subsequent tool calls until you restart.

Funplay MCP does not batch operations. Each tool call is an individual HTTP request to the Editor. Large-scene operations that involve hundreds of GameObjects will generate hundreds of round trips. For initial level layout of massive scenes, you are better off writing a traditional Editor script.

The tooling operates at the Editor level, not at runtime. You cannot attach the MCP server to a built player. If you need to debug a standalone build, use standard profiling and logging tools instead.

The full profile's input simulation tools interact with the Editor's input system, which differs slightly from runtime input in some Unity versions. Test any input-dependent tool calls against your target platform early.

Finally, remember that the model has full access to your project. Anyone with access to the MCP endpoint can instruct the connected AI to modify scripts, delete assets, or change scene hierarchy. Do not expose port 8765 outside localhost, and do not leave the server running unattended on shared machines.

When Not to Use This

Skip Funplay MCP if your project runs on a Unity version older than 2022.3—the package will not resolve. Skip it if your team has strict approval processes for Editor extensions and you cannot add open-source packages under the MIT license. And skip it if you only need one-off script generation; the setup overhead is not worth it for a single file.

Next Steps

Visit the Funplay Unity MCP repository for the full tool reference and release notes. For tutorials and deeper integration guides, check the articles at gamebooom.ai/en/blog/. If you work in other engines, explore the sibling projects: Funplay Godot MCP (105 tools, Godot 4.2 or later) and Funplay Cocos MCP (67 tools, Cocos Creator 3.8 or later).

Clone the repo, start the server, and let Claude Code build your next scene.

Keep reading

Try it in your project. All four repos are on GitHub under github.com/FunplayAI — pick the engine you're using and follow the README.
How to Connect Claude Code to Unity with Funplay MCP in Three Steps | funplay mcp