unity-mcp-cli
v0.89.0
Published
Cross-platform CLI tool for AI Game Developer (Skills & MCP). Full AI develop and test loop. Efficient token usage, advanced tools. Creates Unity project, installs plugins, configures tools, and manages HTTP connection with Unity Editor and a game made wi
Downloads
13,765
Maintainers
Readme
Cross-platform CLI tool for Unity MCP — create projects, install plugins, configure MCP tools, and launch Unity with active MCP connections. All from a single command line.
- :white_check_mark: Create projects — scaffold new Unity projects via Unity Editor
- :white_check_mark: Install editors — install any Unity Editor version from the command line
- :white_check_mark: Install plugin — add Unity-MCP plugin to
manifest.jsonwith all required scoped registries - :white_check_mark: Remove plugin — remove Unity-MCP plugin from
manifest.json - :white_check_mark: Configure — enable/disable MCP tools, prompts, and resources
- :white_check_mark: Status check — see Unity process, local server, and cloud server connection status at a glance
- :white_check_mark: Run tools — execute MCP tools directly from the command line
- :white_check_mark: Setup MCP — write AI agent MCP config files for any of 14 supported agents
- :white_check_mark: Setup skills — generate skill files for AI agents via the MCP server
- :white_check_mark: Wait for ready — poll until Unity Editor and MCP server are connected and accepting tool calls
- :white_check_mark: Open & Connect — launch Unity with optional MCP environment variables for automated server connection
- :white_check_mark: Cross-platform — Windows, macOS, and Linux
- :white_check_mark: CI-friendly — auto-detects non-interactive terminals and disables spinners/colors
- :white_check_mark: Verbose mode — use
--verboseon any command for detailed diagnostic output - :white_check_mark: Version-aware — never downgrades plugin versions, resolves latest from OpenUPM
Quick Start
Install globally and run:
# 1.1 Install unity-mcp-cli # ┌────────────────────┐
npm install -g unity-mcp-cli # │ Available AI agent │
# ├────────────────────┤
# 1.2 (Optional) Install Unity # │ antigravity │
unity-mcp-cli install-unity # │ claude-code │
# │ claude-desktop │
# 1.3 (Optional) Create Unity project # │ cline │
unity-mcp-cli create-project ./MyUnityProject # │ codex │
# │ cursor │
# 2. Install "AI Game Developer" in Unity project # │ gemini │
unity-mcp-cli install-plugin ./MyUnityProject # │ github-copilot-cli │
# │ kilo-code │
# 3. Sign in to ai-game.dev (OAuth device flow) # │ open-code │
unity-mcp-cli login # │ rider-junie │
# │ unity-ai │
# 4. Open Unity project (auto-connects and generates skills) │ vs-copilot │
unity-mcp-cli open ./MyUnityProject # │ vscode-copilot │
# └────────────────────┘
# 5. Wait for Unity Editor to be ready
unity-mcp-cli wait-for-ready ./MyUnityProjectOr run any command instantly with npx — no global installation required:
npx unity-mcp-cli install-plugin /path/to/unity/projectRequirements: Node.js ^20.19.0 || >=22.12.0. Unity Hub is installed automatically if not found.
Contents
Commands
configure
Configure MCP tools, prompts, and resources in UserSettings/AI-Game-Developer-Config.json.
unity-mcp-cli configure ./MyGame --list| Option | Required | Description |
|---|---|---|
| [path] | Yes | Path to the Unity project (positional or --path) |
| --list | No | List current configuration and exit |
| --enable-tools <names> | No | Enable specific tools (comma-separated) |
| --disable-tools <names> | No | Disable specific tools (comma-separated) |
| --enable-all-tools | No | Enable all tools |
| --disable-all-tools | No | Disable all tools |
| --enable-prompts <names> | No | Enable specific prompts (comma-separated) |
| --disable-prompts <names> | No | Disable specific prompts (comma-separated) |
| --enable-all-prompts | No | Enable all prompts |
| --disable-all-prompts | No | Disable all prompts |
| --enable-resources <names> | No | Enable specific resources (comma-separated) |
| --disable-resources <names> | No | Disable specific resources (comma-separated) |
| --enable-all-resources | No | Enable all resources |
| --disable-all-resources | No | Disable all resources |
Example — enable specific tools and disable all prompts:
unity-mcp-cli configure ./MyGame \
--enable-tools gameobject-create,gameobject-find \
--disable-all-promptsExample — enable everything:
unity-mcp-cli configure ./MyGame \
--enable-all-tools \
--enable-all-prompts \
--enable-all-resourcescreate-project
Create a new Unity project using the Unity Editor.
unity-mcp-cli create-project /path/to/new/project| Option | Required | Description |
|---|---|---|
| [path] | Yes | Path where the project will be created (positional or --path) |
| --unity <version> | No | Unity Editor version to use (defaults to highest installed) |
Example — create a project with a specific editor version:
unity-mcp-cli create-project ./MyGame --unity 2022.3.62f1install-extension
Install one of the Unity-MCP extensions — the optional tool packs that add MCP tools for Animation, Cinemachine, Input System, Navigation, Particle System, ProBuilder, Splines, Terrain, Tilemap, and Timeline — into a Unity project's Packages/manifest.json. This is the command-line equivalent of the Extensions section in the AI Game Developer editor window, and it installs from the same shared catalogue.
# See what is installable (no project and no network required)
unity-mcp-cli install-extension --list
# Run from inside the Unity project folder — the path is optional
cd ./MyGame && unity-mcp-cli install-extension Tilemap| Argument / Option | Required | Description |
|---|---|---|
| [id] | Yes (unless --list) | Extension to install — the OpenUPM package id (com.ivanmurzak.unity.mcp.tilemap) or the catalogue name (Tilemap). Matched case-insensitively. An unknown id lists every installable extension so you can self-correct. |
| [path] | No | Path to the Unity project (positional or --path). Defaults to the current directory, verified the same way as install-plugin. |
| --extension-version <version> | No | Extension version to install (defaults to latest from OpenUPM). Not --version — that is the CLI's own global version flag. |
| --list | No | List the installable extensions and exit. |
This command:
- Adds the OpenUPM scoped registry with all required scopes (the
com.ivanmurzakscope is what makes the extension resolvable at all) - Adds the extension's package id to
dependencies, resolving OpenUPM'slatestat install time - Never downgrades on an auto-resolved version — if a higher version is already installed, it is preserved and a warning is printed. Pass
--extension-versionto force a specific value, including a downgrade. - Is idempotent — a re-run that finds the extension already up to date reports so and writes nothing
Example — install a specific extension version:
unity-mcp-cli install-extension Cinemachine ./MyGame --extension-version 1.0.17Example — in-process, from the library:
import { installExtension, EXTENSIONS_CATALOG } from 'unity-mcp-cli';
const result = await installExtension({
unityProjectPath: './MyGame',
extensionId: 'Tilemap',
});
if (result.kind === 'success') {
console.log(result.outcome, result.fromVersion, '->', result.toVersion);
}After running this command, open (or focus) the Unity Editor so the Package Manager resolves the new dependency.
install-plugin
Install the Unity-MCP plugin into a Unity project's Packages/manifest.json. Optionally download the RID-matched MCP server binary and redeem a team enrollment code in the same run.
# Run from inside the Unity project folder — the path is optional
cd ./MyGame && unity-mcp-cli install-plugin| Option | Required | Description |
|---|---|---|
| [path] | No | Path to the Unity project (positional or --path). Defaults to the current directory; the resolved directory is verified to be a real Unity project (Packages/manifest.json marker) and, on a miss, the error lists exactly what was checked. |
| --plugin-version <version> | No | Plugin version to install (defaults to latest from OpenUPM) |
| --with-server | No | Also download the RID-matched GameDev-MCP-Server binary into the CLI-managed directory |
| --server-version <version> | No | Server version to download with --with-server (default: the CLI's pinned server version) |
| --server-source <path-or-url> | No | Offline/CI override — install the server from a local zip path or URL (skips checksum verification) |
| --enroll <code> | No | Redeem an enrollment code for a plugin credential (planted in the shared machine store and pinned to this project) |
| --enroll-stdin | No | Read the enrollment code from stdin instead of argv (keeps it out of shell history) |
This command:
- Adds the OpenUPM scoped registry with all required scopes
- Adds
com.ivanmurzak.unity.mcptodependencies - Never downgrades — if a higher version is already installed, it is preserved
Example — install a specific plugin version:
unity-mcp-cli install-plugin ./MyGame --plugin-version 0.51.6Example — redeem a team enrollment code (path defaults to cwd):
cd ./MyGame && unity-mcp-cli install-plugin --enroll <code>After running this command, open the project in Unity Editor to complete the package installation.
install-unity
Install a Unity Editor version via Unity Hub CLI.
unity-mcp-cli install-unity 6000.3.1f1| Argument / Option | Required | Description |
|---|---|---|
| [version] | No | Unity Editor version to install (e.g. 6000.3.1f1) |
| --path <path> | No | Read the required version from an existing project |
If neither argument nor option is provided, the command installs the latest stable release from Unity Hub's releases list.
Example — install the editor version that a project needs:
unity-mcp-cli install-unity --path ./MyGamelogin
Sign in to ai-game.dev and store the credential in the shared machine credential store (~/.ai-game-dev/credentials.json). Runs the browser-based OAuth 2.1 device flow — there is no personal access token to create or paste. The sign-in authorizes the whole machine: it mints an agent credential and derives an engine-tools credential from it, and every consumer (the CLI's cloud commands, the Unity Editor plugin, the desktop app) refreshes it automatically — tokens rotate in the background, so you sign in once per machine, not once per session.
unity-mcp-cli login| Option | Required | Description |
|---|---|---|
| --project <path> | No | Store the credential in a project-local store (<path>/.ai-game-dev/) instead of the shared machine store |
| --force | No | Re-authenticate even if a credential already exists |
| --tools-only | No | Authorize engine tools only (no agent credential is stored, so desktop-app pickup is impossible). Intended for CI / automation runners, which then appear as their own revocable device group |
| --yes | No | Assume "yes" for prompts — required to confirm an account switch non-interactively (signing in as a different account than the machine currently holds) |
The command prints a short user code and a verification URL, opens your browser, and polls until you approve the sign-in. If a credential already exists it exits early with "Already signed in" — pass --force to replace it. Signing in as a different account than the one the machine holds asks for confirmation first (declining leaves everything unchanged); pass --yes to confirm in scripts.
Example — sign in (shared machine store):
unity-mcp-cli loginExample — CI runner, engine tools only:
unity-mcp-cli login --tools-onlyExample — store the credential next to a specific project:
unity-mcp-cli login --project ./MyGameopen
Open a Unity project in the Unity Editor. By default, sets MCP connection environment variables if connection options are provided. Use --no-connect to open without MCP connection.
# Explicit path
unity-mcp-cli open ./MyGame
# From inside the Unity project folder — path defaults to the current directory
cd ./MyGame && unity-mcp-cli open| Option | Env Variable | Required | Description |
|---|---|---|---|
| [path] | — | No | Path to the Unity project (positional or --path). Defaults to the current working directory. |
| --unity <version> | — | No | Specific Unity Editor version to use (defaults to version from project settings, falls back to highest installed) |
| --editor-path <path> | — | No | Explicit path to the Unity Editor executable. Skips Unity Hub discovery, useful for custom install locations. |
| --no-connect | — | No | Open without MCP connection environment variables |
| --url <url> | UNITY_MCP_CLOUD_URL | No | MCP server URL to connect to (the CLI still exports the legacy alias UNITY_MCP_HOST, which the plugin also accepts) |
| --keep-connected | UNITY_MCP_KEEP_CONNECTED | No | Force keep the connection alive |
| --token <token> | UNITY_MCP_TOKEN | No | Authentication token |
| --auth <option> | UNITY_MCP_AUTH_OPTION | No | Auth mode: none, oauth, or token |
| --tools <names> | UNITY_MCP_TOOLS | No | Comma-separated list of tools to enable |
| --transport <method> | UNITY_MCP_TRANSPORT | No | Transport method: streamableHttp or stdio |
| --start-server <value> | UNITY_MCP_START_SERVER | No | Set to true or false to control MCP server auto-start |
| --no-auto-dismiss-launch-errors | — | No | Disable auto-dismissal of the Unity Editor "compile errors at launch" dialog (default: enabled) |
| --launch-dismiss-timeout-ms <ms> | — | No | Overall timeout (milliseconds) for the launch-errors auto-dismiss polling loop (default: 30000) |
| --launch-dismiss-poll-interval-ms <ms> | — | No | Polling tick interval (milliseconds) for the launch-errors auto-dismiss loop (default: 1500) |
The editor process is spawned in detached mode. By default, after spawning the editor, open polls for Unity's "compile errors at launch" dialog ("Enter Safe Mode?" on Unity 2020.2+, "Hold On" / "Compiler Errors" on older releases) and clicks Ignore so the editor finishes initialising — without this, any in-Editor automation that needs to run after a state where Unity itself can't compile (e.g. the NuGet dependency resolver) cannot self-heal. The dialog is surfaced after Unity has booted, connected to Package Manager, and started compiling — empirically ~6s on a fast machine and longer on a slow one — so the polling loop has a grace window after which it exits early if no dialog has been seen. The grace window has to cover Unity's full startup phase or the loop bails out before the dialog ever appears (issue #737); it never runs the full --launch-dismiss-timeout-ms in the no-dialog case. If the dialog is observed (and successfully dismissed), polling continues until the overall timeout so a re-appearing dialog (resolver fixes one error → dialog re-surfaces with the next) is dismissed again. Library-mode callers can supply an AbortSignal (launchDismissAbortSignal on OpenProjectOptions) to abort the loop the instant their own readiness signal fires.
Auto-dismiss platform requirements
| Platform | Requirement | Notes |
|---|---|---|
| Windows | Built-in (Win32 API) | Uses EnumWindows / EnumChildWindows / SendMessageW(BM_CLICK) driven from PowerShell. No extra setup required. |
| macOS | Accessibility permission must be granted to the terminal (or unity-mcp-cli binary). System Settings → Privacy & Security → Accessibility. | Implemented via AppleScript / osascript. Without this permission, osascript reports an error every poll tick and the dialog cannot be dismissed. |
| Linux/X11 | xdotool on PATH (e.g. sudo apt-get install xdotool). | Wayland is not supported in the first cut — track upstream issues for Wayland support. |
To opt out entirely, pass --no-auto-dismiss-launch-errors.
Example — open with MCP connection:
unity-mcp-cli open ./MyGame \
--url http://localhost:8080 \
--keep-connectedExample — open without MCP connection (simple open):
unity-mcp-cli open ./MyGame --no-connectExample — open with authentication and specific tools:
unity-mcp-cli open ./MyGame \
--url http://my-server:8080 \
--token my-secret-token \
--auth token \
--tools gameobject-create,gameobject-findclose
Gracefully terminate the Unity Editor instance running for a given project path. Symmetric counterpart of open — for scripted workflows (CI agents, pipeline executors, integration test fixtures) that need a clean tear-down without resorting to OS-level process kills.
unity-mcp-cli close ./MyGame| Option | Required | Description |
|---|---|---|
| [path] | No | Path to the Unity project (positional, defaults to current directory) |
| --timeout <seconds> | No | Polite-quit timeout in seconds (default: 30) |
| --force | No | Hard-kill the Editor if it does not exit within --timeout |
How it works:
- Resolves the running Editor's PID by reading
<project>/Temp/UnityLockfile(4-byte little-endian uint32) and cross-checking against process enumeration to handle stale lock files. - Sends a polite-quit signal —
SIGTERMon Linux/macOS,taskkill(no/F) on Windows — letting Unity finish autosave / asset-import. - Polls every 250ms until the process exits or
--timeoutelapses. - If the timeout expires AND
--forceis set, falls back toSIGKILL/taskkill /F. - Idempotent — closing an already-closed Editor (or a project whose Editor was never running) exits 0 with
no running Editor for project at <path>. - Refuses to act on any path that is not a Unity project root (
ProjectSettings/ProjectVersion.txtmust exist) — protects against accidental kill-all-Unity-on-host invocations.
Windows headless caveat: the polite-quit step uses
taskkill(no/F), which deliversWM_CLOSE. That message only reaches processes owning a top-level window on the same desktop/session as the CLI. If Unity was launched by a Windows service in session 0 (or any other non-interactive desktop), the polite-quit will be silently dropped, the--timeoutwill elapse, and--forcebecomes the only path that brings the Editor down. Plan accordingly in headless CI runners.
Example — close, fall back to force after 60s:
unity-mcp-cli close ./MyGame --timeout 60 --forceExample — clean tear-down at the end of an automation script:
unity-mcp-cli open ./MyGame
unity-mcp-cli wait-for-ready ./MyGame
unity-mcp-cli run-tool tests-run ./MyGame --input '{"testMode":"EditMode"}'
unity-mcp-cli close ./MyGamerun-tool
Execute an MCP tool directly via the HTTP API. The server URL and authorization token are automatically resolved from the project's config file (UserSettings/AI-Game-Developer-Config.json), based on the current connection mode (Custom or Cloud).
unity-mcp-cli run-tool gameobject-create ./MyGame --input '{"name":"Cube"}'| Option | Required | Description |
|---|---|---|
| <tool-name> | Yes | Name of the MCP tool to execute |
| [path] | No | Unity project path (positional or --path) — used to read config and detect port |
| --url <url> | No | Direct server URL override (bypasses config) |
| --token <token> | No | Bearer token override (bypasses config) |
| --input <json> | No | JSON string of tool arguments (defaults to {}) |
| --input-file <file> | No | Read JSON arguments from a file |
| --raw | No | Output raw JSON (no formatting, no spinner) |
| --timeout <ms> | No | Request timeout in milliseconds (default: 60000) |
URL resolution priority:
--url→ use directly- Config file →
host(Custom mode) or hardcoded cloud endpoint (Cloud mode) - Deterministic port from project path
Authorization is read automatically from the project config (token in Custom mode, cloudToken in Cloud mode). Use --token to override the config-derived token explicitly.
Example — call a tool (URL and auth from config):
unity-mcp-cli run-tool gameobject-find ./MyGame --input '{"query":"Player"}'Example — explicit URL override:
unity-mcp-cli run-tool scene-save --url http://localhost:8080Example — pipe raw JSON output:
unity-mcp-cli run-tool assets-list ./MyGame --raw | jq '.results'wait-for-ready
Wait until Unity Editor and MCP server are connected and ready to accept tool calls. Polls the server at a configurable interval until it responds successfully or the timeout is reached. Useful for automation scripts and AI agent orchestration where open launches Unity but the agent needs to know when it can start calling tools.
unity-mcp-cli wait-for-ready ./MyGame| Option | Required | Description |
|---|---|---|
| [path] | No | Unity project path (positional or --path) — used to read config and detect port |
| --url <url> | No | Direct server URL override (bypasses config) |
| --token <token> | No | Bearer token override (bypasses config) |
| --timeout <ms> | No | Maximum time to wait in milliseconds (default: 120000) |
| --interval <ms> | No | Polling interval in milliseconds (default: 3000) |
Example — wait with default timeout (120s):
unity-mcp-cli open ./MyGame
unity-mcp-cli wait-for-ready ./MyGame
unity-mcp-cli run-tool tests-run ./MyGame --input '{"testMode":"EditMode"}'Example — shorter timeout for CI:
unity-mcp-cli wait-for-ready ./MyGame --timeout 60000 --interval 2000Example — explicit server URL:
unity-mcp-cli wait-for-ready --url http://localhost:8080 --timeout 30000setup-mcp
Write MCP config files for AI agents, enabling headless/CI setup without the Unity Editor UI. Supports all 14 agents (Claude Code, Cursor, Gemini, Codex, etc.).
By default the written config is credential-free (the client authenticates with your native OAuth sign-in from login) and pinned to this project via a per-project URL (https://ai-game.dev/mcp/p/<pin> for http transport, or a project=<pin> argument for stdio). Pass --no-pin for the shared, unpinned endpoint, or --token to opt into writing a static credential (PAT) into the config. This output matches the Unity Editor's Configure MCP button byte-for-byte.
unity-mcp-cli setup-mcp claude-code ./MyGame| Option | Required | Description |
|---|---|---|
| [agent-id] | Yes | Agent to configure (use --list to see all) |
| [path] | No | Unity project path (defaults to cwd) |
| --transport <transport> | No | Transport method: stdio or http (default: http) |
| --url <url> | No | Server URL override (for http transport) |
| --token <token> | No | Explicit PAT opt-in — writes a static credential into the config (default: credential-free, native OAuth) |
| --no-pin | No | Write an unpinned URL / omit the project= argument (default: pin to this project via /mcp/p/<pin>) |
| --list | No | List all available agent IDs |
Example — list all supported agents:
unity-mcp-cli setup-mcp --listExample — configure Cursor with stdio transport:
unity-mcp-cli setup-mcp cursor ./MyGame --transport stdioExample — write an unpinned config (shared /mcp endpoint):
unity-mcp-cli setup-mcp claude-code ./MyGame --no-pinsetup-skills
Generate skill files for an AI agent by calling the MCP server's system tool API. Requires Unity Editor to be running with the MCP plugin installed.
unity-mcp-cli setup-skills claude-code ./MyGame| Option | Required | Description |
|---|---|---|
| [agent-id] | Yes | Agent to generate skills for (use --list to see all) |
| [path] | No | Unity project path (defaults to cwd) |
| --url <url> | No | Server URL override |
| --token <token> | No | Auth token override |
| --list | No | List all agents with skills support status |
| --timeout <ms> | No | Request timeout in milliseconds (default: 60000) |
Example — list agents with skills support:
unity-mcp-cli setup-skills --listremove-plugin
Remove the Unity-MCP plugin from a Unity project's Packages/manifest.json.
unity-mcp-cli remove-plugin ./MyGame| Option | Required | Description |
|---|---|---|
| [path] | Yes | Path to the Unity project (positional or --path) |
This command:
- Removes
com.ivanmurzak.unity.mcpfromdependencies - Preserves scoped registries and scopes — other packages may depend on them
- No-op if the plugin is not installed
After running this command, open the project in Unity Editor to apply the change.
status
Check Unity Editor and MCP server connection status. Shows whether Unity is running, whether the local MCP server is reachable, and whether the config-resolved server (e.g., cloud) is reachable.
unity-mcp-cli status ./MyGame| Option | Required | Description |
|---|---|---|
| [path] | No | Unity project path (positional or --path) |
| --url <url> | No | Direct server URL override (bypasses config) |
| --token <token> | No | Bearer token override (bypasses config) |
| --timeout <ms> | No | Probe timeout in milliseconds (default: 5000) |
Example output:
Unity-MCP Status
Project: /path/to/MyGame
──────────────────────────────────────────────────
Unity Editor Process
✔ Unity is running (PID: 53740)
Local MCP Server
URL: http://localhost:22958
✖ Not available (connection refused)
Config Server
URL: https://ai-game.dev/mcp
✔ Connected
──────────────────────────────────────────────────
✔ MCP server is reachable — ready for tool callsGlobal Options
These options are available on all commands:
| Option | Description |
|---|---|
| -v, --verbose | Enable verbose diagnostic output for troubleshooting |
| --version | Display CLI version |
| --help | Display help for the command |
Example — run any command with verbose output:
unity-mcp-cli install-plugin ./MyGame --verboseFull Automation Example
Set up a complete Unity MCP project from scratch in one script:
# 1. Create a new Unity project
unity-mcp-cli create-project ./MyAIGame --unity 6000.3.1f1
# 2. Install the Unity-MCP plugin
unity-mcp-cli install-plugin ./MyAIGame
# 3. Enable all MCP tools
unity-mcp-cli configure ./MyAIGame --enable-all-tools
# 4. Sign in to ai-game.dev (browser OAuth; credential saved to ~/.ai-game-dev)
unity-mcp-cli login
# 5. Open the project (auto-connects and generates skills for claude-code)
unity-mcp-cli open ./MyAIGame
# 6. Wait for Unity Editor and MCP server to be ready
unity-mcp-cli wait-for-ready ./MyAIGame
# 7. Run tests to verify everything works
unity-mcp-cli run-tool tests-run ./MyAIGame --input '{"testMode":"EditMode"}'How It Works
Deterministic Port
The CLI generates a deterministic port for each Unity project based on its directory path (SHA256 hash mapped to port range 20000–29999). This matches the port generation in the Unity plugin, ensuring the server and plugin automatically agree on the same port without manual configuration.
Plugin Installation
The install-plugin command modifies Packages/manifest.json directly:
- Adds the OpenUPM scoped registry (
package.openupm.com) - Registers all required scopes (
com.ivanmurzak,extensions.unity) - Adds the
com.ivanmurzak.unity.mcpdependency with version-aware updates (never downgrades)
Configuration File
The configure command reads and writes UserSettings/AI-Game-Developer-Config.json, which controls:
- Tools — MCP tools available to AI agents
- Prompts — pre-defined prompts injected into LLM conversations
- Resources — read-only data exposed to AI agents
- Connection settings — host URL, auth token, transport method, timeouts
Unity Hub Integration
Commands that manage editors or create projects use the Unity Hub CLI (--headless mode). If Unity Hub is not installed, the CLI downloads and installs it automatically:
- Windows — silent install via
UnityHubSetup.exe /S(may require administrator privileges) - macOS — downloads the DMG, mounts it, and copies
Unity Hub.appto/Applications - Linux — downloads
UnityHub.AppImageto~/Applications/
For the full Unity-MCP project documentation, see the main README.
Library API (v0.67.0+)
In addition to the CLI binary, unity-mcp-cli exposes its core commands as a typed, side-effect-free library so other Node.js / TypeScript tools can embed the same install / configure flow without shelling out.
import { installPlugin, removePlugin, configure, setupMcp } from 'unity-mcp-cli';
const result = await installPlugin({
unityProjectPath: './MyUnityProject',
// version: '0.67.0', // optional — defaults to latest from OpenUPM
onProgress: (event) => {
// phase is one of: 'start' | 'dependencies-resolved' | 'manifest-patched' | 'done'
console.log(event.phase, event.message);
},
});
if (!result.success) {
console.error('Install failed:', result.error?.message);
return;
}
console.log(`Installed v${result.installedVersion}`);
for (const warning of result.warnings) console.warn(warning);
for (const step of result.nextSteps) console.log(step);Each function returns a typed { success, ... } result object; errors are never thrown past the public boundary. The library entry has no top-level side effects — import 'unity-mcp-cli' never parses argv and never writes to stdout or stderr.
See CHANGELOG.md for the full list of exported functions and types.
