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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
interface RcCallBody {
|
|
2
|
+
objectPath: string;
|
|
3
|
+
functionName: string;
|
|
4
|
+
parameters?: Record<string, any>;
|
|
5
|
+
generateTransaction?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class UnrealBridge {
|
|
8
|
+
private ws?;
|
|
9
|
+
private http;
|
|
10
|
+
private env;
|
|
11
|
+
private log;
|
|
12
|
+
private connected;
|
|
13
|
+
private reconnectTimer?;
|
|
14
|
+
private reconnectAttempts;
|
|
15
|
+
private readonly MAX_RECONNECT_ATTEMPTS;
|
|
16
|
+
private readonly BASE_RECONNECT_DELAY;
|
|
17
|
+
private commandQueue;
|
|
18
|
+
private isProcessing;
|
|
19
|
+
private readonly MIN_COMMAND_DELAY;
|
|
20
|
+
private readonly MAX_COMMAND_DELAY;
|
|
21
|
+
private readonly STAT_COMMAND_DELAY;
|
|
22
|
+
private lastCommandTime;
|
|
23
|
+
private lastStatCommandTime;
|
|
24
|
+
private readonly _SAFE_VIEWMODES;
|
|
25
|
+
private readonly UNSAFE_VIEWMODES;
|
|
26
|
+
private readonly PYTHON_TEMPLATES;
|
|
27
|
+
get isConnected(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Attempt to connect with retries
|
|
30
|
+
* @param maxAttempts Maximum number of connection attempts
|
|
31
|
+
* @param timeoutMs Timeout for each connection attempt in milliseconds
|
|
32
|
+
* @param retryDelayMs Delay between retry attempts in milliseconds
|
|
33
|
+
* @returns Promise that resolves when connected or rejects after all attempts fail
|
|
34
|
+
*/
|
|
35
|
+
tryConnect(maxAttempts?: number, timeoutMs?: number, retryDelayMs?: number): Promise<boolean>;
|
|
36
|
+
connect(timeoutMs?: number): Promise<void>;
|
|
37
|
+
httpCall<T = any>(path: string, method?: 'GET' | 'POST' | 'PUT', body?: any): Promise<T>;
|
|
38
|
+
call(body: RcCallBody): Promise<any>;
|
|
39
|
+
getExposed(): Promise<any>;
|
|
40
|
+
executeConsoleCommand(command: string): Promise<any>;
|
|
41
|
+
executePython(command: string): Promise<any>;
|
|
42
|
+
private scheduleReconnect;
|
|
43
|
+
disconnect(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Enhanced Editor Function Access
|
|
46
|
+
* Use Python scripting as a bridge to access modern Editor Subsystem functions
|
|
47
|
+
*/
|
|
48
|
+
executeEditorFunction(functionName: string, params?: Record<string, any>): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Execute Python script and parse the result
|
|
51
|
+
*/
|
|
52
|
+
private executePythonWithResult;
|
|
53
|
+
/**
|
|
54
|
+
* Get the Unreal Engine version via Python and parse major/minor/patch.
|
|
55
|
+
*/
|
|
56
|
+
getEngineVersion(): Promise<{
|
|
57
|
+
version: string;
|
|
58
|
+
major: number;
|
|
59
|
+
minor: number;
|
|
60
|
+
patch: number;
|
|
61
|
+
isUE56OrAbove: boolean;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Query feature flags (Python availability, editor subsystems) via Python.
|
|
65
|
+
*/
|
|
66
|
+
getFeatureFlags(): Promise<{
|
|
67
|
+
pythonEnabled: boolean;
|
|
68
|
+
subsystems: {
|
|
69
|
+
unrealEditor: boolean;
|
|
70
|
+
levelEditor: boolean;
|
|
71
|
+
editorActor: boolean;
|
|
72
|
+
};
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Fallback commands when Python is not available
|
|
76
|
+
*/
|
|
77
|
+
private executeFallbackCommand;
|
|
78
|
+
/**
|
|
79
|
+
* SOLUTION 2: Safe ViewMode Switching
|
|
80
|
+
* Prevent crashes by validating and safely switching viewmodes
|
|
81
|
+
*/
|
|
82
|
+
setSafeViewMode(mode: string): Promise<any>;
|
|
83
|
+
/**
|
|
84
|
+
* Get safe alternative for unsafe viewmodes
|
|
85
|
+
*/
|
|
86
|
+
private getSafeAlternative;
|
|
87
|
+
/**
|
|
88
|
+
* SOLUTION 3: Command Throttling and Queueing
|
|
89
|
+
* Prevent rapid command execution that can overwhelm the engine
|
|
90
|
+
*/
|
|
91
|
+
private executeThrottledCommand;
|
|
92
|
+
/**
|
|
93
|
+
* Process command queue with appropriate delays
|
|
94
|
+
*/
|
|
95
|
+
private processCommandQueue;
|
|
96
|
+
/**
|
|
97
|
+
* Calculate appropriate delay based on command priority and type
|
|
98
|
+
*/
|
|
99
|
+
private calculateDelay;
|
|
100
|
+
/**
|
|
101
|
+
* SOLUTION 4: Enhanced Asset Creation
|
|
102
|
+
* Use Python scripting for complex asset creation that requires editor scripting
|
|
103
|
+
*/
|
|
104
|
+
createComplexAsset(assetType: string, params: Record<string, any>): Promise<any>;
|
|
105
|
+
/**
|
|
106
|
+
* Start the command processor
|
|
107
|
+
*/
|
|
108
|
+
private startCommandProcessor;
|
|
109
|
+
/**
|
|
110
|
+
* Helper delay function
|
|
111
|
+
*/
|
|
112
|
+
private delay;
|
|
113
|
+
/**
|
|
114
|
+
* Batch command execution with proper delays
|
|
115
|
+
*/
|
|
116
|
+
executeBatch(commands: Array<{
|
|
117
|
+
command: string;
|
|
118
|
+
priority?: number;
|
|
119
|
+
}>): Promise<any[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Get safe console commands for common operations
|
|
122
|
+
*/
|
|
123
|
+
getSafeCommands(): Record<string, string>;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=unreal-bridge.d.ts.map
|