@akiojin/unity-mcp-server 2.40.2 → 2.40.3

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 (90) hide show
  1. package/README.md +21 -0
  2. package/bin/unity-mcp-server +1 -1
  3. package/package.json +1 -1
  4. package/src/core/codeIndex.js +64 -15
  5. package/src/core/server.js +3 -34
  6. package/src/handlers/analysis/AnalyzeSceneContentsToolHandler.js +27 -24
  7. package/src/handlers/analysis/FindByComponentToolHandler.js +4 -1
  8. package/src/handlers/analysis/GetAnimatorStateToolHandler.js +5 -5
  9. package/src/handlers/analysis/GetComponentValuesToolHandler.js +4 -1
  10. package/src/handlers/analysis/GetGameObjectDetailsToolHandler.js +27 -24
  11. package/src/handlers/analysis/GetInputActionsStateToolHandler.js +5 -5
  12. package/src/handlers/analysis/GetObjectReferencesToolHandler.js +4 -1
  13. package/src/handlers/asset/AssetDatabaseManageToolHandler.js +24 -6
  14. package/src/handlers/asset/AssetDependencyAnalyzeToolHandler.js +21 -11
  15. package/src/handlers/asset/AssetImportSettingsManageToolHandler.js +7 -7
  16. package/src/handlers/asset/AssetMaterialCreateToolHandler.js +78 -81
  17. package/src/handlers/asset/AssetMaterialModifyToolHandler.js +57 -61
  18. package/src/handlers/asset/AssetPrefabCreateToolHandler.js +61 -64
  19. package/src/handlers/asset/AssetPrefabExitModeToolHandler.js +9 -13
  20. package/src/handlers/asset/AssetPrefabInstantiateToolHandler.js +110 -116
  21. package/src/handlers/asset/AssetPrefabModifyToolHandler.js +58 -58
  22. package/src/handlers/asset/AssetPrefabOpenToolHandler.js +7 -5
  23. package/src/handlers/asset/AssetPrefabSaveToolHandler.js +13 -6
  24. package/src/handlers/compilation/CompilationGetStateToolHandler.js +4 -3
  25. package/src/handlers/component/ComponentAddToolHandler.js +2 -2
  26. package/src/handlers/component/ComponentGetTypesToolHandler.js +17 -21
  27. package/src/handlers/component/ComponentListToolHandler.js +5 -3
  28. package/src/handlers/component/ComponentModifyToolHandler.js +3 -3
  29. package/src/handlers/component/ComponentRemoveToolHandler.js +2 -2
  30. package/src/handlers/console/ConsoleClearToolHandler.js +36 -46
  31. package/src/handlers/editor/EditorLayersManageToolHandler.js +7 -6
  32. package/src/handlers/editor/EditorTagsManageToolHandler.js +20 -11
  33. package/src/handlers/editor/EditorToolsManageToolHandler.js +2 -2
  34. package/src/handlers/editor/EditorWindowsManageToolHandler.js +6 -5
  35. package/src/handlers/gameobject/GameObjectCreateToolHandler.js +62 -66
  36. package/src/handlers/gameobject/GameObjectDeleteToolHandler.js +9 -9
  37. package/src/handlers/gameobject/GameObjectFindToolHandler.js +13 -11
  38. package/src/handlers/gameobject/GameObjectGetHierarchyToolHandler.js +22 -16
  39. package/src/handlers/input/InputActionAddToolHandler.js +2 -2
  40. package/src/handlers/input/InputActionMapCreateToolHandler.js +2 -2
  41. package/src/handlers/input/InputActionMapRemoveToolHandler.js +2 -2
  42. package/src/handlers/input/InputActionRemoveToolHandler.js +2 -2
  43. package/src/handlers/input/InputBindingAddToolHandler.js +2 -2
  44. package/src/handlers/input/InputBindingCompositeCreateToolHandler.js +2 -2
  45. package/src/handlers/input/InputBindingRemoveAllToolHandler.js +2 -2
  46. package/src/handlers/input/InputBindingRemoveToolHandler.js +2 -2
  47. package/src/handlers/input/InputControlSchemesManageToolHandler.js +2 -2
  48. package/src/handlers/package/PackageManagerToolHandler.js +41 -44
  49. package/src/handlers/package/RegistryConfigToolHandler.js +28 -7
  50. package/src/handlers/playmode/PlaymodeGetStateToolHandler.js +12 -16
  51. package/src/handlers/playmode/PlaymodePauseToolHandler.js +8 -12
  52. package/src/handlers/playmode/PlaymodeWaitForStateToolHandler.js +6 -3
  53. package/src/handlers/scene/GetSceneInfoToolHandler.js +11 -11
  54. package/src/handlers/scene/SceneCreateToolHandler.js +28 -31
  55. package/src/handlers/scene/SceneListToolHandler.js +21 -24
  56. package/src/handlers/scene/SceneLoadToolHandler.js +27 -29
  57. package/src/handlers/scene/SceneSaveToolHandler.js +19 -22
  58. package/src/handlers/screenshot/ScreenshotCaptureToolHandler.js +88 -66
  59. package/src/handlers/script/CodeIndexStatusToolHandler.js +4 -3
  60. package/src/handlers/script/CodeIndexUpdateToolHandler.js +24 -14
  61. package/src/handlers/script/ScriptCreateClassToolHandler.js +44 -9
  62. package/src/handlers/script/ScriptPackagesListToolHandler.js +91 -91
  63. package/src/handlers/script/ScriptRefactorRenameToolHandler.js +80 -71
  64. package/src/handlers/script/ScriptRemoveSymbolToolHandler.js +21 -7
  65. package/src/handlers/script/ScriptSearchToolHandler.js +299 -266
  66. package/src/handlers/script/ScriptSymbolsGetToolHandler.js +88 -79
  67. package/src/handlers/settings/SettingsGetToolHandler.js +28 -13
  68. package/src/handlers/settings/SettingsUpdateToolHandler.js +20 -6
  69. package/src/handlers/ui/UIClickElementToolHandler.js +87 -96
  70. package/src/handlers/ui/UIFindElementsToolHandler.js +45 -55
  71. package/src/handlers/ui/UIGetElementStateToolHandler.js +35 -43
  72. package/src/handlers/ui/UISetElementValueToolHandler.js +42 -49
  73. package/src/handlers/ui/UISimulateInputToolHandler.js +134 -136
  74. package/src/handlers/video/VideoCaptureForToolHandler.js +24 -7
  75. package/src/lsp/LspRpcClient.js +24 -12
  76. package/src/tools/analysis/analyzeSceneContents.js +85 -85
  77. package/src/tools/analysis/findByComponent.js +73 -73
  78. package/src/tools/analysis/getAnimatorState.js +287 -287
  79. package/src/tools/analysis/getComponentValues.js +161 -161
  80. package/src/tools/analysis/getGameObjectDetails.js +138 -138
  81. package/src/tools/analysis/getInputActionsState.js +291 -291
  82. package/src/tools/analysis/getObjectReferences.js +72 -72
  83. package/src/tools/input/inputActionsEditor.js +522 -474
  84. package/src/tools/scene/createScene.js +98 -97
  85. package/src/tools/scene/getSceneInfo.js +82 -81
  86. package/src/tools/scene/listScenes.js +70 -69
  87. package/src/tools/scene/loadScene.js +108 -106
  88. package/src/tools/scene/saveScene.js +78 -77
  89. package/src/tools/system/ping.js +9 -12
  90. package/src/utils/validators.js +2 -2
