@akiojin/unity-mcp-server 2.32.0 → 2.37.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.
Files changed (26) hide show
  1. package/README.md +30 -5
  2. package/package.json +9 -4
  3. package/src/core/config.js +241 -242
  4. package/src/core/projectInfo.js +15 -0
  5. package/src/core/transports/HybridStdioServerTransport.js +78 -75
  6. package/src/handlers/addressables/AddressablesAnalyzeToolHandler.js +45 -47
  7. package/src/handlers/addressables/AddressablesBuildToolHandler.js +32 -33
  8. package/src/handlers/addressables/AddressablesManageToolHandler.js +74 -75
  9. package/src/handlers/component/ComponentFieldSetToolHandler.js +419 -419
  10. package/src/handlers/index.js +437 -437
  11. package/src/handlers/input/InputGamepadToolHandler.js +162 -0
  12. package/src/handlers/input/InputKeyboardToolHandler.js +127 -0
  13. package/src/handlers/input/InputMouseToolHandler.js +188 -0
  14. package/src/handlers/input/InputSystemControlToolHandler.js +63 -64
  15. package/src/handlers/input/InputTouchToolHandler.js +178 -0
  16. package/src/handlers/playmode/PlaymodePlayToolHandler.js +36 -23
  17. package/src/handlers/playmode/PlaymodeStopToolHandler.js +32 -21
  18. package/src/handlers/test/TestGetStatusToolHandler.js +37 -10
  19. package/src/handlers/test/TestRunToolHandler.js +36 -35
  20. package/src/lsp/LspProcessManager.js +18 -12
  21. package/src/utils/editorState.js +42 -0
  22. package/src/utils/testResultsCache.js +70 -0
  23. package/src/handlers/input/InputGamepadSimulateToolHandler.js +0 -116
  24. package/src/handlers/input/InputKeyboardSimulateToolHandler.js +0 -79
  25. package/src/handlers/input/InputMouseSimulateToolHandler.js +0 -107
  26. package/src/handlers/input/InputTouchSimulateToolHandler.js +0 -142
package/README.md CHANGED
@@ -100,11 +100,13 @@ Add to your `claude_desktop_config.json`:
100
100
  ## Available Tools (Standardized Names)
101
101
 
102
102
  ### System & Core Tools
103
+
103
104
  - `system_ping` — Test connection to Unity Editor and verify server status
104
105
  - `system_refresh_assets` — Refresh Unity assets and trigger recompilation
105
106
  - `system_get_command_stats` — Retrieve recent MCP command usage metrics
106
107
 
107
108
  ### GameObject Management
109
+
108
110
  - `gameobject_create` — Create GameObjects with primitives, transforms, tags, and layers
109
111
  - `gameobject_find` — Find GameObjects by name, tag, or layer with pattern matching
110
112
  - `gameobject_modify` — Modify GameObject properties (transform, name, active state, parent)
@@ -112,6 +114,7 @@ Add to your `claude_desktop_config.json`:
112
114
  - `gameobject_get_hierarchy` — Inspect scene hierarchy with component details
113
115
 
114
116
  ### Component System
117
+
115
118
  - `component_add` — Add Unity components to GameObjects with initial properties
116
119
  - `component_remove` — Remove components from GameObjects with safety checks
117
120
  - `component_modify` — Modify component properties with nested support
@@ -120,6 +123,7 @@ Add to your `claude_desktop_config.json`:
120
123
  - `component_get_types` — Discover available component types with filtering
121
124
 
122
125
  ### Scene Management
126
+
123
127
  - `scene_create` — Create new scenes with build-settings integration
124
128
  - `scene_load` — Load scenes in Single or Additive mode
125
129
  - `scene_save` — Save the active scene (supports Save As)
@@ -127,6 +131,7 @@ Add to your `claude_desktop_config.json`:
127
131
  - `scene_info_get` — Retrieve detailed scene information including GameObject counts
128
132
 
129
133
  ### Analysis & Diagnostics
134
+
130
135
  - `analysis_scene_contents_analyze` — Gather scene statistics and performance metrics
131
136
  - `analysis_component_find` — Locate GameObjects by component type with scope filtering
132
137
  - `analysis_component_values_get` — Inspect component properties and values
@@ -136,6 +141,7 @@ Add to your `claude_desktop_config.json`:
136
141
  - `analysis_animator_runtime_info_get` — Retrieve runtime Animator diagnostics (Play Mode)
