unreal-engine-mcp-server 0.2.1 → 0.3.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.
@@ -1,10 +1,29 @@
1
- // Consolidated tool definitions - reduced from 36 to 10 multi-purpose tools
1
+ // Consolidated tool definitions - reduced from 36 to 13 multi-purpose tools
2
2
 
3
3
  export const consolidatedToolDefinitions = [
4
4
  // 1. ASSET MANAGER - Combines asset operations
5
5
  {
6
6
  name: 'manage_asset',
7
- description: 'Manage assets - list, import, create materials',
7
+ description: `Search, browse, import, and create simple material assets.
8
+
9
+ When to use this tool:
10
+ - You want to list assets in the project Content directory (use /Game; /Content is auto-mapped).
11
+ - You want to import files from disk into the project (e.g., FBX, PNG, WAV, EXR).
12
+ - You want to generate a very basic Material asset by name at a path.
13
+
14
+ Supported actions:
15
+ - list: Returns assets in a folder (recursive behavior is auto-enabled for /Game).
16
+ - import: Imports a file into the project at a destination path (e.g., /Game/Folder).
17
+ - create_material: Creates a simple Material asset at a path.
18
+
19
+ Tips:
20
+ - Unreal uses /Game for project content; this server maps /Content → /Game automatically.
21
+ - For large projects, listing /Game returns a sample subset for speed; refine to subfolders.
22
+
23
+ Examples:
24
+ - {"action":"list","directory":"/Game/ThirdPerson"}
25
+ - {"action":"import","sourcePath":"C:/Temp/Tree.fbx","destinationPath":"/Game/Environment/Trees"}
26
+ - {"action":"create_material","name":"M_Mask","path":"/Game/Materials"}`,
8
27
  inputSchema: {
9
28
  type: 'object',
10
29
  properties: {
@@ -52,7 +71,35 @@ export const consolidatedToolDefinitions = [
52
71
  // 2. ACTOR CONTROL - Combines actor operations
53
72
  {
54
73
  name: 'control_actor',
55
- description: 'Control actors - spawn, delete, apply physics. For spawning, supports both actor classes (e.g., StaticMeshActor, CameraActor) and asset paths (e.g., /Engine/BasicShapes/Cube) which will auto-spawn as StaticMeshActor',
74
+ description: `Spawn, delete, and apply physics to actors in the level.
75
+
76
+ When to use this tool:
77
+ - Place an actor/mesh, remove an actor, or nudge an actor with a physics force.
78
+
79
+ Supported actions:
80
+ - spawn
81
+ - delete
82
+ - apply_force
83
+
84
+ Spawning:
85
+ - classPath can be a class name (e.g., StaticMeshActor, CameraActor) OR an asset path (e.g., /Engine/BasicShapes/Cube, /Game/Meshes/SM_Rock).
86
+ - Asset paths auto-spawn StaticMeshActor with the mesh assigned.
87
+
88
+ Deleting:
89
+ - Finds actors by label/name (case-insensitive) and deletes matches.
90
+
91
+ Apply force:
92
+ - Applies a world-space force vector to an actor with physics enabled.
93
+
94
+ Tips:
95
+ - classPath accepts classes or asset paths; simple names like Cube auto-resolve to engine assets.
96
+ - location/rotation are optional; defaults are used if omitted.
97
+ - For delete/apply_force, provide actorName.
98
+
99
+ Examples:
100
+ - {"action":"spawn","classPath":"/Engine/BasicShapes/Cube","location":{"x":0,"y":0,"z":100}}
101
+ - {"action":"delete","actorName":"Cube_1"}
102
+ - {"action":"apply_force","actorName":"PhysicsBox","force":{"x":0,"y":0,"z":5000}}`,
56
103
  inputSchema: {
57
104
  type: 'object',
58
105
  properties: {
@@ -112,7 +159,26 @@ export const consolidatedToolDefinitions = [
112
159
  // 3. EDITOR CONTROL - Combines editor operations
113
160
  {
114
161
  name: 'control_editor',
115
- description: 'Control editor - PIE mode, camera, viewport',
162
+ description: `Play/Stop PIE, position the editor camera, and switch common view modes.
163
+
164
+ When to use this tool:
165
+ - Start/stop a PIE session, move the viewport camera, or change viewmode (Lit/Unlit/Wireframe/etc.).
166
+
167
+ Supported actions:
168
+ - play
169
+ - stop
170
+ - set_camera
171
+ - set_view_mode
172
+
173
+ Notes:
174
+ - View modes are validated; unsafe modes are blocked.
175
+ - Camera accepts location/rotation (optional); values normalized.
176
+
177
+ Examples:
178
+ - {"action":"play"}
179
+ - {"action":"set_camera","location":{"x":0,"y":-600,"z":250},"rotation":{"pitch":0,"yaw":0,"roll":0}}
180
+ - {"action":"set_view_mode","viewMode":"Wireframe"}
181
+ - {"action":"stop"}`,
116
182
  inputSchema: {
117
183
  type: 'object',
118
184
  properties: {
@@ -170,7 +236,28 @@ export const consolidatedToolDefinitions = [
170
236
  // 4. LEVEL MANAGER - Combines level and lighting operations
171
237
  {
172
238
  name: 'manage_level',
173
- description: 'Manage levels and lighting',
239
+ description: `Load/save/stream levels, create lights, and trigger lighting builds.
240
+
241
+ When to use this tool:
242
+ - Switch to a level, save the current level, stream sublevels, add a light, or start a lighting build.
243
+
244
+ Supported actions:
245
+ - load
246
+ - save
247
+ - stream
248
+ - create_light
249
+ - build_lighting
250
+
251
+ Tips:
252
+ - Use /Game paths for levels (e.g., /Game/Maps/Level).
253
+ - For streaming, set shouldBeLoaded and shouldBeVisible accordingly.
254
+ - For lights, provide lightType and optional location/intensity.
255
+
256
+ Examples:
257
+ - {"action":"load","levelPath":"/Game/Maps/Lobby"}
258
+ - {"action":"stream","levelName":"Sublevel_A","shouldBeLoaded":true,"shouldBeVisible":true}
259
+ - {"action":"create_light","lightType":"Directional","name":"KeyLight","intensity":5.0}
260
+ - {"action":"build_lighting","quality":"High"}`,
174
261
  inputSchema: {
175
262
  type: 'object',
176
263
  properties: {
@@ -226,7 +313,25 @@ export const consolidatedToolDefinitions = [
226
313
  // 5. ANIMATION SYSTEM - Combines animation and physics setup
227
314
  {
228
315
  name: 'animation_physics',
229
- description: 'Animation and physics systems',
316
+ description: `Create animation blueprints, play montages, and set up simple ragdolls.
317
+
318
+ When to use this tool:
319
+ - Generate an Anim Blueprint for a skeleton, play a Montage/Animation on an actor, or enable ragdoll.
320
+
321
+ Supported actions:
322
+ - create_animation_bp
323
+ - play_montage
324
+ - setup_ragdoll
325
+
326
+ Tips:
327
+ - Ensure the montage/animation is compatible with the target actor/skeleton.
328
+ - setup_ragdoll requires a valid physicsAssetName on the skeleton.
329
+ - Use savePath when creating new assets.
330
+
331
+ Examples:
332
+ - {"action":"create_animation_bp","name":"ABP_Hero","skeletonPath":"/Game/Characters/Hero/SK_Hero_Skeleton","savePath":"/Game/Characters/Hero"}
333
+ - {"action":"play_montage","actorName":"Hero","montagePath":"/Game/Anim/MT_Attack"}
334
+ - {"action":"setup_ragdoll","skeletonPath":"/Game/Characters/Hero/SK_Hero_Skeleton","physicsAssetName":"PHYS_Hero"}`,
230
335
  inputSchema: {
231
336
  type: 'object',
232
337
  properties: {
@@ -266,7 +371,24 @@ export const consolidatedToolDefinitions = [
266
371
  // 6. EFFECTS SYSTEM - Combines particles and visual effects
267
372
  {
268
373
  name: 'create_effect',
269
- description: 'Create visual effects - particles, Niagara',
374
+ description: `Create particles/FX and lightweight debug shapes for rapid iteration.
375
+
376
+ When to use this tool:
377
+ - Spawn a Niagara system at a location, create a particle effect by type tag, or draw debug geometry for planning.
378
+
379
+ Supported actions:
380
+ - particle
381
+ - niagara
382
+ - debug_shape
383
+
384
+ Tips:
385
+ - Set color as RGBA [r,g,b,a]; scale defaults to 1 if omitted.
386
+ - Use debug shapes for quick layout planning and measurements.
387
+
388
+ Examples:
389
+ - {"action":"niagara","systemPath":"/Game/FX/NS_Explosion","location":{"x":0,"y":0,"z":200},"scale":1.0}
390
+ - {"action":"particle","effectType":"Smoke","name":"SMK1","location":{"x":100,"y":0,"z":50}}
391
+ - {"action":"debug_shape","shape":"Sphere","location":{"x":0,"y":0,"z":0},"size":100,"duration":5}`,
270
392
  inputSchema: {
271
393
  type: 'object',
272
394
  properties: {
@@ -327,7 +449,22 @@ export const consolidatedToolDefinitions = [
327
449
  // 7. BLUEPRINT MANAGER - Blueprint operations
328
450
  {
329
451
  name: 'manage_blueprint',
330
- description: 'Create and modify blueprints',
452
+ description: `Create new Blueprints and add components programmatically.
453
+
454
+ When to use this tool:
455
+ - Quickly scaffold a Blueprint asset or add a component to an existing Blueprint.
456
+
457
+ Supported actions:
458
+ - create
459
+ - add_component
460
+
461
+ Tips:
462
+ - blueprintType can be Actor, Pawn, Character, etc.
463
+ - Component names should be unique within the Blueprint.
464
+
465
+ Examples:
466
+ - {"action":"create","name":"BP_Switch","blueprintType":"Actor","savePath":"/Game/Blueprints"}
467
+ - {"action":"add_component","name":"BP_Switch","componentType":"PointLightComponent","componentName":"KeyLight"}`,
331
468
  inputSchema: {
332
469
  type: 'object',
333
470
  properties: {
@@ -362,7 +499,28 @@ export const consolidatedToolDefinitions = [
362
499
  // 8. ENVIRONMENT BUILDER - Landscape and foliage
363
500
  {
364
501
  name: 'build_environment',
365
- description: 'Build environment - landscape, foliage',
502
+ description: `Environment authoring helpers (landscape, foliage).
503
+
504
+ When to use this tool:
505
+ - Create a procedural terrain alternative, add/paint foliage, or attempt a landscape workflow.
506
+
507
+ Supported actions:
508
+ - create_landscape
509
+ - sculpt
510
+ - add_foliage
511
+ - paint_foliage
512
+
513
+ Important:
514
+ - Native Landscape creation via Python is limited and may return a helpful error suggesting Landscape Mode in the editor.
515
+ - Foliage helpers create FoliageType assets and support simple placement.
516
+
517
+ Tips:
518
+ - Adjust brushSize and strength to tune sculpting results.
519
+
520
+ Examples:
521
+ - {"action":"create_landscape","name":"Landscape_Basic","sizeX":1024,"sizeY":1024}
522
+ - {"action":"add_foliage","name":"FT_Grass","meshPath":"/Game/Foliage/SM_Grass","density":300}
523
+ - {"action":"paint_foliage","foliageType":"/Game/Foliage/Types/FT_Grass","position":{"x":0,"y":0,"z":0},"brushSize":300}`,
366
524
  inputSchema: {
367
525
  type: 'object',
368
526
  properties: {
@@ -413,7 +571,31 @@ export const consolidatedToolDefinitions = [
413
571
  // 9. PERFORMANCE & AUDIO - System settings
414
572
  {
415
573
  name: 'system_control',
416
- description: 'Control performance, audio, UI, screenshots, and engine lifecycle',
574
+ description: `Performance toggles, quality settings, audio playback, simple UI helpers, screenshots, and engine lifecycle.
575
+
576
+ When to use this tool:
577
+ - Toggle profiling and FPS stats, adjust quality (sg.*), play a sound, create/show a basic widget, take a screenshot, or launch/quit the editor.
578
+
579
+ Supported actions:
580
+ - profile
581
+ - show_fps
582
+ - set_quality
583
+ - play_sound
584
+ - create_widget
585
+ - show_widget
586
+ - screenshot
587
+ - engine_start
588
+ - engine_quit
589
+
590
+ Tips:
591
+ - Screenshot resolution format: 1920x1080.
592
+ - engine_start can read UE project path from env; provide editorExe/projectPath if needed.
593
+
594
+ Examples:
595
+ - {"action":"show_fps","enabled":true}
596
+ - {"action":"set_quality","category":"Shadows","level":2}
597
+ - {"action":"play_sound","soundPath":"/Game/Audio/SFX/Click","volume":0.5}
598
+ - {"action":"screenshot","resolution":"1920x1080"}`,
417
599
  inputSchema: {
418
600
  type: 'object',
419
601
  properties: {
@@ -483,7 +665,22 @@ export const consolidatedToolDefinitions = [
483
665
  // 10. CONSOLE COMMAND - Universal tool
484
666
  {
485
667
  name: 'console_command',
486
- description: 'Execute any console command in Unreal Engine',
668
+ description: `Execute an Unreal console command with built-in safety.
669
+
670
+ When to use this tool:
671
+ - Fire a specific command (e.g., stat fps, viewmode wireframe, r.ScreenPercentage 75).
672
+
673
+ Safety:
674
+ - Dangerous commands are blocked (quit/exit, GPU crash triggers, unsafe visualizebuffer modes, etc.).
675
+ - Unknown commands will return a warning instead of crashing.
676
+
677
+ Tips:
678
+ - Prefer dedicated tools (system_control, control_editor) when available for structured control.
679
+
680
+ Examples:
681
+ - {"command":"stat fps"}
682
+ - {"command":"viewmode wireframe"}
683
+ - {"command":"r.ScreenPercentage 75"}`,
487
684
  inputSchema: {
488
685
  type: 'object',
489
686
  properties: {
@@ -507,7 +704,29 @@ export const consolidatedToolDefinitions = [
507
704
  // 11. REMOTE CONTROL PRESETS
508
705
  {
509
706
  name: 'manage_rc',
510
- description: 'Manage Remote Control presets: create, expose, list fields, set/get values',
707
+ description: `Create and manage Remote Control presets; expose actors/properties; set/get values.
708
+
709
+ When to use this tool:
710
+ - Automate Remote Control (RC) preset authoring and interaction from the assistant.
711
+
712
+ Supported actions:
713
+ - create_preset
714
+ - expose_actor
715
+ - expose_property
716
+ - list_fields
717
+ - set_property
718
+ - get_property
719
+
720
+ Tips:
721
+ - value must be JSON-serializable.
722
+ - Use objectPath/presetPath with full asset/object paths.
723
+
724
+ Examples:
725
+ - {"action":"create_preset","name":"LivePreset","path":"/Game/RCPresets"}
726
+ - {"action":"expose_actor","presetPath":"/Game/RCPresets/LivePreset","actorName":"CameraActor"}
727
+ - {"action":"expose_property","presetPath":"/Game/RCPresets/LivePreset","objectPath":"/Script/Engine.Default__Engine","propertyName":"GameUserSettings"}
728
+ - {"action":"list_fields","presetPath":"/Game/RCPresets/LivePreset"}
729
+ - {"action":"set_property","objectPath":"/Game/MyActor","propertyName":"CustomFloat","value":0.5}`,
511
730
  inputSchema: {
512
731
  type: 'object',
513
732
  properties: {
@@ -542,7 +761,37 @@ export const consolidatedToolDefinitions = [
542
761
  // 12. SEQUENCER / CINEMATICS
543
762
  {
544
763
  name: 'manage_sequence',
545
- description: 'Create/open sequences, add cameras/actors, manage bindings, control playback, and set properties',
764
+ description: `Create/open Level Sequences, bind actors, add cameras, and control playback.
765
+
766
+ When to use this tool:
767
+ - Build quick cinematics: create/open a sequence, add a camera or actors, tweak properties, and play.
768
+
769
+ Supported actions:
770
+ - create
771
+ - open
772
+ - add_camera
773
+ - add_actor
774
+ - add_actors
775
+ - remove_actors
776
+ - get_bindings
777
+ - add_spawnable_from_class
778
+ - play
779
+ - pause
780
+ - stop
781
+ - set_properties
782
+ - get_properties
783
+ - set_playback_speed
784
+
785
+ Tips:
786
+ - Set spawnable=true to auto-create a camera actor.
787
+ - Use frameRate/lengthInFrames to define timing; use playbackStart/End to trim.
788
+
789
+ Examples:
790
+ - {"action":"create","name":"Intro","path":"/Game/Cinematics"}
791
+ - {"action":"add_camera","spawnable":true}
792
+ - {"action":"add_actor","actorName":"Hero"}
793
+ - {"action":"play","loopMode":"once"}
794
+ - {"action":"set_properties","path":"/Game/Cinematics/Intro","frameRate":24,"lengthInFrames":480}`,
546
795
  inputSchema: {
547
796
  type: 'object',
548
797
  properties: {
@@ -595,7 +844,22 @@ export const consolidatedToolDefinitions = [
595
844
  // 13. INTROSPECTION
596
845
  {
597
846
  name: 'inspect',
598
- description: 'Inspect objects and set properties safely',
847
+ description: `Read object info and set properties with validation.
848
+
849
+ When to use this tool:
850
+ - Inspect an object by path (class default object or actor/component) and optionally modify properties.
851
+
852
+ Supported actions:
853
+ - inspect_object
854
+ - set_property
855
+
856
+ Tips:
857
+ - propertyName is case-sensitive; ensure it exists on the target object.
858
+ - For class default objects (CDOs), use the /Script/...Default__Class path.
859
+
860
+ Examples:
861
+ - {"action":"inspect_object","objectPath":"/Script/Engine.Default__Engine"}
862
+ - {"action":"set_property","objectPath":"/Game/MyActor","propertyName":"CustomBool","value":true}`,
599
863
  inputSchema: {
600
864
  type: 'object',
601
865
  properties: {
@@ -1,6 +1,9 @@
1
- // Consolidated tool handlers - maps 10 tools to all 36 operations
1
+ // Consolidated tool handlers - maps 13 tools to all 36 operations
2
2
  import { handleToolCall } from './tool-handlers.js';
3
3
  import { cleanObject } from '../utils/safe-json.js';
4
+ import { Logger } from '../utils/logger.js';
5
+
6
+ const log = new Logger('ConsolidatedToolHandler');
4
7
 
5
8
  export async function handleConsolidatedToolCall(
6
9
  name: string,
@@ -8,7 +11,8 @@ export async function handleConsolidatedToolCall(
8
11
  tools: any
9
12
  ) {
10
13
  const startTime = Date.now();
11
- console.log(`[ConsolidatedToolHandler] Starting execution of ${name} at ${new Date().toISOString()}`);
14
+ // Use scoped logger (stderr) to avoid polluting stdout JSON
15
+ log.debug(`Starting execution of ${name} at ${new Date().toISOString()}`);
12
16
 
13
17
  try {
14
18
  // Validate args is not null/undefined