unreal-engine-mcp-server 0.5.0 → 0.5.1

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 (139) hide show
  1. package/.env.example +1 -1
  2. package/.github/release-drafter-config.yml +51 -0
  3. package/.github/workflows/greetings.yml +5 -1
  4. package/.github/workflows/labeler.yml +2 -1
  5. package/.github/workflows/publish-mcp.yml +1 -0
  6. package/.github/workflows/release-drafter.yml +1 -1
  7. package/.github/workflows/release.yml +3 -3
  8. package/CHANGELOG.md +71 -0
  9. package/CONTRIBUTING.md +1 -1
  10. package/GEMINI.md +115 -0
  11. package/Public/Plugin_setup_guide.mp4 +0 -0
  12. package/README.md +166 -200
  13. package/dist/config.d.ts +0 -1
  14. package/dist/config.js +0 -1
  15. package/dist/constants.d.ts +4 -0
  16. package/dist/constants.js +4 -0
  17. package/dist/graphql/loaders.d.ts +64 -0
  18. package/dist/graphql/loaders.js +117 -0
  19. package/dist/graphql/resolvers.d.ts +3 -3
  20. package/dist/graphql/resolvers.js +33 -30
  21. package/dist/graphql/server.js +3 -1
  22. package/dist/graphql/types.d.ts +2 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +13 -2
  25. package/dist/server-setup.d.ts +0 -1
  26. package/dist/server-setup.js +0 -40
  27. package/dist/tools/actors.d.ts +40 -24
  28. package/dist/tools/actors.js +8 -2
  29. package/dist/tools/assets.d.ts +19 -71
  30. package/dist/tools/assets.js +28 -22
  31. package/dist/tools/base-tool.d.ts +4 -4
  32. package/dist/tools/base-tool.js +1 -1
  33. package/dist/tools/blueprint.d.ts +33 -61
  34. package/dist/tools/consolidated-tool-handlers.js +96 -110
  35. package/dist/tools/dynamic-handler-registry.d.ts +11 -9
  36. package/dist/tools/dynamic-handler-registry.js +17 -95
  37. package/dist/tools/editor.d.ts +19 -193
  38. package/dist/tools/editor.js +8 -0
  39. package/dist/tools/environment.d.ts +8 -14
  40. package/dist/tools/foliage.d.ts +18 -143
  41. package/dist/tools/foliage.js +4 -2
  42. package/dist/tools/handlers/actor-handlers.js +0 -5
  43. package/dist/tools/handlers/asset-handlers.js +454 -454
  44. package/dist/tools/landscape.d.ts +16 -116
  45. package/dist/tools/landscape.js +7 -3
  46. package/dist/tools/level.d.ts +22 -103
  47. package/dist/tools/level.js +24 -16
  48. package/dist/tools/lighting.js +5 -1
  49. package/dist/tools/materials.js +5 -1
  50. package/dist/tools/niagara.js +37 -2
  51. package/dist/tools/performance.d.ts +0 -1
  52. package/dist/tools/performance.js +0 -1
  53. package/dist/tools/physics.js +5 -1
  54. package/dist/tools/sequence.d.ts +24 -24
  55. package/dist/tools/sequence.js +13 -0
  56. package/dist/tools/ui.d.ts +0 -2
  57. package/dist/types/automation-responses.d.ts +115 -0
  58. package/dist/types/automation-responses.js +2 -0
  59. package/dist/types/responses.d.ts +249 -0
  60. package/dist/types/responses.js +2 -0
  61. package/dist/types/tool-interfaces.d.ts +135 -135
  62. package/dist/utils/command-validator.js +3 -2
  63. package/dist/utils/path-security.d.ts +2 -0
  64. package/dist/utils/path-security.js +24 -0
  65. package/dist/utils/response-factory.d.ts +4 -4
  66. package/dist/utils/response-factory.js +15 -21
  67. package/docs/Migration-Guide-v0.5.0.md +1 -9
  68. package/docs/testing-guide.md +2 -2
  69. package/package.json +12 -6
  70. package/scripts/run-all-tests.mjs +25 -20
  71. package/server.json +3 -2
  72. package/src/config.ts +1 -1
  73. package/src/constants.ts +7 -0
  74. package/src/graphql/loaders.ts +244 -0
  75. package/src/graphql/resolvers.ts +47 -49
  76. package/src/graphql/server.ts +3 -1
  77. package/src/graphql/types.ts +3 -0
  78. package/src/index.ts +15 -2
  79. package/src/resources/assets.ts +5 -4
  80. package/src/server-setup.ts +3 -37
  81. package/src/tools/actors.ts +36 -28
  82. package/src/tools/animation.ts +1 -0
  83. package/src/tools/assets.ts +74 -63
  84. package/src/tools/base-tool.ts +3 -3
  85. package/src/tools/blueprint.ts +59 -59
  86. package/src/tools/consolidated-tool-handlers.ts +129 -150
  87. package/src/tools/dynamic-handler-registry.ts +22 -140
  88. package/src/tools/editor.ts +39 -26
  89. package/src/tools/environment.ts +21 -27
  90. package/src/tools/foliage.ts +28 -25
  91. package/src/tools/handlers/actor-handlers.ts +2 -8
  92. package/src/tools/handlers/asset-handlers.ts +484 -484
  93. package/src/tools/handlers/sequence-handlers.ts +1 -1
  94. package/src/tools/landscape.ts +34 -28
  95. package/src/tools/level.ts +96 -76
  96. package/src/tools/lighting.ts +6 -1
  97. package/src/tools/materials.ts +8 -2
  98. package/src/tools/niagara.ts +44 -2
  99. package/src/tools/performance.ts +1 -2
  100. package/src/tools/physics.ts +7 -1
  101. package/src/tools/sequence.ts +41 -25
  102. package/src/tools/ui.ts +0 -2
  103. package/src/types/automation-responses.ts +119 -0
  104. package/src/types/responses.ts +355 -0
  105. package/src/types/tool-interfaces.ts +135 -135
  106. package/src/utils/command-validator.ts +3 -2
  107. package/src/utils/normalize.test.ts +162 -0
  108. package/src/utils/path-security.ts +43 -0
  109. package/src/utils/response-factory.ts +29 -24
  110. package/src/utils/safe-json.test.ts +90 -0
  111. package/src/utils/validation.test.ts +184 -0
  112. package/tests/test-animation.mjs +358 -33
  113. package/tests/test-asset-graph.mjs +311 -0
  114. package/tests/test-audio.mjs +314 -116
  115. package/tests/test-behavior-tree.mjs +327 -144
  116. package/tests/test-blueprint-graph.mjs +343 -12
  117. package/tests/test-control-editor.mjs +85 -53
  118. package/tests/test-graphql.mjs +58 -8
  119. package/tests/test-input.mjs +349 -0
  120. package/tests/test-inspect.mjs +291 -61
  121. package/tests/test-landscape.mjs +304 -48
  122. package/tests/test-lighting.mjs +428 -0
  123. package/tests/test-manage-level.mjs +70 -51
  124. package/tests/test-performance.mjs +539 -0
  125. package/tests/test-sequence.mjs +82 -46
  126. package/tests/test-system.mjs +72 -33
  127. package/tests/test-wasm.mjs +98 -8
  128. package/vitest.config.ts +35 -0
  129. package/.github/release-drafter.yml +0 -148
  130. package/dist/prompts/index.d.ts +0 -21
  131. package/dist/prompts/index.js +0 -217
  132. package/dist/tools/blueprint/helpers.d.ts +0 -29
  133. package/dist/tools/blueprint/helpers.js +0 -182
  134. package/src/prompts/index.ts +0 -249
  135. package/src/tools/blueprint/helpers.ts +0 -189
  136. package/tests/test-blueprint-events.mjs +0 -35
  137. package/tests/test-extra-tools.mjs +0 -38
  138. package/tests/test-render.mjs +0 -33
  139. package/tests/test-search-assets.mjs +0 -66