137
142
 
138
143
  ### Asset Management
144
+
139
145
  - `asset_prefab_create` — Create prefabs from GameObjects or blank templates
140
146
  - `asset_prefab_instantiate` — Instantiate prefabs with custom transforms
141
147
  - `asset_prefab_modify` — Apply property overrides to existing prefabs
@@ -149,6 +155,7 @@ Add to your `claude_desktop_config.json`:
149
155
  - `asset_dependency_analyze` — Audit asset dependencies and identify unused assets
150
156
 
151
157
  ### Script & Code Tools
158
+
152
159
  - `script_read` — Read script file contents with syntax-aware formatting
153
160
  - `script_search` — Search C# sources by substring/regex/glob filters
154
161
  - `script_symbols_get` — Enumerate symbols within a specific C# file
@@ -163,10 +170,12 @@ Add to your `claude_desktop_config.json`:
163
170
  - `code_index_status` — Report status of the persistent code index
164
171
 
165
172
  ### Code Index Utilities
173
+
166
174
  - `code_index_build` — フルスキャンでシンボルインデックスを再構築(開発時は `delayStartMs` や `throttleMs` で進捗観測用に速度調整可能)
167
175
  - `code_index_update` — 変更した C# ファイルのみ差分再インデックス
168
176
 
169
177
  ### Play Mode Controls
178
+
170
179
  - `playmode_play` — Enter Play Mode
171
180
  - `playmode_pause` — Pause or resume Play Mode
172
181
  - `playmode_stop` — Exit Play Mode back to Edit Mode
@@ -174,6 +183,7 @@ Add to your `claude_desktop_config.json`:
174
183
  - `playmode_wait_for_state` — Await a target play/edit state
175
184
 
176
185
  ### UI Automation
186
+
177
187
  - `ui_find_elements` — Locate UI elements by type, tag, or name
178
188
  - `ui_click_element` — Simulate clicking UI buttons, toggles, etc.
179
189
  - `ui_get_element_state` — Inspect UI element properties and interactability
@@ -181,11 +191,18 @@ Add to your `claude_desktop_config.json`:
181
191
  - `ui_simulate_input` — Execute complex multi-step UI interaction sequences
182
192
 
183
193
  ### Input System Utilities
194
+
184
195
  - `input_system_control` — Dispatch keyboard/mouse/gamepad/touch operations
185
- - `input_keyboard_simulate` — Simulate keyboard input with combos or text
186
- - `input_mouse_simulate` — Simulate mouse movement, clicks, drags, and scrolling
187
- - `input_gamepad_simulate` — Simulate gamepad buttons, sticks, and triggers
188
- - `input_touch_simulate` — Simulate touch gestures (tap, swipe, pinch)
196
+ - `input_keyboard` — Keyboard input with batching, combos, typing, and auto-hold durations
197
+ - `input_mouse` — Mouse movement, clicks, drags, per-button press/hold, and batching
198
+ - `input_gamepad` — Gamepad buttons, sticks, triggers, d-pad with batching and timed holds
199
+ - `input_touch` — Touch gestures (tap/swipe/pinch/multi) with batched steps
200
+
201
+ #### 同時押下とホールドの扱い
202
+
203
+ - **単一アクションで同時押下**: キーボードは `action:"combo"`、タッチは `action:"multi"`、ゲームパッドのスティックは `action:"stick"` で X/Y を同時指定できます。
204
+ - **`actions[]` バッチ**: 異なるボタンやデバイスを同一フレームで実行したい場合は `actions:[{...},{...}]` に並べて送信します(順番を保持)。
205
+ - **ホールド時間**: `holdSeconds` を press/button/trigger などに付与すると、その秒数後に自動で release/state reset がスケジュールされます。省略すると押下状態が維持されるので、手動で release アクションを送ってください。
189
206
  - `input_action_add` — Add actions to an Input Action map
190
207
  - `input_action_remove` — Remove actions from an Input Action map
191
208
  - `input_action_map_create` — Create new Input Action maps
@@ -199,6 +216,7 @@ Add to your `claude_desktop_config.json`:
199
216
  - `input_actions_asset_analyze` — Produce structured summaries of Input Actions assets
200
217
 
201
218
  ### Editor & Console Utilities
219
+
202
220
  - `menu_item_execute` — Trigger Unity Editor menu items programmatically
203
221
  - `console_clear` — Clear Unity console logs with filtering options
