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
|
-
**
|
|
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)
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://www.unrealengine.com/)
|
|
8
8
|
[](#development)
|
|
9
|
-
[](#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> —
|
|
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
|
|
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
|
@@ -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
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
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
|
-
|
|
91
|
+
// Primary path: use the LevelEditor module API (works for docked viewports).
|
|
92
|
+
if (FModuleManager::Get().IsModuleLoaded(TEXT("LevelEditor")))
|
|
90
93
|
{
|
|
91
|
-
|
|
94
|
+
FLevelEditorModule& LevelEditorModule =
|
|
95
|
+
FModuleManager::GetModuleChecked<FLevelEditorModule>(TEXT("LevelEditor"));
|
|
96
|
+
TSharedPtr<SLevelViewport> ActiveViewport = LevelEditorModule.GetFirstActiveLevelViewport();
|
|
97
|
+
if (ActiveViewport.IsValid())
|
|
92
98
|
{
|
|
93
|
-
|
|
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
|
|
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
|
-
//
|
|
293
|
-
|
|
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("
|
|
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);
|