MCP Directory

How to add MCP Unity to Cursor

Connect AI assistants to the Unity Editor to manipulate scenes, GameObjects, assets, and run tests via MCP. Paste the config into ~/.cursor/mcp.json and restart Cursor.

Last updated June 14, 2026 · 1.8k · stdio · no auth

Cursor config for MCP Unity

{
  "mcpServers": {
    "mcp-unity": {
      "command": "node",
      "args": [
        "ABSOLUTE/PATH/TO/mcp-unity/Server~/build/index.js"
      ]
    }
  }
}

Setup steps

  1. 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the MCP Unity config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of MCP Unity's tools to confirm it's connected.

Before you start

  • Unity 6 or later (to install the server package)
  • Node.js 18 or later (to run the server)
  • npm 9 or later (to build/debug the server)
  • Install the Unity package via Package Manager git URL: https://github.com/CoderGamester/mcp-unity.git
  • Start the WebSocket server from Unity (Tools > MCP Unity > Server Window > Start Server)

What MCP Unity can do in Cursor

execute_menu_item

Executes Unity menu items (functions tagged with the MenuItem attribute).

select_gameobject

Selects game objects in the Unity hierarchy by path or instance ID.

update_gameobject

Updates a GameObject's core properties (name, tag, layer, active/static state), or creates the GameObject if it does not exist.

update_component

Updates component fields on a GameObject, or adds the component if the GameObject does not contain it.

add_package

Installs new packages in the Unity Package Manager.

run_tests

Runs tests using the Unity Test Runner.

send_console_log

Sends a console log to Unity.

add_asset_to_scene

Adds an asset from the AssetDatabase to the Unity scene.

Security

The Node.js MCP server connects to a WebSocket server that Unity runs locally (default localhost:8090, port UNITY_PORT). By default the WebSocket binds to localhost; enabling 'Allow Remote Connections' binds it to 0.0.0.0 (all interfaces), exposing Editor control over the network — only do this on trusted networks and behind a firewall. The Node server is launched via an absolute or project-relative path to a locally built build/index.js; rebuild it after package updates since the UPM package-cache hash in the path changes.

MCP Unity + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the MCP Unity config there under the "mcpServers" key and restart the client.

Is MCP Unity safe to use with Cursor?

The Node.js MCP server connects to a WebSocket server that Unity runs locally (default localhost:8090, port UNITY_PORT). By default the WebSocket binds to localhost; enabling 'Allow Remote Connections' binds it to 0.0.0.0 (all interfaces), exposing Editor control over the network — only do this on trusted networks and behind a firewall. The Node server is launched via an absolute or project-relative path to a locally built build/index.js; rebuild it after package updates since the UPM package-cache hash in the path changes.

What is MCP Unity?

A bridge that connects the Unity Editor to AI assistants using the Model Context Protocol. It exposes Editor functionality (creating objects, modifying components, running tests, etc.) as MCP tools and resources by running a WebSocket server inside Unity plus a Node.js MCP server that acts as a WebSocket client to Unity.

Which MCP hosts and IDEs support MCP Unity?

Any client that can act as an MCP client. Known compatible platforms include Cursor, Windsurf, Claude Desktop, Claude Code, Codex CLI, GitHub Copilot, Google Antigravity, and OpenCode.

Can I extend MCP Unity with custom tools?

Yes. In Unity (C#) you create classes inheriting from McpToolBase and register them in McpUnityServer.cs; in the Node.js server (TypeScript) you add a matching tool handler with a Zod schema in Server/src/tools/ and register it in Server/src/index.ts.

View repo Full MCP Unity page