@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.
- package/package.json +1 -1
- package/src/core/config.js +27 -0
- package/src/core/projectInfo.js +17 -2
- package/src/core/toolManifest.json +79 -79
- package/src/core/unityConnection.js +74 -7
- package/src/handlers/analysis/FindByComponentToolHandler.js +1 -1
- package/src/handlers/analysis/GetComponentValuesToolHandler.js +1 -1
- package/src/handlers/analysis/GetObjectReferencesToolHandler.js +1 -1
- package/src/handlers/asset/AssetDatabaseManageToolHandler.js +1 -1
- package/src/handlers/asset/AssetDependencyAnalyzeToolHandler.js +1 -1
- package/src/handlers/asset/AssetImportSettingsManageToolHandler.js +1 -1
- package/src/handlers/asset/AssetMaterialCreateToolHandler.js +1 -1
- package/src/handlers/asset/AssetMaterialModifyToolHandler.js +1 -1
- package/src/handlers/asset/AssetPrefabCreateToolHandler.js +1 -1
- package/src/handlers/asset/AssetPrefabExitModeToolHandler.js +1 -1
- package/src/handlers/asset/AssetPrefabInstantiateToolHandler.js +1 -1
- package/src/handlers/asset/AssetPrefabModifyToolHandler.js +1 -1
- package/src/handlers/asset/AssetPrefabOpenToolHandler.js +1 -1
- package/src/handlers/asset/AssetPrefabSaveToolHandler.js +1 -1
- package/src/handlers/compilation/CompilationGetStateToolHandler.js +1 -1
- package/src/handlers/component/ComponentAddToolHandler.js +1 -1
- package/src/handlers/component/ComponentFieldSetToolHandler.js +1 -1
- package/src/handlers/component/ComponentGetTypesToolHandler.js +1 -1
- package/src/handlers/component/ComponentListToolHandler.js +1 -1
- package/src/handlers/component/ComponentModifyToolHandler.js +1 -1
- package/src/handlers/component/ComponentRemoveToolHandler.js +1 -1
- package/src/handlers/console/ConsoleClearToolHandler.js +1 -1
- package/src/handlers/console/ConsoleReadToolHandler.js +1 -1
- package/src/handlers/editor/EditorLayersManageToolHandler.js +21 -25
- package/src/handlers/editor/EditorQuitToolHandler.js +1 -1
- package/src/handlers/editor/EditorSelectionManageToolHandler.js +1 -1
- package/src/handlers/editor/EditorTagsManageToolHandler.js +1 -1
- package/src/handlers/editor/EditorToolsManageToolHandler.js +1 -1
- package/src/handlers/editor/EditorWindowsManageToolHandler.js +1 -1
- package/src/handlers/gameobject/GameObjectCreateToolHandler.js +2 -2
- package/src/handlers/gameobject/GameObjectDeleteToolHandler.js +2 -2
- package/src/handlers/gameobject/GameObjectFindToolHandler.js +19 -5
- package/src/handlers/gameobject/GameObjectGetHierarchyToolHandler.js +2 -2
- package/src/handlers/gameobject/GameObjectModifyToolHandler.js +2 -2
- package/src/handlers/menu/MenuItemExecuteToolHandler.js +1 -1
- package/src/handlers/package/PackageManagerToolHandler.js +2 -2
- package/src/handlers/package/RegistryConfigToolHandler.js +1 -1
- package/src/handlers/playmode/PlaymodeGetStateToolHandler.js +1 -1
- package/src/handlers/playmode/PlaymodePauseToolHandler.js +2 -2
- package/src/handlers/playmode/PlaymodePlayToolHandler.js +2 -2
- package/src/handlers/playmode/PlaymodeStopToolHandler.js +2 -2
- package/src/handlers/playmode/PlaymodeWaitForStateToolHandler.js +1 -1
- package/src/handlers/scene/SceneCreateToolHandler.js +1 -1
- package/src/handlers/scene/SceneListToolHandler.js +1 -1
- package/src/handlers/scene/SceneLoadToolHandler.js +1 -1
- package/src/handlers/scene/SceneSaveToolHandler.js +1 -1
- package/src/handlers/screenshot/ScreenshotAnalyzeToolHandler.js +1 -1
- package/src/handlers/screenshot/ScreenshotCaptureToolHandler.js +1 -1
- package/src/handlers/script/ScriptSymbolsGetToolHandler.js +39 -21
- package/src/handlers/settings/SettingsGetToolHandler.js +1 -1
- package/src/handlers/settings/SettingsUpdateToolHandler.js +1 -1
- package/src/handlers/system/SystemGetCommandStatsToolHandler.js +1 -1
- package/src/handlers/system/SystemPingToolHandler.js +2 -2
- package/src/handlers/system/SystemRefreshAssetsToolHandler.js +2 -2
- package/src/handlers/test/TestGetStatusToolHandler.js +1 -1
- package/src/handlers/test/TestRunToolHandler.js +1 -1
- package/src/handlers/ui/UIClickElementToolHandler.js +1 -1
- package/src/handlers/ui/UIFindElementsToolHandler.js +1 -1
- package/src/handlers/ui/UIGetElementStateToolHandler.js +1 -1
- package/src/handlers/ui/UISetElementValueToolHandler.js +1 -1
- package/src/handlers/ui/UISimulateInputToolHandler.js +1 -1
- package/src/handlers/video/VideoCaptureForToolHandler.js +6 -6
- package/src/handlers/video/VideoCaptureStartToolHandler.js +1 -1
- package/src/handlers/video/VideoCaptureStatusToolHandler.js +1 -1
- package/src/handlers/video/VideoCaptureStopToolHandler.js +2 -2
- package/src/tools/analysis/analyzeSceneContents.js +2 -2
- package/src/tools/analysis/findByComponent.js +2 -2
- package/src/tools/analysis/getAnimatorState.js +6 -6
- package/src/tools/analysis/getComponentValues.js +2 -2
- package/src/tools/analysis/getGameObjectDetails.js +2 -2
- package/src/tools/analysis/getInputActionsState.js +2 -2
- package/src/tools/analysis/getObjectReferences.js +2 -2
- package/src/tools/input/inputActionsEditor.js +9 -9
- package/src/tools/scene/createScene.js +3 -3
- package/src/tools/scene/getSceneInfo.js +2 -2
- package/src/tools/scene/listScenes.js +3 -3
- package/src/tools/scene/loadScene.js +3 -3
- package/src/tools/scene/saveScene.js +3 -3
- package/src/tools/system/ping.js +5 -5
- package/src/core/unityCommandType.js +0 -10
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tool definition for
|
|
2
|
+
* Tool definition for get_scene_info
|
|
3
3
|
*/
|
|
4
4
|
export const getSceneInfoToolDefinition = {
|
|
5
|
-
name: '
|
|
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
|
|
2
|
+
* Tool definition for list_scenes
|
|
3
3
|
*/
|
|
4
4
|
export const listScenesToolDefinition = {
|
|
5
|
-
name: '
|
|
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('
|
|
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
|
|
2
|
+
* Tool definition for load_scene
|
|
3
3
|
*/
|
|
4
4
|
export const loadSceneToolDefinition = {
|
|
5
|
-
name: '
|
|
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('
|
|
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
|
|
2
|
+
* Tool definition for save_scene
|
|
3
3
|
*/
|
|
4
4
|
export const saveSceneToolDefinition = {
|
|
5
|
-
name: '
|
|
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('
|
|
56
|
+
const result = await unityConnection.sendCommand('save_scene', args);
|
|
57
57
|
|
|
58
58
|
// Handle Unity response
|
|
59
59
|
if (result.status === 'error') {
|
package/src/tools/system/ping.js
CHANGED
|
@@ -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: '
|
|
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 === '
|
|
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('
|
|
43
|
-
message: args?.message || '
|
|
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 || '
|
|
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
|
-
}
|