@mseep/anklebreaker-unity-mcp 2.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: true
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 30
15
+ permissions:
16
+ contents: read
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+
20
+ - uses: actions/setup-node@v6
21
+ with:
22
+ node-version: "22"
23
+ registry-url: "https://registry.npmjs.org"
24
+
25
+ - name: Sync package.json version with release tag
26
+ run: |
27
+ VERSION="${GITHUB_REF_NAME#v}"
28
+ npm version "$VERSION" --no-git-tag-version --allow-same-version
29
+
30
+ - run: npm install
31
+
32
+ - run: npm publish --access public
33
+ env:
34
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.mcpbignore ADDED
@@ -0,0 +1,9 @@
1
+ .git
2
+ .gitignore
3
+ .mcpbignore
4
+ tests
5
+ *.mcpb
6
+ claude-desktop-config.json
7
+ README.md
8
+ CHANGELOG.md
9
+ package-lock.json
package/CHANGELOG.md ADDED
@@ -0,0 +1,85 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package will be documented in this file.
4
+
5
+ ## [2.30.0] - 2026-06-02
6
+
7
+ ### Added
8
+ - **`unity_screenshot_editor_window` tool** — capture any Editor window (Inspector, Project, Console, custom windows) to a PNG file. Unlike `unity_screenshot_game` / `unity_screenshot_scene` (which render a camera), it grabs the actual editor UI via the Win32 `PrintWindow` API, so it works even when the window is hidden behind others, without raising it or stealing focus. **Windows editor only** — returns a clear unsupported-platform error on macOS/Linux. Defaults to `Assets/Screenshots/`, accepts any user-chosen `.png` path; args `window` (required), `path`, `maxDimension`. Companion to the `unity-mcp-plugin` 2.32.0 change.
9
+
10
+ ## [2.29.0] - 2026-05-21
11
+
12
+ ### Added
13
+ - **MPPM virtual player & scenario tools** — `unity_mppm_list_players`, `unity_mppm_activate_player`, `unity_mppm_deactivate_player` (manage Multiplayer Play Mode virtual players) and `unity_mppm_create_scenario` (create a ScenarioConfig asset). Companion to the `unity-mcp-plugin` 2.31.0 MPPM changes; the existing `unity_mppm_*` scenario tools also got clearer descriptions.
14
+
15
+ ## [2.28.3] - 2026-05-21
16
+
17
+ ### Changed
18
+ - **`instanceId` tool parameters declared as `string`** — Unity 6.5 entity ids are 64-bit values that exceed JavaScript's safe-integer range; sent as JSON numbers they were rounded, breaking object-by-`instanceId` resolution. All 26 `instanceId` input schemas in `editor-tools.js` are now `string`. Companion to the `unity-mcp-plugin` 2.28.0 change. Fixes [#24](https://github.com/AnkleBreaker-Studio/unity-mcp-server/issues/24).
19
+
20
+ ## [2.28.2] - 2026-04-22
21
+
22
+ ### Fixed
23
+ - **MCP JSON-RPC framing corrupted by debug logs on stdout** — Two `console.debug(...)` call sites in `src/unity-editor-bridge.js` and `src/tool-tiers.js` wrote diagnostic lines to stdout, which the MCP stdio transport reserves exclusively for JSON-RPC messages. Strict clients (Codex CLI) closed the transport on the first non-JSON chunk; lenient clients (Claude Desktop, Claude Code) tolerated it, which is why the bug escaped earlier detection. Both call sites now use `console.error(...)` so logs go to stderr. Fixes [#11](https://github.com/AnkleBreaker-Studio/unity-mcp-server/issues/11).
24
+
25
+ ## [2.28.1] - 2026-04-02
26
+
27
+ ### Fixed
28
+ - **npm publish workflow** — Added `--allow-same-version` to `npm version` command to prevent CI failure when `package.json` already matches the release tag
29
+
30
+ ## [2.28.0] - 2026-04-02
31
+
32
+ ### Added
33
+ - **SpriteAtlas tools** — 7 new tools for Unity SpriteAtlas management (contributed by [@zaferdace](https://github.com/zaferdace)):
34
+ - `spriteatlas/create` — Create a new SpriteAtlas asset
35
+ - `spriteatlas/info` — Get SpriteAtlas details (packed sprites, settings)
36
+ - `spriteatlas/add` — Add sprites/folders to a SpriteAtlas
37
+ - `spriteatlas/remove` — Remove entries from a SpriteAtlas
38
+ - `spriteatlas/settings` — Configure packing, texture, and platform settings
39
+ - `spriteatlas/delete` — Delete a SpriteAtlas asset
40
+ - `spriteatlas/list` — List all SpriteAtlases in the project
41
+ - New `spriteatlas-bridge.js` and `spriteatlas-tools.js` modules
42
+
43
+ ### Added
44
+ - **npm auto-publish** — GitHub Action that automatically publishes to npm whenever a new GitHub release is created (contributed by [@vatanaksoytezer](https://github.com/vatanaksoytezer) in [#8](https://github.com/AnkleBreaker-Studio/unity-mcp-server/pull/8))
45
+
46
+ ### Changed
47
+ - **npm package renamed** — Package renamed from `unity-mcp-server` to `anklebreaker-unity-mcp` to avoid name conflict on npm. Install via `npx anklebreaker-unity-mcp@latest`
48
+
49
+ ### Fixed
50
+ - **UTF-8 encoding** — Fixed mojibake characters (corrupted em-dashes, arrows, section headers) across all comments in `unity-editor-bridge.js`; removed stale BOM
51
+ - **package-lock.json** — Synced version field to 2.27.0
52
+
53
+ ## [2.27.0] - 2026-03-25
54
+
55
+ ### Added
56
+ - **UMA (Unity Multipurpose Avatar) integration** — 13 new tools for the complete UMA asset pipeline:
57
+ - `uma/inspect-fbx` — Inspect FBX meshes for UMA compatibility
58
+ - `uma/create-slot` — Create SlotDataAsset from mesh data
59
+ - `uma/create-overlay` — Create OverlayDataAsset with texture assignments
60
+ - `uma/create-wardrobe-recipe` — Create WardrobeRecipe combining slots and overlays
61
+ - `uma/create-wardrobe-from-fbx` — Atomic FBX-to-wardrobe pipeline (inspect → slot → overlay → recipe in one call)
62
+ - `uma/wardrobe-equip` — Equip/unequip wardrobe items on DynamicCharacterAvatar
63
+ - `uma/list-global-library` — Browse the UMA Global Library contents
64
+ - `uma/list-wardrobe-slots` — List available wardrobe slots
65
+ - `uma/list-uma-materials` — List UMA-compatible materials
66
+ - `uma/get-project-config` — Get UMA project configuration
67
+ - `uma/verify-recipe` — Validate a WardrobeRecipe for missing references
68
+ - `uma/rebuild-global-library` — Force rebuild the Global Library index
69
+ - `uma/register-assets` — Register Slot/Overlay/Recipe assets in the Global Library
70
+ - New `uma-bridge.js` module — UMA bridge functions extracted into a dedicated module
71
+ - New `uma-tools.js` — Full tool definitions and schemas for all UMA tools
72
+
73
+ ## [2.26.0] - 2026-03-25
74
+
75
+ ### Added
76
+ - **Compilation error detection** — New `unity_get_compilation_errors` tool retrieves C# compilation errors and warnings via `CompilationPipeline` API, independent of console log buffer
77
+ - **Test Runner integration** — Run EditMode/PlayMode tests, poll results, list available tests via Unity Test Runner API
78
+
79
+ ## [2.25.0] - 2026-03-09
80
+
81
+ ### Added
82
+ - **Parallel-safe instance routing** — Per-request `port` parameter on every `unity_*` tool call for multi-agent safety
83
+ - **Per-request port override** — Stateless routing mechanism bypassing shared per-agent state
84
+ - **Schema injection** — Optional `port` parameter auto-injected into every `unity_*` tool schema
85
+ - **Enhanced select_instance response** — Explicit routing instructions for AI assistants
package/LICENSE ADDED
@@ -0,0 +1,69 @@
1
+ AnkleBreaker Open License v1.0
2
+
3
+ Copyright (c) 2024-2026 AnkleBreaker Consulting & AnkleBreaker Studio.
4
+ All rights reserved.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to use,
8
+ copy, modify, merge, publish, and distribute the Software, subject to the
9
+ following conditions:
10
+
11
+ 1. COPYRIGHT & LICENSE NOTICE
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ 2. ATTRIBUTION REQUIREMENT
16
+ Any product, tool, service, or application that integrates or is built
17
+ using this Software must display the following attribution in a reasonably
18
+ visible location (e.g., about page, splash screen, credits, documentation,
19
+ or README):
20
+
21
+ "Made with AnkleBreaker MCP"
22
+ or
23
+ "Powered by AnkleBreaker MCP"
24
+
25
+ along with the AnkleBreaker MCP logo (available at
26
+ https://github.com/AnkleBreaker-Studio/unity-mcp-plugin/blob/main/icon.png)
27
+ when technically feasible.
28
+
29
+ This attribution requirement applies to commercial and non-commercial
30
+ products alike. Personal and educational use within private environments
31
+ (not distributed to third parties) is exempt from this requirement.
32
+
33
+ 3. RESALE PROHIBITION
34
+ You MAY NOT sell, sublicense, or commercially distribute the Software — or
35
+ any derivative work based on it — as a tool, product, or service.
36
+
37
+ This means you CANNOT:
38
+
39
+ a) Sell or resell the Software itself, in whole or in part, whether
40
+ modified or unmodified;
41
+ b) Add a paywall, licensing mechanism, or access restriction to the
42
+ Software and sell it;
43
+ c) Repackage, rename, rebrand, or rebundle the Software with only
44
+ cosmetic or trivial changes and sell it;
45
+ d) Wrap the Software in a thin service layer, installer, or distribution
46
+ mechanism and sell it;
47
+ e) Offer the Software as part of a paid bundle where it is the primary
48
+ value proposition.
49
+
50
+ For clarity, the following uses ARE permitted:
51
+
52
+ - Using the Software internally within a company or team, including in
53
+ commercial projects, at no cost;
54
+ - Integrating the Software as a free component of a larger product or
55
+ service that itself provides substantial independent value;
56
+ - Building and distributing FREE extensions, plugins, or derivative
57
+ works on top of the Software;
58
+ - Offering consulting, support, or training services around the Software.
59
+
60
+ If you are unsure whether your intended use qualifies, contact
61
+ contact@anklebreaker-studio.com before distributing.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
69
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,368 @@
1
+ <p align="center">
2
+ <img src="icon.png" alt="AnkleBreaker MCP" width="180" />
3
+ </p>
4
+
5
+ # Unity MCP Server AI-Powered Unity Editor & Hub Control
6
+
7
+ > **The most comprehensive [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for Unity game development.** Connect Claude, Cursor, Windsurf, or any MCP-compatible AI assistant to **Unity Editor** and **Unity Hub** with **288 tools** across **30+ categories**. Built and maintained by [AnkleBreaker Studio](https://github.com/AnkleBreaker-Studio).
8
+
9
+ **AnkleBreaker Unity MCP** turns your AI assistant into a full Unity co-pilot — create scenes, manipulate GameObjects, manage components, run builds, profile performance, edit Shader Graphs, control Amplify Shader Editor, sculpt terrain, bake NavMesh, manage animations, run multiplayer playmode scenarios, and much more — all without leaving your AI chat. Works with Claude Desktop, Claude Cowork, Cursor, Windsurf, and any tool that supports the Model Context Protocol.
10
+
11
+ ### Neon Brick Breaker — Built from scratch by AI in under 5 minutes
12
+ > Claude creates the entire game: scene setup, neon materials with bloom post-processing, brick grid layout, game scripts, VFX, and UI — all through Unity MCP commands.
13
+
14
+ <p align="center">
15
+ <img src="docs/unity-mcp-showcase-brickbreaker.gif" alt="Unity MCP AI building a neon brick breaker game in Unity Editor" width="800" />
16
+ </p>
17
+
18
+ ### 3D Medieval Village — AI-generated terrain, houses, and environment
19
+ > From an empty scene to a fully decorated village: terrain sculpting, material creation, procedural house building via C# editor scripts, trees, fences, and pathways.
20
+
21
+ <p align="center">
22
+ <img src="docs/unity-mcp-showcase-village.gif" alt="Unity MCP — AI building a 3D medieval village with houses, trees, and terrain" width="800" />
23
+ </p>
24
+
25
+ ### 3D Castle — Complete level with FPS walkthrough
26
+ > AI builds a multi-room castle with courtyard, throne room, armory, and guard room. Adjusts lighting, spawns the player, and runs an FPS walkthrough to verify the result.
27
+
28
+ <p align="center">
29
+ <img src="docs/unity-mcp-showcase-castle.gif" alt="Unity MCP — AI building a 3D castle with FPS walkthrough in Unity Editor" width="800" />
30
+ </p>
31
+
32
+ ### How It Works — AI → MCP Server → Unity Plugin → Unity Editor
33
+ > The Model Context Protocol connects your AI assistant to Unity through a lightweight bridge. Commands flow from your AI chat directly into the editor in real-time.
34
+
35
+ <p align="center">
36
+ <img src="docs/unity-mcp-architecture.gif" alt="Unity MCP Architecture — AI Assistant → MCP Server → Unity Plugin → Unity Editor" width="800" />
37
+ </p>
38
+
39
+ ## Features
40
+
41
+ **288 tools** covering the full Unity workflow:
42
+
43
+ | Category | Tools |
44
+ |----------|-------|
45
+ | **Unity Hub** | List/install editors, manage modules, set install paths |
46
+ | **Scenes** | Open, save, create scenes, get full hierarchy tree with pagination |
47
+ | **GameObjects** | Create (primitives/empty), delete, duplicate, reparent, activate/deactivate, transform (world/local) |
48
+ | **Components** | Add, remove, get/set any serialized property, wire object references, batch wire |
49
+ | **Assets** | List, import, delete, search, create prefabs, create & assign materials |
50
+ | **Scripts** | Create, read, update C# scripts |
51
+ | **Builds** | Multi-platform builds (Windows, macOS, Linux, Android, iOS, WebGL) |
52
+ | **Console & Compilation** | Read/clear Unity console logs (errors, warnings, info); get C# compilation errors via CompilationPipeline (independent of console buffer) |
53
+ | **Testing** | Run EditMode/PlayMode tests, poll results, list available tests via Unity Test Runner API |
54
+ | **Play Mode** | Play, pause, stop |
55
+ | **Editor** | Execute menu items, run C# code, get editor state, undo/redo |
56
+ | **Project** | Project info, packages (list/add/remove/search), render pipeline, build settings |
57
+ | **Animation** | List clips & controllers, get parameters, play animations |
58
+ | **Prefab** | Open/close prefab mode, get overrides, apply/revert changes |
59
+ | **Physics** | Raycasts, sphere/box casts, overlap tests, physics settings |
60
+ | **Lighting** | Manage lights, environment, skybox, lightmap baking, reflection probes |
61
+ | **Audio** | AudioSources, AudioListeners, AudioMixers, play/stop, mixer params |
62
+ | **Terrain** | Create/modify terrains, paint heightmaps/textures, manage terrain layers, trees, details |
63
+ | **Navigation** | NavMesh baking, agents, obstacles, off-mesh links |
64
+ | **Particles** | Particle system creation, inspection, module editing |
65
+ | **UI** | Canvas, UI elements, layout groups, event system |
66
+ | **Tags & Layers** | List/add/remove tags, assign tags & layers |
67
+ | **Selection** | Get/set editor selection, find by name/tag/component/layer/tag |
68
+ | **Graphics** | Scene and game view capture (inline images for visual inspection) |
69
+ | **Input Actions** | Action maps, actions, bindings (Input System package) |
70
+ | **Assembly Defs** | List, inspect, create, update .asmdef files |
71
+ | **ScriptableObjects** | Create, inspect, modify ScriptableObject assets |
72
+ | **Constraints** | Position, rotation, scale, aim, parent constraints |
73
+ | **LOD** | LOD group management and configuration |
74
+ | **Profiler** | Start/stop profiling, stats, deep profiles, save profiler data |
75
+ | **Frame Debugger** | Enable/disable, draw call list & details, render targets |
76
+ | **Memory Profiler** | Memory breakdown, top consumers, snapshots (`com.unity.memoryprofiler`) |
77
+ | **Shader Graph** | List, inspect, create, open Shader Graphs & Sub Graphs; VFX Graphs |
78
+ | **Amplify Shader Editor** | Full graph manipulation — create, inspect, add/remove/connect/disconnect/duplicate nodes, set properties, templates, save/close (if installed) |
79
+ | **MPPM Scenarios** | List, activate, start, stop multiplayer playmode scenarios; get status & player info |
80
+ | **Multi-Instance** | Discover and switch between multiple running Unity Editor instances |
81
+ | **Multi-Agent** | List active agents, get agent action logs, queue monitoring |
82
+ | **SpriteAtlas** | Create, inspect, add/remove sprites, configure settings, delete, list SpriteAtlases |
83
+ | **UMA (Unity Multipurpose Avatar)** | Create slots, overlays, wardrobe recipes from FBX; equip/unequip items on DCA; browse/rebuild Global Library |
84
+ | **Project Context** | Auto-inject project-specific docs and guidelines for AI agents |
85
+
86
+ ## Architecture
87
+
88
+ ```
89
+ Claude / AI Assistant ←→ MCP Server (this repo) ←→ Unity Editor Plugin (HTTP bridge)
90
+
91
+ Unity Hub CLI
92
+ ```
93
+
94
+ This server communicates with:
95
+ - **Unity Hub** via its CLI (supports both modern `--headless` and legacy `-- --headless` syntax)
96
+ - **Unity Editor** via the companion [unity-mcp-plugin](https://github.com/AnkleBreaker-Studio/unity-mcp-plugin) which runs an HTTP API inside the editor
97
+
98
+ ### 288 Tools Across 30+ Categories
99
+ > Scene management, GameObjects, components, physics, terrain, Shader Graph, Amplify Shader Editor, profiling, animation, NavMesh, builds, multiplayer, and more.
100
+
101
+ <p align="center">
102
+ <img src="docs/unity-mcp-features.gif" alt="Unity MCP Features — 268 tools across 30+ categories for AI-powered game development" width="800" />
103
+ </p>
104
+
105
+ ### Two-Tier Tool System
106
+
107
+ To avoid overwhelming MCP clients with 288 tools, the server uses a two-tier architecture:
108
+ - **Core tools** (~70) are always exposed directly
109
+ - **Advanced tools** (~130+) are accessed via a single `unity_advanced_tool` proxy with lazy loading
110
+
111
+ This keeps the tool count manageable for clients like Claude Desktop and Cowork while still providing access to every Unity feature. Use `unity_list_advanced_tools` to discover all advanced tools by category.
112
+
113
+ ### Multi-Instance Support
114
+
115
+ The server automatically discovers all running Unity Editor instances on startup. If only one instance is found, it auto-connects. If multiple instances are running (e.g., main editor + ParrelSync clones), it prompts you to select which one to work with.
116
+
117
+ **Port Resilience** — The server includes a multi-layer protection system for reliable multi-project workflows:
118
+
119
+ - **Port Identity Validation** — When restoring a saved connection, the server verifies the instance identity (project name + path) matches the expected target. If Unity restarts and a different project grabs the port, the server detects this and re-discovers the correct instance.
120
+ - **Compile-Time Resilience** — During long Unity compiles (when the editor is unresponsive), the server checks the shared instance registry. If the registry entry is fresh (updated within the last 5 minutes via heartbeat), the connection is preserved instead of dropped.
121
+ - **Crash Detection** — The plugin sends a heartbeat every 30 seconds to the instance registry. If Unity crashes and the heartbeat stops, the server detects the stale registry entry (>5 minutes old) and clears it, allowing proper re-discovery.
122
+ - **Port Affinity** — The plugin remembers its last-used port via EditorPrefs and reclaims it on restart, minimizing port swaps across editor restarts.
123
+
124
+ ## Quick Start
125
+
126
+ ### 1. Install the Unity Plugin
127
+
128
+ In Unity: **Window > Package Manager > + > Add package from git URL:**
129
+ ```
130
+ https://github.com/AnkleBreaker-Studio/unity-mcp-plugin.git
131
+ ```
132
+
133
+ ### 2. Install this MCP Server
134
+
135
+ ```bash
136
+ git clone https://github.com/AnkleBreaker-Studio/unity-mcp-server.git
137
+ cd unity-mcp-server
138
+ npm install
139
+ ```
140
+
141
+ ### 3. Add to Claude Desktop
142
+
143
+ Open Claude Desktop > Settings > Developer > Edit Config, and add:
144
+
145
+ ```json
146
+ {
147
+ "mcpServers": {
148
+ "unity": {
149
+ "command": "node",
150
+ "args": ["C:/path/to/unity-mcp-server/src/index.js"],
151
+ "env": {
152
+ "UNITY_HUB_PATH": "C:\\Program Files\\Unity Hub\\Unity Hub.exe",
153
+ "UNITY_BRIDGE_PORT": "7890"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ Restart Claude Desktop. Done!
161
+
162
+ ### 4. Try It
163
+
164
+ - *"List my installed Unity editors"*
165
+ - *"Show me the scene hierarchy"*
166
+ - *"Create a red cube at position (0, 2, 0) and add a Rigidbody"*
167
+ - *"Profile my scene and show the top memory consumers"*
168
+ - *"List all Shader Graphs in my project"*
169
+ - *"Build my project for Windows"*
170
+ - *"List and start my MPPM multiplayer scenarios"*
171
+ - *"Capture a screenshot of my scene view"*
172
+ - *"Show me the active agent sessions"*
173
+
174
+ ## Configuration
175
+
176
+ | Environment Variable | Default | Description |
177
+ |---------------------|---------|-------------|
178
+ | `UNITY_HUB_PATH` | `C:\Program Files\Unity Hub\Unity Hub.exe` | Unity Hub executable path |
179
+ | `UNITY_BRIDGE_HOST` | `127.0.0.1` | Editor bridge host |
180
+ | `UNITY_BRIDGE_PORT` | `7890` | Editor bridge port (auto-discovered when using multi-instance) |
181
+ | `UNITY_BRIDGE_TIMEOUT` | `30000` | Request timeout in ms |
182
+ | `UNITY_PORT_RANGE_START` | `7890` | Start of port scan range for multi-instance discovery |
183
+ | `UNITY_PORT_RANGE_END` | `7899` | End of port scan range |
184
+ | `UNITY_REGISTRY_STALENESS_TIMEOUT` | `300000` | Registry entry staleness timeout in ms (crash detection) |
185
+ | `UNITY_RESPONSE_SOFT_LIMIT` | `2097152` | Response size soft limit in bytes (warning) |
186
+ | `UNITY_RESPONSE_HARD_LIMIT` | `4194304` | Response size hard limit in bytes (truncation) |
187
+ | `UNITY_MCP_DEBUG` | `false` | Enable debug logging for troubleshooting |
188
+
189
+ The Unity plugin also has its own settings accessible via the Dashboard (`Window > MCP Dashboard`) for port, auto-start, and per-category feature toggles.
190
+
191
+ ## Optional Package Support
192
+
193
+ Some tools activate automatically when their packages are detected in the Unity project:
194
+
195
+ | Package / Asset | Features Unlocked |
196
+ |----------------|-------------------|
197
+ | `com.unity.memoryprofiler` | Memory snapshot capture via MemoryProfiler API |
198
+ | `com.unity.shadergraph` | Shader Graph creation, inspection, opening |
199
+ | `com.unity.visualeffectgraph` | VFX Graph listing and opening |
200
+ | `com.unity.inputsystem` | Input Action map and binding inspection |
201
+ | `com.unity.multiplayer.playmode` | MPPM scenario listing, activation, start/stop, player info |
202
+ | Amplify Shader Editor (Asset Store) | Amplify shader listing, inspection, opening |
203
+ | UMA 2 (Asset Store) | UMA SlotDataAsset/OverlayDataAsset creation, WardrobeRecipe pipeline, Global Library management, DCA wardrobe equip/unequip |
204
+
205
+ Features for uninstalled packages return helpful messages explaining what to install.
206
+
207
+ ## Requirements
208
+
209
+ - Node.js 18+
210
+ - Unity Hub (for Hub tools)
211
+ - Unity Editor with [unity-mcp-plugin](https://github.com/AnkleBreaker-Studio/unity-mcp-plugin) installed (for Editor tools)
212
+
213
+ ## Troubleshooting
214
+
215
+ **"Connection failed" errors** — Make sure Unity Editor is open and the plugin is installed. Check the Unity Console for `[MCP Bridge] Server started on port 7890`.
216
+
217
+ **"Unity Hub not found"** — Update `UNITY_HUB_PATH` in your config to match your installation.
218
+
219
+ **"Category disabled" errors** — A feature category may be toggled off. Open `Window > MCP Dashboard` in Unity to check category settings.
220
+
221
+ **Port conflicts** — Change `UNITY_BRIDGE_PORT` in your Claude config and update the port in Unity's MCP Dashboard settings.
222
+
223
+ ## Why AnkleBreaker Unity MCP?
224
+
225
+ AnkleBreaker Unity MCP is the most comprehensive MCP integration for Unity, purpose-built to leverage the full power of **Claude Cowork** and other AI assistants. Here's how it compares to alternatives:
226
+
227
+ ### Feature Comparison
228
+
229
+ | Feature | **AnkleBreaker MCP** | **Bezi** | **Coplay MCP** | **Unity AI** |
230
+ |---------|:-------------------:|:--------:|:--------------:|:------------:|
231
+ | **Total Tools** | **288** | ~30 | 34 | Limited (built-in) |
232
+ | **Feature Categories** | **30+** | ~5 | ~5 | N/A |
233
+ | **Non-Blocking Editor** | ✅ Full background operation | ❌ Freezes Unity during tasks | ✅ | ✅ |
234
+ | **Open Source** | ✅ AnkleBreaker Open License | ❌ Proprietary | ✅ MIT License | ❌ Proprietary |
235
+ | **Claude Cowork Optimized** | ✅ Two-tier lazy loading | ❌ Not MCP-based | ⚠️ Basic | ❌ Not MCP-based |
236
+ | **Multi-Instance Support** | ✅ Auto-discovery | ❌ | ❌ | ❌ |
237
+ | **Multi-Agent Support** | ✅ Session tracking + queuing | ❌ | ❌ | ❌ |
238
+ | **Unity Hub Control** | ✅ Install editors & modules | ❌ | ❌ | ❌ |
239
+ | **Scene Hierarchy** | ✅ Full tree + pagination | ⚠️ Limited | ⚠️ Basic | ⚠️ Limited |
240
+ | **Physics Tools** | ✅ Raycasts, overlap, settings | ❌ | ❌ | ❌ |
241
+ | **Terrain Tools** | ✅ Full terrain pipeline | ❌ | ❌ | ❌ |
242
+ | **Shader Graph** | ✅ Create, inspect, open | ❌ | ❌ | ❌ |
243
+ | **Profiling & Debugging** | ✅ Profiler + Frame Debugger + Memory | ❌ | ❌ | ⚠️ Basic |
244
+ | **Animation System** | ✅ Controllers, clips, parameters | ⚠️ Basic | ⚠️ Basic | ⚠️ Basic |
245
+ | **NavMesh / Navigation** | ✅ Bake, agents, obstacles | ❌ | ❌ | ❌ |
246
+ | **Particle Systems** | ✅ Full module editing | ❌ | ❌ | ❌ |
247
+ | **MPPM Multiplayer** | ✅ Scenarios, start/stop | ❌ | ❌ | ❌ |
248
+ | **Visual Inspection** | ✅ Scene + Game view capture | ❌ | ⚠️ Limited | ❌ |
249
+ | **Play Mode Resilient** | ✅ Survives domain reload | ❌ | ❌ | N/A |
250
+ | **Port Resilience** | ✅ Identity validation + crash detection | ❌ | ❌ | N/A |
251
+ | **Project Context** | ✅ Custom docs for AI agents | ❌ | ❌ | ⚠️ Built-in only |
252
+
253
+ ### Cost Comparison
254
+
255
+ > **AnkleBreaker Unity MCP is completely free and open source.** The prices below reflect only the cost of the AI assistant (Claude) itself — the MCP plugin and server are $0.
256
+
257
+ | Solution | Monthly Cost | What You Get |
258
+ |----------|:----------:|--------------|
259
+ | **AnkleBreaker MCP (free) + Claude Pro** | **$20/mo** | 288 tools, full Unity control, open source — MCP is free, price is Claude only |
260
+ | **AnkleBreaker MCP (free) + Claude Max 5x** | **$100/mo** | Same + 5x usage for heavy workflows — MCP is free, price is Claude only |
261
+ | **AnkleBreaker MCP (free) + Claude Max 20x** | **$200/mo** | Same + 20x usage for teams/studios — MCP is free, price is Claude only |
262
+ | **Bezi Pro** | $20/mo | ~30 tools, 800 credits/mo, freezes Unity |
263
+ | **Bezi Advanced** | $60/mo | ~30 tools, 2400 credits/mo, freezes Unity |
264
+ | **Bezi Team** | $200/mo | 3 seats, 8000 credits, still freezes Unity |
265
+ | **Unity AI** | Included with Unity Pro/Enterprise | Limited AI tools, Unity Points system, no MCP |
266
+ | **Coplay MCP** | Free (beta) | 34 tools, basic categories |
267
+
268
+ ### Key Advantages
269
+
270
+ **vs. Bezi:**
271
+ Bezi runs as a proprietary Unity plugin with its own credit-based billing — $20–$200/mo on top of your AI subscription. It has historically suffered from freezing the Unity Editor during AI tasks, blocking your workflow. AnkleBreaker MCP is completely free and open source, runs entirely in the background with zero editor impact, and offers 8x more tools — the only cost is your existing Claude subscription.
272
+
273
+ **vs. Coplay MCP:**
274
+ Coplay MCP provides 34 tools across ~5 categories. AnkleBreaker MCP delivers 288 tools across 30+ categories including advanced features like physics raycasts, terrain editing, shader graph management, profiling, NavMesh, particle systems, and MPPM multiplayer — none of which exist in Coplay. Our two-tier lazy loading system is specifically optimized for Claude Cowork's tool limits.
275
+
276
+ **vs. Unity AI:**
277
+ Unity AI (successor to Muse) is built into Unity 6.2+ but limited to Unity's own AI models and a credit-based "Unity Points" system. It cannot be used with Claude or any external AI assistant, has no MCP support, and offers a fraction of the automation capabilities. AnkleBreaker MCP works with any MCP-compatible AI while giving you full control over which AI models you use.
278
+
279
+ ## Support the Project
280
+
281
+ If Unity MCP helps your workflow, consider supporting its development! Your support helps fund new features, bug fixes, documentation, and more open-source game dev tools.
282
+
283
+ <a href="https://github.com/sponsors/AnkleBreaker-Studio">
284
+ <img src="https://img.shields.io/badge/Sponsor-GitHub%20Sponsors-ea4aaa?logo=github&style=for-the-badge" alt="GitHub Sponsors" />
285
+ </a>
286
+ <a href="https://www.patreon.com/AnkleBreakerStudio">
287
+ <img src="https://img.shields.io/badge/Support-Patreon-f96854?logo=patreon&style=for-the-badge" alt="Patreon" />
288
+ </a>
289
+
290
+ **Sponsor tiers include priority feature requests** — your ideas get bumped up the roadmap! Check out the tiers on [GitHub Sponsors](https://github.com/sponsors/AnkleBreaker-Studio) or [Patreon](https://www.patreon.com/AnkleBreakerStudio).
291
+
292
+ ## What's New in v2.30.0
293
+
294
+ - **`unity_screenshot_editor_window` tool** — capture any Editor window (Inspector, Project, Console, custom editor windows) to a PNG. Unlike the game/scene capture tools (which render a camera), it grabs the real editor UI via the Win32 `PrintWindow` API, so it works even when the window is hidden behind other windows — no raising or focus-stealing. **Windows editor only**: on macOS/Linux it returns a clear "unsupported platform" message instead of capturing, and the assistant will tell you the feature isn't available on your OS. Defaults to `Assets/Screenshots/`, accepts any user-chosen `.png` path. The assistant only invokes it when you explicitly ask for an editor-window screenshot. Companion to `unity-mcp-plugin` v2.32.0.
295
+
296
+ ## What's New in v2.28.2
297
+
298
+ - **Codex CLI compatibility** — Two diagnostic `console.debug(...)` calls in the bridge were writing to stdout, corrupting the MCP JSON-RPC framing. Strict clients like Codex CLI closed the transport as soon as they hit the non-JSON line; the bug was invisible on Claude Desktop / Claude Code which tolerate the framing violation. Both call sites now log to stderr.
299
+
300
+ ## What's New in v2.28.0
301
+
302
+ - **npm auto-publish** — A GitHub Action now automatically publishes to npm whenever a new GitHub release is created. Contributed by [@vatanaksoytezer](https://github.com/vatanaksoytezer) in [#8](https://github.com/AnkleBreaker-Studio/unity-mcp-server/pull/8).
303
+ - **npm package renamed** — Package renamed from `unity-mcp-server` to `anklebreaker-unity-mcp` to avoid name conflict on npm. Install via `npx anklebreaker-unity-mcp@latest`.
304
+ - **SpriteAtlas tools** — 7 new tools for Unity SpriteAtlas management: create, inspect, add/remove sprites, configure packing & texture settings, delete, and list SpriteAtlases. Contributed by [@zaferdace](https://github.com/zaferdace). Registered as advanced tools accessible via `unity_advanced_tool`.
305
+ - **UTF-8 encoding fix** — Fixed corrupted characters in `unity-editor-bridge.js` comments and section headers.
306
+
307
+ ## What's New in v2.27.0
308
+
309
+ - **UMA (Unity Multipurpose Avatar) integration** — 13 new tools for the complete UMA asset pipeline. Create SlotDataAssets, OverlayDataAssets, and WardrobeRecipes directly from FBX files, equip/unequip wardrobe items on DynamicCharacterAvatar, browse and manage the UMA Global Library, verify recipes for missing references, and more. Requires UMA 2 (available on the Asset Store). Registered as advanced tools accessible via `unity_advanced_tool`.
310
+
311
+ ## What's New in v2.26.0
312
+
313
+ - **Compilation error detection** — New `unity_get_compilation_errors` tool retrieves C# compilation errors and warnings directly from Unity's `CompilationPipeline` API. Unlike `unity_console_log`, this is independent of the console log buffer — not affected by console clear, Play Mode log flooding, or buffer overflow. Supports filtering by severity (`error`, `warning`, `all`) and count limit. Registered as a core tool (always directly accessible, not behind `unity_advanced_tool`).
314
+
315
+ ## What's New in v2.25.0
316
+
317
+ - **Parallel-safe instance routing** — When multiple AI agents (e.g. Claude Cowork tasks) share the same MCP process, each agent can now include a `port` parameter in every `unity_*` tool call to guarantee routing to the correct Unity Editor instance. This prevents cross-agent contamination where one task's `unity_select_instance` could redirect another task's commands to the wrong project.
318
+ - **Per-request port override** — A new stateless routing mechanism bypasses the shared per-agent state entirely. The `port` parameter is extracted by middleware before the tool handler runs, used for routing, then stripped from the args. This is safe because MCP stdio transport processes requests sequentially.
319
+ - **Schema injection** — The optional `port` parameter is automatically injected into every `unity_*` tool schema (except `unity_list_instances`, `unity_select_instance`, and `unity_hub_*`), so AI assistants see it as a legitimate parameter and pass it consistently.
320
+ - **Enhanced select_instance response** — `unity_select_instance` now returns explicit routing instructions telling the AI to include `port` in all subsequent calls.
321
+
322
+ ## Frequently Asked Questions
323
+
324
+ **What is Unity MCP?**
325
+ Unity MCP (Model Context Protocol) is an open-source integration that connects AI assistants like Claude, Cursor, and Windsurf to the Unity Editor and Unity Hub. It allows AI to directly control Unity — creating scenes, placing objects, writing scripts, running builds, profiling, and more — through a standardized protocol.
326
+
327
+ **How does AnkleBreaker Unity MCP compare to other Unity AI tools?**
328
+ AnkleBreaker Unity MCP offers 288 tools across 30+ categories, making it the most comprehensive Unity MCP integration available. Competitors like Bezi (~30 tools) and Coplay MCP (34 tools) cover a fraction of Unity's features. Unlike Bezi, AnkleBreaker MCP is free, open source, and doesn't freeze the Unity Editor during AI operations.
329
+
330
+ **Does it work with Claude Desktop / Claude Cowork?**
331
+ Yes. AnkleBreaker Unity MCP is purpose-built for Claude Desktop and Claude Cowork. It uses a two-tier lazy loading system to stay within MCP client tool limits while exposing all 281 tools on demand.
332
+
333
+ **Does it work with Cursor, Windsurf, or other MCP clients?**
334
+ Yes. Any AI tool that supports the Model Context Protocol can connect to this server. This includes Cursor, Windsurf, Claude Desktop, Claude Cowork, and any other MCP-compatible client.
335
+
336
+ **What Unity versions are supported?**
337
+ Unity 2021.3 LTS and newer, including Unity 2022.3 LTS and Unity 6. The plugin is installed via Unity Package Manager (UPM).
338
+
339
+ **Is it free?**
340
+ Yes. Both the MCP server and the Unity plugin are completely free and open source under the AnkleBreaker Open License. The only cost is your AI assistant subscription (e.g., Claude Pro at $20/month).
341
+
342
+ **Can multiple AI agents use it simultaneously?**
343
+ Yes. The server supports multi-agent operation with session tracking, action logging, and queued execution to prevent conflicts. It also supports multiple Unity Editor instances running side-by-side.
344
+
345
+ **Does it support Amplify Shader Editor?**
346
+ Yes. If Amplify Shader Editor is installed in your project, 23 additional tools are unlocked for full shader graph manipulation — creating nodes, connecting them, setting properties, using templates, and more. Projects without Amplify work perfectly; the tools gracefully report that ASE is not installed.
347
+
348
+ ## Related Projects
349
+
350
+ - **[unity-mcp-plugin](https://github.com/AnkleBreaker-Studio/unity-mcp-plugin)** — The companion Unity Editor plugin (UPM package) that this server connects to
351
+ - **[Model Context Protocol](https://modelcontextprotocol.io)** — The open standard that powers this integration
352
+ - **[Claude Desktop](https://claude.ai/download)** — Anthropic's AI assistant with built-in MCP support
353
+ - **[AnkleBreaker Studio](https://github.com/AnkleBreaker-Studio)** — The game studio behind this project
354
+
355
+ ---
356
+
357
+ <details>
358
+ <summary><strong>Keywords</strong> (for search engines)</summary>
359
+
360
+ Unity MCP, Unity MCP Server, Unity MCP Plugin, Unity AI, AI game development, AI Unity Editor, Claude Unity, Cursor Unity, Windsurf Unity, Model Context Protocol Unity, MCP server Unity, Unity automation, AI-assisted game development, Unity Editor AI control, Unity Hub AI, Unity build automation, Unity scene management AI, Unity GameObject AI, Unity component automation, Shader Graph AI, Amplify Shader Editor AI, Unity terrain AI, Unity NavMesh AI, Unity physics AI, Unity profiler AI, Unity animation AI, MPPM multiplayer AI, Unity MCP integration, free Unity AI tools, open source Unity AI, AnkleBreaker Studio, AnkleBreaker MCP, Unity MCP bridge, Unity Editor plugin MCP, UPM MCP package, AI co-pilot Unity, Unity game dev AI assistant
361
+
362
+ </details>
363
+
364
+ ## License
365
+
366
+ AnkleBreaker Open License v1.0 — see [LICENSE](LICENSE)
367
+
368
+ This license requires: (1) including the copyright notice, (2) displaying **"Made with AnkleBreaker MCP"** (or "Powered by AnkleBreaker MCP") attribution in any product built with it (personal/educational use is exempt), and (3) **reselling the tool is forbidden** — you may not sell, sublicense, or commercially distribute this software or derivatives of it. See the full [LICENSE](LICENSE) for details.
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "unity-mcp": {
4
+ "command": "node",
5
+ "args": ["C:/PATH_TO/unity-mcp-server/src/index.js"],
6
+ "env": {
7
+ "UNITY_HUB_PATH": "C:\\Program Files\\Unity Hub\\Unity Hub.exe",
8
+ "UNITY_BRIDGE_PORT": "7890"
9
+ }
10
+ }
11
+ }
12
+ }
Binary file
Binary file
package/icon.png ADDED
Binary file