ultimate-unreal-engine-mcp 0.1.8 → 0.1.9

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.
@@ -93,15 +93,20 @@ export function registerEditorTools(server, bridge) {
93
93
  y: z.number().describe('Y coordinate in Unreal units (cm)'),
94
94
  z: z.number().describe('Z coordinate in Unreal units (cm)'),
95
95
  }).describe('World-space location to spawn the actor at'),
96
+ label: z.string().optional().describe('Optional editor display label for the spawned actor'),
96
97
  }),
97
98
  annotations: {
98
99
  readOnlyHint: false,
99
100
  destructiveHint: false,
100
101
  },
101
102
  }, withKnownIssues('ue_spawn_actor', async (args) => {
103
+ const payload = { class_name: args.class_name, location: args.location };
104
+ if (args.label) {
105
+ payload['label'] = args.label;
106
+ }
102
107
  return sendOrDisconnect(_bridge, {
103
108
  type: 'actor.spawn',
104
- payload: { class_name: args.class_name, location: args.location },
109
+ payload,
105
110
  });
106
111
  }));
107
112
  // --------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-unreal-engine-mcp",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "MCP server giving AI assistants full access to Unreal Engine 5.7 projects",
5
5
  "type": "module",
6
6
  "engines": {
@@ -201,6 +201,13 @@ void RegisterActorCommands(FMCPCommandRouter& Router)
201
201
  const FVector Location(X, Y, Z);
202
202
  const FRotator Rotation(0.0, 0.0, 0.0);
203
203
 
204
+ // Optional label — sets the editor display name after spawn.
205
+ FString Label;
206
+ if (Payload->TryGetStringField(TEXT("label"), Label) && !Label.IsEmpty())
207
+ {
208
+ Params.Name = FName(*Label);
209
+ }
210
+
204
211
  AActor* Spawned = World->SpawnActor<AActor>(ActorClass, Location, Rotation, Params);
205
212
  if (!Spawned)
206
213
  {
@@ -208,6 +215,12 @@ void RegisterActorCommands(FMCPCommandRouter& Router)
208
215
  return;
209
216
  }
210
217
 
218
+ // Apply explicit label if provided (overrides auto-generated label).
219
+ if (!Label.IsEmpty())
220
+ {
221
+ Spawned->SetActorLabel(Label);
222
+ }
223
+
211
224
  TSharedPtr<FJsonObject> Data = MakeShared<FJsonObject>();
212
225
  Data->SetStringField(TEXT("label"), Spawned->GetActorLabel());
213
226
  Data->SetStringField(TEXT("id"), Spawned->GetName());