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.
- package/.env.example +1 -1
- package/.github/release-drafter-config.yml +51 -0
- package/.github/workflows/greetings.yml +5 -1
- package/.github/workflows/labeler.yml +2 -1
- package/.github/workflows/publish-mcp.yml +1 -0
- package/.github/workflows/release-drafter.yml +1 -1
- package/.github/workflows/release.yml +3 -3
- package/CHANGELOG.md +71 -0
- package/CONTRIBUTING.md +1 -1
- package/GEMINI.md +115 -0
- package/Public/Plugin_setup_guide.mp4 +0 -0
- package/README.md +166 -200
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +4 -0
- package/dist/graphql/loaders.d.ts +64 -0
- package/dist/graphql/loaders.js +117 -0
- package/dist/graphql/resolvers.d.ts +3 -3
- package/dist/graphql/resolvers.js +33 -30
- package/dist/graphql/server.js +3 -1
- package/dist/graphql/types.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -2
- package/dist/server-setup.d.ts +0 -1
- package/dist/server-setup.js +0 -40
- package/dist/tools/actors.d.ts +40 -24
- package/dist/tools/actors.js +8 -2
- package/dist/tools/assets.d.ts +19 -71
- package/dist/tools/assets.js +28 -22
- package/dist/tools/base-tool.d.ts +4 -4
- package/dist/tools/base-tool.js +1 -1
- package/dist/tools/blueprint.d.ts +33 -61
- package/dist/tools/consolidated-tool-handlers.js +96 -110
- package/dist/tools/dynamic-handler-registry.d.ts +11 -9
- package/dist/tools/dynamic-handler-registry.js +17 -95
- package/dist/tools/editor.d.ts +19 -193
- package/dist/tools/editor.js +8 -0
- package/dist/tools/environment.d.ts +8 -14
- package/dist/tools/foliage.d.ts +18 -143
- package/dist/tools/foliage.js +4 -2
- package/dist/tools/handlers/actor-handlers.js +0 -5
- package/dist/tools/handlers/asset-handlers.js +454 -454
- package/dist/tools/landscape.d.ts +16 -116
- package/dist/tools/landscape.js +7 -3
- package/dist/tools/level.d.ts +22 -103
- package/dist/tools/level.js +24 -16
- package/dist/tools/lighting.js +5 -1
- package/dist/tools/materials.js +5 -1
- package/dist/tools/niagara.js +37 -2
- package/dist/tools/performance.d.ts +0 -1
- package/dist/tools/performance.js +0 -1
- package/dist/tools/physics.js +5 -1
- package/dist/tools/sequence.d.ts +24 -24
- package/dist/tools/sequence.js +13 -0
- package/dist/tools/ui.d.ts +0 -2
- package/dist/types/automation-responses.d.ts +115 -0
- package/dist/types/automation-responses.js +2 -0
- package/dist/types/responses.d.ts +249 -0
- package/dist/types/responses.js +2 -0
- package/dist/types/tool-interfaces.d.ts +135 -135
- package/dist/utils/command-validator.js +3 -2
- package/dist/utils/path-security.d.ts +2 -0
- package/dist/utils/path-security.js +24 -0
- package/dist/utils/response-factory.d.ts +4 -4
- package/dist/utils/response-factory.js +15 -21
- package/docs/Migration-Guide-v0.5.0.md +1 -9
- package/docs/testing-guide.md +2 -2
- package/package.json +12 -6
- package/scripts/run-all-tests.mjs +25 -20
- package/server.json +3 -2
- package/src/config.ts +1 -1
- package/src/constants.ts +7 -0
- package/src/graphql/loaders.ts +244 -0
- package/src/graphql/resolvers.ts +47 -49
- package/src/graphql/server.ts +3 -1
- package/src/graphql/types.ts +3 -0
- package/src/index.ts +15 -2
- package/src/resources/assets.ts +5 -4
- package/src/server-setup.ts +3 -37
- package/src/tools/actors.ts +36 -28
- package/src/tools/animation.ts +1 -0
- package/src/tools/assets.ts +74 -63
- package/src/tools/base-tool.ts +3 -3
- package/src/tools/blueprint.ts +59 -59
- package/src/tools/consolidated-tool-handlers.ts +129 -150
- package/src/tools/dynamic-handler-registry.ts +22 -140
- package/src/tools/editor.ts +39 -26
- package/src/tools/environment.ts +21 -27
- package/src/tools/foliage.ts +28 -25
- package/src/tools/handlers/actor-handlers.ts +2 -8
- package/src/tools/handlers/asset-handlers.ts +484 -484
- package/src/tools/handlers/sequence-handlers.ts +1 -1
- package/src/tools/landscape.ts +34 -28
- package/src/tools/level.ts +96 -76
- package/src/tools/lighting.ts +6 -1
- package/src/tools/materials.ts +8 -2
- package/src/tools/niagara.ts +44 -2
- package/src/tools/performance.ts +1 -2
- package/src/tools/physics.ts +7 -1
- package/src/tools/sequence.ts +41 -25
- package/src/tools/ui.ts +0 -2
- package/src/types/automation-responses.ts +119 -0
- package/src/types/responses.ts +355 -0
- package/src/types/tool-interfaces.ts +135 -135
- package/src/utils/command-validator.ts +3 -2
- package/src/utils/normalize.test.ts +162 -0
- package/src/utils/path-security.ts +43 -0
- package/src/utils/response-factory.ts +29 -24
- package/src/utils/safe-json.test.ts +90 -0
- package/src/utils/validation.test.ts +184 -0
- package/tests/test-animation.mjs +358 -33
- package/tests/test-asset-graph.mjs +311 -0
- package/tests/test-audio.mjs +314 -116
- package/tests/test-behavior-tree.mjs +327 -144
- package/tests/test-blueprint-graph.mjs +343 -12
- package/tests/test-control-editor.mjs +85 -53
- package/tests/test-graphql.mjs +58 -8
- package/tests/test-input.mjs +349 -0
- package/tests/test-inspect.mjs +291 -61
- package/tests/test-landscape.mjs +304 -48
- package/tests/test-lighting.mjs +428 -0
- package/tests/test-manage-level.mjs +70 -51
- package/tests/test-performance.mjs +539 -0
- package/tests/test-sequence.mjs +82 -46
- package/tests/test-system.mjs +72 -33
- package/tests/test-wasm.mjs +98 -8
- package/vitest.config.ts +35 -0
- package/.github/release-drafter.yml +0 -148
- package/dist/prompts/index.d.ts +0 -21
- package/dist/prompts/index.js +0 -217
- package/dist/tools/blueprint/helpers.d.ts +0 -29
- package/dist/tools/blueprint/helpers.js +0 -182
- package/src/prompts/index.ts +0 -249
- package/src/tools/blueprint/helpers.ts +0 -189
- package/tests/test-blueprint-events.mjs +0 -35
- package/tests/test-extra-tools.mjs +0 -38
- package/tests/test-render.mjs +0 -33
- package/tests/test-search-assets.mjs +0 -66
package/README.md
CHANGED
|
@@ -6,161 +6,119 @@
|
|
|
6
6
|
[](https://www.unrealengine.com/)
|
|
7
7
|
[](https://registry.modelcontextprotocol.io/)
|
|
8
8
|
|
|
9
|
-
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal Engine through
|
|
9
|
+
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal Engine through a native C++ Automation Bridge plugin. Built with TypeScript, C++, and Rust (WebAssembly).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- **Asset Management** - Browse, import, and create materials
|
|
15
|
-
- **Actor Control** - Spawn, delete, and manipulate actors with physics
|
|
16
|
-
- **Editor Control** - PIE sessions, camera, and viewport management
|
|
17
|
-
- **Level Management** - Load/save levels, lighting, and environment building
|
|
18
|
-
- **Animation & Physics** - Blueprints, state machines, ragdolls, constraints, vehicle setup
|
|
19
|
-
- **Visual Effects** - Niagara particles, GPU simulations, procedural effects
|
|
20
|
-
- **Sequencer** - Cinematics, camera animations, and timeline control
|
|
21
|
-
- **Graph Editing** - Blueprint, Niagara, Material, and Behavior Tree graph manipulation
|
|
22
|
-
- **World Partition** - Load cells, manage data layers
|
|
23
|
-
- **Render Management** - Render targets, Nanite, Lumen
|
|
24
|
-
- **Pipeline & Testing** - Run UBT, automated tests
|
|
25
|
-
- **Observability** - Log streaming, gameplay debugger, insights, asset queries
|
|
26
|
-
- **Console Commands** - Safe execution with dangerous command filtering
|
|
27
|
-
- **GraphQL API** - Flexible data querying for assets, actors, and blueprints
|
|
28
|
-
|
|
29
|
-
### High-Performance WebAssembly
|
|
30
|
-
- **5-8x faster JSON parsing** - WASM-accelerated property parsing
|
|
31
|
-
- **5-10x faster transform math** - Optimized 3D vector/matrix operations
|
|
32
|
-
- **3-5x faster dependency resolution** - Rapid asset graph traversal
|
|
33
|
-
- **Automatic fallbacks** - Works perfectly without WASM binary
|
|
34
|
-
- **Performance monitoring** - Built-in metrics tracking
|
|
35
|
-
|
|
36
|
-
## Quick Start
|
|
13
|
+
## Table of Contents
|
|
37
14
|
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
> 💡 After toggling any plugin, restart the editor to finalize activation. The MCP Automation Bridge provides all automation capabilities through native C++ handlers.
|
|
50
|
-
|
|
51
|
-
### Plugin feature map
|
|
52
|
-
|
|
53
|
-
| Plugin | Location | Used By | Notes |
|
|
54
|
-
|--------|----------|---------|-------|
|
|
55
|
-
| MCP Automation Bridge | Project Plugins ▸ MCP Automation Bridge | All automation operations | Primary C++ automation transport with native handlers |
|
|
56
|
-
| Editor Scripting Utilities | Scripting | Asset/Actor subsystem operations | Supplies Editor Actor/Asset subsystems |
|
|
57
|
-
| Sequencer | Built-in | Sequencer tools | Ensure not disabled in project settings |
|
|
58
|
-
| Level Sequence Editor | Animation | Sequencer tools | Required for `manage_sequence` operations |
|
|
59
|
-
| Control Rig | Animation | Animation/Physics tools | Required for `animation_physics` operations |
|
|
60
|
-
| Subobject Data Interface | Scripting | Blueprint tools | Required for `manage_blueprint` component operations (UE 5.7+) |
|
|
61
|
-
|
|
62
|
-
> Tools such as `physics.configureVehicle` accept an optional `pluginDependencies` array so you can list the specific Unreal plugins your project relies on (for example, Chaos Vehicles or third-party vehicle frameworks). When provided, the server will verify those plugins are active before running the configuration.
|
|
63
|
-
|
|
64
|
-
### MCP Automation Bridge plugin
|
|
65
|
-
- Location: `plugins/McpAutomationBridge`
|
|
66
|
-
- Installation: copy the folder into your project's `Plugins/` directory and regenerate project files.
|
|
67
|
-
- Sync helper: run `npm run automation:sync -- --engine "X:/Unreal_Engine/UE_5.6/Engine/Plugins" --project "X:/Newfolder(2)/Game/Unreal/Trial/Plugins" --clean-engine --clean-project` after repo updates to copy the latest bridge build into both plugin folders and strip legacy entries (such as `SupportedTargetPlatforms: ["Editor"]`) that trigger startup warnings.
|
|
68
|
-
- Verification: run `node scripts/verify-automation-bridge.js --project "C:/Path/To/YourProject/Plugins" --config "C:/Path/To/YourProject/Config/DefaultEngine.ini"` to confirm the plugin files and automation bridge environment variables are in place before launching Unreal.
|
|
69
|
-
- Configuration: enable **MCP Automation Bridge** in **Edit ▸ Plugins**, restart the editor, then set the endpoint/token under **Edit ▸ Project Settings ▸ Plugins ▸ MCP Automation Bridge**. The bridge ships with its own lightweight WebSocket client, so you no longer need the engine's WebSockets plugin enabled.
|
|
70
|
-
- Startup: after configuration, the Output Log should show a successful connection and the `bridge_started` broadcast; `SendRawMessage` becomes available to Blueprint and C++ callers for manual testing.
|
|
71
|
-
- Current scope: manages a WebSocket session to the Node MCP server (`ws://127.0.0.1:8091` by default), performs optional capability-token handshakes, dispatches inbound JSON to native C++ handlers, implements reconnect backoff, and responds to editor functions, property operations, blueprint actions, and more through native implementations.
|
|
72
|
-
- Usage: all consolidated tools use the automation bridge for native C++ execution. Keep the plugin enabled for all workflows.
|
|
73
|
-
- Diagnostics: the `ue://automation-bridge` MCP resource surfaces handshake timestamps, recent disconnects, pending automation requests, and whether the Node listener is running—handy when validating editor connectivity from a client.
|
|
74
|
-
- Roadmap: expand the bridge with elevated actions (SCS authoring, typed property marshaling, modal mediation, asset workflows).
|
|
75
|
-
|
|
76
|
-
### WebAssembly Performance (Optional)
|
|
77
|
-
|
|
78
|
-
The MCP server includes WebAssembly acceleration for computationally intensive operations. WASM is **automatically used when available** and **gracefully falls back** to pure TypeScript when the bundle or toolchain is missing.
|
|
79
|
-
|
|
80
|
-
**To enable full WASM acceleration (5–8x faster operations):**
|
|
15
|
+
- [Features](#features)
|
|
16
|
+
- [Getting Started](#getting-started)
|
|
17
|
+
- [Configuration](#configuration)
|
|
18
|
+
- [Available Tools](#available-tools)
|
|
19
|
+
- [WebAssembly Acceleration](#webassembly-acceleration)
|
|
20
|
+
- [GraphQL API](#graphql-api)
|
|
21
|
+
- [Docker](#docker)
|
|
22
|
+
- [Documentation](#documentation)
|
|
23
|
+
- [Development](#development)
|
|
24
|
+
- [Contributing](#contributing)
|
|
81
25
|
|
|
82
|
-
|
|
83
|
-
# 1. Install Rust toolchain and wasm-pack (once per machine)
|
|
84
|
-
# See https://rustup.rs for installing Rust.
|
|
85
|
-
cargo install wasm-pack
|
|
86
|
-
|
|
87
|
-
# 2. Build TypeScript + WASM bundle
|
|
88
|
-
# The build script always runs the TypeScript compiler and then
|
|
89
|
-
# optionally builds the WASM bundle. If wasm-pack is missing the
|
|
90
|
-
# build will succeed with a warning and the server will use
|
|
91
|
-
# TypeScript fallbacks.
|
|
92
|
-
npm run build
|
|
26
|
+
---
|
|
93
27
|
|
|
94
|
-
|
|
95
|
-
# In .env or your process environment:
|
|
96
|
-
# WASM_ENABLED=true
|
|
28
|
+
## Features
|
|
97
29
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
30
|
+
| Category | Capabilities |
|
|
31
|
+
|----------|-------------|
|
|
32
|
+
| **Asset Management** | Browse, import, duplicate, rename, delete assets; create materials |
|
|
33
|
+
| **Actor Control** | Spawn, delete, transform, physics, tags, components |
|
|
34
|
+
| **Editor Control** | PIE sessions, camera, viewport, screenshots, bookmarks |
|
|
35
|
+
| **Level Management** | Load/save levels, streaming, World Partition, data layers |
|
|
36
|
+
| **Animation & Physics** | Animation BPs, state machines, ragdolls, vehicles, constraints |
|
|
37
|
+
| **Visual Effects** | Niagara particles, GPU simulations, procedural effects, debug shapes |
|
|
38
|
+
| **Sequencer** | Cinematics, timeline control, camera animations, keyframes |
|
|
39
|
+
| **Graph Editing** | Blueprint, Niagara, Material, and Behavior Tree graph manipulation |
|
|
40
|
+
| **Audio** | Sound cues, audio components, sound mixes, ambient sounds |
|
|
41
|
+
| **System** | Console commands, UBT, tests, logs, project settings, CVars |
|
|
103
42
|
|
|
104
|
-
|
|
43
|
+
### Architecture
|
|
105
44
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
45
|
+
- **Native C++ Automation** — All operations route through the MCP Automation Bridge plugin
|
|
46
|
+
- **Graceful Degradation** — Server starts even without an active Unreal connection
|
|
47
|
+
- **On-Demand Connection** — Retries automation handshakes with exponential backoff
|
|
48
|
+
- **Command Safety** — Blocks dangerous console commands
|
|
49
|
+
- **Asset Caching** — 10-second TTL for improved performance
|
|
110
50
|
|
|
111
|
-
|
|
112
|
-
# Server will always use TypeScript implementations only.
|
|
113
|
-
```
|
|
51
|
+
---
|
|
114
52
|
|
|
115
|
-
|
|
53
|
+
## Getting Started
|
|
116
54
|
|
|
117
|
-
|
|
118
|
-
> WASM build failed or wasm-pack missing; continuing with TypeScript-only build.
|
|
119
|
-
- At runtime, the server attempts to load the bundle once. On `ERR_MODULE_NOT_FOUND`
|
|
120
|
-
it logs a single warning suggesting `npm run build`/`cargo install wasm-pack` and
|
|
121
|
-
permanently falls back to TypeScript for that process.
|
|
55
|
+
### Prerequisites
|
|
122
56
|
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
- Transform calculations (5-10x faster)
|
|
126
|
-
- Vector/matrix math (5x faster)
|
|
127
|
-
- Asset dependency resolution (3-5x faster)
|
|
57
|
+
- **Node.js** 18+
|
|
58
|
+
- **Unreal Engine** 5.0–5.7
|
|
128
59
|
|
|
129
|
-
###
|
|
60
|
+
### Step 1: Install MCP Server
|
|
130
61
|
|
|
131
|
-
|
|
62
|
+
**Option A: NPX (Recommended)**
|
|
63
|
+
```bash
|
|
64
|
+
npx unreal-engine-mcp-server
|
|
65
|
+
```
|
|
132
66
|
|
|
67
|
+
**Option B: Clone & Build**
|
|
133
68
|
```bash
|
|
134
|
-
# Clone the repository
|
|
135
69
|
git clone https://github.com/ChiR24/Unreal_mcp.git
|
|
136
70
|
cd Unreal_mcp
|
|
137
|
-
|
|
138
|
-
# Install dependencies and build
|
|
139
71
|
npm install
|
|
140
72
|
npm run build
|
|
141
|
-
|
|
142
|
-
# Run directly
|
|
143
73
|
node dist/cli.js
|
|
144
74
|
```
|
|
145
75
|
|
|
146
|
-
### Unreal
|
|
76
|
+
### Step 2: Install Unreal Plugin
|
|
77
|
+
|
|
78
|
+
The MCP Automation Bridge plugin is included at `Unreal_mcp/plugins/McpAutomationBridge`.
|
|
79
|
+
|
|
80
|
+
**Method 1: Copy Folder**
|
|
81
|
+
```
|
|
82
|
+
Copy: Unreal_mcp/plugins/McpAutomationBridge/
|
|
83
|
+
To: YourUnrealProject/Plugins/McpAutomationBridge/
|
|
84
|
+
```
|
|
85
|
+
Regenerate project files after copying.
|
|
86
|
+
|
|
87
|
+
**Method 2: Add in Editor**
|
|
88
|
+
1. Open Unreal Editor → **Edit → Plugins**
|
|
89
|
+
2. Click **"Add"** → Browse to `Unreal_mcp/plugins/`
|
|
90
|
+
3. Select the `McpAutomationBridge` folder
|
|
91
|
+
|
|
92
|
+
**Video Guide:**
|
|
93
|
+
|
|
94
|
+
https://github.com/user-attachments/assets/d8b86ebc-4364-48c9-9781-de854bf3ef7d
|
|
147
95
|
|
|
148
|
-
|
|
96
|
+
### Step 3: Enable Required Plugins
|
|
149
97
|
|
|
150
|
-
|
|
98
|
+
Enable via **Edit → Plugins**, then restart the editor:
|
|
151
99
|
|
|
152
|
-
|
|
100
|
+
| Plugin | Required For |
|
|
101
|
+
|--------|--------------|
|
|
102
|
+
| **MCP Automation Bridge** | All automation operations |
|
|
103
|
+
| **Editor Scripting Utilities** | Asset/Actor subsystem operations |
|
|
104
|
+
| **Sequencer** | Sequencer tools |
|
|
105
|
+
| **Level Sequence Editor** | `manage_sequence` operations |
|
|
106
|
+
| **Control Rig** | `animation_physics` operations |
|
|
107
|
+
| **Subobject Data Interface** | Blueprint components (UE 5.7+) |
|
|
153
108
|
|
|
154
|
-
|
|
109
|
+
### Step 4: Configure MCP Client
|
|
155
110
|
|
|
111
|
+
Add to your Claude Desktop / Cursor config file:
|
|
112
|
+
|
|
113
|
+
**Using Clone/Build:**
|
|
156
114
|
```json
|
|
157
115
|
{
|
|
158
116
|
"mcpServers": {
|
|
159
117
|
"unreal-engine": {
|
|
160
|
-
"command": "
|
|
161
|
-
"args": ["
|
|
118
|
+
"command": "node",
|
|
119
|
+
"args": ["path/to/Unreal_mcp/dist/cli.js"],
|
|
162
120
|
"env": {
|
|
163
|
-
"UE_PROJECT_PATH": "C:/
|
|
121
|
+
"UE_PROJECT_PATH": "C:/Path/To/YourProject",
|
|
164
122
|
"MCP_AUTOMATION_PORT": "8091"
|
|
165
123
|
}
|
|
166
124
|
}
|
|
@@ -168,138 +126,144 @@ No additional engine configuration required. The MCP Automation Bridge plugin ha
|
|
|
168
126
|
}
|
|
169
127
|
```
|
|
170
128
|
|
|
171
|
-
|
|
172
|
-
|
|
129
|
+
**Using NPX:**
|
|
173
130
|
```json
|
|
174
131
|
{
|
|
175
132
|
"mcpServers": {
|
|
176
133
|
"unreal-engine": {
|
|
177
|
-
"command": "
|
|
178
|
-
"args": ["
|
|
134
|
+
"command": "npx",
|
|
135
|
+
"args": ["unreal-engine-mcp-server"],
|
|
179
136
|
"env": {
|
|
180
|
-
"UE_PROJECT_PATH": "C:/
|
|
181
|
-
"MCP_AUTOMATION_PORT": "8091"
|
|
137
|
+
"UE_PROJECT_PATH": "C:/Path/To/YourProject"
|
|
182
138
|
}
|
|
183
139
|
}
|
|
184
140
|
}
|
|
185
141
|
}
|
|
186
142
|
```
|
|
187
143
|
|
|
188
|
-
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Configuration
|
|
147
|
+
|
|
148
|
+
### Environment Variables
|
|
149
|
+
|
|
150
|
+
```env
|
|
151
|
+
# Required
|
|
152
|
+
UE_PROJECT_PATH="C:/Path/To/YourProject"
|
|
153
|
+
|
|
154
|
+
# Automation Bridge
|
|
155
|
+
MCP_AUTOMATION_HOST=127.0.0.1
|
|
156
|
+
MCP_AUTOMATION_PORT=8091
|
|
157
|
+
|
|
158
|
+
# Logging
|
|
159
|
+
LOG_LEVEL=info # debug | info | warn | error
|
|
160
|
+
|
|
161
|
+
# Optional
|
|
162
|
+
WASM_ENABLED=true
|
|
163
|
+
MCP_AUTOMATION_REQUEST_TIMEOUT_MS=120000
|
|
164
|
+
ASSET_LIST_TTL_MS=10000
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Available Tools
|
|
189
170
|
|
|
190
171
|
| Tool | Description |
|
|
191
172
|
|------|-------------|
|
|
192
173
|
| `manage_asset` | Assets, Materials, Render Targets, Behavior Trees |
|
|
193
|
-
| `control_actor` | Spawn, delete,
|
|
194
|
-
| `control_editor` | PIE, Camera,
|
|
195
|
-
| `manage_level` | Load/Save, World Partition |
|
|
196
|
-
| `manage_lighting` | Spawn
|
|
197
|
-
| `manage_performance` | Profiling,
|
|
174
|
+
| `control_actor` | Spawn, delete, transform, physics, tags |
|
|
175
|
+
| `control_editor` | PIE, Camera, viewport, screenshots |
|
|
176
|
+
| `manage_level` | Load/Save, World Partition, streaming |
|
|
177
|
+
| `manage_lighting` | Spawn lights, GI, shadows, build lighting |
|
|
178
|
+
| `manage_performance` | Profiling, optimization, scalability |
|
|
198
179
|
| `animation_physics` | Animation BPs, Vehicles, Ragdolls |
|
|
199
180
|
| `manage_effect` | Niagara, Particles, Debug Shapes |
|
|
200
181
|
| `manage_blueprint` | Create, SCS, Graph Editing |
|
|
201
182
|
| `manage_blueprint_graph` | Direct Blueprint Graph Manipulation |
|
|
202
183
|
| `build_environment` | Landscape, Foliage, Procedural |
|
|
203
184
|
| `system_control` | UBT, Tests, Logs, Project Settings, CVars |
|
|
204
|
-
| `manage_sequence` | Sequencer/Cinematics |
|
|
185
|
+
| `manage_sequence` | Sequencer / Cinematics |
|
|
205
186
|
| `inspect` | Object Introspection |
|
|
206
187
|
| `manage_audio` | Audio Assets & Components |
|
|
207
188
|
| `manage_behavior_tree` | Behavior Tree Graph Editing |
|
|
208
189
|
| `manage_input` | Enhanced Input Actions & Contexts |
|
|
209
190
|
|
|
191
|
+
### Supported Asset Types
|
|
210
192
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
- [Handler Mappings](docs/handler-mapping.md) - TypeScript to C++ routing guide
|
|
214
|
-
- [GraphQL API](docs/GraphQL-API.md) - Query and mutation reference
|
|
215
|
-
- [Automation Progress](docs/native-automation-progress.md) - Implementation status
|
|
193
|
+
Blueprints • Materials • Textures • Static Meshes • Skeletal Meshes • Levels • Sounds • Particles • Niagara Systems • Behavior Trees
|
|
216
194
|
|
|
217
|
-
|
|
195
|
+
---
|
|
218
196
|
|
|
219
|
-
|
|
220
|
-
- **Graceful Degradation** - Server starts even without an active Unreal connection
|
|
221
|
-
- **On-Demand Connection** - Retries automation handshakes with backoff instead of persistent polling
|
|
222
|
-
- **Non-Intrusive Health Checks** - Uses echo commands every 30 seconds while connected
|
|
223
|
-
- **Command Safety** - Blocks dangerous console commands
|
|
224
|
-
- **Input Flexibility** - Vectors/rotators accept object or array format
|
|
225
|
-
- **Asset Caching** - 10-second TTL for improved performance
|
|
226
|
-
- **GraphQL** - Specialized endpoint for complex queries
|
|
197
|
+
## WebAssembly Acceleration
|
|
227
198
|
|
|
228
|
-
|
|
199
|
+
Optional WASM acceleration for computationally intensive operations. **Enabled by default** when available, falls back to TypeScript automatically.
|
|
229
200
|
|
|
230
|
-
|
|
201
|
+
| Operation | Speedup |
|
|
202
|
+
|-----------|---------|
|
|
203
|
+
| JSON parsing | 5–8x |
|
|
204
|
+
| Transform calculations | 5–10x |
|
|
205
|
+
| Vector/matrix math | 5x |
|
|
206
|
+
| Dependency resolution | 3–5x |
|
|
231
207
|
|
|
232
|
-
|
|
208
|
+
### Building WASM (Optional)
|
|
233
209
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
210
|
+
```bash
|
|
211
|
+
cargo install wasm-pack # Once per machine
|
|
212
|
+
npm run build # Builds TS + WASM
|
|
213
|
+
```
|
|
237
214
|
|
|
238
|
-
|
|
215
|
+
To disable: `WASM_ENABLED=false`
|
|
239
216
|
|
|
240
|
-
|
|
241
|
-
- **View Modes**: `viewmode wireframe`, `viewmode unlit`
|
|
242
|
-
- **Gameplay**: `slomo 0.5`, `god`, `fly`
|
|
243
|
-
- **Rendering**: `r.screenpercentage 50`, `r.vsync 0`
|
|
217
|
+
---
|
|
244
218
|
|
|
245
|
-
|
|
219
|
+
## GraphQL API
|
|
246
220
|
|
|
247
|
-
|
|
221
|
+
Optional GraphQL endpoint for complex queries. **Disabled by default.**
|
|
248
222
|
|
|
249
223
|
```env
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
# Automation bridge WebSocket client (Node -> Unreal editor)
|
|
254
|
-
MCP_AUTOMATION_HOST=127.0.0.1 # Host/interface for the automation bridge connection
|
|
255
|
-
MCP_AUTOMATION_PORT=8091 # Primary bridge port (must match the plugin's port)
|
|
256
|
-
MCP_AUTOMATION_CLIENT_MODE=true # Set to false to disable the automation bridge client
|
|
257
|
-
MCP_AUTOMATION_CAPABILITY_TOKEN= # Optional capability token for handshake security
|
|
258
|
-
|
|
259
|
-
# Legacy/Alternative variables
|
|
260
|
-
# MCP_AUTOMATION_WS_PORT=8090 # Fallback port if MCP_AUTOMATION_PORT is unset
|
|
261
|
-
# MCP_AUTOMATION_BRIDGE_ENABLED=true # Legacy alias for MCP_AUTOMATION_CLIENT_MODE
|
|
262
|
-
|
|
263
|
-
# WebAssembly acceleration
|
|
264
|
-
WASM_ENABLED=true # Default: enabled if unset; set false to force TS-only
|
|
265
|
-
# Optional override when hosting the WASM bundle elsewhere:
|
|
266
|
-
# WASM_PATH=file:///absolute/path/to/unreal_mcp_wasm.js
|
|
267
|
-
|
|
268
|
-
# Timeouts / caching (advanced – safe defaults are baked in)
|
|
269
|
-
MCP_AUTOMATION_REQUEST_TIMEOUT_MS=120000
|
|
270
|
-
MCP_AUTOMATION_EVENT_TIMEOUT_MS=0
|
|
271
|
-
ASSET_LIST_TTL_MS=10000
|
|
224
|
+
GRAPHQL_ENABLED=true
|
|
225
|
+
GRAPHQL_PORT=4000
|
|
272
226
|
```
|
|
273
227
|
|
|
274
|
-
|
|
275
|
-
- The server uses `dotenv` to load `.env` for local development. A `.env.production` file is included as a reference for production deployments; copy values into your real environment or secret store as appropriate.
|
|
276
|
-
- Environment variables (.env / system env) override the internal runtime defaults (for example, defaults in `src/index.ts`, `src/automation-bridge.ts`, and individual tool implementations). This lets you tune timeouts, logging, and WASM behavior without modifying source code. Keep secrets in `.env` or a secret manager — do not store secrets in source files.
|
|
228
|
+
See [GraphQL API Documentation](docs/GraphQL-API.md).
|
|
277
229
|
|
|
278
|
-
|
|
230
|
+
---
|
|
279
231
|
|
|
280
|
-
|
|
281
|
-
### Docker
|
|
232
|
+
## Docker
|
|
282
233
|
|
|
283
234
|
```bash
|
|
284
235
|
docker build -t unreal-mcp .
|
|
285
|
-
docker run -it --rm unreal-mcp
|
|
236
|
+
docker run -it --rm -e UE_PROJECT_PATH=/project unreal-mcp
|
|
286
237
|
```
|
|
287
238
|
|
|
288
|
-
|
|
239
|
+
---
|
|
289
240
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
241
|
+
## Documentation
|
|
242
|
+
|
|
243
|
+
| Document | Description |
|
|
244
|
+
|----------|-------------|
|
|
245
|
+
| [Handler Mappings](docs/handler-mapping.md) | TypeScript to C++ routing |
|
|
246
|
+
| [GraphQL API](docs/GraphQL-API.md) | Query and mutation reference |
|
|
247
|
+
| [WebAssembly Integration](docs/WebAssembly-Integration.md) | WASM performance guide |
|
|
248
|
+
| [Plugin Extension](docs/editor-plugin-extension.md) | C++ plugin architecture |
|
|
249
|
+
| [Testing Guide](docs/testing-guide.md) | How to run and write tests |
|
|
250
|
+
| [Migration Guide v0.5.0](docs/Migration-Guide-v0.5.0.md) | Upgrade to v0.5.0 |
|
|
251
|
+
| [Roadmap](docs/Roadmap.md) | Development phases |
|
|
252
|
+
| [Automation Progress](docs/native-automation-progress.md) | Implementation status |
|
|
253
|
+
|
|
254
|
+
---
|
|
294
255
|
|
|
295
256
|
## Development
|
|
296
257
|
|
|
297
258
|
```bash
|
|
298
|
-
npm run build
|
|
299
|
-
npm run lint
|
|
300
|
-
npm run
|
|
259
|
+
npm run build # Build TypeScript + WASM
|
|
260
|
+
npm run lint # Run ESLint
|
|
261
|
+
npm run test:unit # Run unit tests
|
|
262
|
+
npm run test:all # Run all tests
|
|
301
263
|
```
|
|
302
264
|
|
|
265
|
+
---
|
|
266
|
+
|
|
303
267
|
## Contributing
|
|
304
268
|
|
|
305
269
|
Contributions welcome! Please:
|
|
@@ -307,6 +271,8 @@ Contributions welcome! Please:
|
|
|
307
271
|
- Keep PRs focused and small
|
|
308
272
|
- Follow existing code style
|
|
309
273
|
|
|
274
|
+
---
|
|
275
|
+
|
|
310
276
|
## License
|
|
311
277
|
|
|
312
|
-
MIT
|
|
278
|
+
MIT — See [LICENSE](LICENSE)
|
package/dist/config.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export declare const EnvSchema: z.ZodObject<{
|
|
|
14
14
|
MCP_ROUTE_STDOUT_LOGS: z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodDefault<z.ZodBoolean>>;
|
|
15
15
|
UE_PROJECT_PATH: z.ZodOptional<z.ZodString>;
|
|
16
16
|
UE_EDITOR_EXE: z.ZodOptional<z.ZodString>;
|
|
17
|
-
UE_SCREENSHOT_DIR: z.ZodOptional<z.ZodString>;
|
|
18
17
|
MCP_AUTOMATION_PORT: z.ZodPipe<z.ZodTransform<number, unknown>, z.ZodDefault<z.ZodNumber>>;
|
|
19
18
|
MCP_AUTOMATION_HOST: z.ZodDefault<z.ZodString>;
|
|
20
19
|
MCP_AUTOMATION_CLIENT_MODE: z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodDefault<z.ZodBoolean>>;
|
package/dist/config.js
CHANGED
|
@@ -34,7 +34,6 @@ export const EnvSchema = z.object({
|
|
|
34
34
|
MCP_ROUTE_STDOUT_LOGS: z.preprocess(stringToBoolean, z.boolean().default(true)),
|
|
35
35
|
UE_PROJECT_PATH: z.string().optional(),
|
|
36
36
|
UE_EDITOR_EXE: z.string().optional(),
|
|
37
|
-
UE_SCREENSHOT_DIR: z.string().optional(),
|
|
38
37
|
MCP_AUTOMATION_PORT: z.preprocess((v) => stringToNumber(v, 8091), z.number().default(8091)),
|
|
39
38
|
MCP_AUTOMATION_HOST: z.string().default('127.0.0.1'),
|
|
40
39
|
MCP_AUTOMATION_CLIENT_MODE: z.preprocess(stringToBoolean, z.boolean().default(false)),
|
package/dist/constants.d.ts
CHANGED
|
@@ -9,4 +9,8 @@ export declare const DEFAULT_TIME_OF_DAY = 9;
|
|
|
9
9
|
export declare const DEFAULT_SUN_INTENSITY = 10000;
|
|
10
10
|
export declare const DEFAULT_SKYLIGHT_INTENSITY = 1;
|
|
11
11
|
export declare const DEFAULT_SCREENSHOT_RESOLUTION = "1920x1080";
|
|
12
|
+
export declare const DEFAULT_OPERATION_TIMEOUT_MS = 30000;
|
|
13
|
+
export declare const DEFAULT_ASSET_OP_TIMEOUT_MS = 60000;
|
|
14
|
+
export declare const EXTENDED_ASSET_OP_TIMEOUT_MS = 120000;
|
|
15
|
+
export declare const LONG_RUNNING_OP_TIMEOUT_MS = 300000;
|
|
12
16
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -9,4 +9,8 @@ export const DEFAULT_TIME_OF_DAY = 9;
|
|
|
9
9
|
export const DEFAULT_SUN_INTENSITY = 10000;
|
|
10
10
|
export const DEFAULT_SKYLIGHT_INTENSITY = 1;
|
|
11
11
|
export const DEFAULT_SCREENSHOT_RESOLUTION = '1920x1080';
|
|
12
|
+
export const DEFAULT_OPERATION_TIMEOUT_MS = 30000;
|
|
13
|
+
export const DEFAULT_ASSET_OP_TIMEOUT_MS = 60000;
|
|
14
|
+
export const EXTENDED_ASSET_OP_TIMEOUT_MS = 120000;
|
|
15
|
+
export const LONG_RUNNING_OP_TIMEOUT_MS = 300000;
|
|
12
16
|
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import DataLoader from 'dataloader';
|
|
2
|
+
import type { AutomationBridge } from '../automation/index.js';
|
|
3
|
+
export interface Actor {
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
class?: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
location?: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
z: number;
|
|
12
|
+
};
|
|
13
|
+
rotation?: {
|
|
14
|
+
pitch: number;
|
|
15
|
+
yaw: number;
|
|
16
|
+
roll: number;
|
|
17
|
+
};
|
|
18
|
+
scale?: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
z: number;
|
|
22
|
+
};
|
|
23
|
+
tags?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface Asset {
|
|
26
|
+
name: string;
|
|
27
|
+
path: string;
|
|
28
|
+
class?: string;
|
|
29
|
+
packagePath?: string;
|
|
30
|
+
size?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface Blueprint {
|
|
33
|
+
name: string;
|
|
34
|
+
path: string;
|
|
35
|
+
parentClass?: string;
|
|
36
|
+
variables?: Array<{
|
|
37
|
+
name: string;
|
|
38
|
+
type: string;
|
|
39
|
+
defaultValue?: unknown;
|
|
40
|
+
}>;
|
|
41
|
+
functions?: Array<{
|
|
42
|
+
name: string;
|
|
43
|
+
parameters?: Array<{
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
46
|
+
}>;
|
|
47
|
+
}>;
|
|
48
|
+
components?: Array<{
|
|
49
|
+
name: string;
|
|
50
|
+
type: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
export interface GraphQLLoaders {
|
|
54
|
+
actorLoader: DataLoader<string, Actor | null>;
|
|
55
|
+
assetLoader: DataLoader<string, Asset | null>;
|
|
56
|
+
blueprintLoader: DataLoader<string, Blueprint | null>;
|
|
57
|
+
actorComponentsLoader: DataLoader<string, Array<{
|
|
58
|
+
name: string;
|
|
59
|
+
type: string;
|
|
60
|
+
}> | null>;
|
|
61
|
+
}
|
|
62
|
+
export declare function createLoaders(automationBridge: AutomationBridge): GraphQLLoaders;
|
|
63
|
+
export declare function clearLoaders(loaders: GraphQLLoaders): void;
|
|
64
|
+
//# sourceMappingURL=loaders.d.ts.map
|