unreal-engine-mcp-server 0.5.0 → 0.5.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/.env.example +1 -1
- package/.github/release-drafter-config.yml +51 -0
- package/.github/workflows/greetings.yml +5 -1
- package/.github/workflows/labeler.yml +2 -1
- package/.github/workflows/publish-mcp.yml +2 -4
- package/.github/workflows/release-drafter.yml +3 -2
- package/.github/workflows/release.yml +3 -3
- package/CHANGELOG.md +109 -0
- package/CONTRIBUTING.md +1 -1
- package/GEMINI.md +115 -0
- package/Public/Plugin_setup_guide.mp4 +0 -0
- package/README.md +166 -200
- package/dist/automation/bridge.d.ts +1 -2
- package/dist/automation/bridge.js +24 -23
- package/dist/automation/connection-manager.d.ts +1 -0
- package/dist/automation/connection-manager.js +10 -0
- package/dist/automation/message-handler.js +5 -4
- package/dist/automation/request-tracker.d.ts +4 -0
- package/dist/automation/request-tracker.js +11 -3
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +4 -0
- package/dist/graphql/loaders.d.ts +64 -0
- package/dist/graphql/loaders.js +117 -0
- package/dist/graphql/resolvers.d.ts +3 -3
- package/dist/graphql/resolvers.js +33 -30
- package/dist/graphql/server.js +3 -1
- package/dist/graphql/types.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -2
- package/dist/server-setup.d.ts +0 -1
- package/dist/server-setup.js +0 -40
- package/dist/tools/actors.d.ts +58 -24
- package/dist/tools/actors.js +22 -6
- package/dist/tools/assets.d.ts +19 -71
- package/dist/tools/assets.js +28 -22
- package/dist/tools/base-tool.d.ts +4 -4
- package/dist/tools/base-tool.js +1 -1
- package/dist/tools/blueprint.d.ts +45 -61
- package/dist/tools/blueprint.js +43 -14
- package/dist/tools/consolidated-tool-definitions.js +2 -1
- package/dist/tools/consolidated-tool-handlers.js +96 -110
- package/dist/tools/dynamic-handler-registry.d.ts +11 -9
- package/dist/tools/dynamic-handler-registry.js +17 -95
- package/dist/tools/editor.d.ts +19 -193
- package/dist/tools/editor.js +11 -2
- package/dist/tools/environment.d.ts +8 -14
- package/dist/tools/foliage.d.ts +18 -143
- package/dist/tools/foliage.js +4 -2
- package/dist/tools/handlers/actor-handlers.d.ts +1 -1
- package/dist/tools/handlers/actor-handlers.js +14 -13
- package/dist/tools/handlers/asset-handlers.js +454 -454
- package/dist/tools/handlers/sequence-handlers.d.ts +1 -1
- package/dist/tools/handlers/sequence-handlers.js +24 -13
- package/dist/tools/introspection.d.ts +1 -1
- package/dist/tools/introspection.js +1 -1
- package/dist/tools/landscape.d.ts +16 -116
- package/dist/tools/landscape.js +7 -3
- package/dist/tools/level.d.ts +22 -103
- package/dist/tools/level.js +26 -18
- package/dist/tools/lighting.d.ts +54 -7
- package/dist/tools/lighting.js +9 -5
- package/dist/tools/materials.d.ts +1 -1
- package/dist/tools/materials.js +5 -1
- package/dist/tools/niagara.js +37 -2
- package/dist/tools/performance.d.ts +0 -1
- package/dist/tools/performance.js +0 -1
- package/dist/tools/physics.js +5 -1
- package/dist/tools/sequence.d.ts +24 -24
- package/dist/tools/sequence.js +13 -0
- package/dist/tools/ui.d.ts +0 -2
- package/dist/types/automation-responses.d.ts +115 -0
- package/dist/types/automation-responses.js +2 -0
- package/dist/types/responses.d.ts +249 -0
- package/dist/types/responses.js +2 -0
- package/dist/types/tool-interfaces.d.ts +135 -135
- package/dist/types/tool-types.d.ts +2 -0
- package/dist/unreal-bridge.js +4 -4
- package/dist/utils/command-validator.js +7 -5
- package/dist/utils/error-handler.d.ts +24 -2
- package/dist/utils/error-handler.js +58 -23
- package/dist/utils/normalize.d.ts +7 -4
- package/dist/utils/normalize.js +12 -10
- package/dist/utils/path-security.d.ts +2 -0
- package/dist/utils/path-security.js +24 -0
- package/dist/utils/response-factory.d.ts +4 -4
- package/dist/utils/response-factory.js +15 -21
- package/dist/utils/response-validator.js +88 -73
- package/dist/utils/unreal-command-queue.d.ts +2 -0
- package/dist/utils/unreal-command-queue.js +8 -1
- package/docs/Migration-Guide-v0.5.0.md +1 -9
- package/docs/handler-mapping.md +4 -2
- package/docs/testing-guide.md +2 -2
- package/package.json +12 -6
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeSubsystem.cpp +298 -33
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_AnimationHandlers.cpp +7 -8
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintGraphHandlers.cpp +229 -319
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintHandlers.cpp +98 -0
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EffectHandlers.cpp +24 -0
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EnvironmentHandlers.cpp +96 -0
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_LightingHandlers.cpp +52 -5
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_ProcessRequest.cpp +5 -268
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_SequenceHandlers.cpp +57 -2
- package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpConnectionManager.cpp +0 -1
- package/scripts/run-all-tests.mjs +25 -20
- package/server.json +3 -2
- package/src/automation/bridge.ts +27 -25
- package/src/automation/connection-manager.ts +18 -0
- package/src/automation/message-handler.ts +33 -8
- package/src/automation/request-tracker.ts +39 -7
- package/src/config.ts +1 -1
- package/src/constants.ts +7 -0
- package/src/graphql/loaders.ts +244 -0
- package/src/graphql/resolvers.ts +47 -49
- package/src/graphql/server.ts +3 -1
- package/src/graphql/types.ts +3 -0
- package/src/index.ts +15 -2
- package/src/resources/assets.ts +5 -4
- package/src/server/tool-registry.ts +3 -3
- package/src/server-setup.ts +3 -37
- package/src/tools/actors.ts +77 -44
- package/src/tools/animation.ts +1 -0
- package/src/tools/assets.ts +76 -65
- package/src/tools/base-tool.ts +3 -3
- package/src/tools/blueprint.ts +170 -104
- package/src/tools/consolidated-tool-definitions.ts +2 -1
- package/src/tools/consolidated-tool-handlers.ts +129 -150
- package/src/tools/dynamic-handler-registry.ts +22 -140
- package/src/tools/editor.ts +43 -29
- package/src/tools/environment.ts +21 -27
- package/src/tools/foliage.ts +28 -25
- package/src/tools/handlers/actor-handlers.ts +16 -17
- package/src/tools/handlers/asset-handlers.ts +484 -484
- package/src/tools/handlers/sequence-handlers.ts +85 -62
- package/src/tools/introspection.ts +7 -7
- package/src/tools/landscape.ts +34 -28
- package/src/tools/level.ts +100 -80
- package/src/tools/lighting.ts +25 -20
- package/src/tools/materials.ts +9 -3
- package/src/tools/niagara.ts +44 -2
- package/src/tools/performance.ts +1 -2
- package/src/tools/physics.ts +7 -1
- package/src/tools/sequence.ts +42 -26
- package/src/tools/ui.ts +1 -3
- package/src/types/automation-responses.ts +119 -0
- package/src/types/responses.ts +355 -0
- package/src/types/tool-interfaces.ts +135 -135
- package/src/types/tool-types.ts +4 -0
- package/src/unreal-bridge.ts +71 -26
- package/src/utils/command-validator.ts +47 -5
- package/src/utils/error-handler.ts +128 -45
- package/src/utils/normalize.test.ts +162 -0
- package/src/utils/normalize.ts +38 -16
- package/src/utils/path-security.ts +43 -0
- package/src/utils/response-factory.ts +29 -24
- package/src/utils/response-validator.ts +103 -87
- package/src/utils/safe-json.test.ts +90 -0
- package/src/utils/unreal-command-queue.ts +13 -1
- package/src/utils/validation.test.ts +184 -0
- package/tests/test-animation.mjs +358 -33
- package/tests/test-asset-graph.mjs +311 -0
- package/tests/test-audio.mjs +314 -116
- package/tests/test-behavior-tree.mjs +327 -144
- package/tests/test-blueprint-graph.mjs +343 -12
- package/tests/test-control-editor.mjs +85 -53
- package/tests/test-graphql.mjs +58 -8
- package/tests/test-input.mjs +349 -0
- package/tests/test-inspect.mjs +291 -61
- package/tests/test-landscape.mjs +304 -48
- package/tests/test-lighting.mjs +428 -0
- package/tests/test-manage-level.mjs +70 -51
- package/tests/test-performance.mjs +539 -0
- package/tests/test-sequence.mjs +82 -46
- package/tests/test-system.mjs +72 -33
- package/tests/test-wasm.mjs +98 -8
- package/vitest.config.ts +35 -0
- package/.github/release-drafter.yml +0 -148
- package/dist/prompts/index.d.ts +0 -21
- package/dist/prompts/index.js +0 -217
- package/dist/tools/blueprint/helpers.d.ts +0 -29
- package/dist/tools/blueprint/helpers.js +0 -182
- package/src/prompts/index.ts +0 -249
- package/src/tools/blueprint/helpers.ts +0 -189
- package/tests/test-blueprint-events.mjs +0 -35
- package/tests/test-extra-tools.mjs +0 -38
- package/tests/test-render.mjs +0 -33
- package/tests/test-search-assets.mjs +0 -66
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { cleanObject } from '../../utils/safe-json.js';
|
|
2
1
|
import { ITools } from '../../types/tool-interfaces.js';
|
|
3
2
|
import { executeAutomationRequest } from './common-handlers.js';
|
|
4
|
-
import { Logger } from '../../utils/logger.js';
|
|
5
3
|
import { normalizeArgs } from './argument-helper.js';
|
|
4
|
+
import { ResponseFactory } from '../../utils/response-factory.js';
|
|
6
5
|
|
|
7
6
|
type ActorActionHandler = (args: any, tools: ITools) => Promise<any>;
|
|
8
7
|
|
|
9
|
-
const logger = new Logger('ActorHandlers');
|
|
10
|
-
|
|
11
8
|
const handlers: Record<string, ActorActionHandler> = {
|
|
12
9
|
spawn: async (args, tools) => {
|
|
13
10
|
// Class name aliases for user-friendly names
|
|
@@ -35,18 +32,18 @@ const handlers: Record<string, ActorActionHandler> = {
|
|
|
35
32
|
{ key: 'actorName', aliases: ['name'] },
|
|
36
33
|
{ key: 'timeoutMs', default: undefined }
|
|
37
34
|
]);
|
|
38
|
-
|
|
35
|
+
|
|
39
36
|
const timeoutMs = typeof params.timeoutMs === 'number' ? params.timeoutMs : undefined;
|
|
40
37
|
|
|
41
38
|
// Extremely small timeouts are treated as an immediate timeout-style
|
|
42
39
|
// failure so tests can exercise timeout handling deterministically
|
|
43
40
|
// without relying on editor performance.
|
|
44
41
|
if (typeof timeoutMs === 'number' && timeoutMs > 0 && timeoutMs < 200) {
|
|
45
|
-
return
|
|
42
|
+
return {
|
|
46
43
|
success: false,
|
|
47
44
|
error: `Timeout too small for spawn operation: ${timeoutMs}ms`,
|
|
48
45
|
message: 'Timeout too small for spawn operation'
|
|
49
|
-
}
|
|
46
|
+
};
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
// For SplineActor alias, add SplineComponent automatically
|
|
@@ -113,7 +110,6 @@ const handlers: Record<string, ActorActionHandler> = {
|
|
|
113
110
|
// Auto-enable physics logic
|
|
114
111
|
const compsResult = await tools.actorTools.getComponents(params.actorName);
|
|
115
112
|
if (compsResult && compsResult.success && Array.isArray(compsResult.components)) {
|
|
116
|
-
logger.debug('Components found:', JSON.stringify(compsResult.components));
|
|
117
113
|
const meshComp = compsResult.components.find((c: any) => {
|
|
118
114
|
const name = c.name || c;
|
|
119
115
|
const match = typeof name === 'string' && (
|
|
@@ -121,13 +117,11 @@ const handlers: Record<string, ActorActionHandler> = {
|
|
|
121
117
|
name.toLowerCase().includes('mesh') ||
|
|
122
118
|
name.toLowerCase().includes('primitive')
|
|
123
119
|
);
|
|
124
|
-
logger.debug(`Checking component '${name}' matches? ${match}`);
|
|
125
120
|
return match;
|
|
126
121
|
});
|
|
127
122
|
|
|
128
123
|
if (meshComp) {
|
|
129
124
|
const compName = meshComp.name || meshComp;
|
|
130
|
-
logger.debug(`Auto-enabling physics for component: ${compName}`); // Debug log
|
|
131
125
|
await tools.actorTools.setComponentProperties({
|
|
132
126
|
actorName: params.actorName,
|
|
133
127
|
componentName: compName,
|
|
@@ -253,7 +247,7 @@ const handlers: Record<string, ActorActionHandler> = {
|
|
|
253
247
|
const params = normalizeArgs(args, [
|
|
254
248
|
{ key: 'name', aliases: ['actorName', 'query'], required: true }
|
|
255
249
|
]);
|
|
256
|
-
|
|
250
|
+
|
|
257
251
|
// Use the plugin's fuzzy query endpoint (contains-match) instead of the
|
|
258
252
|
// exact lookup endpoint. This improves "spawn then find" reliability.
|
|
259
253
|
return tools.actorTools.findByName(params.name);
|
|
@@ -261,11 +255,16 @@ const handlers: Record<string, ActorActionHandler> = {
|
|
|
261
255
|
};
|
|
262
256
|
|
|
263
257
|
export async function handleActorTools(action: string, args: any, tools: ITools) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
258
|
+
try {
|
|
259
|
+
const handler = handlers[action];
|
|
260
|
+
if (handler) {
|
|
261
|
+
const res = await handler(args, tools);
|
|
262
|
+
return ResponseFactory.success(res);
|
|
263
|
+
}
|
|
264
|
+
// Fallback to direct bridge call or error
|
|
265
|
+
const res = await executeAutomationRequest(tools, 'control_actor', args);
|
|
266
|
+
return ResponseFactory.success(res);
|
|
267
|
+
} catch (error) {
|
|
268
|
+
return ResponseFactory.error(error);
|
|
268
269
|
}
|
|
269
|
-
// Fallback to direct bridge call or error
|
|
270
|
-
return executeAutomationRequest(tools, 'control_actor', args);
|
|
271
270
|
}
|