@@ -2,85 +2,85 @@
2
2
  * Tool definition for analysis_object_references_get
3
3
  */
4
4
  export const getObjectReferencesToolDefinition = {
5
- name: 'analysis_object_references_get',
6
- description: 'Find references to and from a GameObject (hierarchy/assets/prefabs).',
7
- inputSchema: {
8
- type: 'object',
9
- properties: {
10
- gameObjectName: {
11
- type: 'string',
12
- description: 'Name of the GameObject to analyze references for'
13
- },
14
- includeAssetReferences: {
15
- type: 'boolean',
16
- description: 'Include references to assets (materials, meshes, etc). Default: true'
17
- },
18
- includeHierarchyReferences: {
19
- type: 'boolean',
20
- description: 'Include parent/child hierarchy references. Default: true'
21
- },
22
- searchInPrefabs: {
23
- type: 'boolean',
24
- description: 'Also search for references in prefab assets. Default: false'
25
- }
26
- },
27
- required: ['gameObjectName']
28
- }
5
+ name: 'analysis_object_references_get',
6
+ description: 'Find references to and from a GameObject (hierarchy/assets/prefabs).',
7
+ inputSchema: {
8
+ type: 'object',
9
+ properties: {
10
+ gameObjectName: {
11
+ type: 'string',
12
+ description: 'Name of the GameObject to analyze references for'
13
+ },
14
+ includeAssetReferences: {
15
+ type: 'boolean',
16
+ description: 'Include references to assets (materials, meshes, etc). Default: true'
17
+ },
18
+ includeHierarchyReferences: {
19
+ type: 'boolean',
20
+ description: 'Include parent/child hierarchy references. Default: true'
21
+ },
22
+ searchInPrefabs: {
23
+ type: 'boolean',
24
+ description: 'Also search for references in prefab assets. Default: false'
25
+ }
26
+ },
27
+ required: ['gameObjectName']
28
+ }
29
29
  };