204
222
  - `console_read` — Stream Unity console output with advanced filters
@@ -210,12 +228,14 @@ Add to your `claude_desktop_config.json`:
210
228
  - `compilation_get_state` — Inspect current compilation state and errors
211
229
 
212
230
  ### Project Settings & Packages
231
+
213
232
  - `settings_get` — Read Unity project settings with granular control
214
233
  - `settings_update` — Safely update project settings (requires confirmation)
215
234
  - `package_manage` — List or manage Unity packages via Package Manager
216
235
  - `package_registry_config` — Configure package registries/scopes
217
236
 
218
237
  ### Asset Visualization & Capture
238
+
219
239
  - `screenshot_capture` — Capture Game/Scene view screenshots
220
240
  - `screenshot_analyze` — Run image analysis on captured screenshots
221
241
  - `video_capture_start` — Begin recording the Game view to video
@@ -224,8 +244,11 @@ Add to your `claude_desktop_config.json`:
224
244
  - `video_capture_for` — Record for a fixed duration before auto-stop
225
245
 
226
246
  ### Testing & Diagnostics
247
+
227
248
  - `test_run` — Run Unity tests (EditMode/PlayMode)
228
- - `test_get_status` — Query test runner progress/results
249
+ - `test_get_status` — Query Unity Test Runner progress/results. Parameters:
250
+ - `includeTestResults` (bool, default `false`): attaches the latest exported `.unity/test-results/*.json` summary to the response when a test run has completed.
251
+ - `includeFileContent` (bool, default `false`): when combined with `includeTestResults`, also returns the JSON file contents as a string so agents can parse the detailed per-test data without reading the file directly.
229
252
 
230
253
  ## Requirements
231
254
 
@@ -236,11 +259,13 @@ Add to your `claude_desktop_config.json`:
236
259
  ## Troubleshooting
237
260
 
238
261
  ### Connection Issues
262
+
239
263
  1. Ensure Unity Editor is running with the Unity package installed
240
264
  2. Check Unity console for connection messages
241
265
  3. Verify port 6400 is not blocked by firewall
242
266
 
243
267
  ### Installation Issues
268
+
244
269
  ```bash
245
270
  # Clear npm cache
246
271
  npm cache clean --force
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akiojin/unity-mcp-server",
3
- "version": "2.32.0",
3
+ "version": "2.37.0",
4
4
  "description": "MCP server and Unity Editor bridge — enables AI assistants to control Unity for AI-assisted workflows",
5
5
  "type": "module",
6
6
  "main": "src/core/server.js",
@@ -26,11 +26,11 @@
26
26
  "simulate:code-index": "node scripts/simulate-code-index-status.mjs",
27
27
  "test:verbose": "VERBOSE_TEST=true node --test tests/**/*.test.js",
28
28
  "prepare": "cd .. && husky || true",
29
- "prepublishOnly": "npm run test:ci",
29
+ "prepublishOnly": "pnpm run test:ci",
30
30
  "postinstall": "chmod +x bin/unity-mcp-server || true",
31
31
  "test:ci:unity": "timeout 60 node --test tests/unit/core/codeIndex.test.js tests/unit/core/codeIndexDb.test.js tests/unit/core/config.test.js tests/unit/core/indexWatcher.test.js tests/unit/core/projectInfo.test.js tests/unit/core/server.test.js || exit 0",
32
32
  "test:unity": "node tests/run-unity-integration.mjs",
33
- "test:nounity": "npm run test:integration",
33
+ "test:nounity": "pnpm run test:integration",
34
34
  "test:ci:integration": "CI=true NODE_ENV=test node --test tests/integration/code-index-background.test.js"
35
35
  },
36
36
  "keywords": [
@@ -53,13 +53,18 @@
53
53
  "find-up": "^6.3.0"
54
54
  },
55
55
  "engines": {
56
- "node": ">=18 <21"
56
+ "node": ">=18 <23"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",
60
60
  "url": "https://github.com/akiojin/unity-mcp-server.git",
61
61
  "directory": "mcp-server"
62
62
  },
63
+ "pnpm": {
64
+ "onlyBuiltDependencies": [
65
+ "better-sqlite3"
66
+ ]
67
+ },
63
68
  "homepage": "https://github.com/akiojin/unity-mcp-server#readme",
64
69
  "bugs": {
65
70
  "url": "https://github.com/akiojin/unity-mcp-server/issues"