@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
@@ -1,437 +1,437 @@
1
- /**
2
- * Central export and registration for all tool handlers
3
- */
4
-
5
- // Export all handlers
6
- // Deprecated Unity-communication handlers removed: ScriptEditPatchToolHandler, ScriptReplacePatternToolHandler
7
- // Script tool registry
8
-
9
- // Import all handler classes at once
10
- import { SystemPingToolHandler } from './system/SystemPingToolHandler.js'
11
- import { SystemRefreshAssetsToolHandler } from './system/SystemRefreshAssetsToolHandler.js'
12
- import { SystemGetCommandStatsToolHandler } from './system/SystemGetCommandStatsToolHandler.js'
13
- import { GameObjectCreateToolHandler } from './gameobject/GameObjectCreateToolHandler.js'
14
- import { GameObjectFindToolHandler } from './gameobject/GameObjectFindToolHandler.js'
15
- import { GameObjectModifyToolHandler } from './gameobject/GameObjectModifyToolHandler.js'
16
- import { GameObjectDeleteToolHandler } from './gameobject/GameObjectDeleteToolHandler.js'
17
- import { GameObjectGetHierarchyToolHandler } from './gameobject/GameObjectGetHierarchyToolHandler.js'
18
- import { SceneCreateToolHandler } from './scene/SceneCreateToolHandler.js'
19
- import { SceneLoadToolHandler } from './scene/SceneLoadToolHandler.js'
20
- import { SceneSaveToolHandler } from './scene/SceneSaveToolHandler.js'
21
- import { SceneListToolHandler } from './scene/SceneListToolHandler.js'
22
- import { GetSceneInfoToolHandler } from './scene/GetSceneInfoToolHandler.js'
23
- import { GetGameObjectDetailsToolHandler } from './analysis/GetGameObjectDetailsToolHandler.js'
24
- import { AnalyzeSceneContentsToolHandler } from './analysis/AnalyzeSceneContentsToolHandler.js'
25
- import { GetComponentValuesToolHandler } from './analysis/GetComponentValuesToolHandler.js'
26
- import { FindByComponentToolHandler } from './analysis/FindByComponentToolHandler.js'
27
- import { GetObjectReferencesToolHandler } from './analysis/GetObjectReferencesToolHandler.js'
28
- import {
29
- GetAnimatorStateToolHandler,
30
- GetAnimatorRuntimeInfoToolHandler
31
- } from './analysis/GetAnimatorStateToolHandler.js'
32
- import {
33
- GetInputActionsStateToolHandler,
34
- AnalyzeInputActionsAssetToolHandler
35
- } from './analysis/GetInputActionsStateToolHandler.js'
36
- import { PlaymodePlayToolHandler } from './playmode/PlaymodePlayToolHandler.js'
37
- import { PlaymodePauseToolHandler } from './playmode/PlaymodePauseToolHandler.js'
38
- import { PlaymodeStopToolHandler } from './playmode/PlaymodeStopToolHandler.js'
39
- import { PlaymodeGetStateToolHandler } from './playmode/PlaymodeGetStateToolHandler.js'
40
- import { PlaymodeWaitForStateToolHandler } from './playmode/PlaymodeWaitForStateToolHandler.js'
41
- import { UIFindElementsToolHandler } from './ui/UIFindElementsToolHandler.js'
42
- import { UIClickElementToolHandler } from './ui/UIClickElementToolHandler.js'
43
- import { UIGetElementStateToolHandler } from './ui/UIGetElementStateToolHandler.js'
44
- import { UISetElementValueToolHandler } from './ui/UISetElementValueToolHandler.js'
45
- import { UISimulateInputToolHandler } from './ui/UISimulateInputToolHandler.js'
46
- import { InputSystemControlToolHandler } from './input/InputSystemControlToolHandler.js'
47
- import { InputKeyboardSimulateToolHandler } from './input/InputKeyboardSimulateToolHandler.js'
48
- import { InputMouseSimulateToolHandler } from './input/InputMouseSimulateToolHandler.js'
49
- import { InputGamepadSimulateToolHandler } from './input/InputGamepadSimulateToolHandler.js'
50
- import { InputTouchSimulateToolHandler } from './input/InputTouchSimulateToolHandler.js'
51
- import { InputActionMapCreateToolHandler } from './input/InputActionMapCreateToolHandler.js'
52
- import { InputActionMapRemoveToolHandler } from './input/InputActionMapRemoveToolHandler.js'
53
- import { InputActionAddToolHandler } from './input/InputActionAddToolHandler.js'
54
- import { InputActionRemoveToolHandler } from './input/InputActionRemoveToolHandler.js'
55
- import { InputBindingAddToolHandler } from './input/InputBindingAddToolHandler.js'
56
- import { InputBindingRemoveToolHandler } from './input/InputBindingRemoveToolHandler.js'
57
- import { InputBindingRemoveAllToolHandler } from './input/InputBindingRemoveAllToolHandler.js'
58
- import { InputBindingCompositeCreateToolHandler } from './input/InputBindingCompositeCreateToolHandler.js'
59
- import { InputControlSchemesManageToolHandler } from './input/InputControlSchemesManageToolHandler.js'
60
- import { AssetPrefabCreateToolHandler } from './asset/AssetPrefabCreateToolHandler.js'
61
- import { AssetPrefabModifyToolHandler } from './asset/AssetPrefabModifyToolHandler.js'
62
- import { AssetPrefabInstantiateToolHandler } from './asset/AssetPrefabInstantiateToolHandler.js'
63
- import { AssetMaterialCreateToolHandler } from './asset/AssetMaterialCreateToolHandler.js'
64
- import { AssetMaterialModifyToolHandler } from './asset/AssetMaterialModifyToolHandler.js'
65
- import { AssetPrefabOpenToolHandler } from './asset/AssetPrefabOpenToolHandler.js'
66
- import { AssetPrefabExitModeToolHandler } from './asset/AssetPrefabExitModeToolHandler.js'
67
- import { AssetPrefabSaveToolHandler } from './asset/AssetPrefabSaveToolHandler.js'
68
- import { AssetImportSettingsManageToolHandler } from './asset/AssetImportSettingsManageToolHandler.js'
69
- import { AssetDatabaseManageToolHandler } from './asset/AssetDatabaseManageToolHandler.js'
70
- import { AssetDependencyAnalyzeToolHandler } from './asset/AssetDependencyAnalyzeToolHandler.js'
71
- import AddressablesManageToolHandler from './addressables/AddressablesManageToolHandler.js'
72
- import AddressablesBuildToolHandler from './addressables/AddressablesBuildToolHandler.js'
73
- import AddressablesAnalyzeToolHandler from './addressables/AddressablesAnalyzeToolHandler.js'
74
- import { MenuItemExecuteToolHandler } from './menu/MenuItemExecuteToolHandler.js'
75
- import { ConsoleClearToolHandler } from './console/ConsoleClearToolHandler.js'
76
- import { ConsoleReadToolHandler } from './console/ConsoleReadToolHandler.js'
77
- import { ScreenshotCaptureToolHandler } from './screenshot/ScreenshotCaptureToolHandler.js'
78
- import { ScreenshotAnalyzeToolHandler } from './screenshot/ScreenshotAnalyzeToolHandler.js'
79
- import { VideoCaptureStartToolHandler } from './video/VideoCaptureStartToolHandler.js'
80
- import { VideoCaptureStopToolHandler } from './video/VideoCaptureStopToolHandler.js'
81
- import { VideoCaptureStatusToolHandler } from './video/VideoCaptureStatusToolHandler.js'
82
- import { VideoCaptureForToolHandler } from './video/VideoCaptureForToolHandler.js'
83
- import { ComponentAddToolHandler } from './component/ComponentAddToolHandler.js'
84
- import { ComponentRemoveToolHandler } from './component/ComponentRemoveToolHandler.js'
85
- import { ComponentModifyToolHandler } from './component/ComponentModifyToolHandler.js'
86
- import { ComponentListToolHandler } from './component/ComponentListToolHandler.js'
87
- import { ComponentGetTypesToolHandler } from './component/ComponentGetTypesToolHandler.js'
88
- import { ComponentFieldSetToolHandler } from './component/ComponentFieldSetToolHandler.js'
89
- import { CompilationGetStateToolHandler } from './compilation/CompilationGetStateToolHandler.js'
90
- import { TestRunToolHandler } from './test/TestRunToolHandler.js'
91
- import { TestGetStatusToolHandler } from './test/TestGetStatusToolHandler.js'
92
- import { EditorTagsManageToolHandler } from './editor/EditorTagsManageToolHandler.js'
93
- import { EditorLayersManageToolHandler } from './editor/EditorLayersManageToolHandler.js'
94
- import { EditorSelectionManageToolHandler } from './editor/EditorSelectionManageToolHandler.js'
95
- import { EditorWindowsManageToolHandler } from './editor/EditorWindowsManageToolHandler.js'
96
- import { EditorToolsManageToolHandler } from './editor/EditorToolsManageToolHandler.js'
97
- import { SettingsGetToolHandler } from './settings/SettingsGetToolHandler.js'
98
- import { SettingsUpdateToolHandler } from './settings/SettingsUpdateToolHandler.js'
99
- import PackageManagerToolHandler from './package/PackageManagerToolHandler.js'
100
- import RegistryConfigToolHandler from './package/RegistryConfigToolHandler.js'
101
- import { ScriptPackagesListToolHandler } from './script/ScriptPackagesListToolHandler.js'
102
- import { ScriptReadToolHandler } from './script/ScriptReadToolHandler.js'
103
- import { ScriptSearchToolHandler } from './script/ScriptSearchToolHandler.js'
104
- import { ScriptEditStructuredToolHandler } from './script/ScriptEditStructuredToolHandler.js'
105
- import { ScriptEditSnippetToolHandler } from './script/ScriptEditSnippetToolHandler.js'
106
- import { ScriptSymbolsGetToolHandler } from './script/ScriptSymbolsGetToolHandler.js'
107
- import { ScriptSymbolFindToolHandler } from './script/ScriptSymbolFindToolHandler.js'
108
- import { ScriptRefsFindToolHandler } from './script/ScriptRefsFindToolHandler.js'
109
- import { CodeIndexStatusToolHandler } from './script/CodeIndexStatusToolHandler.js'
110
- import { ScriptRefactorRenameToolHandler } from './script/ScriptRefactorRenameToolHandler.js'
111
- import { ScriptCreateClassToolHandler } from './script/ScriptCreateClassToolHandler.js'
112
- import { ScriptRemoveSymbolToolHandler } from './script/ScriptRemoveSymbolToolHandler.js'
113
- import { CodeIndexUpdateToolHandler } from './script/CodeIndexUpdateToolHandler.js'
114
- import { CodeIndexBuildToolHandler } from './script/CodeIndexBuildToolHandler.js'
115
- export { BaseToolHandler } from './base/BaseToolHandler.js'
116
-
117
- // System handlers
118
- export { SystemPingToolHandler } from './system/SystemPingToolHandler.js'
119
- export { SystemRefreshAssetsToolHandler } from './system/SystemRefreshAssetsToolHandler.js'
120
- export { SystemGetCommandStatsToolHandler } from './system/SystemGetCommandStatsToolHandler.js'
121
-
122
- // GameObject handlers
123
- export { GameObjectCreateToolHandler } from './gameobject/GameObjectCreateToolHandler.js'
124
- export { GameObjectFindToolHandler } from './gameobject/GameObjectFindToolHandler.js'
125
- export { GameObjectModifyToolHandler } from './gameobject/GameObjectModifyToolHandler.js'
126
- export { GameObjectDeleteToolHandler } from './gameobject/GameObjectDeleteToolHandler.js'
127
- export { GameObjectGetHierarchyToolHandler } from './gameobject/GameObjectGetHierarchyToolHandler.js'
128
-
129
- // Scene handlers
130
- export { SceneCreateToolHandler } from './scene/SceneCreateToolHandler.js'
131
- export { SceneLoadToolHandler } from './scene/SceneLoadToolHandler.js'
132
- export { SceneSaveToolHandler } from './scene/SceneSaveToolHandler.js'
133
- export { SceneListToolHandler } from './scene/SceneListToolHandler.js'
134
- export { GetSceneInfoToolHandler } from './scene/GetSceneInfoToolHandler.js'
135
-
136
- // Analysis handlers
137
- export { GetGameObjectDetailsToolHandler } from './analysis/GetGameObjectDetailsToolHandler.js'
138
- export { AnalyzeSceneContentsToolHandler } from './analysis/AnalyzeSceneContentsToolHandler.js'
139
- export { GetComponentValuesToolHandler } from './analysis/GetComponentValuesToolHandler.js'
140
- export { FindByComponentToolHandler } from './analysis/FindByComponentToolHandler.js'
141
- export { GetObjectReferencesToolHandler } from './analysis/GetObjectReferencesToolHandler.js'
142
- export {
143
- GetAnimatorStateToolHandler,
144
- GetAnimatorRuntimeInfoToolHandler
145
- } from './analysis/GetAnimatorStateToolHandler.js'
146
- export {
147
- GetInputActionsStateToolHandler,
148
- AnalyzeInputActionsAssetToolHandler
149
- } from './analysis/GetInputActionsStateToolHandler.js'
150
-
151
- // PlayMode handlers
152
- export { PlaymodePlayToolHandler } from './playmode/PlaymodePlayToolHandler.js'
153
- export { PlaymodePauseToolHandler } from './playmode/PlaymodePauseToolHandler.js'
154
- export { PlaymodeStopToolHandler } from './playmode/PlaymodeStopToolHandler.js'
155
- export { PlaymodeGetStateToolHandler } from './playmode/PlaymodeGetStateToolHandler.js'
156
- export { PlaymodeWaitForStateToolHandler } from './playmode/PlaymodeWaitForStateToolHandler.js'
157
-
158
- // UI handlers
159
- export { UIFindElementsToolHandler } from './ui/UIFindElementsToolHandler.js'
160
- export { UIClickElementToolHandler } from './ui/UIClickElementToolHandler.js'
161
- export { UIGetElementStateToolHandler } from './ui/UIGetElementStateToolHandler.js'
162
- export { UISetElementValueToolHandler } from './ui/UISetElementValueToolHandler.js'
163
- export { UISimulateInputToolHandler } from './ui/UISimulateInputToolHandler.js'
164
-
165
- // Input System handlers
166
- export { InputSystemControlToolHandler } from './input/InputSystemControlToolHandler.js'
167
- export { InputKeyboardSimulateToolHandler } from './input/InputKeyboardSimulateToolHandler.js'
168
- export { InputMouseSimulateToolHandler } from './input/InputMouseSimulateToolHandler.js'
169
- export { InputGamepadSimulateToolHandler } from './input/InputGamepadSimulateToolHandler.js'
170
- export { InputTouchSimulateToolHandler } from './input/InputTouchSimulateToolHandler.js'
171
- export { InputActionMapCreateToolHandler } from './input/InputActionMapCreateToolHandler.js'
172
- export { InputActionMapRemoveToolHandler } from './input/InputActionMapRemoveToolHandler.js'
173
- export { InputActionAddToolHandler } from './input/InputActionAddToolHandler.js'
174
- export { InputActionRemoveToolHandler } from './input/InputActionRemoveToolHandler.js'
175
- export { InputBindingAddToolHandler } from './input/InputBindingAddToolHandler.js'
176
- export { InputBindingRemoveToolHandler } from './input/InputBindingRemoveToolHandler.js'
177
- export { InputBindingRemoveAllToolHandler } from './input/InputBindingRemoveAllToolHandler.js'
178
- export { InputBindingCompositeCreateToolHandler } from './input/InputBindingCompositeCreateToolHandler.js'
179
- export { InputControlSchemesManageToolHandler } from './input/InputControlSchemesManageToolHandler.js'
180
-
181
- // Asset handlers
182
- export { AssetPrefabCreateToolHandler } from './asset/AssetPrefabCreateToolHandler.js'
183
- export { AssetPrefabModifyToolHandler } from './asset/AssetPrefabModifyToolHandler.js'
184
- export { AssetPrefabInstantiateToolHandler } from './asset/AssetPrefabInstantiateToolHandler.js'
185
- export { AssetMaterialCreateToolHandler } from './asset/AssetMaterialCreateToolHandler.js'
186
- export { AssetMaterialModifyToolHandler } from './asset/AssetMaterialModifyToolHandler.js'
187
- export { AssetPrefabOpenToolHandler } from './asset/AssetPrefabOpenToolHandler.js'
188
- export { AssetPrefabExitModeToolHandler } from './asset/AssetPrefabExitModeToolHandler.js'
189
- export { AssetPrefabSaveToolHandler } from './asset/AssetPrefabSaveToolHandler.js'
190
- export { AssetImportSettingsManageToolHandler } from './asset/AssetImportSettingsManageToolHandler.js'
191
- export { AssetDatabaseManageToolHandler } from './asset/AssetDatabaseManageToolHandler.js'
192
- export { AssetDependencyAnalyzeToolHandler } from './asset/AssetDependencyAnalyzeToolHandler.js'
193
-
194
- // Addressables handlers
195
- export { default as AddressablesManageToolHandler } from './addressables/AddressablesManageToolHandler.js'
196
- export { default as AddressablesBuildToolHandler } from './addressables/AddressablesBuildToolHandler.js'
197
- export { default as AddressablesAnalyzeToolHandler } from './addressables/AddressablesAnalyzeToolHandler.js'
198
-
199
- // Menu handlers
200
- export { MenuItemExecuteToolHandler } from './menu/MenuItemExecuteToolHandler.js'
201
-
202
- // Console handlers
203
- export { ConsoleClearToolHandler } from './console/ConsoleClearToolHandler.js'
204
- export { ConsoleReadToolHandler } from './console/ConsoleReadToolHandler.js'
205
-
206
- // Screenshot handlers
207
- export { ScreenshotCaptureToolHandler } from './screenshot/ScreenshotCaptureToolHandler.js'
208
- export { ScreenshotAnalyzeToolHandler } from './screenshot/ScreenshotAnalyzeToolHandler.js'
209
-
210
- // Video handlers
211
- export { VideoCaptureStartToolHandler } from './video/VideoCaptureStartToolHandler.js'
212
- export { VideoCaptureStopToolHandler } from './video/VideoCaptureStopToolHandler.js'
213
- export { VideoCaptureStatusToolHandler } from './video/VideoCaptureStatusToolHandler.js'
214
- export { VideoCaptureForToolHandler } from './video/VideoCaptureForToolHandler.js'
215
-
216
- // Component handlers
217
- export { ComponentAddToolHandler } from './component/ComponentAddToolHandler.js'
218
- export { ComponentRemoveToolHandler } from './component/ComponentRemoveToolHandler.js'
219
- export { ComponentModifyToolHandler } from './component/ComponentModifyToolHandler.js'
220
- export { ComponentListToolHandler } from './component/ComponentListToolHandler.js'
221
- export { ComponentGetTypesToolHandler } from './component/ComponentGetTypesToolHandler.js'
222
- export { ComponentFieldSetToolHandler } from './component/ComponentFieldSetToolHandler.js'
223
-
224
- // Compilation handlers
225
- export { CompilationGetStateToolHandler } from './compilation/CompilationGetStateToolHandler.js'
226
-
227
- // Test handlers
228
- export { TestRunToolHandler } from './test/TestRunToolHandler.js'
229
- export { TestGetStatusToolHandler } from './test/TestGetStatusToolHandler.js'
230
-
231
- // Editor control handlers
232
- export { EditorTagsManageToolHandler } from './editor/EditorTagsManageToolHandler.js'
233
- export { EditorLayersManageToolHandler } from './editor/EditorLayersManageToolHandler.js'
234
- export { EditorSelectionManageToolHandler } from './editor/EditorSelectionManageToolHandler.js'
235
- export { EditorWindowsManageToolHandler } from './editor/EditorWindowsManageToolHandler.js'
236
- export { EditorToolsManageToolHandler } from './editor/EditorToolsManageToolHandler.js'
237
-
238
- // Settings handlers
239
- export { SettingsGetToolHandler } from './settings/SettingsGetToolHandler.js'
240
- export { SettingsUpdateToolHandler } from './settings/SettingsUpdateToolHandler.js'
241
-
242
- // Package management handlers
243
- export { default as PackageManagerToolHandler } from './package/PackageManagerToolHandler.js'
244
- export { default as RegistryConfigToolHandler } from './package/RegistryConfigToolHandler.js'
245
-
246
- // Script handlers
247
- export { ScriptPackagesListToolHandler } from './script/ScriptPackagesListToolHandler.js'
248
- export { ScriptReadToolHandler } from './script/ScriptReadToolHandler.js'
249
- export { ScriptSearchToolHandler } from './script/ScriptSearchToolHandler.js'
250
- export { ScriptEditStructuredToolHandler } from './script/ScriptEditStructuredToolHandler.js'
251
- export { ScriptEditSnippetToolHandler } from './script/ScriptEditSnippetToolHandler.js'
252
- export { ScriptRefsFindToolHandler } from './script/ScriptRefsFindToolHandler.js'
253
- export { ScriptSymbolFindToolHandler } from './script/ScriptSymbolFindToolHandler.js'
254
- export { ScriptSymbolsGetToolHandler } from './script/ScriptSymbolsGetToolHandler.js'
255
- export { CodeIndexStatusToolHandler } from './script/CodeIndexStatusToolHandler.js'
256
- export { ScriptRefactorRenameToolHandler } from './script/ScriptRefactorRenameToolHandler.js'
257
- export { ScriptCreateClassToolHandler } from './script/ScriptCreateClassToolHandler.js'
258
- export { ScriptRemoveSymbolToolHandler } from './script/ScriptRemoveSymbolToolHandler.js'
259
- export { CodeIndexUpdateToolHandler } from './script/CodeIndexUpdateToolHandler.js'
260
- export { CodeIndexBuildToolHandler } from './script/CodeIndexBuildToolHandler.js'
261
- // Roslyn (external CLI) tool handlers removed(内部ユーティリティのみ存続)
262
-
263
- // Handler registry - single source of truth
264
- const HANDLER_CLASSES = [
265
- // System handlers
266
- SystemPingToolHandler,
267
- SystemRefreshAssetsToolHandler,
268
- SystemGetCommandStatsToolHandler,
269
-
270
- // GameObject handlers
271
- GameObjectCreateToolHandler,
272
- GameObjectFindToolHandler,
273
- GameObjectModifyToolHandler,
274
- GameObjectDeleteToolHandler,
275
- GameObjectGetHierarchyToolHandler,
276
-
277
- // Scene handlers
278
- SceneCreateToolHandler,
279
- SceneLoadToolHandler,
280
- SceneSaveToolHandler,
281
- SceneListToolHandler,
282
- GetSceneInfoToolHandler,
283
-
284
- // Analysis handlers
285
- GetGameObjectDetailsToolHandler,
286
- AnalyzeSceneContentsToolHandler,
287
- GetComponentValuesToolHandler,
288
- FindByComponentToolHandler,
289
- GetObjectReferencesToolHandler,
290
- GetAnimatorStateToolHandler,
291
- GetAnimatorRuntimeInfoToolHandler,
292
- GetInputActionsStateToolHandler,
293
- AnalyzeInputActionsAssetToolHandler,
294
-
295
- // PlayMode handlers
296
- PlaymodePlayToolHandler,
297
- PlaymodePauseToolHandler,
298
- PlaymodeStopToolHandler,
299
- PlaymodeGetStateToolHandler,
300
- PlaymodeWaitForStateToolHandler,
301
-
302
- // UI handlers
303
- UIFindElementsToolHandler,
304
- UIClickElementToolHandler,
305
- UIGetElementStateToolHandler,
306
- UISetElementValueToolHandler,
307
- UISimulateInputToolHandler,
308
-
309
- // Input System handlers
310
- InputSystemControlToolHandler,
311
- InputKeyboardSimulateToolHandler,
312
- InputMouseSimulateToolHandler,
313
- InputGamepadSimulateToolHandler,
314
- InputTouchSimulateToolHandler,
315
- InputActionMapCreateToolHandler,
316
- InputActionMapRemoveToolHandler,
317
- InputActionAddToolHandler,
318
- InputActionRemoveToolHandler,
319
- InputBindingAddToolHandler,
320
- InputBindingRemoveToolHandler,
321
- InputBindingRemoveAllToolHandler,
322
- InputBindingCompositeCreateToolHandler,
323
- InputControlSchemesManageToolHandler,
324
-
325
- // Asset handlers
326
- AssetPrefabCreateToolHandler,
327
- AssetPrefabModifyToolHandler,
328
- AssetPrefabInstantiateToolHandler,
329
- AssetMaterialCreateToolHandler,
330
- AssetMaterialModifyToolHandler,
331
- AssetPrefabOpenToolHandler,
332
- AssetPrefabExitModeToolHandler,
333
- AssetPrefabSaveToolHandler,
334
- AssetImportSettingsManageToolHandler,
335
- AssetDatabaseManageToolHandler,
336
- AssetDependencyAnalyzeToolHandler,
337
-
338
- // Addressables handlers
339
- AddressablesManageToolHandler,
340
- AddressablesBuildToolHandler,
341
- AddressablesAnalyzeToolHandler,
342
-
343
- // Menu handlers
344
- MenuItemExecuteToolHandler,
345
-
346
- // Console handlers
347
- ConsoleClearToolHandler,
348
- ConsoleReadToolHandler,
349
-
350
- // Screenshot handlers
351
- ScreenshotCaptureToolHandler,
352
- ScreenshotAnalyzeToolHandler,
353
- // Video handlers
354
- VideoCaptureStartToolHandler,
355
- VideoCaptureStopToolHandler,
356
- VideoCaptureStatusToolHandler,
357
- VideoCaptureForToolHandler,
358
- // Script handlers
359
- ScriptPackagesListToolHandler,
360
- ScriptReadToolHandler,
361
- ScriptSearchToolHandler,
362
- ScriptEditStructuredToolHandler,
363
- ScriptEditSnippetToolHandler,
364
- ScriptRefsFindToolHandler,
365
- ScriptSymbolFindToolHandler,
366
- ScriptSymbolsGetToolHandler,
367
- CodeIndexStatusToolHandler,
368
- ScriptRefactorRenameToolHandler,
369
- ScriptCreateClassToolHandler,
370
- ScriptRemoveSymbolToolHandler,
371
- CodeIndexUpdateToolHandler,
372
- CodeIndexBuildToolHandler,
373
-
374
- // Component handlers
375
- ComponentAddToolHandler,
376
- ComponentRemoveToolHandler,
377
- ComponentModifyToolHandler,
378
- ComponentListToolHandler,
379
- ComponentGetTypesToolHandler,
380
- ComponentFieldSetToolHandler,
381
-
382
- // Compilation handlers
383
- CompilationGetStateToolHandler,
384
-
385
- // Test handlers
386
- TestRunToolHandler,
387
- TestGetStatusToolHandler,
388
-
389
- // Editor control handlers
390
- EditorTagsManageToolHandler,
391
- EditorLayersManageToolHandler,
392
- EditorSelectionManageToolHandler,
393
- EditorWindowsManageToolHandler,
394
- EditorToolsManageToolHandler,
395
-
396
- // Settings handlers
397
- SettingsGetToolHandler,
398
- SettingsUpdateToolHandler,
399
-
400
- // Package management handlers
401
- PackageManagerToolHandler,
402
- RegistryConfigToolHandler
403
- ]
404
-
405
- /**
406
- * Creates and returns all tool handlers
407
- * @param {UnityConnection} unityConnection - Connection to Unity
408
- * @returns {Map<string, BaseToolHandler>} Map of tool name to handler
409
- */
410
- export function createHandlers(unityConnection) {
411
- const handlers = new Map()
412
- const failedHandlers = []
413
-
414
- // Instantiate all handlers from the registry
415
- for (const HandlerClass of HANDLER_CLASSES) {
416
- try {
417
- const handler = new HandlerClass(unityConnection)
418
- handlers.set(handler.name, handler)
419
- } catch (error) {
420
- failedHandlers.push(HandlerClass.name)
421
- console.error(`[MCP] Failed to create handler ${HandlerClass.name}:`, error.message)
422
- // Continue with other handlers instead of throwing
423
- }
424
- }
425
-
426
- if (failedHandlers.length > 0) {
427
- console.error(
428
- `[MCP] Failed to initialize ${failedHandlers.length} handlers: ${failedHandlers.join(', ')}`
429
- )
430
- }
431
-
432
- console.error(
433
- `[MCP] Successfully initialized ${handlers.size}/${HANDLER_CLASSES.length} handlers`
434
- )
435
-
436
- return handlers
437
- }
1
+ /**
2
+ * Central export and registration for all tool handlers
3
+ */
4
+
5
+ // Export all handlers
6
+ // Deprecated Unity-communication handlers removed: ScriptEditPatchToolHandler, ScriptReplacePatternToolHandler
7
+ // Script tool registry
8
+
9
+ // Import all handler classes at once
10
+ import { SystemPingToolHandler } from './system/SystemPingToolHandler.js';
11
+ import { SystemRefreshAssetsToolHandler } from './system/SystemRefreshAssetsToolHandler.js';
12
+ import { SystemGetCommandStatsToolHandler } from './system/SystemGetCommandStatsToolHandler.js';
13
+ import { GameObjectCreateToolHandler } from './gameobject/GameObjectCreateToolHandler.js';
14
+ import { GameObjectFindToolHandler } from './gameobject/GameObjectFindToolHandler.js';
15
+ import { GameObjectModifyToolHandler } from './gameobject/GameObjectModifyToolHandler.js';
16
+ import { GameObjectDeleteToolHandler } from './gameobject/GameObjectDeleteToolHandler.js';
17
+ import { GameObjectGetHierarchyToolHandler } from './gameobject/GameObjectGetHierarchyToolHandler.js';
18
+ import { SceneCreateToolHandler } from './scene/SceneCreateToolHandler.js';
19
+ import { SceneLoadToolHandler } from './scene/SceneLoadToolHandler.js';
20
+ import { SceneSaveToolHandler } from './scene/SceneSaveToolHandler.js';
21
+ import { SceneListToolHandler } from './scene/SceneListToolHandler.js';
22
+ import { GetSceneInfoToolHandler } from './scene/GetSceneInfoToolHandler.js';
23
+ import { GetGameObjectDetailsToolHandler } from './analysis/GetGameObjectDetailsToolHandler.js';
24
+ import { AnalyzeSceneContentsToolHandler } from './analysis/AnalyzeSceneContentsToolHandler.js';
25
+ import { GetComponentValuesToolHandler } from './analysis/GetComponentValuesToolHandler.js';
26
+ import { FindByComponentToolHandler } from './analysis/FindByComponentToolHandler.js';
27
+ import { GetObjectReferencesToolHandler } from './analysis/GetObjectReferencesToolHandler.js';
28
+ import {
29
+ GetAnimatorStateToolHandler,
30
+ GetAnimatorRuntimeInfoToolHandler
31
+ } from './analysis/GetAnimatorStateToolHandler.js';
32
+ import {
33
+ GetInputActionsStateToolHandler,
34
+ AnalyzeInputActionsAssetToolHandler
35
+ } from './analysis/GetInputActionsStateToolHandler.js';
36
+ import { PlaymodePlayToolHandler } from './playmode/PlaymodePlayToolHandler.js';
37
+ import { PlaymodePauseToolHandler } from './playmode/PlaymodePauseToolHandler.js';
38
+ import { PlaymodeStopToolHandler } from './playmode/PlaymodeStopToolHandler.js';
39
+ import { PlaymodeGetStateToolHandler } from './playmode/PlaymodeGetStateToolHandler.js';
40
+ import { PlaymodeWaitForStateToolHandler } from './playmode/PlaymodeWaitForStateToolHandler.js';
41
+ import { UIFindElementsToolHandler } from './ui/UIFindElementsToolHandler.js';
42
+ import { UIClickElementToolHandler } from './ui/UIClickElementToolHandler.js';
43
+ import { UIGetElementStateToolHandler } from './ui/UIGetElementStateToolHandler.js';
44
+ import { UISetElementValueToolHandler } from './ui/UISetElementValueToolHandler.js';
45
+ import { UISimulateInputToolHandler } from './ui/UISimulateInputToolHandler.js';
46
+ import { InputSystemControlToolHandler } from './input/InputSystemControlToolHandler.js';
47
+ import { InputKeyboardToolHandler } from './input/InputKeyboardToolHandler.js';
48
+ import { InputMouseToolHandler } from './input/InputMouseToolHandler.js';
49
+ import { InputGamepadToolHandler } from './input/InputGamepadToolHandler.js';
50
+ import { InputTouchToolHandler } from './input/InputTouchToolHandler.js';
51
+ import { InputActionMapCreateToolHandler } from './input/InputActionMapCreateToolHandler.js';
52
+ import { InputActionMapRemoveToolHandler } from './input/InputActionMapRemoveToolHandler.js';
53
+ import { InputActionAddToolHandler } from './input/InputActionAddToolHandler.js';
54
+ import { InputActionRemoveToolHandler } from './input/InputActionRemoveToolHandler.js';
55
+ import { InputBindingAddToolHandler } from './input/InputBindingAddToolHandler.js';
56
+ import { InputBindingRemoveToolHandler } from './input/InputBindingRemoveToolHandler.js';
57
+ import { InputBindingRemoveAllToolHandler } from './input/InputBindingRemoveAllToolHandler.js';
58
+ import { InputBindingCompositeCreateToolHandler } from './input/InputBindingCompositeCreateToolHandler.js';
59
+ import { InputControlSchemesManageToolHandler } from './input/InputControlSchemesManageToolHandler.js';
60
+ import { AssetPrefabCreateToolHandler } from './asset/AssetPrefabCreateToolHandler.js';
61
+ import { AssetPrefabModifyToolHandler } from './asset/AssetPrefabModifyToolHandler.js';
62
+ import { AssetPrefabInstantiateToolHandler } from './asset/AssetPrefabInstantiateToolHandler.js';
63
+ import { AssetMaterialCreateToolHandler } from './asset/AssetMaterialCreateToolHandler.js';
64
+ import { AssetMaterialModifyToolHandler } from './asset/AssetMaterialModifyToolHandler.js';
65
+ import { AssetPrefabOpenToolHandler } from './asset/AssetPrefabOpenToolHandler.js';
66
+ import { AssetPrefabExitModeToolHandler } from './asset/AssetPrefabExitModeToolHandler.js';
67
+ import { AssetPrefabSaveToolHandler } from './asset/AssetPrefabSaveToolHandler.js';
68
+ import { AssetImportSettingsManageToolHandler } from './asset/AssetImportSettingsManageToolHandler.js';
69
+ import { AssetDatabaseManageToolHandler } from './asset/AssetDatabaseManageToolHandler.js';
70
+ import { AssetDependencyAnalyzeToolHandler } from './asset/AssetDependencyAnalyzeToolHandler.js';
71
+ import AddressablesManageToolHandler from './addressables/AddressablesManageToolHandler.js';
72
+ import AddressablesBuildToolHandler from './addressables/AddressablesBuildToolHandler.js';
73
+ import AddressablesAnalyzeToolHandler from './addressables/AddressablesAnalyzeToolHandler.js';
74
+ import { MenuItemExecuteToolHandler } from './menu/MenuItemExecuteToolHandler.js';
75
+ import { ConsoleClearToolHandler } from './console/ConsoleClearToolHandler.js';
76
+ import { ConsoleReadToolHandler } from './console/ConsoleReadToolHandler.js';
77
+ import { ScreenshotCaptureToolHandler } from './screenshot/ScreenshotCaptureToolHandler.js';
78
+ import { ScreenshotAnalyzeToolHandler } from './screenshot/ScreenshotAnalyzeToolHandler.js';
79
+ import { VideoCaptureStartToolHandler } from './video/VideoCaptureStartToolHandler.js';
80
+ import { VideoCaptureStopToolHandler } from './video/VideoCaptureStopToolHandler.js';
81
+ import { VideoCaptureStatusToolHandler } from './video/VideoCaptureStatusToolHandler.js';
82
+ import { VideoCaptureForToolHandler } from './video/VideoCaptureForToolHandler.js';
83
+ import { ComponentAddToolHandler } from './component/ComponentAddToolHandler.js';
84
+ import { ComponentRemoveToolHandler } from './component/ComponentRemoveToolHandler.js';
85
+ import { ComponentModifyToolHandler } from './component/ComponentModifyToolHandler.js';
86
+ import { ComponentListToolHandler } from './component/ComponentListToolHandler.js';
87
+ import { ComponentGetTypesToolHandler } from './component/ComponentGetTypesToolHandler.js';
88
+ import { ComponentFieldSetToolHandler } from './component/ComponentFieldSetToolHandler.js';
89
+ import { CompilationGetStateToolHandler } from './compilation/CompilationGetStateToolHandler.js';
90
+ import { TestRunToolHandler } from './test/TestRunToolHandler.js';
91
+ import { TestGetStatusToolHandler } from './test/TestGetStatusToolHandler.js';
92
+ import { EditorTagsManageToolHandler } from './editor/EditorTagsManageToolHandler.js';
93
+ import { EditorLayersManageToolHandler } from './editor/EditorLayersManageToolHandler.js';
94
+ import { EditorSelectionManageToolHandler } from './editor/EditorSelectionManageToolHandler.js';
95
+ import { EditorWindowsManageToolHandler } from './editor/EditorWindowsManageToolHandler.js';
96
+ import { EditorToolsManageToolHandler } from './editor/EditorToolsManageToolHandler.js';
97
+ import { SettingsGetToolHandler } from './settings/SettingsGetToolHandler.js';
98
+ import { SettingsUpdateToolHandler } from './settings/SettingsUpdateToolHandler.js';
99
+ import PackageManagerToolHandler from './package/PackageManagerToolHandler.js';
100
+ import RegistryConfigToolHandler from './package/RegistryConfigToolHandler.js';
101
+ import { ScriptPackagesListToolHandler } from './script/ScriptPackagesListToolHandler.js';
102
+ import { ScriptReadToolHandler } from './script/ScriptReadToolHandler.js';
103
+ import { ScriptSearchToolHandler } from './script/ScriptSearchToolHandler.js';
104
+ import { ScriptEditStructuredToolHandler } from './script/ScriptEditStructuredToolHandler.js';
105
+ import { ScriptEditSnippetToolHandler } from './script/ScriptEditSnippetToolHandler.js';
106
+ import { ScriptSymbolsGetToolHandler } from './script/ScriptSymbolsGetToolHandler.js';
107
+ import { ScriptSymbolFindToolHandler } from './script/ScriptSymbolFindToolHandler.js';
108
+ import { ScriptRefsFindToolHandler } from './script/ScriptRefsFindToolHandler.js';
109
+ import { CodeIndexStatusToolHandler } from './script/CodeIndexStatusToolHandler.js';
110
+ import { ScriptRefactorRenameToolHandler } from './script/ScriptRefactorRenameToolHandler.js';
111
+ import { ScriptCreateClassToolHandler } from './script/ScriptCreateClassToolHandler.js';
112
+ import { ScriptRemoveSymbolToolHandler } from './script/ScriptRemoveSymbolToolHandler.js';
113
+ import { CodeIndexUpdateToolHandler } from './script/CodeIndexUpdateToolHandler.js';
114
+ import { CodeIndexBuildToolHandler } from './script/CodeIndexBuildToolHandler.js';
115
+ export { BaseToolHandler } from './base/BaseToolHandler.js';
116
+
117
+ // System handlers
118
+ export { SystemPingToolHandler } from './system/SystemPingToolHandler.js';
119
+ export { SystemRefreshAssetsToolHandler } from './system/SystemRefreshAssetsToolHandler.js';
120
+ export { SystemGetCommandStatsToolHandler } from './system/SystemGetCommandStatsToolHandler.js';
121
+
122
+ // GameObject handlers
123
+ export { GameObjectCreateToolHandler } from './gameobject/GameObjectCreateToolHandler.js';
124
+ export { GameObjectFindToolHandler } from './gameobject/GameObjectFindToolHandler.js';
125
+ export { GameObjectModifyToolHandler } from './gameobject/GameObjectModifyToolHandler.js';
126
+ export { GameObjectDeleteToolHandler } from './gameobject/GameObjectDeleteToolHandler.js';
127
+ export { GameObjectGetHierarchyToolHandler } from './gameobject/GameObjectGetHierarchyToolHandler.js';
128
+
129
+ // Scene handlers
130
+ export { SceneCreateToolHandler } from './scene/SceneCreateToolHandler.js';
131
+ export { SceneLoadToolHandler } from './scene/SceneLoadToolHandler.js';
132
+ export { SceneSaveToolHandler } from './scene/SceneSaveToolHandler.js';
133
+ export { SceneListToolHandler } from './scene/SceneListToolHandler.js';
134
+ export { GetSceneInfoToolHandler } from './scene/GetSceneInfoToolHandler.js';
135
+
136
+ // Analysis handlers
137
+ export { GetGameObjectDetailsToolHandler } from './analysis/GetGameObjectDetailsToolHandler.js';
138
+ export { AnalyzeSceneContentsToolHandler } from './analysis/AnalyzeSceneContentsToolHandler.js';
139
+ export { GetComponentValuesToolHandler } from './analysis/GetComponentValuesToolHandler.js';
140
+ export { FindByComponentToolHandler } from './analysis/FindByComponentToolHandler.js';
141
+ export { GetObjectReferencesToolHandler } from './analysis/GetObjectReferencesToolHandler.js';
142
+ export {
143
+ GetAnimatorStateToolHandler,
144
+ GetAnimatorRuntimeInfoToolHandler
145
+ } from './analysis/GetAnimatorStateToolHandler.js';
146
+ export {
147
+ GetInputActionsStateToolHandler,
148
+ AnalyzeInputActionsAssetToolHandler
149
+ } from './analysis/GetInputActionsStateToolHandler.js';
150
+
151
+ // PlayMode handlers
152
+ export { PlaymodePlayToolHandler } from './playmode/PlaymodePlayToolHandler.js';
153
+ export { PlaymodePauseToolHandler } from './playmode/PlaymodePauseToolHandler.js';
154
+ export { PlaymodeStopToolHandler } from './playmode/PlaymodeStopToolHandler.js';
155
+ export { PlaymodeGetStateToolHandler } from './playmode/PlaymodeGetStateToolHandler.js';
156
+ export { PlaymodeWaitForStateToolHandler } from './playmode/PlaymodeWaitForStateToolHandler.js';
157
+
158
+ // UI handlers
159
+ export { UIFindElementsToolHandler } from './ui/UIFindElementsToolHandler.js';
160
+ export { UIClickElementToolHandler } from './ui/UIClickElementToolHandler.js';
161
+ export { UIGetElementStateToolHandler } from './ui/UIGetElementStateToolHandler.js';
162
+ export { UISetElementValueToolHandler } from './ui/UISetElementValueToolHandler.js';
163
+ export { UISimulateInputToolHandler } from './ui/UISimulateInputToolHandler.js';
164
+
165
+ // Input System handlers
166
+ export { InputSystemControlToolHandler } from './input/InputSystemControlToolHandler.js';
167
+ export { InputKeyboardToolHandler } from './input/InputKeyboardToolHandler.js';
168
+ export { InputMouseToolHandler } from './input/InputMouseToolHandler.js';
169
+ export { InputGamepadToolHandler } from './input/InputGamepadToolHandler.js';
170
+ export { InputTouchToolHandler } from './input/InputTouchToolHandler.js';
171
+ export { InputActionMapCreateToolHandler } from './input/InputActionMapCreateToolHandler.js';
172
+ export { InputActionMapRemoveToolHandler } from './input/InputActionMapRemoveToolHandler.js';
173
+ export { InputActionAddToolHandler } from './input/InputActionAddToolHandler.js';
174
+ export { InputActionRemoveToolHandler } from './input/InputActionRemoveToolHandler.js';
175
+ export { InputBindingAddToolHandler } from './input/InputBindingAddToolHandler.js';
176
+ export { InputBindingRemoveToolHandler } from './input/InputBindingRemoveToolHandler.js';
177
+ export { InputBindingRemoveAllToolHandler } from './input/InputBindingRemoveAllToolHandler.js';
178
+ export { InputBindingCompositeCreateToolHandler } from './input/InputBindingCompositeCreateToolHandler.js';
179
+ export { InputControlSchemesManageToolHandler } from './input/InputControlSchemesManageToolHandler.js';
180
+
181
+ // Asset handlers
182
+ export { AssetPrefabCreateToolHandler } from './asset/AssetPrefabCreateToolHandler.js';
183
+ export { AssetPrefabModifyToolHandler } from './asset/AssetPrefabModifyToolHandler.js';
184
+ export { AssetPrefabInstantiateToolHandler } from './asset/AssetPrefabInstantiateToolHandler.js';
185
+ export { AssetMaterialCreateToolHandler } from './asset/AssetMaterialCreateToolHandler.js';
186
+ export { AssetMaterialModifyToolHandler } from './asset/AssetMaterialModifyToolHandler.js';
187
+ export { AssetPrefabOpenToolHandler } from './asset/AssetPrefabOpenToolHandler.js';
188
+ export { AssetPrefabExitModeToolHandler } from './asset/AssetPrefabExitModeToolHandler.js';
189
+ export { AssetPrefabSaveToolHandler } from './asset/AssetPrefabSaveToolHandler.js';
190
+ export { AssetImportSettingsManageToolHandler } from './asset/AssetImportSettingsManageToolHandler.js';
191
+ export { AssetDatabaseManageToolHandler } from './asset/AssetDatabaseManageToolHandler.js';
192
+ export { AssetDependencyAnalyzeToolHandler } from './asset/AssetDependencyAnalyzeToolHandler.js';
193
+
194
+ // Addressables handlers
195
+ export { default as AddressablesManageToolHandler } from './addressables/AddressablesManageToolHandler.js';
196
+ export { default as AddressablesBuildToolHandler } from './addressables/AddressablesBuildToolHandler.js';
197
+ export { default as AddressablesAnalyzeToolHandler } from './addressables/AddressablesAnalyzeToolHandler.js';
198
+
199
+ // Menu handlers
200
+ export { MenuItemExecuteToolHandler } from './menu/MenuItemExecuteToolHandler.js';
201
+
202
+ // Console handlers
203
+ export { ConsoleClearToolHandler } from './console/ConsoleClearToolHandler.js';
204
+ export { ConsoleReadToolHandler } from './console/ConsoleReadToolHandler.js';
205
+
206
+ // Screenshot handlers
207
+ export { ScreenshotCaptureToolHandler } from './screenshot/ScreenshotCaptureToolHandler.js';
208
+ export { ScreenshotAnalyzeToolHandler } from './screenshot/ScreenshotAnalyzeToolHandler.js';
209
+
210
+ // Video handlers
211
+ export { VideoCaptureStartToolHandler } from './video/VideoCaptureStartToolHandler.js';
212
+ export { VideoCaptureStopToolHandler } from './video/VideoCaptureStopToolHandler.js';
213
+ export { VideoCaptureStatusToolHandler } from './video/VideoCaptureStatusToolHandler.js';
214
+ export { VideoCaptureForToolHandler } from './video/VideoCaptureForToolHandler.js';
215
+
216
+ // Component handlers
217
+ export { ComponentAddToolHandler } from './component/ComponentAddToolHandler.js';
218
+ export { ComponentRemoveToolHandler } from './component/ComponentRemoveToolHandler.js';
219
+ export { ComponentModifyToolHandler } from './component/ComponentModifyToolHandler.js';
220
+ export { ComponentListToolHandler } from './component/ComponentListToolHandler.js';
221
+ export { ComponentGetTypesToolHandler } from './component/ComponentGetTypesToolHandler.js';
222
+ export { ComponentFieldSetToolHandler } from './component/ComponentFieldSetToolHandler.js';
223
+
224
+ // Compilation handlers
225
+ export { CompilationGetStateToolHandler } from './compilation/CompilationGetStateToolHandler.js';
226
+
227
+ // Test handlers
228
+ export { TestRunToolHandler } from './test/TestRunToolHandler.js';
229
+ export { TestGetStatusToolHandler } from './test/TestGetStatusToolHandler.js';
230
+
231
+ // Editor control handlers
232
+ export { EditorTagsManageToolHandler } from './editor/EditorTagsManageToolHandler.js';
233
+ export { EditorLayersManageToolHandler } from './editor/EditorLayersManageToolHandler.js';
234
+ export { EditorSelectionManageToolHandler } from './editor/EditorSelectionManageToolHandler.js';
235
+ export { EditorWindowsManageToolHandler } from './editor/EditorWindowsManageToolHandler.js';
236
+ export { EditorToolsManageToolHandler } from './editor/EditorToolsManageToolHandler.js';
237
+
238
+ // Settings handlers
239
+ export { SettingsGetToolHandler } from './settings/SettingsGetToolHandler.js';
240
+ export { SettingsUpdateToolHandler } from './settings/SettingsUpdateToolHandler.js';
241
+
242
+ // Package management handlers
243
+ export { default as PackageManagerToolHandler } from './package/PackageManagerToolHandler.js';
244
+ export { default as RegistryConfigToolHandler } from './package/RegistryConfigToolHandler.js';
245
+
246
+ // Script handlers
247
+ export { ScriptPackagesListToolHandler } from './script/ScriptPackagesListToolHandler.js';
248
+ export { ScriptReadToolHandler } from './script/ScriptReadToolHandler.js';
249
+ export { ScriptSearchToolHandler } from './script/ScriptSearchToolHandler.js';
250
+ export { ScriptEditStructuredToolHandler } from './script/ScriptEditStructuredToolHandler.js';
251
+ export { ScriptEditSnippetToolHandler } from './script/ScriptEditSnippetToolHandler.js';
252
+ export { ScriptRefsFindToolHandler } from './script/ScriptRefsFindToolHandler.js';
253
+ export { ScriptSymbolFindToolHandler } from './script/ScriptSymbolFindToolHandler.js';
254
+ export { ScriptSymbolsGetToolHandler } from './script/ScriptSymbolsGetToolHandler.js';
255
+ export { CodeIndexStatusToolHandler } from './script/CodeIndexStatusToolHandler.js';
256
+ export { ScriptRefactorRenameToolHandler } from './script/ScriptRefactorRenameToolHandler.js';
257
+ export { ScriptCreateClassToolHandler } from './script/ScriptCreateClassToolHandler.js';
258
+ export { ScriptRemoveSymbolToolHandler } from './script/ScriptRemoveSymbolToolHandler.js';
259
+ export { CodeIndexUpdateToolHandler } from './script/CodeIndexUpdateToolHandler.js';
260
+ export { CodeIndexBuildToolHandler } from './script/CodeIndexBuildToolHandler.js';
261
+ // Roslyn (external CLI) tool handlers removed(内部ユーティリティのみ存続)
262
+
263
+ // Handler registry - single source of truth
264
+ const HANDLER_CLASSES = [
265
+ // System handlers
266
+ SystemPingToolHandler,
267
+ SystemRefreshAssetsToolHandler,
268
+ SystemGetCommandStatsToolHandler,
269
+
270
+ // GameObject handlers
271
+ GameObjectCreateToolHandler,
272
+ GameObjectFindToolHandler,
273
+ GameObjectModifyToolHandler,
274
+ GameObjectDeleteToolHandler,
275
+ GameObjectGetHierarchyToolHandler,
276
+
277
+ // Scene handlers
278
+ SceneCreateToolHandler,
279
+ SceneLoadToolHandler,
280
+ SceneSaveToolHandler,
281
+ SceneListToolHandler,
282
+ GetSceneInfoToolHandler,
283
+
284
+ // Analysis handlers
285
+ GetGameObjectDetailsToolHandler,
286
+ AnalyzeSceneContentsToolHandler,
287
+ GetComponentValuesToolHandler,
288
+ FindByComponentToolHandler,
289
+ GetObjectReferencesToolHandler,
290
+ GetAnimatorStateToolHandler,
291
+ GetAnimatorRuntimeInfoToolHandler,
292
+ GetInputActionsStateToolHandler,
293
+ AnalyzeInputActionsAssetToolHandler,
294
+
295
+ // PlayMode handlers
296
+ PlaymodePlayToolHandler,
297
+ PlaymodePauseToolHandler,
298
+ PlaymodeStopToolHandler,
299
+ PlaymodeGetStateToolHandler,
300
+ PlaymodeWaitForStateToolHandler,
301
+
302
+ // UI handlers
303
+ UIFindElementsToolHandler,
304
+ UIClickElementToolHandler,
305
+ UIGetElementStateToolHandler,
306
+ UISetElementValueToolHandler,
307
+ UISimulateInputToolHandler,
308
+
309
+ // Input System handlers
310
+ InputSystemControlToolHandler,
311
+ InputKeyboardToolHandler,
312
+ InputMouseToolHandler,
313
+ InputGamepadToolHandler,
314
+ InputTouchToolHandler,
315
+ InputActionMapCreateToolHandler,
316
+ InputActionMapRemoveToolHandler,
317
+ InputActionAddToolHandler,
318
+ InputActionRemoveToolHandler,
319
+ InputBindingAddToolHandler,
320
+ InputBindingRemoveToolHandler,
321
+ InputBindingRemoveAllToolHandler,
322
+ InputBindingCompositeCreateToolHandler,
323
+ InputControlSchemesManageToolHandler,
324
+
325
+ // Asset handlers
326
+ AssetPrefabCreateToolHandler,
327
+ AssetPrefabModifyToolHandler,
328
+ AssetPrefabInstantiateToolHandler,
329
+ AssetMaterialCreateToolHandler,
330
+ AssetMaterialModifyToolHandler,
331
+ AssetPrefabOpenToolHandler,
332
+ AssetPrefabExitModeToolHandler,
333
+ AssetPrefabSaveToolHandler,
334
+ AssetImportSettingsManageToolHandler,
335
+ AssetDatabaseManageToolHandler,
336
+ AssetDependencyAnalyzeToolHandler,
337
+
338
+ // Addressables handlers
339
+ AddressablesManageToolHandler,
340
+ AddressablesBuildToolHandler,
341
+ AddressablesAnalyzeToolHandler,
342
+
343
+ // Menu handlers
344
+ MenuItemExecuteToolHandler,
345
+
346
+ // Console handlers
347
+ ConsoleClearToolHandler,
348
+ ConsoleReadToolHandler,
349
+
350
+ // Screenshot handlers
351
+ ScreenshotCaptureToolHandler,
352
+ ScreenshotAnalyzeToolHandler,
353
+ // Video handlers
354
+ VideoCaptureStartToolHandler,
355
+ VideoCaptureStopToolHandler,
356
+ VideoCaptureStatusToolHandler,
357
+ VideoCaptureForToolHandler,
358
+ // Script handlers
359
+ ScriptPackagesListToolHandler,
360
+ ScriptReadToolHandler,
361
+ ScriptSearchToolHandler,
362
+ ScriptEditStructuredToolHandler,
363
+ ScriptEditSnippetToolHandler,
364
+ ScriptRefsFindToolHandler,
365
+ ScriptSymbolFindToolHandler,
366
+ ScriptSymbolsGetToolHandler,
367
+ CodeIndexStatusToolHandler,
368
+ ScriptRefactorRenameToolHandler,
369
+ ScriptCreateClassToolHandler,
370
+ ScriptRemoveSymbolToolHandler,
371
+ CodeIndexUpdateToolHandler,
372
+ CodeIndexBuildToolHandler,
373
+
374
+ // Component handlers
375
+ ComponentAddToolHandler,
376
+ ComponentRemoveToolHandler,
377
+ ComponentModifyToolHandler,
378
+ ComponentListToolHandler,
379
+ ComponentGetTypesToolHandler,
380
+ ComponentFieldSetToolHandler,
381
+
382
+ // Compilation handlers
383
+ CompilationGetStateToolHandler,
384
+
385
+ // Test handlers
386
+ TestRunToolHandler,
387
+ TestGetStatusToolHandler,
388
+
389
+ // Editor control handlers
390
+ EditorTagsManageToolHandler,
391
+ EditorLayersManageToolHandler,
392
+ EditorSelectionManageToolHandler,
393
+ EditorWindowsManageToolHandler,
394
+ EditorToolsManageToolHandler,
395
+
396
+ // Settings handlers
397
+ SettingsGetToolHandler,
398
+ SettingsUpdateToolHandler,
399
+
400
+ // Package management handlers
401
+ PackageManagerToolHandler,
402
+ RegistryConfigToolHandler
403
+ ];
404
+
405
+ /**
406
+ * Creates and returns all tool handlers
407
+ * @param {UnityConnection} unityConnection - Connection to Unity
408
+ * @returns {Map<string, BaseToolHandler>} Map of tool name to handler
409
+ */
410
+ export function createHandlers(unityConnection) {
411
+ const handlers = new Map();
412
+ const failedHandlers = [];
413
+
414
+ // Instantiate all handlers from the registry
415
+ for (const HandlerClass of HANDLER_CLASSES) {
416
+ try {
417
+ const handler = new HandlerClass(unityConnection);
418
+ handlers.set(handler.name, handler);
419
+ } catch (error) {
420
+ failedHandlers.push(HandlerClass.name);
421
+ console.error(`[MCP] Failed to create handler ${HandlerClass.name}:`, error.message);
422
+ // Continue with other handlers instead of throwing
423
+ }
424
+ }
425
+
426
+ if (failedHandlers.length > 0) {
427
+ console.error(
428
+ `[MCP] Failed to initialize ${failedHandlers.length} handlers: ${failedHandlers.join(', ')}`
429
+ );
430
+ }
431
+
432
+ console.error(
433
+ `[MCP] Successfully initialized ${handlers.size}/${HANDLER_CLASSES.length} handlers`
434
+ );
435
+
436
+ return handlers;
437
+ }