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.
Files changed (139) hide show
  1. package/.env.example +1 -1
  2. package/.github/release-drafter-config.yml +51 -0
  3. package/.github/workflows/greetings.yml +5 -1
  4. package/.github/workflows/labeler.yml +2 -1
  5. package/.github/workflows/publish-mcp.yml +1 -0
  6. package/.github/workflows/release-drafter.yml +1 -1
  7. package/.github/workflows/release.yml +3 -3
  8. package/CHANGELOG.md +71 -0
  9. package/CONTRIBUTING.md +1 -1
  10. package/GEMINI.md +115 -0
  11. package/Public/Plugin_setup_guide.mp4 +0 -0
  12. package/README.md +166 -200
  13. package/dist/config.d.ts +0 -1
  14. package/dist/config.js +0 -1
  15. package/dist/constants.d.ts +4 -0
  16. package/dist/constants.js +4 -0
  17. package/dist/graphql/loaders.d.ts +64 -0
  18. package/dist/graphql/loaders.js +117 -0
  19. package/dist/graphql/resolvers.d.ts +3 -3
  20. package/dist/graphql/resolvers.js +33 -30
  21. package/dist/graphql/server.js +3 -1
  22. package/dist/graphql/types.d.ts +2 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +13 -2
  25. package/dist/server-setup.d.ts +0 -1
  26. package/dist/server-setup.js +0 -40
  27. package/dist/tools/actors.d.ts +40 -24
  28. package/dist/tools/actors.js +8 -2
  29. package/dist/tools/assets.d.ts +19 -71
  30. package/dist/tools/assets.js +28 -22
  31. package/dist/tools/base-tool.d.ts +4 -4
  32. package/dist/tools/base-tool.js +1 -1
  33. package/dist/tools/blueprint.d.ts +33 -61
  34. package/dist/tools/consolidated-tool-handlers.js +96 -110
  35. package/dist/tools/dynamic-handler-registry.d.ts +11 -9
  36. package/dist/tools/dynamic-handler-registry.js +17 -95
  37. package/dist/tools/editor.d.ts +19 -193
  38. package/dist/tools/editor.js +8 -0
  39. package/dist/tools/environment.d.ts +8 -14
  40. package/dist/tools/foliage.d.ts +18 -143
  41. package/dist/tools/foliage.js +4 -2
  42. package/dist/tools/handlers/actor-handlers.js +0 -5
  43. package/dist/tools/handlers/asset-handlers.js +454 -454
  44. package/dist/tools/landscape.d.ts +16 -116
  45. package/dist/tools/landscape.js +7 -3
  46. package/dist/tools/level.d.ts +22 -103
  47. package/dist/tools/level.js +24 -16
  48. package/dist/tools/lighting.js +5 -1
  49. package/dist/tools/materials.js +5 -1
  50. package/dist/tools/niagara.js +37 -2
  51. package/dist/tools/performance.d.ts +0 -1
  52. package/dist/tools/performance.js +0 -1
  53. package/dist/tools/physics.js +5 -1
  54. package/dist/tools/sequence.d.ts +24 -24
  55. package/dist/tools/sequence.js +13 -0
  56. package/dist/tools/ui.d.ts +0 -2
  57. package/dist/types/automation-responses.d.ts +115 -0
  58. package/dist/types/automation-responses.js +2 -0
  59. package/dist/types/responses.d.ts +249 -0
  60. package/dist/types/responses.js +2 -0
  61. package/dist/types/tool-interfaces.d.ts +135 -135
  62. package/dist/utils/command-validator.js +3 -2
  63. package/dist/utils/path-security.d.ts +2 -0
  64. package/dist/utils/path-security.js +24 -0
  65. package/dist/utils/response-factory.d.ts +4 -4
  66. package/dist/utils/response-factory.js +15 -21
  67. package/docs/Migration-Guide-v0.5.0.md +1 -9
  68. package/docs/testing-guide.md +2 -2
  69. package/package.json +12 -6
  70. package/scripts/run-all-tests.mjs +25 -20
  71. package/server.json +3 -2
  72. package/src/config.ts +1 -1
  73. package/src/constants.ts +7 -0
  74. package/src/graphql/loaders.ts +244 -0
  75. package/src/graphql/resolvers.ts +47 -49
  76. package/src/graphql/server.ts +3 -1
  77. package/src/graphql/types.ts +3 -0
  78. package/src/index.ts +15 -2
  79. package/src/resources/assets.ts +5 -4
  80. package/src/server-setup.ts +3 -37
  81. package/src/tools/actors.ts +36 -28
  82. package/src/tools/animation.ts +1 -0
  83. package/src/tools/assets.ts +74 -63
  84. package/src/tools/base-tool.ts +3 -3
  85. package/src/tools/blueprint.ts +59 -59
  86. package/src/tools/consolidated-tool-handlers.ts +129 -150
  87. package/src/tools/dynamic-handler-registry.ts +22 -140
  88. package/src/tools/editor.ts +39 -26
  89. package/src/tools/environment.ts +21 -27
  90. package/src/tools/foliage.ts +28 -25
  91. package/src/tools/handlers/actor-handlers.ts +2 -8
  92. package/src/tools/handlers/asset-handlers.ts +484 -484
  93. package/src/tools/handlers/sequence-handlers.ts +1 -1
  94. package/src/tools/landscape.ts +34 -28
  95. package/src/tools/level.ts +96 -76
  96. package/src/tools/lighting.ts +6 -1
  97. package/src/tools/materials.ts +8 -2
  98. package/src/tools/niagara.ts +44 -2
  99. package/src/tools/performance.ts +1 -2
  100. package/src/tools/physics.ts +7 -1
  101. package/src/tools/sequence.ts +41 -25
  102. package/src/tools/ui.ts +0 -2
  103. package/src/types/automation-responses.ts +119 -0
  104. package/src/types/responses.ts +355 -0
  105. package/src/types/tool-interfaces.ts +135 -135
  106. package/src/utils/command-validator.ts +3 -2
  107. package/src/utils/normalize.test.ts +162 -0
  108. package/src/utils/path-security.ts +43 -0
  109. package/src/utils/response-factory.ts +29 -24
  110. package/src/utils/safe-json.test.ts +90 -0
  111. package/src/utils/validation.test.ts +184 -0
  112. package/tests/test-animation.mjs +358 -33
  113. package/tests/test-asset-graph.mjs +311 -0
  114. package/tests/test-audio.mjs +314 -116
  115. package/tests/test-behavior-tree.mjs +327 -144
  116. package/tests/test-blueprint-graph.mjs +343 -12
  117. package/tests/test-control-editor.mjs +85 -53
  118. package/tests/test-graphql.mjs +58 -8
  119. package/tests/test-input.mjs +349 -0
  120. package/tests/test-inspect.mjs +291 -61
  121. package/tests/test-landscape.mjs +304 -48
  122. package/tests/test-lighting.mjs +428 -0
  123. package/tests/test-manage-level.mjs +70 -51
  124. package/tests/test-performance.mjs +539 -0
  125. package/tests/test-sequence.mjs +82 -46
  126. package/tests/test-system.mjs +72 -33
  127. package/tests/test-wasm.mjs +98 -8
  128. package/vitest.config.ts +35 -0
  129. package/.github/release-drafter.yml +0 -148
  130. package/dist/prompts/index.d.ts +0 -21
  131. package/dist/prompts/index.js +0 -217
  132. package/dist/tools/blueprint/helpers.d.ts +0 -29
  133. package/dist/tools/blueprint/helpers.js +0 -182
  134. package/src/prompts/index.ts +0 -249
  135. package/src/tools/blueprint/helpers.ts +0 -189
  136. package/tests/test-blueprint-events.mjs +0 -35
  137. package/tests/test-extra-tools.mjs +0 -38
  138. package/tests/test-render.mjs +0 -33
  139. package/tests/test-search-assets.mjs +0 -66
