unreal-engine-mcp-server 0.5.0 → 0.5.2

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 (188) 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 +2 -4
  6. package/.github/workflows/release-drafter.yml +3 -2
  7. package/.github/workflows/release.yml +3 -3
  8. package/CHANGELOG.md +109 -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/automation/bridge.d.ts +1 -2
  14. package/dist/automation/bridge.js +24 -23
  15. package/dist/automation/connection-manager.d.ts +1 -0
  16. package/dist/automation/connection-manager.js +10 -0
  17. package/dist/automation/message-handler.js +5 -4
  18. package/dist/automation/request-tracker.d.ts +4 -0
  19. package/dist/automation/request-tracker.js +11 -3
  20. package/dist/config.d.ts +0 -1
  21. package/dist/config.js +0 -1
  22. package/dist/constants.d.ts +4 -0
  23. package/dist/constants.js +4 -0
  24. package/dist/graphql/loaders.d.ts +64 -0
  25. package/dist/graphql/loaders.js +117 -0
  26. package/dist/graphql/resolvers.d.ts +3 -3
  27. package/dist/graphql/resolvers.js +33 -30
  28. package/dist/graphql/server.js +3 -1
  29. package/dist/graphql/types.d.ts +2 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +13 -2
  32. package/dist/server-setup.d.ts +0 -1
  33. package/dist/server-setup.js +0 -40
  34. package/dist/tools/actors.d.ts +58 -24
  35. package/dist/tools/actors.js +22 -6
  36. package/dist/tools/assets.d.ts +19 -71
  37. package/dist/tools/assets.js +28 -22
  38. package/dist/tools/base-tool.d.ts +4 -4
  39. package/dist/tools/base-tool.js +1 -1
  40. package/dist/tools/blueprint.d.ts +45 -61
  41. package/dist/tools/blueprint.js +43 -14
  42. package/dist/tools/consolidated-tool-definitions.js +2 -1
  43. package/dist/tools/consolidated-tool-handlers.js +96 -110
  44. package/dist/tools/dynamic-handler-registry.d.ts +11 -9
  45. package/dist/tools/dynamic-handler-registry.js +17 -95
  46. package/dist/tools/editor.d.ts +19 -193
  47. package/dist/tools/editor.js +11 -2
  48. package/dist/tools/environment.d.ts +8 -14
  49. package/dist/tools/foliage.d.ts +18 -143
  50. package/dist/tools/foliage.js +4 -2
  51. package/dist/tools/handlers/actor-handlers.d.ts +1 -1
  52. package/dist/tools/handlers/actor-handlers.js +14 -13
  53. package/dist/tools/handlers/asset-handlers.js +454 -454
  54. package/dist/tools/handlers/sequence-handlers.d.ts +1 -1
  55. package/dist/tools/handlers/sequence-handlers.js +24 -13
  56. package/dist/tools/introspection.d.ts +1 -1
  57. package/dist/tools/introspection.js +1 -1
  58. package/dist/tools/landscape.d.ts +16 -116
  59. package/dist/tools/landscape.js +7 -3
  60. package/dist/tools/level.d.ts +22 -103
  61. package/dist/tools/level.js +26 -18
  62. package/dist/tools/lighting.d.ts +54 -7
  63. package/dist/tools/lighting.js +9 -5
  64. package/dist/tools/materials.d.ts +1 -1
  65. package/dist/tools/materials.js +5 -1
  66. package/dist/tools/niagara.js +37 -2
  67. package/dist/tools/performance.d.ts +0 -1
  68. package/dist/tools/performance.js +0 -1
  69. package/dist/tools/physics.js +5 -1
  70. package/dist/tools/sequence.d.ts +24 -24
  71. package/dist/tools/sequence.js +13 -0
  72. package/dist/tools/ui.d.ts +0 -2
  73. package/dist/types/automation-responses.d.ts +115 -0
  74. package/dist/types/automation-responses.js +2 -0
  75. package/dist/types/responses.d.ts +249 -0
  76. package/dist/types/responses.js +2 -0
  77. package/dist/types/tool-interfaces.d.ts +135 -135
  78. package/dist/types/tool-types.d.ts +2 -0
  79. package/dist/unreal-bridge.js +4 -4
  80. package/dist/utils/command-validator.js +7 -5
  81. package/dist/utils/error-handler.d.ts +24 -2
  82. package/dist/utils/error-handler.js +58 -23
  83. package/dist/utils/normalize.d.ts +7 -4
  84. package/dist/utils/normalize.js +12 -10
  85. package/dist/utils/path-security.d.ts +2 -0
  86. package/dist/utils/path-security.js +24 -0
  87. package/dist/utils/response-factory.d.ts +4 -4
  88. package/dist/utils/response-factory.js +15 -21
  89. package/dist/utils/response-validator.js +88 -73
  90. package/dist/utils/unreal-command-queue.d.ts +2 -0
  91. package/dist/utils/unreal-command-queue.js +8 -1
  92. package/docs/Migration-Guide-v0.5.0.md +1 -9
  93. package/docs/handler-mapping.md +4 -2
  94. package/docs/testing-guide.md +2 -2
  95. package/package.json +12 -6
  96. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridgeSubsystem.cpp +298 -33
  97. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_AnimationHandlers.cpp +7 -8
  98. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintGraphHandlers.cpp +229 -319
  99. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_BlueprintHandlers.cpp +98 -0
  100. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EffectHandlers.cpp +24 -0
  101. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_EnvironmentHandlers.cpp +96 -0
  102. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_LightingHandlers.cpp +52 -5
  103. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_ProcessRequest.cpp +5 -268
  104. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpAutomationBridge_SequenceHandlers.cpp +57 -2
  105. package/plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/McpConnectionManager.cpp +0 -1
  106. package/scripts/run-all-tests.mjs +25 -20
  107. package/server.json +3 -2
  108. package/src/automation/bridge.ts +27 -25
  109. package/src/automation/connection-manager.ts +18 -0
  110. package/src/automation/message-handler.ts +33 -8
  111. package/src/automation/request-tracker.ts +39 -7
  112. package/src/config.ts +1 -1
  113. package/src/constants.ts +7 -0
  114. package/src/graphql/loaders.ts +244 -0
  115. package/src/graphql/resolvers.ts +47 -49
  116. package/src/graphql/server.ts +3 -1
  117. package/src/graphql/types.ts +3 -0
  118. package/src/index.ts +15 -2
  119. package/src/resources/assets.ts +5 -4
  120. package/src/server/tool-registry.ts +3 -3
  121. package/src/server-setup.ts +3 -37
  122. package/src/tools/actors.ts +77 -44
  123. package/src/tools/animation.ts +1 -0
  124. package/src/tools/assets.ts +76 -65
  125. package/src/tools/base-tool.ts +3 -3
  126. package/src/tools/blueprint.ts +170 -104
  127. package/src/tools/consolidated-tool-definitions.ts +2 -1
  128. package/src/tools/consolidated-tool-handlers.ts +129 -150
  129. package/src/tools/dynamic-handler-registry.ts +22 -140
  130. package/src/tools/editor.ts +43 -29
  131. package/src/tools/environment.ts +21 -27
  132. package/src/tools/foliage.ts +28 -25
  133. package/src/tools/handlers/actor-handlers.ts +16 -17
  134. package/src/tools/handlers/asset-handlers.ts +484 -484
  135. package/src/tools/handlers/sequence-handlers.ts +85 -62
  136. package/src/tools/introspection.ts +7 -7
  137. package/src/tools/landscape.ts +34 -28
  138. package/src/tools/level.ts +100 -80
  139. package/src/tools/lighting.ts +25 -20
  140. package/src/tools/materials.ts +9 -3
  141. package/src/tools/niagara.ts +44 -2
  142. package/src/tools/performance.ts +1 -2
  143. package/src/tools/physics.ts +7 -1
  144. package/src/tools/sequence.ts +42 -26
  145. package/src/tools/ui.ts +1 -3
  146. package/src/types/automation-responses.ts +119 -0
  147. package/src/types/responses.ts +355 -0
  148. package/src/types/tool-interfaces.ts +135 -135
  149. package/src/types/tool-types.ts +4 -0
  150. package/src/unreal-bridge.ts +71 -26
  151. package/src/utils/command-validator.ts +47 -5
  152. package/src/utils/error-handler.ts +128 -45
  153. package/src/utils/normalize.test.ts +162 -0
  154. package/src/utils/normalize.ts +38 -16
  155. package/src/utils/path-security.ts +43 -0
  156. package/src/utils/response-factory.ts +29 -24
  157. package/src/utils/response-validator.ts +103 -87
  158. package/src/utils/safe-json.test.ts +90 -0
  159. package/src/utils/unreal-command-queue.ts +13 -1
  160. package/src/utils/validation.test.ts +184 -0
  161. package/tests/test-animation.mjs +358 -33
  162. package/tests/test-asset-graph.mjs +311 -0
  163. package/tests/test-audio.mjs +314 -116
  164. package/tests/test-behavior-tree.mjs +327 -144
  165. package/tests/test-blueprint-graph.mjs +343 -12
  166. package/tests/test-control-editor.mjs +85 -53
  167. package/tests/test-graphql.mjs +58 -8
  168. package/tests/test-input.mjs +349 -0
  169. package/tests/test-inspect.mjs +291 -61
  170. package/tests/test-landscape.mjs +304 -48
  171. package/tests/test-lighting.mjs +428 -0
  172. package/tests/test-manage-level.mjs +70 -51
  173. package/tests/test-performance.mjs +539 -0
  174. package/tests/test-sequence.mjs +82 -46
  175. package/tests/test-system.mjs +72 -33
  176. package/tests/test-wasm.mjs +98 -8
  177. package/vitest.config.ts +35 -0
  178. package/.github/release-drafter.yml +0 -148
  179. package/dist/prompts/index.d.ts +0 -21
  180. package/dist/prompts/index.js +0 -217
  181. package/dist/tools/blueprint/helpers.d.ts +0 -29
  182. package/dist/tools/blueprint/helpers.js +0 -182
  183. package/src/prompts/index.ts +0 -249
  184. package/src/tools/blueprint/helpers.ts +0 -189
  185. package/tests/test-blueprint-events.mjs +0 -35
  186. package/tests/test-extra-tools.mjs +0 -38
  187. package/tests/test-render.mjs +0 -33
  188. 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,21 +56,19 @@ 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
 
