@akiojin/unity-mcp-server 3.2.1 → 4.1.2

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 (85) hide show
  1. package/package.json +1 -1
  2. package/src/core/config.js +27 -0
  3. package/src/core/projectInfo.js +17 -2
  4. package/src/core/toolManifest.json +79 -79
  5. package/src/core/unityConnection.js +74 -7
  6. package/src/handlers/analysis/FindByComponentToolHandler.js +1 -1
  7. package/src/handlers/analysis/GetComponentValuesToolHandler.js +1 -1
  8. package/src/handlers/analysis/GetObjectReferencesToolHandler.js +1 -1
  9. package/src/handlers/asset/AssetDatabaseManageToolHandler.js +1 -1
  10. package/src/handlers/asset/AssetDependencyAnalyzeToolHandler.js +1 -1
  11. package/src/handlers/asset/AssetImportSettingsManageToolHandler.js +1 -1
  12. package/src/handlers/asset/AssetMaterialCreateToolHandler.js +1 -1
  13. package/src/handlers/asset/AssetMaterialModifyToolHandler.js +1 -1
  14. package/src/handlers/asset/AssetPrefabCreateToolHandler.js +1 -1
  15. package/src/handlers/asset/AssetPrefabExitModeToolHandler.js +1 -1
  16. package/src/handlers/asset/AssetPrefabInstantiateToolHandler.js +1 -1
  17. package/src/handlers/asset/AssetPrefabModifyToolHandler.js +1 -1
  18. package/src/handlers/asset/AssetPrefabOpenToolHandler.js +1 -1
  19. package/src/handlers/asset/AssetPrefabSaveToolHandler.js +1 -1
  20. package/src/handlers/compilation/CompilationGetStateToolHandler.js +1 -1
  21. package/src/handlers/component/ComponentAddToolHandler.js +1 -1
  22. package/src/handlers/component/ComponentFieldSetToolHandler.js +1 -1
  23. package/src/handlers/component/ComponentGetTypesToolHandler.js +1 -1
  24. package/src/handlers/component/ComponentListToolHandler.js +1 -1
  25. package/src/handlers/component/ComponentModifyToolHandler.js +1 -1
  26. package/src/handlers/component/ComponentRemoveToolHandler.js +1 -1
  27. package/src/handlers/console/ConsoleClearToolHandler.js +1 -1
  28. package/src/handlers/console/ConsoleReadToolHandler.js +1 -1
  29. package/src/handlers/editor/EditorLayersManageToolHandler.js +21 -25
  30. package/src/handlers/editor/EditorQuitToolHandler.js +1 -1
  31. package/src/handlers/editor/EditorSelectionManageToolHandler.js +1 -1
  32. package/src/handlers/editor/EditorTagsManageToolHandler.js +1 -1
  33. package/src/handlers/editor/EditorToolsManageToolHandler.js +1 -1
  34. package/src/handlers/editor/EditorWindowsManageToolHandler.js +1 -1
  35. package/src/handlers/gameobject/GameObjectCreateToolHandler.js +2 -2
  36. package/src/handlers/gameobject/GameObjectDeleteToolHandler.js +2 -2
  37. package/src/handlers/gameobject/GameObjectFindToolHandler.js +19 -5
  38. package/src/handlers/gameobject/GameObjectGetHierarchyToolHandler.js +2 -2
  39. package/src/handlers/gameobject/GameObjectModifyToolHandler.js +2 -2
  40. package/src/handlers/menu/MenuItemExecuteToolHandler.js +1 -1
  41. package/src/handlers/package/PackageManagerToolHandler.js +2 -2
  42. package/src/handlers/package/RegistryConfigToolHandler.js +1 -1
  43. package/src/handlers/playmode/PlaymodeGetStateToolHandler.js +1 -1
  44. package/src/handlers/playmode/PlaymodePauseToolHandler.js +2 -2
  45. package/src/handlers/playmode/PlaymodePlayToolHandler.js +2 -2
  46. package/src/handlers/playmode/PlaymodeStopToolHandler.js +2 -2
  47. package/src/handlers/playmode/PlaymodeWaitForStateToolHandler.js +1 -1
  48. package/src/handlers/scene/SceneCreateToolHandler.js +1 -1
  49. package/src/handlers/scene/SceneListToolHandler.js +1 -1
  50. package/src/handlers/scene/SceneLoadToolHandler.js +1 -1
  51. package/src/handlers/scene/SceneSaveToolHandler.js +1 -1
  52. package/src/handlers/screenshot/ScreenshotAnalyzeToolHandler.js +1 -1
  53. package/src/handlers/screenshot/ScreenshotCaptureToolHandler.js +1 -1
  54. package/src/handlers/script/ScriptSymbolsGetToolHandler.js +39 -21
  55. package/src/handlers/settings/SettingsGetToolHandler.js +1 -1
  56. package/src/handlers/settings/SettingsUpdateToolHandler.js +1 -1
  57. package/src/handlers/system/SystemGetCommandStatsToolHandler.js +1 -1
  58. package/src/handlers/system/SystemPingToolHandler.js +2 -2
  59. package/src/handlers/system/SystemRefreshAssetsToolHandler.js +2 -2
  60. package/src/handlers/test/TestGetStatusToolHandler.js +1 -1
  61. package/src/handlers/test/TestRunToolHandler.js +1 -1
  62. package/src/handlers/ui/UIClickElementToolHandler.js +1 -1
  63. package/src/handlers/ui/UIFindElementsToolHandler.js +1 -1
  64. package/src/handlers/ui/UIGetElementStateToolHandler.js +1 -1
  65. package/src/handlers/ui/UISetElementValueToolHandler.js +1 -1
  66. package/src/handlers/ui/UISimulateInputToolHandler.js +1 -1
  67. package/src/handlers/video/VideoCaptureForToolHandler.js +6 -6
  68. package/src/handlers/video/VideoCaptureStartToolHandler.js +1 -1
  69. package/src/handlers/video/VideoCaptureStatusToolHandler.js +1 -1
  70. package/src/handlers/video/VideoCaptureStopToolHandler.js +2 -2
  71. package/src/tools/analysis/analyzeSceneContents.js +2 -2
  72. package/src/tools/analysis/findByComponent.js +2 -2
  73. package/src/tools/analysis/getAnimatorState.js +6 -6
  74. package/src/tools/analysis/getComponentValues.js +2 -2
  75. package/src/tools/analysis/getGameObjectDetails.js +2 -2
  76. package/src/tools/analysis/getInputActionsState.js +2 -2
  77. package/src/tools/analysis/getObjectReferences.js +2 -2
  78. package/src/tools/input/inputActionsEditor.js +9 -9
  79. package/src/tools/scene/createScene.js +3 -3
  80. package/src/tools/scene/getSceneInfo.js +2 -2
  81. package/src/tools/scene/listScenes.js +3 -3
  82. package/src/tools/scene/loadScene.js +3 -3
  83. package/src/tools/scene/saveScene.js +3 -3
  84. package/src/tools/system/ping.js +5 -5
  85. package/src/core/unityCommandType.js +0 -10
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Tool definition for scene_info_get
2
+ * Tool definition for get_scene_info
3
3
  */