package/.env.example CHANGED
@@ -6,7 +6,7 @@ MCP_ROUTE_STDOUT_LOGS=true
6
6
  # Unreal Engine Settings
7
7
  UE_PROJECT_PATH="C:/Users/YourName/Documents/Unreal Projects/YourProject/YourProject.uproject"
8
8
  # UE_EDITOR_EXE="C:/Program Files/Epic Games/UE_5.7/Engine/Binaries/Win64/UnrealEditor.exe"
9
- # UE_SCREENSHOT_DIR="C:/Users/YourName/Documents/Unreal Projects/YourProject/Saved/Screenshots"
9
+
10
10
 
11
11
  # Automation Bridge Connection (Node -> Unreal)
12
12
  MCP_AUTOMATION_HOST=127.0.0.1
@@ -0,0 +1,51 @@
1
+ name-template: 'v$NEXT_PATCH_VERSION'
2
+ tag-template: 'v$NEXT_PATCH_VERSION'
3
+ categories:
4
+ - title: '🚀 Features'
5
+ labels:
6
+ - 'type/enhancement'
7
+ - 'feature'
8
+ - 'enhancement'
9
+ - title: '🐛 Bug Fixes'
10
+ labels:
11
+ - 'type/bug'
12
+ - 'bug'
13
+ - 'fix'
14
+ - title: '📚 Documentation'
15
+ labels:
16
+ - 'area/docs'
17
+ - 'documentation'
18
+ - title: '🧰 Tools'
19
+ labels:
20
+ - 'area/tools'
21
+ - 'tooling'
22
+ - title: '🔌 Plugin'
23
+ labels:
24
+ - 'area/plugin'
25
+ - title: '🧪 Testing'
26
+ labels:
27
+ - 'area/testing'
28
+ - 'test'
29
+ - title: '📦 Maintenance'
30
+ labels:
31
+ - 'chore'
32
+ - 'maintenance'
33
+ change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
34
+ change-title-escapes: '\<*_&'
35
+ version-resolver:
36
+ major:
37
+ labels:
38
+ - 'major'
39
+ minor:
40
+ labels:
41
+ - 'minor'
42
+ patch:
43
+ labels:
44
+ - 'patch'
45
+ - 'type/bug'
46
+ - 'bug'
47
+ default: patch
48
+ template: |
49
+ ## Changes in this Release
50
+
51
+ $CHANGES
@@ -1,6 +1,10 @@
1
1
  name: Greetings