30
30
 
31
31
  /**
32
32
  * Handler for get_object_references tool
33
33
  */
34
34
  export async function getObjectReferencesHandler(unityConnection, args) {
35
- try {
36
- // Check connection
37
- if (!unityConnection.isConnected()) {
38
- return {
39
- content: [
40
- {
41
- type: 'text',
42
- text: 'Failed to get object references: Unity connection not available'
43
- }
44
- ],
45
- isError: true
46
- };
47
- }
48
-
49
- // Send command to Unity
50
- const result = await unityConnection.sendCommand('analysis_object_references_get', args);
35
+ try {
36
+ // Check connection
37
+ if (!unityConnection.isConnected()) {
38
+ return {
39
+ content: [
40
+ {
41
+ type: 'text',
42
+ text: 'Failed to get object references: Unity connection not available'
43
+ }
44
+ ],
45
+ isError: true
46
+ };
47
+ }
51
48
 
52
- // Handle Unity response
53
- if (result.status === 'error') {
54
- return {
55
- content: [
56
- {
57
- type: 'text',
58
- text: `Failed to get object references: ${result.error}`
59
- }
60
- ],
61
- isError: true
62
- };
63
- }
49
+ // Send command to Unity
50
+ const result = await unityConnection.sendCommand('analysis_object_references_get', args);
64
51
 
65
- // Success response
66
- return {
67
- content: [
68
- {
69
- type: 'text',
70
- text: result.result.summary || `References analyzed for ${args.gameObjectName}`
71
- }
72
- ],
73
- isError: false
74
- };
75
- } catch (error) {
76
- return {
77
- content: [
78
- {
79
- type: 'text',
80
- text: `Failed to get object references: ${error.message}`
81
- }
82
- ],
83
- isError: true
84
- };
52
+ // Handle Unity response
53
+ if (result.status === 'error') {
54
+ return {
55
+ content: [
56
+ {
57
+ type: 'text',
58
+ text: `Failed to get object references: ${result.error}`
59
+ }
60
+ ],
61
+ isError: true
62
+ };
85
63
  }
64
+
65
+ // Success response
66
+ return {
67
+ content: [
68
+ {
69
+ type: 'text',
70
+ text: result.result.summary || `References analyzed for ${args.gameObjectName}`
71
+ }
72
+ ],
73
+ isError: false
74
+ };
75
+ } catch (error) {
76
+ return {
77
+ content: [
78
+ {
79
+ type: 'text',
80
+ text: `Failed to get object references: ${error.message}`
81
+ }
82
+ ],
83
+ isError: true
84
+ };
85
+ }
86
86
  }