62
63
  - name: Install MCP Publisher
63
- if: ${{ success() }}
64
64
  run: |
65
- curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.1.0/mcp-publisher_1.1.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
65
+ curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.4.0/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
66
66
  chmod +x mcp-publisher
67
67
 
68
68
  - name: Login to MCP Registry
69
- if: ${{ success() }}
70
69
  run: ./mcp-publisher login github-oidc
71
70
 
72
71
  - name: Publish to MCP Registry
73
- if: ${{ success() }}
74
72
  run: ./mcp-publisher publish
75
73
 
76
74
  - name: Verify publication
@@ -15,9 +15,10 @@ jobs:
15
15
  contents: write
16
16
  pull-requests: write
17
17
  runs-on: ubuntu-latest
18
+ timeout-minutes: 15
18
19
  steps:
19
- - uses: release-drafter/release-drafter@v6.1.0 # v6.1.0
20
+ - uses: release-drafter/release-drafter@v6
20
21
  with:
21
- config-name: release-drafter.yml
22
+ config-name: release-drafter-config.yml
22
23
  env:
23
24
  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,115 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## 🏷️ [0.5.2] - 2025-12-18
11
+
12
+ > [!IMPORTANT]
13
+ > ### 🔄 Breaking Changes
14
+ > - **Standardized Tools & Type Safety** - All tool handlers now use consistent interfaces with improved type safety. Some internal API signatures have changed. (`079e3c2`)
15
+
16
+ ### ✨ Added
17
+
18
+ <details>
19
+ <summary><b>🛠️ Blueprint Enhancements</b> (<code>e710751</code>)</summary>
20
+
21
+ | Feature | Description |
22
+ |---------|-------------|
23
+ | **Dynamic Node Creation** | Support for creating nodes dynamically in Blueprint graphs |
24
+ | **Struct Property Support** | Added ability to set and get struct properties on Blueprint components |
25
+
26
+ </details>
27
+
28
+ ### 🔄 Changed
29
+
30
+ <details>
31
+ <summary><b>🎯 Standardized Tool Interfaces</b> (<a href="https://github.com/ChiR24/Unreal_mcp/pull/28">#28</a>)</summary>
32
+
33
+ | Component | Change |
34
+ |-----------|--------|
35
+ | Tool Handlers | Optimized bridge communication and standardized response handling |
36
+ | Type Safety | Hardened type definitions across all tool interfaces |
37
+ | Bridge Optimization | Improved performance and reliability of automation bridge |
38
+
39
+ </details>
40
+
41
+ ### 🔧 CI/CD
42
+
43
+ - 🔗 **MCP Publisher** - Fixed download URL format in workflow steps (`0d452e7`)
44
+ - 🧹 **Workflow Cleanup** - Removed unnecessary success conditions from MCP workflow steps (`82bd575`)
45
+
46
+ ---
47
+
48
+ ## 🏷️ [0.5.1] - 2025-12-17
49
+
50
+ > [!WARNING]
51
+ > ### ⚠️ Breaking Changes
52
+ > - **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`)
53
+ > - **Test Suite Structure** - New test files added and existing tests enhanced with comprehensive coverage.
54
+
55
+ ### 🔄 Changed
56
+
57
+ <details>
58
+ <summary><b>🎯 Standardized Tool Interfaces</b> (<code>5e615c5</code>)</summary>
59
+
60
+ | Component | Change |
61
+ |-----------|--------|
62
+ | Tool Methods | Updated all tool methods to return `StandardActionResponse` type for consistency |
63
+ | Tool Interfaces | Modified interfaces (assets, blueprint, editor, environment, foliage, landscape, level, sequence) to use standardized response format |
64
+ | Type System | Added proper type imports and exports for `StandardActionResponse` |
65
+ | Handler Files | Updated to work with new standardized response types |
66
+ | Response Structure | All implementations return correct structure with `success`/`error` fields |
67
+
68
+ </details>
69
+
70
+ ### ✨ Added
71
+
72
+ <details>
73
+ <summary><b>🧪 Comprehensive Test Suite</b> (<a href="https://github.com/ChiR24/Unreal_mcp/pull/25">#25</a>)</summary>
74
+
75
+ | Feature | Description |
76
+ |---------|-------------|
77
+ | **Test Coverage** | Added comprehensive test files with success, error, and edge cases |
78
+ | **GraphQL DataLoader** | Implemented N+1 query optimization with batching and caching |
79
+ | **Type-Safe Interfaces** | Added type-safe automation response interfaces for better error handling |
80
+ | **Utility Tests** | Added tests for core utilities (normalize, safe-json, validation) |
81
+ | **Real-World Scenarios** | Enhanced coverage with real-world scenarios and cleanup procedures |
82
+ | **New Test Suites** | Audio, lighting, performance, input, and asset graph management |
83
+ | **Enhanced Logging** | Improved diagnostic logging throughout tools |
84
+ | **Documentation** | Updated supported Unreal Engine versions (5.0-5.7) in testing documentation |
85
+
86
+ </details>
87
+
88
+ ### 🧹 Maintenance
89
+
90
+ - 🗑️ **Prompts Module Cleanup** - Removed prompts module and related GraphQL prompt functionality ([#26](https://github.com/ChiR24/Unreal_mcp/pull/26))
91
+ - 🔒 **Security Updates** - Removed unused dependencies (axios, json5, yargs) from package.json for security (`5e615c5`)
92
+ - 📐 **Tool Interfaces** - Enhanced asset and level tools with security validation and timeout handling (`5e615c5`)
93
+
94
+ ### 📦 Dependencies
95
+
96
+ <details>
97
+ <summary><b>GitHub Actions Updates</b></summary>
98
+
99
+ | Package | Update | PR | Commit |
100
+ |---------|--------|-----|--------|
101
+ | `actions/checkout` | v4 → v6 | [#23](https://github.com/ChiR24/Unreal_mcp/pull/23) | `4c6b3b5` |
102
+ | `actions/setup-node` | v4 → v6 | [#22](https://github.com/ChiR24/Unreal_mcp/pull/22) | `71aa35c` |
103
+ | `softprops/action-gh-release` | 2.0.8 → 2.5.0 | [#21](https://github.com/ChiR24/Unreal_mcp/pull/21) | `b6c8a46` |
104
+
105
+ </details>
106
+
107
+ <details>
108
+ <summary><b>NPM Package Updates</b> (<a href="https://github.com/ChiR24/Unreal_mcp/pull/24">#24</a>, <code>5e615c5</code>)</summary>
109
+
110
+ | Package | Update |
111
+ |---------|--------|
112
+ | `@modelcontextprotocol/sdk` | 1.25.0 → 1.25.1 |
113
+ | `@types/node` | 25.0.2 → 25.0.3 |
114
+
115
+ </details>
116
+
117
+ ---
118
+
10
119
  ## 🏷️ [0.5.0] - 2025-12-16
11
120
 
12
121
  > [!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