2
2
 
3
- on: [pull_request_target, issues]
3
+ on:
4
+ pull_request_target:
5
+ types: [opened]
6
+ issues:
7
+ types: [opened]
4
8
 
5
9
  permissions:
6
10
  issues: write
@@ -1,6 +1,7 @@
1
1
  name: "Pull Request Labeler"
2
2
  on:
3
- - pull_request_target
3
+ pull_request_target:
4
+ types: [opened, synchronize, reopened]
4
5
 
5
6
  permissions:
6
7
  contents: read
@@ -56,6 +56,7 @@ jobs:
56
56
 
57
57
  - name: Publish to npm
58
58
  run: npm publish
59
+ continue-on-error: true
59
60
  env:
60
61
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61
62
 
@@ -18,6 +18,6 @@ jobs:
18
18
  steps:
19
19
  - uses: release-drafter/release-drafter@v6.1.0 # v6.1.0
20
20
  with:
21
- config-name: release-drafter.yml
21
+ config-name: release-drafter-config.yml
22
22
  env:
23
23
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -15,12 +15,12 @@ jobs:
15
15
 
16
16
  steps:
17
17
  - name: Checkout code
18
- uses: actions/checkout@v4 # v4
18
+ uses: actions/checkout@v6 # v4
19
19
  with:
20
20
  fetch-depth: 0
21
21
 
22
22
  - name: Setup Node.js
23
- uses: actions/setup-node@v4 # v4
23
+ uses: actions/setup-node@v6 # v4
24
24
  with:
25
25
  node-version: '20'
26
26
  cache: 'npm'
@@ -91,7 +91,7 @@ jobs:
91
91
  fi
92
92
 
93
93
  - name: Create GitHub Release
94
- uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
94
+ uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
95
95
  with:
96
96
  name: Release ${{ steps.version.outputs.tag }}
97
97
  body_path: release_notes.md