@@ -1,12 +1,7 @@
1
1
  import { AutomationBridge } from '../automation/index.js';
2
2
  import { UnrealBridge } from '../unreal-bridge.js';
3
- interface EnvironmentResult {
4
- success: boolean;
5
- message?: string;
6
- error?: string;
7
- details?: Record<string, unknown>;
8
- }
9
- export declare class EnvironmentTools {
3
+ import { IEnvironmentTools, StandardActionResponse } from '../types/tool-interfaces.js';
4
+ export declare class EnvironmentTools implements IEnvironmentTools {
10
5
  private automationBridge?;
11
6
  constructor(_bridge: UnrealBridge, automationBridge?: AutomationBridge | undefined);
12
7
  setAutomationBridge(automationBridge?: AutomationBridge): void;
@@ -16,21 +11,20 @@ export declare class EnvironmentTools {
16
11
  private getDefaultSkylightIntensity;
17
12
  private normalizeNumber;
18
13
  private invoke;
19
- setTimeOfDay(hour: unknown): Promise<EnvironmentResult>;
20
- setSunIntensity(intensity: unknown): Promise<EnvironmentResult>;
21
- setSkylightIntensity(intensity: unknown): Promise<EnvironmentResult>;
14
+ setTimeOfDay(hour: unknown): Promise<StandardActionResponse>;
15
+ setSunIntensity(intensity: unknown): Promise<StandardActionResponse>;
16
+ setSkylightIntensity(intensity: unknown): Promise<StandardActionResponse>;
22
17
  exportSnapshot(params: {
23
18
  path?: unknown;
24
19
  filename?: unknown;
25
- }): Promise<EnvironmentResult>;
20
+ }): Promise<StandardActionResponse>;
26
21
  importSnapshot(params: {
27
22
  path?: unknown;
28
23
  filename?: unknown;
29
- }): Promise<EnvironmentResult>;
24
+ }): Promise<StandardActionResponse>;
30
25
  cleanup(params?: {
31
26
  names?: unknown;
32
27
  name?: unknown;
33
- }): Promise<EnvironmentResult>;
28
+ }): Promise<StandardActionResponse>;
34
29
  }
