unreal-engine-mcp-server 0.2.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/.dockerignore +57 -0
- package/.env.production +25 -0
- package/.eslintrc.json +54 -0
- package/.github/workflows/publish-mcp.yml +75 -0
- package/Dockerfile +54 -0
- package/LICENSE +21 -0
- package/Public/icon.png +0 -0
- package/README.md +209 -0
- package/claude_desktop_config_example.json +13 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +7 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +484 -0
- package/dist/prompts/index.d.ts +14 -0
- package/dist/prompts/index.js +38 -0
- package/dist/python-utils.d.ts +29 -0
- package/dist/python-utils.js +54 -0
- package/dist/resources/actors.d.ts +13 -0
- package/dist/resources/actors.js +83 -0
- package/dist/resources/assets.d.ts +23 -0
- package/dist/resources/assets.js +245 -0
- package/dist/resources/levels.d.ts +17 -0
- package/dist/resources/levels.js +94 -0
- package/dist/tools/actors.d.ts +51 -0
- package/dist/tools/actors.js +459 -0
- package/dist/tools/animation.d.ts +196 -0
- package/dist/tools/animation.js +579 -0
- package/dist/tools/assets.d.ts +21 -0
- package/dist/tools/assets.js +304 -0
- package/dist/tools/audio.d.ts +170 -0
- package/dist/tools/audio.js +416 -0
- package/dist/tools/blueprint.d.ts +144 -0
- package/dist/tools/blueprint.js +652 -0
- package/dist/tools/build_environment_advanced.d.ts +66 -0
- package/dist/tools/build_environment_advanced.js +484 -0
- package/dist/tools/consolidated-tool-definitions.d.ts +2598 -0
- package/dist/tools/consolidated-tool-definitions.js +607 -0
- package/dist/tools/consolidated-tool-handlers.d.ts +2 -0
- package/dist/tools/consolidated-tool-handlers.js +1050 -0
- package/dist/tools/debug.d.ts +185 -0
- package/dist/tools/debug.js +265 -0
- package/dist/tools/editor.d.ts +88 -0
- package/dist/tools/editor.js +365 -0
- package/dist/tools/engine.d.ts +30 -0
- package/dist/tools/engine.js +36 -0
- package/dist/tools/foliage.d.ts +155 -0
- package/dist/tools/foliage.js +525 -0
- package/dist/tools/introspection.d.ts +98 -0
- package/dist/tools/introspection.js +683 -0
- package/dist/tools/landscape.d.ts +158 -0
- package/dist/tools/landscape.js +375 -0
- package/dist/tools/level.d.ts +110 -0
- package/dist/tools/level.js +362 -0
- package/dist/tools/lighting.d.ts +159 -0
- package/dist/tools/lighting.js +1179 -0
- package/dist/tools/materials.d.ts +34 -0
- package/dist/tools/materials.js +146 -0
- package/dist/tools/niagara.d.ts +145 -0
- package/dist/tools/niagara.js +289 -0
- package/dist/tools/performance.d.ts +163 -0
- package/dist/tools/performance.js +412 -0
- package/dist/tools/physics.d.ts +189 -0
- package/dist/tools/physics.js +784 -0
- package/dist/tools/rc.d.ts +110 -0
- package/dist/tools/rc.js +363 -0
- package/dist/tools/sequence.d.ts +112 -0
- package/dist/tools/sequence.js +675 -0
- package/dist/tools/tool-definitions.d.ts +4919 -0
- package/dist/tools/tool-definitions.js +891 -0
- package/dist/tools/tool-handlers.d.ts +47 -0
- package/dist/tools/tool-handlers.js +830 -0
- package/dist/tools/ui.d.ts +171 -0
- package/dist/tools/ui.js +337 -0
- package/dist/tools/visual.d.ts +29 -0
- package/dist/tools/visual.js +67 -0
- package/dist/types/env.d.ts +10 -0
- package/dist/types/env.js +18 -0
- package/dist/types/index.d.ts +323 -0
- package/dist/types/index.js +28 -0
- package/dist/types/tool-types.d.ts +274 -0
- package/dist/types/tool-types.js +13 -0
- package/dist/unreal-bridge.d.ts +126 -0
- package/dist/unreal-bridge.js +992 -0
- package/dist/utils/cache-manager.d.ts +64 -0
- package/dist/utils/cache-manager.js +176 -0
- package/dist/utils/error-handler.d.ts +66 -0
- package/dist/utils/error-handler.js +243 -0
- package/dist/utils/errors.d.ts +133 -0
- package/dist/utils/errors.js +256 -0
- package/dist/utils/http.d.ts +26 -0
- package/dist/utils/http.js +135 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.js +32 -0
- package/dist/utils/normalize.d.ts +17 -0
- package/dist/utils/normalize.js +49 -0
- package/dist/utils/response-validator.d.ts +34 -0
- package/dist/utils/response-validator.js +121 -0
- package/dist/utils/safe-json.d.ts +4 -0
- package/dist/utils/safe-json.js +97 -0
- package/dist/utils/stdio-redirect.d.ts +2 -0
- package/dist/utils/stdio-redirect.js +20 -0
- package/dist/utils/validation.d.ts +50 -0
- package/dist/utils/validation.js +173 -0
- package/mcp-config-example.json +14 -0
- package/package.json +63 -0
- package/server.json +60 -0
- package/src/cli.ts +7 -0
- package/src/index.ts +543 -0
- package/src/prompts/index.ts +51 -0
- package/src/python/editor_compat.py +181 -0
- package/src/python-utils.ts +57 -0
- package/src/resources/actors.ts +92 -0
- package/src/resources/assets.ts +251 -0
- package/src/resources/levels.ts +83 -0
- package/src/tools/actors.ts +480 -0
- package/src/tools/animation.ts +713 -0
- package/src/tools/assets.ts +305 -0
- package/src/tools/audio.ts +548 -0
- package/src/tools/blueprint.ts +736 -0
- package/src/tools/build_environment_advanced.ts +526 -0
- package/src/tools/consolidated-tool-definitions.ts +619 -0
- package/src/tools/consolidated-tool-handlers.ts +1093 -0
- package/src/tools/debug.ts +368 -0
- package/src/tools/editor.ts +360 -0
- package/src/tools/engine.ts +32 -0
- package/src/tools/foliage.ts +652 -0
- package/src/tools/introspection.ts +778 -0
- package/src/tools/landscape.ts +523 -0
- package/src/tools/level.ts +410 -0
- package/src/tools/lighting.ts +1316 -0
- package/src/tools/materials.ts +148 -0
- package/src/tools/niagara.ts +312 -0
- package/src/tools/performance.ts +549 -0
- package/src/tools/physics.ts +924 -0
- package/src/tools/rc.ts +437 -0
- package/src/tools/sequence.ts +791 -0
- package/src/tools/tool-definitions.ts +907 -0
- package/src/tools/tool-handlers.ts +941 -0
- package/src/tools/ui.ts +499 -0
- package/src/tools/visual.ts +60 -0
- package/src/types/env.ts +27 -0
- package/src/types/index.ts +414 -0
- package/src/types/tool-types.ts +343 -0
- package/src/unreal-bridge.ts +1118 -0
- package/src/utils/cache-manager.ts +213 -0
- package/src/utils/error-handler.ts +320 -0
- package/src/utils/errors.ts +312 -0
- package/src/utils/http.ts +184 -0
- package/src/utils/logger.ts +30 -0
- package/src/utils/normalize.ts +54 -0
- package/src/utils/response-validator.ts +145 -0
- package/src/utils/safe-json.ts +112 -0
- package/src/utils/stdio-redirect.ts +18 -0
- package/src/utils/validation.ts +212 -0
- package/tsconfig.json +33 -0
package/.dockerignore
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Git
|
|
2
|
+
.git
|
|
3
|
+
.gitignore
|
|
4
|
+
|
|
5
|
+
# Node modules
|
|
6
|
+
node_modules
|
|
7
|
+
npm-debug.log*
|
|
8
|
+
yarn-debug.log*
|
|
9
|
+
yarn-error.log*
|
|
10
|
+
|
|
11
|
+
# TypeScript build output (will be built in Docker)
|
|
12
|
+
dist
|
|
13
|
+
|
|
14
|
+
# Development files
|
|
15
|
+
.env
|
|
16
|
+
.env.local
|
|
17
|
+
.env.development
|
|
18
|
+
.env.test
|
|
19
|
+
|
|
20
|
+
# IDE
|
|
21
|
+
.vscode
|
|
22
|
+
.idea
|
|
23
|
+
*.swp
|
|
24
|
+
*.swo
|
|
25
|
+
*.swn
|
|
26
|
+
.DS_Store
|
|
27
|
+
|
|
28
|
+
# Testing
|
|
29
|
+
coverage
|
|
30
|
+
.nyc_output
|
|
31
|
+
*.test.ts
|
|
32
|
+
*.spec.ts
|
|
33
|
+
|
|
34
|
+
# Documentation
|
|
35
|
+
README.md
|
|
36
|
+
CONTRIBUTING.md
|
|
37
|
+
CHANGELOG.md
|
|
38
|
+
LICENSE
|
|
39
|
+
|
|
40
|
+
# Docker
|
|
41
|
+
Dockerfile
|
|
42
|
+
.dockerignore
|
|
43
|
+
docker-compose*.yml
|
|
44
|
+
|
|
45
|
+
# CI/CD
|
|
46
|
+
.github
|
|
47
|
+
.gitlab-ci.yml
|
|
48
|
+
.travis.yml
|
|
49
|
+
|
|
50
|
+
# Logs
|
|
51
|
+
logs
|
|
52
|
+
*.log
|
|
53
|
+
|
|
54
|
+
# Temporary files
|
|
55
|
+
tmp
|
|
56
|
+
temp
|
|
57
|
+
*.tmp
|
package/.env.production
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Production Configuration for Unreal Engine MCP Server
|
|
2
|
+
|
|
3
|
+
# Unreal Engine Remote Control Settings
|
|
4
|
+
UE_HOST=127.0.0.1
|
|
5
|
+
UE_RC_HTTP_PORT=30010
|
|
6
|
+
UE_RC_WS_PORT=30020
|
|
7
|
+
|
|
8
|
+
# Tool Mode Configuration
|
|
9
|
+
# Set to 'false' to use individual tools (36+), 'true' or unset for consolidated (10)
|
|
10
|
+
USE_CONSOLIDATED_TOOLS=true
|
|
11
|
+
|
|
12
|
+
# Logging Level
|
|
13
|
+
LOG_LEVEL=info
|
|
14
|
+
|
|
15
|
+
# Server Settings
|
|
16
|
+
SERVER_NAME=unreal-engine-mcp
|
|
17
|
+
SERVER_VERSION=1.0.0
|
|
18
|
+
|
|
19
|
+
# Connection Settings
|
|
20
|
+
MAX_RETRY_ATTEMPTS=3
|
|
21
|
+
RETRY_DELAY_MS=2000
|
|
22
|
+
|
|
23
|
+
# Performance Settings
|
|
24
|
+
REQUEST_TIMEOUT_MS=30000
|
|
25
|
+
WEBSOCKET_KEEPALIVE_MS=30000
|
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"parserOptions": {
|
|
5
|
+
"ecmaVersion": 2022,
|
|
6
|
+
"sourceType": "module",
|
|
7
|
+
"project": "./tsconfig.json"
|
|
8
|
+
},
|
|
9
|
+
"plugins": [
|
|
10
|
+
"@typescript-eslint"
|
|
11
|
+
],
|
|
12
|
+
"extends": [
|
|
13
|
+
"eslint:recommended",
|
|
14
|
+
"plugin:@typescript-eslint/recommended"
|
|
15
|
+
],
|
|
16
|
+
"env": {
|
|
17
|
+
"node": true,
|
|
18
|
+
"es2022": true
|
|
19
|
+
},
|
|
20
|
+
"rules": {
|
|
21
|
+
"@typescript-eslint/no-unused-vars": [
|
|
22
|
+
"warn",
|
|
23
|
+
{
|
|
24
|
+
"args": "all",
|
|
25
|
+
"argsIgnorePattern": "^_",
|
|
26
|
+
"caughtErrors": "all",
|
|
27
|
+
"caughtErrorsIgnorePattern": "^_",
|
|
28
|
+
"destructuredArrayIgnorePattern": "^_",
|
|
29
|
+
"varsIgnorePattern": "^_",
|
|
30
|
+
"ignoreRestSiblings": true
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
34
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
35
|
+
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
36
|
+
"no-console": "off",
|
|
37
|
+
"semi": ["error", "always"],
|
|
38
|
+
"quotes": ["error", "single", { "avoidEscape": true }],
|
|
39
|
+
"no-empty": ["error", { "allowEmptyCatch": true }],
|
|
40
|
+
"no-useless-escape": "warn",
|
|
41
|
+
"no-case-declarations": "off",
|
|
42
|
+
"prefer-const": "warn",
|
|
43
|
+
"no-unused-vars": "off"
|
|
44
|
+
},
|
|
45
|
+
"ignorePatterns": [
|
|
46
|
+
"dist/",
|
|
47
|
+
"node_modules/",
|
|
48
|
+
"*.js",
|
|
49
|
+
"*.d.ts",
|
|
50
|
+
"*.cjs",
|
|
51
|
+
"vitest.config.ts",
|
|
52
|
+
"test-*.js"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: Publish to MCP Registry
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"] # Triggers on version tags like v1.2.0
|
|
6
|
+
workflow_dispatch: # Allow manual triggering
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write # Required for OIDC authentication
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: "20"
|
|
23
|
+
registry-url: "https://registry.npmjs.org"
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm ci
|
|
27
|
+
|
|
28
|
+
- name: Run tests
|
|
29
|
+
run: npm run test
|
|
30
|
+
continue-on-error: true
|
|
31
|
+
|
|
32
|
+
- name: Run linting
|
|
33
|
+
run: npm run lint
|
|
34
|
+
|
|
35
|
+
- name: Build package
|
|
36
|
+
run: npm run build
|
|
37
|
+
|
|
38
|
+
- name: Extract version from tag
|
|
39
|
+
id: version
|
|
40
|
+
run: |
|
|
41
|
+
if [[ ${{ github.event_name }} == "push" && ${{ github.ref }} == refs/tags/* ]]; then
|
|
42
|
+
VERSION=${GITHUB_REF#refs/tags/v}
|
|
43
|
+
else
|
|
44
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
45
|
+
fi
|
|
46
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
47
|
+
echo "Publishing version: $VERSION"
|
|
48
|
+
|
|
49
|
+
- name: Update server.json version
|
|
50
|
+
run: |
|
|
51
|
+
VERSION=${{ steps.version.outputs.version }}
|
|
52
|
+
jq --arg v "$VERSION" '.version = $v | .packages[] |= if .registry_type == "npm" then .version = $v else . end' server.json > tmp && mv tmp server.json
|
|
53
|
+
echo "Updated server.json:"
|
|
54
|
+
cat server.json
|
|
55
|
+
|
|
56
|
+
- name: Publish to npm
|
|
57
|
+
run: npm publish
|
|
58
|
+
env:
|
|
59
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
60
|
+
|
|
61
|
+
- name: Install MCP Publisher
|
|
62
|
+
run: |
|
|
63
|
+
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
|
|
64
|
+
|
|
65
|
+
- name: Login to MCP Registry
|
|
66
|
+
run: ./mcp-publisher login github-oidc
|
|
67
|
+
|
|
68
|
+
- name: Publish to MCP Registry
|
|
69
|
+
run: ./mcp-publisher publish
|
|
70
|
+
|
|
71
|
+
- name: Verify publication
|
|
72
|
+
run: |
|
|
73
|
+
echo "Waiting for registry to update..."
|
|
74
|
+
sleep 30
|
|
75
|
+
curl -s "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.ChiR24/unreal-engine-mcp" | jq '.'
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Multi-stage build for efficient image size
|
|
2
|
+
FROM node:20-alpine AS builder
|
|
3
|
+
|
|
4
|
+
# Set working directory
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
# Copy package files
|
|
8
|
+
COPY package*.json ./
|
|
9
|
+
|
|
10
|
+
# Install ALL dependencies (including dev) for building - skip prepare script
|
|
11
|
+
RUN npm ci --ignore-scripts
|
|
12
|
+
|
|
13
|
+
# Copy TypeScript config and source files
|
|
14
|
+
COPY tsconfig.json ./
|
|
15
|
+
COPY src ./src
|
|
16
|
+
|
|
17
|
+
# Build the TypeScript project
|
|
18
|
+
RUN npm run build
|
|
19
|
+
|
|
20
|
+
# Production stage
|
|
21
|
+
FROM node:20-alpine
|
|
22
|
+
|
|
23
|
+
# Install dumb-init for proper signal handling
|
|
24
|
+
RUN apk add --no-cache dumb-init
|
|
25
|
+
|
|
26
|
+
# Create non-root user
|
|
27
|
+
RUN addgroup -g 1001 -S nodejs && \
|
|
28
|
+
adduser -S nodejs -u 1001
|
|
29
|
+
|
|
30
|
+
# Set working directory
|
|
31
|
+
WORKDIR /app
|
|
32
|
+
|
|
33
|
+
# Copy package files
|
|
34
|
+
COPY package*.json ./
|
|
35
|
+
|
|
36
|
+
# Install production dependencies only (skip prepare script)
|
|
37
|
+
RUN npm ci --only=production --ignore-scripts && \
|
|
38
|
+
npm cache clean --force
|
|
39
|
+
|
|
40
|
+
# Copy built application from builder stage
|
|
41
|
+
COPY --from=builder /app/dist ./dist
|
|
42
|
+
|
|
43
|
+
# Change ownership to nodejs user
|
|
44
|
+
RUN chown -R nodejs:nodejs /app
|
|
45
|
+
|
|
46
|
+
# Switch to non-root user
|
|
47
|
+
USER nodejs
|
|
48
|
+
|
|
49
|
+
# MCP servers use stdio, no port exposure needed
|
|
50
|
+
# Use dumb-init to handle signals properly
|
|
51
|
+
ENTRYPOINT ["dumb-init", "--"]
|
|
52
|
+
|
|
53
|
+
# Run the MCP server
|
|
54
|
+
CMD ["node", "dist/cli.js"]
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Unreal Engine MCP Server Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/Public/icon.png
ADDED
|
Binary file
|
package/README.md
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Unreal Engine MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.npmjs.com/package/unreal-engine-mcp-server)
|
|
5
|
+
[](https://github.com/modelcontextprotocol/sdk)
|
|
6
|
+
[](https://www.unrealengine.com/)
|
|
7
|
+
|
|
8
|
+
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal Engine via Remote Control API. Built with TypeScript and designed for game development automation.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
### Core Capabilities
|
|
13
|
+
- **Asset Management** - Browse, import, and create materials
|
|
14
|
+
- **Actor Control** - Spawn, delete, and manipulate actors with physics
|
|
15
|
+
- **Editor Control** - PIE sessions, camera, and viewport management
|
|
16
|
+
- **Level Management** - Load/save levels, lighting, and environment building
|
|
17
|
+
- **Animation & Physics** - Blueprints, state machines, ragdolls, constraints
|
|
18
|
+
- **Visual Effects** - Niagara particles, GPU simulations, procedural effects
|
|
19
|
+
- **Sequencer** - Cinematics, camera animations, and timeline control
|
|
20
|
+
- **Console Commands** - Safe execution with dangerous command filtering
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### Prerequisites
|
|
25
|
+
- Node.js 18+
|
|
26
|
+
- Unreal Engine 5.0-5.6
|
|
27
|
+
- Required UE Plugins:
|
|
28
|
+
- Remote Control
|
|
29
|
+
- Web Remote Control
|
|
30
|
+
- Python Script Plugin
|
|
31
|
+
- Editor Scripting Utilities
|
|
32
|
+
|
|
33
|
+
### Installation
|
|
34
|
+
|
|
35
|
+
#### Option 1: NPM Package (Recommended)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Install globally
|
|
39
|
+
npm install -g unreal-engine-mcp-server
|
|
40
|
+
|
|
41
|
+
# Or install locally in your project
|
|
42
|
+
npm install unreal-engine-mcp-server
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Option 2: Clone and Build
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Clone the repository
|
|
49
|
+
git clone https://github.com/ChiR24/Unreal_mcp.git
|
|
50
|
+
cd Unreal_mcp
|
|
51
|
+
|
|
52
|
+
# Install dependencies and build
|
|
53
|
+
npm install
|
|
54
|
+
npm run build
|
|
55
|
+
|
|
56
|
+
# Run directly
|
|
57
|
+
node dist/cli.js
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Unreal Engine Configuration
|
|
61
|
+
|
|
62
|
+
Add to your project's `Config/DefaultEngine.ini`:
|
|
63
|
+
|
|
64
|
+
```ini
|
|
65
|
+
[/Script/PythonScriptPlugin.PythonScriptPluginSettings]
|
|
66
|
+
bRemoteExecution=True
|
|
67
|
+
bAllowRemotePythonExecution=True
|
|
68
|
+
|
|
69
|
+
[/Script/RemoteControl.RemoteControlSettings]
|
|
70
|
+
bAllowRemoteExecutionOfConsoleCommands=True
|
|
71
|
+
bEnableRemoteExecution=True
|
|
72
|
+
bAllowPythonExecution=True
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then enable Python execution in: Edit > Project Settings > Plugins > Remote Control
|
|
76
|
+
|
|
77
|
+
## MCP Client Configuration
|
|
78
|
+
|
|
79
|
+
### Claude Desktop / Cursor
|
|
80
|
+
|
|
81
|
+
#### For NPM Installation (Global)
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"mcpServers": {
|
|
86
|
+
"unreal-engine": {
|
|
87
|
+
"command": "unreal-engine-mcp-server",
|
|
88
|
+
"env": {
|
|
89
|
+
"UE_HOST": "127.0.0.1",
|
|
90
|
+
"UE_RC_HTTP_PORT": "30010",
|
|
91
|
+
"UE_RC_WS_PORT": "30020"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### For NPM Installation (Local)
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"unreal-engine": {
|
|
104
|
+
"command": "npx",
|
|
105
|
+
"args": ["unreal-engine-mcp-server"],
|
|
106
|
+
"env": {
|
|
107
|
+
"UE_HOST": "127.0.0.1",
|
|
108
|
+
"UE_RC_HTTP_PORT": "30010",
|
|
109
|
+
"UE_RC_WS_PORT": "30020"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### For Clone/Build Installation
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"mcpServers": {
|
|
121
|
+
"unreal-engine": {
|
|
122
|
+
"command": "node",
|
|
123
|
+
"args": ["path/to/Unreal_mcp/dist/cli.js"],
|
|
124
|
+
"env": {
|
|
125
|
+
"UE_HOST": "127.0.0.1",
|
|
126
|
+
"UE_RC_HTTP_PORT": "30010",
|
|
127
|
+
"UE_RC_WS_PORT": "30020"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Available Tools (13 Consolidated)
|
|
135
|
+
|
|
136
|
+
| Tool | Description |
|
|
137
|
+
|------|-------------|
|
|
138
|
+
| `manage_asset` | List, create materials, import assets |
|
|
139
|
+
| `control_actor` | Spawn, delete actors, apply physics |
|
|
140
|
+
| `control_editor` | PIE control, camera, view modes |
|
|
141
|
+
| `manage_level` | Load/save levels, lighting |
|
|
142
|
+
| `animation_physics` | Animation blueprints, ragdolls |
|
|
143
|
+
| `create_effect` | Particles, Niagara, debug shapes |
|
|
144
|
+
| `manage_blueprint` | Create blueprints, add components |
|
|
145
|
+
| `build_environment` | Landscapes, terrain, foliage |
|
|
146
|
+
| `system_control` | Profiling, quality, UI, screenshots |
|
|
147
|
+
| `console_command` | Direct console command execution |
|
|
148
|
+
| `manage_rc` | Remote Control presets |
|
|
149
|
+
| `manage_sequence` | Sequencer/cinematics |
|
|
150
|
+
| `inspect` | Object introspection |
|
|
151
|
+
|
|
152
|
+
## Key Features
|
|
153
|
+
|
|
154
|
+
- **Graceful Degradation** - Server starts even without UE connection
|
|
155
|
+
- **Auto-Reconnection** - Attempts reconnection every 10 seconds
|
|
156
|
+
- **Connection Timeout** - 5-second timeout with configurable retries
|
|
157
|
+
- **Non-Intrusive Health Checks** - Uses echo commands every 30 seconds
|
|
158
|
+
- **Command Safety** - Blocks dangerous console commands
|
|
159
|
+
- **Input Flexibility** - Vectors/rotators accept object or array format
|
|
160
|
+
- **Asset Caching** - 10-second TTL for improved performance
|
|
161
|
+
|
|
162
|
+
## Supported Asset Types
|
|
163
|
+
|
|
164
|
+
Blueprints, Materials, Textures, Static/Skeletal Meshes, Levels, Sounds, Particles, Niagara Systems
|
|
165
|
+
|
|
166
|
+
## Example Console Commands
|
|
167
|
+
|
|
168
|
+
- **Statistics**: `stat fps`, `stat gpu`, `stat memory`
|
|
169
|
+
- **View Modes**: `viewmode wireframe`, `viewmode unlit`
|
|
170
|
+
- **Gameplay**: `slomo 0.5`, `god`, `fly`
|
|
171
|
+
- **Rendering**: `r.screenpercentage 50`, `r.vsync 0`
|
|
172
|
+
|
|
173
|
+
## Configuration
|
|
174
|
+
|
|
175
|
+
### Environment Variables
|
|
176
|
+
|
|
177
|
+
```env
|
|
178
|
+
UE_HOST=127.0.0.1 # Unreal Engine host
|
|
179
|
+
UE_RC_HTTP_PORT=30010 # Remote Control HTTP port
|
|
180
|
+
UE_RC_WS_PORT=30020 # Remote Control WebSocket port
|
|
181
|
+
USE_CONSOLIDATED_TOOLS=true # Use 13 consolidated tools (false = 37 individual)
|
|
182
|
+
LOG_LEVEL=info # debug | info | warn | error
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Docker
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
docker build -t unreal-mcp .
|
|
189
|
+
docker run -it --rm unreal-mcp
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Development
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm run build # Build TypeScript
|
|
196
|
+
npm run lint # Run ESLint
|
|
197
|
+
npm run lint:fix # Fix linting issues
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Contributing
|
|
201
|
+
|
|
202
|
+
Contributions welcome! Please:
|
|
203
|
+
- Include reproduction steps for bugs
|
|
204
|
+
- Keep PRs focused and small
|
|
205
|
+
- Follow existing code style
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
MIT - See [LICENSE](LICENSE) file
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import 'dotenv/config';
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { UnrealBridge } from './unreal-bridge.js';
|
|
4
|
+
export declare function createServer(): Promise<{
|
|
5
|
+
server: Server<{
|
|
6
|
+
method: string;
|
|
7
|
+
params?: {
|
|
8
|
+
[x: string]: unknown;
|
|
9
|
+
_meta?: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
progressToken?: string | number | undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
method: string;
|
|
16
|
+
params?: {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
_meta?: {
|
|
19
|
+
[x: string]: unknown;
|
|
20
|
+
} | undefined;
|
|
21
|
+
} | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
_meta?: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
} | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
bridge: UnrealBridge;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function startStdioServer(): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|