package/CHANGELOG.md CHANGED
@@ -7,6 +7,77 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## 🏷️ [0.5.1] - 2025-12-17
11
+
12
+ > [!WARNING]
13
+ > ### ⚠️ Breaking Changes
14
+ > - **Standardized Return Types** - All tool methods now return `StandardActionResponse` type instead of generic objects. Consumers must update their code to handle the new response structure with `success`, `data`, `warnings`, and `error` fields. (`5e615c5`)
15
+ > - **Test Suite Structure** - New test files added and existing tests enhanced with comprehensive coverage.
16
+
17
+ ### 🔄 Changed
18
+
19
+ <details>
20
+ <summary><b>🎯 Standardized Tool Interfaces</b> (<code>5e615c5</code>)</summary>
21
+
22
+ | Component | Change |
23
+ |-----------|--------|
24
+ | Tool Methods | Updated all tool methods to return `StandardActionResponse` type for consistency |
25
+ | Tool Interfaces | Modified interfaces (assets, blueprint, editor, environment, foliage, landscape, level, sequence) to use standardized response format |
26
+ | Type System | Added proper type imports and exports for `StandardActionResponse` |
27
+ | Handler Files | Updated to work with new standardized response types |
28
+ | Response Structure | All implementations return correct structure with `success`/`error` fields |
29
+
30
+ </details>
31
+
32
+ ### ✨ Added
33
+
34
+ <details>
35
+ <summary><b>🧪 Comprehensive Test Suite</b> (<a href="https://github.com/ChiR24/Unreal_mcp/pull/25">#25</a>)</summary>
36
+
37
+ | Feature | Description |
38
+ |---------|-------------|
39
+ | **Test Coverage** | Added comprehensive test files with success, error, and edge cases |
40
+ | **GraphQL DataLoader** | Implemented N+1 query optimization with batching and caching |
41
+ | **Type-Safe Interfaces** | Added type-safe automation response interfaces for better error handling |
42
+ | **Utility Tests** | Added tests for core utilities (normalize, safe-json, validation) |
43
+ | **Real-World Scenarios** | Enhanced coverage with real-world scenarios and cleanup procedures |
44
+ | **New Test Suites** | Audio, lighting, performance, input, and asset graph management |
45
+ | **Enhanced Logging** | Improved diagnostic logging throughout tools |
46
+ | **Documentation** | Updated supported Unreal Engine versions (5.0-5.7) in testing documentation |
47
+
48
+ </details>
49
+
50
+ ### 🧹 Maintenance
51
+
52
+ - 🗑️ **Prompts Module Cleanup** - Removed prompts module and related GraphQL prompt functionality ([#26](https://github.com/ChiR24/Unreal_mcp/pull/26))
53
+ - 🔒 **Security Updates** - Removed unused dependencies (axios, json5, yargs) from package.json for security (`5e615c5`)
54
+ - 📐 **Tool Interfaces** - Enhanced asset and level tools with security validation and timeout handling (`5e615c5`)
55
+
56
+ ### 📦 Dependencies
57
+
58
+ <details>
59
+ <summary><b>GitHub Actions Updates</b></summary>
60
+
61
+ | Package | Update | PR | Commit |
62
+ |---------|--------|-----|--------|
63
+ | `actions/checkout` | v4 → v6 | [#23](https://github.com/ChiR24/Unreal_mcp/pull/23) | `4c6b3b5` |
64
+ | `actions/setup-node` | v4 → v6 | [#22](https://github.com/ChiR24/Unreal_mcp/pull/22) | `71aa35c` |
65
+ | `softprops/action-gh-release` | 2.0.8 → 2.5.0 | [#21](https://github.com/ChiR24/Unreal_mcp/pull/21) | `b6c8a46` |
66
+
67
+ </details>
68
+
69
+ <details>
70
+ <summary><b>NPM Package Updates</b> (<a href="https://github.com/ChiR24/Unreal_mcp/pull/24">#24</a>, <code>5e615c5</code>)</summary>
71
+
72
+ | Package | Update |
73
+ |---------|--------|
74
+ | `@modelcontextprotocol/sdk` | 1.25.0 → 1.25.1 |
75
+ | `@types/node` | 25.0.2 → 25.0.3 |
76
+
77
+ </details>
78
+
79
+ ---
80
+
10
81
  ## 🏷️ [0.5.0] - 2025-12-16
11
82
 
12
83
  > [!IMPORTANT]
package/CONTRIBUTING.md CHANGED
@@ -26,7 +26,7 @@ Please be respectful and constructive in all interactions. We're building someth
26
26
 
27
27
  1. Fork and clone the repository:
28
28
  ```bash
29
- git clone https://github.com/YOUR_USERNAME/unreal-engine-mcp-server.git
29
+ git clone https://github.com/ChiR24/Unreal_mcp.git
30
30
  cd unreal-engine-mcp-server
31
31
  ```
32
32
 
package/GEMINI.md ADDED
@@ -0,0 +1,115 @@
1
+ # Unreal Engine MCP Server
2
+
3
+ ## Project Overview
4
+
5
+ The **Unreal Engine MCP Server** (`unreal-engine-mcp-server`) is a comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal Engine via a native automation bridge. It facilitates bidirectional communication between an AI agent (running via MCP) and an active Unreal Engine Editor session.
6
+
7
+ ### Architecture
8
+
9
+ The system is composed of three main components:
10
+
11
+ 1. **MCP Server (Node.js/TypeScript):**
12
+ * **Role:** The core server that implements the MCP protocol, handles client requests, and orchestrates communication.
13
+ * **Location:** `src/`
14
+ * **Key File:** `src/index.ts` (Entry point), `src/unreal-bridge.ts` (Connection management).
15
+ * **Tools:** Defines MCP tools for Actor manipulation, Asset management, Blueprints, etc. (found in `src/tools/`).
16
+
17
+ 2. **Unreal Engine Plugin (C++):**
18
+ * **Role:** Acts as the receiver and executor within the Unreal Engine process. It runs a WebSocket server to listen for commands from the Node.js server.
19
+ * **Location:** `Plugins/McpAutomationBridge/`
20
+ * **Key Functionality:** Handles `execute_console_command`, `set_object_property`, and other engine-level operations on the Game Thread.
21
+ * **Communication:** Listens on `ws://localhost:8091` (default).
22
+
23
+ 3. **WebAssembly Module (Rust):**
24
+ * **Role:** Provides high-performance utilities for the Node.js server, such as complex property parsing and vector math.
25
+ * **Location:** `wasm/`
26
+ * **Key File:** `wasm/src/lib.rs`.
27
+
28
+ ## Building and Running
29
+
30
+ ### Prerequisites
31
+ * Node.js (v18 or higher)
32
+ * Unreal Engine (5.0-5.7)
33
+ * Rust (optional, if modifying WASM components)
34
+
35
+ ### Setup
36
+
37
+ 1. **Install Dependencies:**
38
+ ```bash
39
+ npm install
40
+ ```
41
+
42
+ 2. **Build the Server:**
43
+ ```bash
44
+ npm run build
45
+ ```
46
+
47
+ 3. **Build WebAssembly (Optional):**
48
+ If you are working on the Rust module:
49
+ ```bash
50
+ npm run build:wasm
51
+ ```
52
+
53
+ 4. **Unreal Plugin Installation:**
54
+ * Copy the `Plugins/McpAutomationBridge` folder into your Unreal Project's `Plugins` directory (e.g., `YourProject/Plugins/`).
55
+ * Regenerate project files and recompile your Unreal project.
56
+ * Enable the plugin in the Unreal Editor if it's not automatically enabled.
57
+ * Ensure the plugin is running (it should log "MCP Automation Bridge listening" to the Output Log).
58
+
59
+ ### Running the Server
60
+ To start the MCP server:
61
+ ```bash
62
+ npm start
63
+ ```
64
+ Or for development with `ts-node`:
65
+ ```bash
66
+ npm run dev
67
+ ```
68
+
69
+ ### Testing
70
+ The project includes a suite of integration tests located in the `tests/` directory. These scripts act as "fake" MCP clients to verify functionality.
71
+
72
+ * **Run All Tests:**
73
+ ```bash
74
+ npm test
75
+ ```
76
+ * **Run Specific Test:**
77
+ ```bash
78
+ npm run test:control_actor
79
+ npm run test:manage_asset
80
+ npm run test:wasm
81
+ ```
82
+
83
+ ## Development Conventions
84
+
85
+ * **Language:**
86
+ * Server logic is written in **TypeScript**.
87
+ * Unreal integration is written in **C++**.
88
+ * Performance modules are written in **Rust**.
89
+ * **Safety:**
90
+ * The `UnrealBridge` class (`src/unreal-bridge.ts`) includes safety mechanisms like command throttling and "Safe ViewMode" switching to prevent crashing the engine with invalid commands.
91
+ * **Do not** bypass these safety checks when adding new functionality.
92
+ * **Linting:**
93
+ * TypeScript: `npm run lint`
94
+ * C++/C#: Scripts provided (`npm run lint:cpp`, `npm run lint:csharp`) rely on external tools like `cpplint` and `dotnet-format`.
95
+
96
+ ## Directory Structure
97
+
98
+ * `src/`: Source code for the Node.js MCP server.
99
+ * `tools/`: Definitions for MCP tools (Actors, Assets, etc.).
100
+ * `resources/`: Definitions for MCP resources.
101
+ * `wasm/`: Compiled WebAssembly bindings.
102
+ * `Plugins/`: Source code for the Unreal Engine C++ plugin.
103
+ * `wasm/`: Source code for the Rust WebAssembly module.
104
+ * `tests/`: Integration tests and test runners.
105
+ * `scripts/`: Utility scripts for build and maintenance.
106
+
107
+ # Project Rules Agent
108
+
109
+ - The user explicitly wants real, working code only. I must never add mocks, placeholders, false-passed success code, or any non-functional code. All solutions should be directly applicable to a live editor and pass all relevant tests genuinely.
110
+ - The user explicitly requires real, working code only. I must never add mocks, placeholders, false-passed success codes, or any non-functional code. All solutions must be directly applicable to a live editor and pass all relevant tests genuinely.
111
+ - Always read full file content.
112
+ - Engine path: X:\Unreal_Engine\UE_5.0\Engine
113
+ - Engine path: X:\Unreal_Engine\UE_5.6\Engine
114
+ - Engine path: X:\Unreal_Engine\UE_5.7\Engine
115
+ - Before editing codes in plugin make sure to check before in engine's code so that all code are correct.
Binary file