4
4
  export const getSceneInfoToolDefinition = {
5
- name: 'scene_info_get',
5
+ name: 'get_scene_info',
6
6
  description: 'Get detailed information about a scene',
7
7
  inputSchema: {
8
8
  type: 'object',
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Tool definition for scene_list
2
+ * Tool definition for list_scenes
3
3
  */
4
4
  export const listScenesToolDefinition = {
5
- name: 'scene_list',
5
+ name: 'list_scenes',
6
6
  description: 'List all scenes in the Unity project',
7
7
  inputSchema: {
8
8
  type: 'object',
@@ -44,7 +44,7 @@ export async function listScenesHandler(unityConnection, args) {
44
44
  }
45
45
 
46
46
  // Send command to Unity
47
- const result = await unityConnection.sendCommand('scene_list', args);
47
+ const result = await unityConnection.sendCommand('list_scenes', args);
48
48
 
49
49
  // Handle Unity response
50
50
  if (result.status === 'error') {
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Tool definition for scene_load
2
+ * Tool definition for load_scene
3
3
  */
4
4
  export const loadSceneToolDefinition = {
5
- name: 'scene_load',
5
+ name: 'load_scene',
6
6
  description: 'Load a scene in Unity',
7
7
  inputSchema: {
8
8
  type: 'object',
@@ -85,7 +85,7 @@ export async function loadSceneHandler(unityConnection, args) {
85
85
  }
86
86
 
87
87
  // Send command to Unity
88
- const result = await unityConnection.sendCommand('scene_load', args);
88
+ const result = await unityConnection.sendCommand('load_scene', args);
89
89
 
90
90
  // Handle Unity response
91
91
  if (result.status === 'error') {
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Tool definition for scene_save
2
+ * Tool definition for save_scene
3
3
  */
4
4
  export const saveSceneToolDefinition = {
5
- name: 'scene_save',
5
+ name: 'save_scene',
6
6
  description: 'Save the current scene in Unity',
7
7
  inputSchema: {
8
8
  type: 'object',
@@ -53,7 +53,7 @@ export async function saveSceneHandler(unityConnection, args) {
53
53
  }
54
54
 
55
55
  // Send command to Unity
56
- const result = await unityConnection.sendCommand('scene_save', args);
56
+ const result = await unityConnection.sendCommand('save_scene', args);
57
57
 
58
58
  // Handle Unity response
59
59
  if (result.status === 'error') {
@@ -6,7 +6,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprot
6
6
  export function registerPingTool(server, unityConnection) {
7
7
  // Tool definition
8
8
  const pingTool = {
9
- name: 'system_ping',
9
+ name: 'ping',
10
10
  description: 'Test connection to Unity Editor',
11
11
  inputSchema: {
12
12
  type: 'object',
@@ -31,7 +31,7 @@ export function registerPingTool(server, unityConnection) {
31
31
  server.setRequestHandler(CallToolRequestSchema, async request => {
32
32
  const { name, arguments: args } = request.params;
33
33
 
34
- if (name === 'system_ping') {
34
+ if (name === 'ping') {
35
35
  try {
36
36
  // Ensure connected
37
37
  if (!unityConnection.isConnected()) {
@@ -39,15 +39,15 @@ export function registerPingTool(server, unityConnection) {
39
39
  }
40
40
 
41
41
  // Send ping with optional message
42
- const result = await unityConnection.sendCommand('system_ping', {
43
- message: args?.message || 'system_ping'
42
+ const result = await unityConnection.sendCommand('ping', {
43
+ message: args?.message || 'ping'
44
44
  });
45
45
 
46
46
  return {
47
47
  content: [
48
48
  {
49
49
  type: 'text',
50
- text: `Unity responded: ${result.message} (echo: ${result.echo || args?.message || 'system_ping'})`
50
+ text: `Unity responded: ${result.message} (echo: ${result.echo || args?.message || 'ping'})`
51
51
  }
52
52
  ]
53
53
  };
@@ -1,10 +0,0 @@
1
- const TOOL_NAME_TO_UNITY_COMMAND_TYPE = Object.freeze({
2
- // Animator tools: tool name (MCP) -> Unity command type (TCP)
3
- analysis_animator_state_get: 'get_animator_state',
4
- analysis_animator_runtime_info_get: 'get_animator_runtime_info'
5
- });
6
-
7
- export function normalizeUnityCommandType(type) {
8
- if (typeof type !== 'string' || type.length === 0) return type;
9
- return TOOL_NAME_TO_UNITY_COMMAND_TYPE[type] ?? type;
10
- }