35
- export {};
36
30
  //# sourceMappingURL=environment.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { UnrealBridge } from '../unreal-bridge.js';
2
2
  import { AutomationBridge } from '../automation/index.js';
3
- export declare class FoliageTools {
3
+ import { IFoliageTools, StandardActionResponse } from '../types/tool-interfaces.js';
4
+ export declare class FoliageTools implements IFoliageTools {
4
5
  private bridge;
5
6
  private automationBridge?;
6
7
  constructor(bridge: UnrealBridge, automationBridge?: AutomationBridge | undefined);
@@ -15,87 +16,21 @@ export declare class FoliageTools {
15
16
  alignToNormal?: boolean;
16
17
  randomYaw?: boolean;
17
18
  groundSlope?: number;
18
- }): Promise<{
19
- success: boolean;
20
- error: string;
21
- note?: undefined;
22
- created?: undefined;
23
- exists?: undefined;
24
- method?: undefined;
25
- assetPath?: undefined;
26
- usedMesh?: undefined;
27
- message?: undefined;
28
- } | {
29
- success: boolean;
30
- error: string;
31
- note: string | undefined;
32
- created?: undefined;
33
- exists?: undefined;
34
- method?: undefined;
35
- assetPath?: undefined;
36
- usedMesh?: undefined;
37
- message?: undefined;
38
- } | {
39
- success: boolean;
40
- created: boolean;
41
- exists: boolean;
42
- method: string;
43
- assetPath: string | undefined;
44
- usedMesh: string | undefined;
45
- note: string | undefined;
46
- message: string;
47
- error?: undefined;
48
- }>;
19
+ }): Promise<StandardActionResponse>;
49
20
  paintFoliage(params: {
50
21
  foliageType: string;
51
22
  position: [number, number, number];
52
23
  brushSize?: number;
53
24
  paintDensity?: number;
54
25
  eraseMode?: boolean;
55
- }): Promise<{
56
- success: boolean;
57
- error: string;
58
- note?: undefined;
59
- added?: undefined;
60
- message?: undefined;
61
- } | {
62
- success: boolean;
63
- error: string;
64
- note: string | undefined;
65
- added?: undefined;
66
- message?: undefined;
67
- } | {
68
- success: boolean;
69
- added: number;
70
- note: string | undefined;
71
- message: string;
72
- error?: undefined;
73
- }>;
26
+ }): Promise<StandardActionResponse>;
74
27
  getFoliageInstances(params: {
75
28
  foliageType?: string;
76
- }): Promise<{
77
- success: boolean;
78
- error: string;
79
- count?: undefined;
80
- instances?: undefined;
81
- } | {
82
- success: boolean;
83
- count: number;
84
- instances: any[];
85
- error?: undefined;
86
- }>;
29
+ }): Promise<StandardActionResponse>;
87
30
  removeFoliage(params: {
88
31
  foliageType?: string;
89
32
  removeAll?: boolean;
90
- }): Promise<{
91
- success: boolean;
92
- error: string;
93
- instancesRemoved?: undefined;
94
- } | {
95
- success: boolean;
96
- instancesRemoved: number;
97
- error?: undefined;
98
- }>;
33
+ }): Promise<StandardActionResponse>;
99
34
  createInstancedMesh(params: {
100
35
  name: string;
101
36
  meshPath: string;
@@ -106,18 +41,12 @@ export declare class FoliageTools {
106
41
  }>;
107
42
  enableCulling?: boolean;
108
43
  cullDistance?: number;
109
- }): Promise<{
110
- success: boolean;
111
- message: string;
112
- }>;
44
+ }): Promise<StandardActionResponse>;
113
45
  setFoliageLOD(params: {
114
46
  foliageType: string;
115
47
  lodDistances?: number[];
116
48
  screenSize?: number[];
117
- }): Promise<{
118
- success: boolean;
119
- message: string;
120
- }>;
49
+ }): Promise<StandardActionResponse>;
121
50
  addFoliage(params: {
122
51
  foliageType: string;
123
52
  locations: Array<{
@@ -125,15 +54,7 @@ export declare class FoliageTools {
125
54
  y: number;
126
55
  z: number;
127
56
  }>;
128
- }): Promise<{
129
- success: boolean;
130
- error: string;
131
- message?: undefined;
132
- } | {
133
- success: boolean;
134
- message: string;
135
- error?: undefined;
136
- }>;
57
+ }): Promise<StandardActionResponse>;
137
58
  createProceduralFoliage(params: {
138
59
  name: string;
139
60
  bounds?: {
@@ -161,23 +82,7 @@ export declare class FoliageTools {
161
82
  size?: [number, number, number];
162
83
  seed?: number;
163
84
  tileSize?: number;
164
- }): Promise<{
165
- success: boolean;
166
- error: string;
167
- message?: undefined;
168
- details?: undefined;
169
- volumeActor?: undefined;
170
- spawnerPath?: undefined;
171
- foliageTypesCount?: undefined;
172
- } | {
173
- success: boolean;
174
- message: string;
175
- details: import("../automation/types.js").AutomationBridgeResponseMessage;
176
- volumeActor: any;
177
- spawnerPath: any;
178
- foliageTypesCount: any;
179
- error?: undefined;
180
- }>;
85
+ }): Promise<StandardActionResponse>;
181
86
  addFoliageInstances(params: {
182
87
  foliageType: string;
183
88
  transforms: Array<{
@@ -185,31 +90,13 @@ export declare class FoliageTools {
185
90
  rotation?: [number, number, number];
186
91
  scale?: [number, number, number];
187
92
  }>;
188
- }): Promise<{
189
- success: boolean;
190
- error: string;
191
- message: string;
192
- instancesCount?: undefined;
193
- } | {
194
- success: boolean;
195
- message: string;
196
- instancesCount: any;
197
- error?: undefined;
198
- } | {
199
- success: boolean;
200
- error: string;
201
- message?: undefined;
202
- instancesCount?: undefined;
203
- }>;
93
+ }): Promise<StandardActionResponse>;
204
94
  setFoliageCollision(params: {
205
95
  foliageType: string;
206
96
  collisionEnabled?: boolean;
207
97
  collisionProfile?: string;
208
98
  generateOverlapEvents?: boolean;
209
- }): Promise<{
210
- success: boolean;
211
- message: string;
212
- }>;
99
+ }): Promise<StandardActionResponse>;
213
100
  createGrassSystem(params: {
214
101
  name: string;
215
102
  grassTypes: Array<{
@@ -220,46 +107,34 @@ export declare class FoliageTools {
220
107
  }>;
221
108
  windStrength?: number;
222
109
  windSpeed?: number;
223
- }): Promise<{
224
- success: boolean;
225
- message: string;
226
- }>;
110
+ }): Promise<StandardActionResponse>;
227
111
  removeFoliageInstances(params: {
228
112
  foliageType: string;
229
113
  position: [number, number, number];
230
114
  radius: number;
231
- }): Promise<any>;
115
+ }): Promise<StandardActionResponse>;
232
116
  selectFoliageInstances(params: {
233
117
  foliageType: string;
234
118
  position?: [number, number, number];
235
119
  radius?: number;
236
120
  selectAll?: boolean;
237
- }): Promise<any>;
121
+ }): Promise<StandardActionResponse>;
238
122
  updateFoliageInstances(params: {
239
123
  foliageType: string;
240
124
  updateTransforms?: boolean;
241
125
  updateMesh?: boolean;
242
126
  newMeshPath?: string;
243
- }): Promise<{
244
- success: boolean;
245
- message: string;
246
- }>;
127
+ }): Promise<StandardActionResponse>;
247
128
  createFoliageSpawner(params: {
248
129
  name: string;
249
130
  spawnArea: 'Landscape' | 'StaticMesh' | 'BSP' | 'Foliage' | 'All';
250
131
  excludeAreas?: Array<[number, number, number, number]>;
251
- }): Promise<{
252
- success: boolean;
253
- message: string;
254
- }>;
132
+ }): Promise<StandardActionResponse>;
255
133
  optimizeFoliage(params: {
256
134
  mergeInstances?: boolean;
257
135
  generateClusters?: boolean;
258
136
  clusterSize?: number;
259
137
  reduceDrawCalls?: boolean;
260
- }): Promise<{
261
- success: boolean;
262
- message: string;
263
- }>;
138
+ }): Promise<StandardActionResponse>;
264
139
  }
