ultimate-unreal-engine-mcp 0.1.15 → 0.1.17

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/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Ultimate Unreal Engine MCP
2
2
 
3
- **129 tools. 26 domains. Full read/write access to Unreal Engine 5.7 — including live editor APIs, Blueprint graphs, and viewport screenshots.**
3
+ **132 tools. 26 domains. Full read/write access to Unreal Engine 5.7 — including live editor APIs, Blueprint graphs, and viewport screenshots.**
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
6
  [![Node 22+](https://img.shields.io/badge/Node.js-22%2B-brightgreen.svg)](https://nodejs.org/)
7
7
  [![UE 5.7](https://img.shields.io/badge/Unreal%20Engine-5.7-orange.svg)](https://www.unrealengine.com/)
8
8
  [![Tests](https://img.shields.io/badge/tests-1021%20passing-success.svg)](#development)
9
- [![Tools](https://img.shields.io/badge/tools-129-informational.svg)](#tool-catalog)
9
+ [![Tools](https://img.shields.io/badge/tools-132-informational.svg)](#tool-catalog)
10
10
 
11
11
  MCP (Model Context Protocol) is a standard that lets AI assistants call tools on external systems — this server exposes Unreal Engine as those tools.
12
12
 
@@ -296,14 +296,17 @@ graph TD
296
296
  </details>
297
297
 
298
298
  <details>
299
- <summary><strong>Editor</strong> — 7 tools</summary>
299
+ <summary><strong>Editor</strong> — 10 tools</summary>
300
300
 
301
301
  | Tool | Description |
302
302
  |------|-------------|
303
303
  | `ue_list_actors` | List actors in the current level with transforms and class info |
304
- | `ue_spawn_actor` | Spawn an actor by class into the current level |
304
+ | `ue_spawn_actor` | Spawn an actor by class with optional label |
305
305
  | `ue_transform_actor` | Move, rotate, scale, or set properties on an actor |
306
306
  | `ue_delete_actor` | Delete an actor from the current level |
307
+ | `ue_set_actor_property` | Set any UPROPERTY on an actor or component by label (bool, int, float, string, name, actor ref, asset ref) |
308
+ | `ue_create_data_asset` | Create a UPrimaryDataAsset with reflection-set properties |
309
+ | `ue_create_curve` | Create a UCurveFloat asset with keyframes |
307
310
  | `ue_query_assets` | Query the asset registry — search by class, path, or name |
308
311
  | `ue_trace_references` | Trace all assets that reference or are referenced by an asset |
309
312
  | `ue_read_level_layout` | Read the current level's actor graph and spatial layout |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-unreal-engine-mcp",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "MCP server giving AI assistants full access to Unreal Engine 5.7 projects",
5
5
  "type": "module",
6
6
  "engines": {
@@ -24,6 +24,8 @@
24
24
  #include "Editor.h"
25
25
  #include "EditorViewportClient.h"
26
26
  #include "LevelEditorViewport.h"
27
+ #include "LevelEditor.h"
28
+ #include "SLevelViewport.h"
27
29
  #include "UnrealClient.h"
28
30
  #include "HighResScreenshot.h"
29
31
  #include "Misc/Paths.h"
@@ -74,10 +76,10 @@ static FString BuildViewportErrorResponse(const FString& CorrId, const FString&
74
76
  }
75
77
 
76
78
  /**
77
- * Returns the first visible level editor viewport client, or nullptr if none is open.
78
- * A static_cast is safe here because MCPBridgeEditor only runs inside the editor and
79
- * GetAllViewportClients() in the level editor context returns FLevelEditorViewportClient
80
- * instances.
79
+ * Returns the first level editor viewport client.
80
+ * Uses FLevelEditorModule::GetFirstActiveLevelViewport() which reliably
81
+ * returns the docked viewport even when it doesn't have focus.
82
+ * Falls back to GEditor->GetAllViewportClients() scan if the module approach fails.
81
83
  */
82
84
  static FLevelEditorViewportClient* GetActiveViewportClient()
83
85
  {
@@ -86,14 +88,24 @@ static FLevelEditorViewportClient* GetActiveViewportClient()
86
88
  return nullptr;
87
89
  }
88
90
 
89
- for (FEditorViewportClient* VC : GEditor->GetAllViewportClients())
91
+ // Primary path: use the LevelEditor module API (works for docked viewports).
92
+ if (FModuleManager::Get().IsModuleLoaded(TEXT("LevelEditor")))
90
93
  {
91
- if (!VC)
94
+ FLevelEditorModule& LevelEditorModule =
95
+ FModuleManager::GetModuleChecked<FLevelEditorModule>(TEXT("LevelEditor"));
96
+ TSharedPtr<SLevelViewport> ActiveViewport = LevelEditorModule.GetFirstActiveLevelViewport();
97
+ if (ActiveViewport.IsValid())
92
98
  {
93
- continue;
99
+ return &ActiveViewport->GetLevelViewportClient();
94
100
  }
101
+ }
102
+
103
+ // Fallback: iterate all viewport clients.
104
+ for (FEditorViewportClient* VC : GEditor->GetAllViewportClients())
105
+ {
106
+ if (!VC) continue;
95
107
  FLevelEditorViewportClient* LVC = static_cast<FLevelEditorViewportClient*>(VC);
96
- if (LVC && LVC->IsVisible())
108
+ if (LVC)
97
109
  {
98
110
  return LVC;
99
111
  }
@@ -289,16 +301,11 @@ void RegisterViewportCommands(FMCPCommandRouter& Router)
289
301
  }
290
302
  }
291
303
 
292
- // Set global screenshot resolution and queue capture.
293
- GScreenshotResolutionX = Width;
294
- GScreenshotResolutionY = Height;
295
- FScreenshotRequest::RequestScreenshot(false /* bShowUI */);
296
-
297
- // Return the directory where UE will write the screenshot file.
298
- const FString ShotDir = FPaths::ScreenShotDir();
304
+ // Use TakeScreenshotToFile which writes to MCPScreenshots/ with a known path.
305
+ const FString FilePath = TakeScreenshotToFile(Width, Height);
299
306
 
300
307
  TSharedPtr<FJsonObject> Data = MakeShared<FJsonObject>();
301
- Data->SetStringField(TEXT("screenshot_dir"), ShotDir);
308
+ Data->SetStringField(TEXT("file_path"), FilePath);
302
309
  Data->SetNumberField(TEXT("width"), static_cast<double>(Width));
303
310
  Data->SetNumberField(TEXT("height"), static_cast<double>(Height));
304
311
  Data->SetBoolField(TEXT("queued"), true);