Unity + AI agents
How to connect Claude Code, Codex, Grok or Cursor to Unity (October 2026)
Unity's free command-line tool lets an AI coding agent open your project, edit the live scene and run C# in the Editor. Here's how to set it up, add Unity's official agent plugin, and what to type first. Checked October 18, 2026.

Unity now has its own free command-line tool, the Unity CLI, and it's the official way to let an AI coding agent work inside a Unity project. Once it's set up, Claude Code, Codex, Grok Build, Cursor and similar tools can check that your Editor is open, create GameObjects in the live scene, save the scene and run C# directly in the Editor.
There are three pieces, and you need the first two whatever agent you use:
- The Unity CLI (
unity), which installs Editors, opens projects and sends commands to a running Editor. - The Pipeline package (
com.unity.pipeline), which goes in your project and lets the CLI talk to the open Editor. - A way for your agent to use it. Agents that can run terminal commands (Claude Code, Codex, Grok Build) just call
unitydirectly, and Unity's official agent plugin teaches them how. Agents that only speak MCP can use the CLI's built-in MCP server instead.
Unity's own guidance is to prefer direct CLI commands: it says they are "faster and use fewer tokens than MCP" (Unity docs, Vendor claim). The older MCP server inside the Unity AI Assistant package is deprecated, so old tutorials that point you there are out of date (Unity docs).
The CLI, the Pipeline package and the plugin are free. The CLI's MCP server runs on your own machine only (localhost) and is separate from Unity's paid AI features (Unity docs). You still pay for whichever AI agent you use. Choosing an engine? See Unity vs Unreal Engine 5 for AI-assisted game dev and Godot vs Unity vs Unreal for AI coding agents. On Unreal, use our UE 5.8 MCP setup guide instead.
What you need
- Unity 6.0 LTS or newer. The Pipeline package and the agent plugin both need Unity 6.0 or later (Pipeline guide, plugin docs). As of October 18, 2026,
unity releaseslists 6000.3.26f1 (Unity 6.3 LTS) and 6000.0.85f1 (Unity 6.0 LTS) as the newest LTS builds, with 6000.6.6f1 as the newest Supported release. - A supported OS for the CLI: Windows 10 21H1 or later, macOS 14 or later, or Linux such as Ubuntu 22.04+ or RHEL 9 with glibc 2.34 or later (Unity CLI docs).
- An AI agent: Claude Code, Codex, Grok Build, Cursor, VS Code with Copilot, Windsurf or another MCP client.
Step-by-step
1. Install the Unity CLI
On macOS or Linux, open a terminal and run (Unity CLI docs):
curl -fsSL https://unity.com/install.sh | bash
On Windows, open PowerShell and run:
irm https://unity.com/install.ps1 | iex
Unity also lists Homebrew (brew install --cask unity-cli), winget (Unity.CLI) and .deb, .rpm and AppImage packages on the same page.
Check it worked:
unity --version
When we ran the script on a Linux machine on October 18, 2026, it downloaded the binary, checked its SHA-256 checksum, put unity in ~/.local/bin and reported 1.0.0-beta.13. The CLI is still labelled beta. If your terminal says unity: command not found, open a new terminal so it picks up the updated PATH.
unity doctor prints a diagnostic report of your setup if anything looks wrong.
2. Install a Unity Editor (skip if you have Unity 6 already)
unity install lts
That installs the current LTS Editor. To pick a specific version and add build modules, use for example unity install 6000.3.26f1 -m android ios webgl. unity editors -i lists what you have installed (Unity CLI docs, CLI reference).
3. Add the Pipeline package to your project
From your project's root folder:
unity pipeline install
This adds com.unity.pipeline to the project (Pipeline guide). The newest version in Unity's package registry on October 18 was 0.8.0-exp.1 (published September 25, 2026), marked experimental. You can also pass --project-path <path> if you're not in the project folder.
4. Open the project and check the connection
unity open ./MyProject
unity status
unity open launches the project with the right Editor version. unity status lists running Editors the CLI can reach. The guide built into the CLI (print it with unity skill show) tells agents to look for the state ready.
Now try a command yourself:
unity command # list commands the Editor exposes
unity command create_gameobject # act on the live, active scene
unity command save_scene # save the active scene
unity command eval --code 'Debug.Log("hello");'
eval runs C# inside the Editor, and eval_file --file path/to/script.cs runs a whole file (Pipeline guide, 20 CLI commands). We haven't run eval against a live Editor (not verified as of Oct 18, 2026). That's powerful: it can change anything in the open project, so use version control.
If unity status shows nothing while Unity is open: the project may have C# compile errors. Unity then opens in Safe Mode, where the Pipeline package doesn't load. Run unity pipeline list to confirm, fix the errors and restart Unity. Agents running in a strict sandbox can also fail to "see" a running Editor (both from Unity's CLI skill).
5. Connect your agent
Pick the route that matches your tool.
Claude Code, Codex or Grok Build: install Unity's agent plugin. Unity publishes an official plugin with Unity-specific skills for these three agents. It contains skills, not an MCP server; the skills that control the Editor do it by running Unity CLI commands, so steps 1, 3 and 4 still apply (plugin overview).
The quickest way is one CLI command. These subcommands are in Unity CLI 1.0.0-beta.13 (unity setup --help):
unity setup claude # Claude Code
unity setup codex # Codex
unity setup grok # Grok Build
unity setup claude --dry-run prints the commands it would run without running them. If you'd rather install by hand, here are the official commands for each agent.
Claude Code (Unity docs). Inside a claude session:
/plugin marketplace add Unity-Technologies/unity-agent-plugin
/plugin install unity@unity-agent-plugin
In the VS Code extension, type /plugins instead. In the Claude desktop app, go to Plugins → Browse, search for Unity, or add the marketplace https://github.com/Unity-Technologies/unity-agent-plugin. The plugin installs for your user by default; for one project only, run claude plugin install unity@unity-agent-plugin --scope local. Type /unity: to see its skills and /plugin to check it's installed. Update with /plugin marketplace update unity-agent-plugin. If skills don't show up, Unity suggests rm -rf ~/.claude/plugins/cache then /reload-plugins.
Codex (Unity docs):
codex plugin marketplace add Unity-Technologies/unity-agent-plugin
codex plugin add unity@unity-agent-plugin
codex plugin list
Update with codex plugin marketplace upgrade unity-agent-plugin; remove with codex plugin remove unity@unity-agent-plugin.
Grok Build (Unity docs):
grok plugin install Unity-Technologies/unity-agent-plugin --trust
grok plugin list
grok plugin details unity
Update with grok plugin update unity; remove with grok plugin remove unity.
Cursor, VS Code, Windsurf and other MCP clients: use unity mcp configure. Unity doesn't list an agent plugin for Cursor, so connect it through the CLI's MCP server (Unity docs):
unity mcp configure --list # see supported clients and where their config lives
unity mcp configure cursor
Add --dry-run first to see exactly what will be written. On our Linux test, unity mcp configure cursor --dry-run showed it would add this to ~/.cursor/mcp.json:
{
"mcpServers": {
"unity": {
"command": "/home/you/.local/bin/unity",
"args": ["mcp"]
}
}
}
Use --local to write a project-level config instead (for clients that support it, such as Cursor and VS Code). In CLI 1.0.0-beta.13 the --list output covered Claude Desktop, Claude Code, Cursor, VS Code, VS Code Insiders, GitHub Copilot CLI, Windsurf, Cline, Codex, Kiro, Kimi, Trae, OpenClaw, Antigravity, Zed, Continue and MCP Inspector. For Codex, the dry run said it would also "relax Codex's sandbox network policy" so commands can reach the Editor over localhost; read that before you accept it. Restart your client after configuring.
Optional: give any agent the CLI skill. unity skill install <client> copies Unity's CLI skill into a client's skills folder. Supported names in beta.13: claude-code, claude-desktop, grok, cursor, windsurf, vscode, cline and codex. unity skill show prints it without installing.
6. Give the agent its first job
Keep Unity open with your project loaded, start your agent in the project folder and try prompts like these.
Check the connection first:
Run
unity statusand tell me which Unity Editor and project you can see. Don't change anything yet.
A small, visible change:
Using the Unity CLI, create an empty GameObject called "Spawner" at the origin in the open scene, add a cube as its child, then save the scene. Tell me each command you ran.
Unity's own example prompts for the plugin (plugin overview):
I want to build a settings screen.
My pixel art looks blurry and jitters when the camera moves.
Create a hexagonal tile palette for my level.
Add in-app purchases so players can buy a coin pack.
Unity's tips for better results, from the same page: say which UI system you want (it suggests UI Toolkit for new projects), ask the agent to read the skill's references/ folder, expect it to ask you questions before it builds, and name the skill outright if it doesn't kick in.
A debugging prompt that uses eval:
Use
unity command evalto check whether the Editor is in Play mode and list every GameObject in the active scene with a Rigidbody. Report back before changing anything.
Things to know
- Use version control. The agent edits the live scene and can run any C# in the Editor. Commit before you start so you can roll back.
- One Editor per project copy. If you run several agents on separate git worktrees, Unity's skill says to open a separate Editor for each and target it with
--project-path. Otherwise one agent's commands can land in another's Editor. - The plugin doesn't always help. Unity's Claude Code page says it makes little difference for simple uGUI work, and that "On Sonnet 5, the plugin mainly supplies correctness" (Unity docs, Vendor claim).
- Beta and experimental labels. The CLI is 1.0.0-beta.13 and the Pipeline package is 0.8.0-exp.1 as of October 18, so commands may change.
unity self-updateupdates the CLI.
Try it
- Install the CLI with
curl -fsSL https://unity.com/install.sh | bash(macOS/Linux) orirm https://unity.com/install.ps1 | iex(Windows), then rununity --version. - In a Unity 6 project, run
unity pipeline install, open the project withunity open .and checkunity status. - Connect your agent:
unity setup claude,unity setup codexorunity setup grokfor the plugin, orunity mcp configure cursor(add--dry-runfirst) for Cursor and other MCP clients. - Ask it: "Run
unity statusand tell me which Unity Editor and project you can see. Don't change anything yet."