265
140
  //# sourceMappingURL=foliage.d.ts.map
@@ -161,7 +161,8 @@ export class FoliageTools {
161
161
  return {
162
162
  success: true,
163
163
  count: coerceNumber(payload.count) ?? 0,
164
- instances: payload.instances ?? []
164
+ instances: payload.instances ?? [],
165
+ message: 'Foliage instances retrieved'
165
166
  };
166
167
  }
167
168
  catch (error) {
@@ -184,7 +185,8 @@ export class FoliageTools {
184
185
  const payload = response.result;
185
186
  return {
186
187
  success: true,
187
- instancesRemoved: coerceNumber(payload.instancesRemoved) ?? 0
188
+ instancesRemoved: coerceNumber(payload.instancesRemoved) ?? 0,
189
+ message: 'Foliage removed'
188
190
  };
189
191
  }
190
192
  catch (error) {
@@ -1,8 +1,6 @@
1
1
  import { cleanObject } from '../../utils/safe-json.js';
2
2
  import { executeAutomationRequest } from './common-handlers.js';
3
- import { Logger } from '../../utils/logger.js';
4
3
  import { normalizeArgs } from './argument-helper.js';
5
- const logger = new Logger('ActorHandlers');
6
4
  const handlers = {
7
5
  spawn: async (args, tools) => {
8
6
  const classAliases = {
@@ -87,18 +85,15 @@ const handlers = {
87
85
  try {
88
86
  const compsResult = await tools.actorTools.getComponents(params.actorName);
89
87
  if (compsResult && compsResult.success && Array.isArray(compsResult.components)) {
90
- logger.debug('Components found:', JSON.stringify(compsResult.components));
91
88
  const meshComp = compsResult.components.find((c) => {
92
89
  const name = c.name || c;
93
90
  const match = typeof name === 'string' && (name.toLowerCase().includes('staticmesh') ||
94
91
  name.toLowerCase().includes('mesh') ||
95
92
  name.toLowerCase().includes('primitive'));
96
- logger.debug(`Checking component '${name}' matches? ${match}`);
97
93
  return match;
98
94
  });
99
95
  if (meshComp) {
100
96
  const compName = meshComp.name || meshComp;
101
- logger.debug(`Auto-enabling physics for component: ${compName}`);
102
97
  await tools.actorTools.setComponentProperties({
103
98
  actorName: params.actorName,
104
99
  componentName: compName,