blueprint-extractor-mcp 2.4.0 → 3.0.0

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 (92) hide show
  1. package/README.md +39 -30
  2. package/dist/automation-controller.d.ts +6 -0
  3. package/dist/automation-controller.js +51 -0
  4. package/dist/catalogs/example-catalog.d.ts +13 -0
  5. package/dist/catalogs/example-catalog.js +485 -0
  6. package/dist/compactor.d.ts +6 -0
  7. package/dist/compactor.js +263 -1
  8. package/dist/helpers/capture.d.ts +5 -0
  9. package/dist/helpers/capture.js +33 -0
  10. package/dist/helpers/commonui-button-style.d.ts +2 -0
  11. package/dist/helpers/commonui-button-style.js +100 -0
  12. package/dist/helpers/formatting.d.ts +14 -0
  13. package/dist/helpers/formatting.js +127 -0
  14. package/dist/helpers/live-coding.d.ts +3 -0
  15. package/dist/helpers/live-coding.js +51 -0
  16. package/dist/helpers/project-resolution.d.ts +22 -0
  17. package/dist/helpers/project-resolution.js +63 -0
  18. package/dist/helpers/project-utils.d.ts +8 -0
  19. package/dist/helpers/project-utils.js +20 -0
  20. package/dist/helpers/subsystem.d.ts +18 -0
  21. package/dist/helpers/subsystem.js +22 -0
  22. package/dist/helpers/tool-help.d.ts +22 -0
  23. package/dist/helpers/tool-help.js +160 -0
  24. package/dist/helpers/tool-registration.d.ts +13 -0
  25. package/dist/helpers/tool-registration.js +29 -0
  26. package/dist/helpers/tool-results.d.ts +17 -0
  27. package/dist/helpers/tool-results.js +138 -0
  28. package/dist/helpers/verification.d.ts +4 -0
  29. package/dist/helpers/verification.js +281 -0
  30. package/dist/helpers/widget-utils.d.ts +2 -0
  31. package/dist/helpers/widget-utils.js +13 -0
  32. package/dist/index.d.ts +4 -26
  33. package/dist/index.js +6 -6445
  34. package/dist/prompts/prompt-catalog.d.ts +108 -0
  35. package/dist/prompts/prompt-catalog.js +303 -0
  36. package/dist/register-server-resources.d.ts +10 -0
  37. package/dist/register-server-resources.js +12 -0
  38. package/dist/register-server-tools.d.ts +30 -0
  39. package/dist/register-server-tools.js +206 -0
  40. package/dist/resources/example-and-capture-resources.d.ts +10 -0
  41. package/dist/resources/example-and-capture-resources.js +293 -0
  42. package/dist/resources/static-doc-resources.d.ts +2 -0
  43. package/dist/resources/static-doc-resources.js +344 -0
  44. package/dist/schemas/tool-inputs.d.ts +3211 -0
  45. package/dist/schemas/tool-inputs.js +433 -0
  46. package/dist/schemas/tool-results.d.ts +12511 -0
  47. package/dist/schemas/tool-results.js +275 -0
  48. package/dist/server-config.d.ts +9 -0
  49. package/dist/server-config.js +63 -0
  50. package/dist/server-factory.d.ts +6 -0
  51. package/dist/server-factory.js +78 -0
  52. package/dist/tool-context.d.ts +29 -0
  53. package/dist/tool-context.js +1 -0
  54. package/dist/tools/animation-authoring.d.ts +16 -0
  55. package/dist/tools/animation-authoring.js +248 -0
  56. package/dist/tools/automation-runs.d.ts +18 -0
  57. package/dist/tools/automation-runs.js +129 -0
  58. package/dist/tools/blueprint-authoring.d.ts +12 -0
  59. package/dist/tools/blueprint-authoring.js +127 -0
  60. package/dist/tools/commonui-button-style.d.ts +10 -0
  61. package/dist/tools/commonui-button-style.js +148 -0
  62. package/dist/tools/data-and-input.d.ts +12 -0
  63. package/dist/tools/data-and-input.js +184 -0
  64. package/dist/tools/extraction.d.ts +12 -0
  65. package/dist/tools/extraction.js +254 -0
  66. package/dist/tools/import-jobs.d.ts +14 -0
  67. package/dist/tools/import-jobs.js +162 -0
  68. package/dist/tools/material-authoring.d.ts +16 -0
  69. package/dist/tools/material-authoring.js +281 -0
  70. package/dist/tools/material-instance.d.ts +15 -0
  71. package/dist/tools/material-instance.js +68 -0
  72. package/dist/tools/project-control.d.ts +30 -0
  73. package/dist/tools/project-control.js +406 -0
  74. package/dist/tools/schema-and-ai-authoring.d.ts +22 -0
  75. package/dist/tools/schema-and-ai-authoring.js +380 -0
  76. package/dist/tools/tables-and-curves.d.ts +16 -0
  77. package/dist/tools/tables-and-curves.js +196 -0
  78. package/dist/tools/utility-tools.d.ts +22 -0
  79. package/dist/tools/utility-tools.js +61 -0
  80. package/dist/tools/widget-animation-authoring.d.ts +11 -0
  81. package/dist/tools/widget-animation-authoring.js +68 -0
  82. package/dist/tools/widget-extraction.d.ts +10 -0
  83. package/dist/tools/widget-extraction.js +63 -0
  84. package/dist/tools/widget-structure.d.ts +11 -0
  85. package/dist/tools/widget-structure.js +231 -0
  86. package/dist/tools/widget-verification.d.ts +26 -0
  87. package/dist/tools/widget-verification.js +387 -0
  88. package/dist/tools/window-ui.d.ts +31 -0
  89. package/dist/tools/window-ui.js +407 -0
  90. package/dist/ue-client.d.ts +10 -0
  91. package/dist/ue-client.js +42 -4
  92. package/package.json +2 -2
package/README.md CHANGED
@@ -1,26 +1,33 @@
1
- # `blueprint-extractor-mcp`
2
-
3
- MCP server for the Unreal Engine `BlueprintExtractor` plugin.
4
-
5
- This package exposes the `blueprint-extractor` server over stdio and talks to a running Unreal Editor through the Remote Control HTTP API.
6
-
7
- The current v2 MCP contract exposes 92 tools, 12 resources, 4 resource templates, and 4 prompts.
8
- Public tools use canonical `snake_case` inputs and return structured JSON success or error envelopes.
9
-
10
- Current surface area includes:
11
-
12
- - read-only extraction tools for Blueprints, AI assets, data assets, curves, materials, and animation metadata
13
- - explicit-save authoring tools for the supported editor-side asset families, including compact widget extraction, incremental widget-structure ops, widget class-default routing, composable material authoring (`set_material_settings`, `add_material_expression`, `connect_material_expressions`, `bind_material_property`), and the advanced `modify_material` escape hatch
14
- - dedicated Enhanced Input authoring tools for `InputAction` and `InputMappingContext` assets (`create_input_action`, `modify_input_action`, `create_input_mapping_context`, `modify_input_mapping_context`)
15
- - dedicated CommonUI button-style tools (`create_commonui_button_style`, `extract_commonui_button_style`, `modify_commonui_button_style`, `apply_commonui_button_style`) for `CommonButtonBase` wrapper surfaces instead of raw `UButton` field mutation
16
- - async import and reimport tools with polling for generic assets plus typed texture and mesh helpers
17
- - host-side project automation tools for external builds, Live Coding requests, restart/reconnect orchestration, `wait_for_editor` recovery polling, a thin window-polish helper, and runtime automation artifacts that surface verification screenshots back to the caller
18
- - a shared visual-verification artifact contract across widget captures, capture diffs, and automation-run screenshots so the caller can inspect rendered results instead of relying on semantic success alone
19
- - static guidance resources, resource templates, and prompts for authoring conventions, selector rules, font roles, project automation, example payloads, widget patterns, unsupported surfaces, safe UI redesign, and classic material graph guidance
20
-
21
- ## Requirements
22
-
23
- - Node.js 18+
1
+ # `blueprint-extractor-mcp`
2
+
3
+ MCP server for the Unreal Engine `BlueprintExtractor` plugin.
4
+
5
+ This package exposes the `blueprint-extractor` server over stdio and talks to a running Unreal Editor through the Remote Control HTTP API.
6
+
7
+ The current v3 contract exposes consolidated extraction, authoring, automation, import, verification, resource, and prompt surfaces for Blueprint Extractor workflows.
8
+ Public tools use canonical `snake_case` inputs. Structured success payloads are returned through `structuredContent`, and non-text artifacts such as capture links or inline images may be attached in `content`.
9
+
10
+ Current surface area includes:
11
+
12
+ - read-only extraction tools for Blueprints, widgets, materials, and consolidated asset-family extraction through `extract_asset`
13
+ - explicit-save authoring tools for the supported editor-side asset families, including dedicated widget animation authoring (`extract_widget_animation`, `create_widget_animation`, `modify_widget_animation`), incremental widget-structure ops, widget class-default routing, `material_graph_operation` for single-step classic material graph edits, and the advanced `modify_material` escape hatch
14
+ - dedicated Enhanced Input authoring tools for `InputAction` and `InputMappingContext` assets (`create_input_action`, `modify_input_action`, `create_input_mapping_context`, `modify_input_mapping_context`)
15
+ - dedicated CommonUI button-style tools (`create_commonui_button_style`, `extract_commonui_button_style`, `modify_commonui_button_style`, `apply_commonui_button_style`) for `CommonButtonBase` wrapper surfaces instead of raw `UButton` field mutation
16
+ - utility and discovery helpers such as `search_assets`, `save_assets`, and `get_tool_help` for schema summaries, related resources, and example families
17
+ - async import and reimport tools with polling for generic assets plus typed texture and mesh helpers
18
+ - host-side project automation tools for external builds, Live Coding requests, restart/reconnect orchestration, `wait_for_editor` recovery polling, a thin window-polish helper, and runtime automation artifacts that surface verification screenshots back to the caller
19
+ - a shared visual-verification artifact contract across widget captures, motion checkpoint bundles, capture diffs, and automation-run screenshots so the caller can inspect rendered results instead of relying on semantic success alone
20
+ - static guidance resources, resource templates, and prompts for authoring conventions, selector rules, font roles, project automation, example payloads, widget patterns, multimodal design specs, widget motion authoring, motion verification, unsupported surfaces, safe UI redesign, and classic material graph guidance
21
+
22
+ ## Migration From Legacy Entrypoints
23
+
24
+ - Use `extract_asset` with `asset_type` for the removed asset-family extract tools, including StateTree, DataAsset, DataTable, BehaviorTree, Blackboard, user-defined struct/enum, curve, curve table, material instance, anim sequence, anim montage, and blend space extraction.
25
+ - Use `material_graph_operation` with `operation` for the removed single-step material graph tools: `set_material_settings`, `add_material_expression`, `connect_material_expressions`, and `bind_material_property`.
26
+ - Call `get_tool_help` when you need the current parameter shape, output summary, related resources, or example families for any registered tool.
27
+
28
+ ## Requirements
29
+
30
+ - Node.js 18+
24
31
  - Unreal Editor with the `Remote Control API` plugin enabled
25
32
  - The `BlueprintExtractor` UE plugin loaded in the editor
26
33
 
@@ -34,7 +41,7 @@ The server reads `UE_REMOTE_CONTROL_PORT` and defaults to `30010`.
34
41
 
35
42
  You can also set `UE_BLUEPRINT_EXTRACTOR_SUBSYSTEM_PATH` to force a specific subsystem object path instead of using the built-in probe list.
36
43
 
37
- For workflow-oriented guidance, the server also exposes prompts such as `design_menu_screen`, `author_material_button_style`, `wire_hud_widget_classes`, and `debug_widget_compile_errors`.
44
+ For workflow-oriented guidance, the server also exposes prompts such as `normalize_ui_design_input`, `design_menu_from_design_spec`, `author_widget_motion_from_design_spec`, `plan_widget_motion_verification`, `design_menu_screen`, `author_material_button_style`, `wire_hud_widget_classes`, and `debug_widget_compile_errors`.
38
45
 
39
46
  For host-side code automation, these optional env vars are supported:
40
47
 
@@ -64,11 +71,13 @@ codex mcp add --env UE_REMOTE_CONTROL_PORT=30010 blueprint-extractor -- npx -y b
64
71
  npm install
65
72
  npm run build
66
73
  npm test
67
- npm run test:pack-smoke
68
- npm run test:publish-gate
69
- ```
70
-
71
- For the gated live smoke test:
74
+ npm run test:pack-smoke
75
+ npm run test:publish-gate
76
+ ```
77
+
78
+ `npm run test:pack-smoke` validates the packaged tarball contract and the packaged README. `npm run test:publish-gate` checks publish readiness for the current version.
79
+
80
+ For the gated live smoke test:
72
81
 
73
82
  ```bash
74
83
  BLUEPRINT_EXTRACTOR_LIVE_E2E=1 npm run test:live
@@ -76,7 +85,7 @@ BLUEPRINT_EXTRACTOR_LIVE_E2E=1 npm run test:live
76
85
 
77
86
  The live suite imports a texture over a local HTTP fixture server, verifies request-header forwarding, imports a local mesh fixture, polls both jobs to completion, smoke-tests the composable material workflow plus material function and material instance authoring, and round-trips the dedicated Enhanced Input authoring tools before saving the returned asset paths.
78
87
 
79
- The default unit/stdio suites also cover prompt registration, resource-template registration, the narrowed widget surfaces (`extract_widget_blueprint`, `modify_widget`, `modify_widget_blueprint`), the host-side project-control tools (`compile_project_code`, `trigger_live_coding`, `restart_editor`, `sync_project_code`, `apply_window_ui_changes`), the compact material graph surfaces (`extract_material`, `modify_material`), and output-schema exposure for the specialized import and cascade tools.
88
+ The default unit/stdio suites also cover prompt registration, resource-template registration, the narrowed widget surfaces (`extract_widget_blueprint`, `extract_widget_animation`, `modify_widget`, `modify_widget_blueprint`, `modify_widget_animation`), the host-side project-control tools (`compile_project_code`, `trigger_live_coding`, `restart_editor`, `sync_project_code`, `apply_window_ui_changes`), motion checkpoint capture/compare, the compact material graph surfaces (`extract_material`, `modify_material`), and output-schema exposure for the specialized import and cascade tools.
80
89
 
81
90
  Repository and full documentation:
82
91
 
@@ -74,6 +74,8 @@ export interface AutomationControllerOptions {
74
74
  now?: () => Date;
75
75
  spawnProcess?: typeof spawn;
76
76
  resolveEditorCommand?: (engineRoot: string, platform: NodeJS.Platform) => Promise<string>;
77
+ maxRunHistory?: number;
78
+ terminalRunRetentionMs?: number;
77
79
  }
78
80
  export declare class AutomationController implements AutomationControllerLike {
79
81
  private readonly env;
@@ -81,6 +83,8 @@ export declare class AutomationController implements AutomationControllerLike {
81
83
  private readonly now;
82
84
  private readonly spawnProcess;
83
85
  private readonly resolveEditorCommandFn;
86
+ private readonly maxRunHistory;
87
+ private readonly terminalRunRetentionMs;
84
88
  private readonly runs;
85
89
  constructor(options?: AutomationControllerOptions);
86
90
  runAutomationTests(request: RunAutomationTestsRequest): Promise<AutomationRunResult>;
@@ -88,6 +92,8 @@ export declare class AutomationController implements AutomationControllerLike {
88
92
  listAutomationTestRuns(includeCompleted?: boolean): Promise<AutomationRunListResult>;
89
93
  readAutomationArtifact(runId: string, artifactName: string): Promise<AutomationArtifactReadResult | null>;
90
94
  private cloneRun;
95
+ private getRunSortTime;
96
+ private pruneRuns;
91
97
  private registerArtifact;
92
98
  private collectReportArtifacts;
93
99
  private buildRunSummary;
@@ -5,6 +5,8 @@ import { createWriteStream } from 'node:fs';
5
5
  import { dirname, extname, join, relative, resolve } from 'node:path';
6
6
  import { resolveCommandInvocation, resolveEditorExecutable } from './project-controller.js';
7
7
  const DEFAULT_TIMEOUT_MS = 60 * 60 * 1000;
8
+ const DEFAULT_MAX_RUN_HISTORY = 50;
9
+ const DEFAULT_TERMINAL_RUN_RETENTION_MS = 24 * 60 * 60 * 1000;
8
10
  function defaultNow() {
9
11
  return new Date();
10
12
  }
@@ -96,6 +98,8 @@ export class AutomationController {
96
98
  now;
97
99
  spawnProcess;
98
100
  resolveEditorCommandFn;
101
+ maxRunHistory;
102
+ terminalRunRetentionMs;
99
103
  runs = new Map();
100
104
  constructor(options = {}) {
101
105
  this.env = options.env ?? process.env;
@@ -103,6 +107,8 @@ export class AutomationController {
103
107
  this.now = options.now ?? defaultNow;
104
108
  this.spawnProcess = options.spawnProcess ?? spawn;
105
109
  this.resolveEditorCommandFn = options.resolveEditorCommand ?? resolveEditorCommand;
110
+ this.maxRunHistory = Math.max(1, options.maxRunHistory ?? DEFAULT_MAX_RUN_HISTORY);
111
+ this.terminalRunRetentionMs = Math.max(0, options.terminalRunRetentionMs ?? DEFAULT_TERMINAL_RUN_RETENTION_MS);
106
112
  }
107
113
  async runAutomationTests(request) {
108
114
  if (!request.engineRoot) {
@@ -164,6 +170,7 @@ export class AutomationController {
164
170
  artifactMap: new Map(),
165
171
  };
166
172
  this.runs.set(runId, run);
173
+ this.pruneRuns(started.getTime());
167
174
  const stdoutStream = createWriteStream(stdoutPath, { encoding: 'utf8' });
168
175
  const stderrStream = createWriteStream(stderrPath, { encoding: 'utf8' });
169
176
  const child = this.spawnProcess(invocation.executable, invocation.args, {
@@ -217,6 +224,7 @@ export class AutomationController {
217
224
  }, null, 2), 'utf8');
218
225
  this.registerArtifact(run, 'summary', summaryPath, 'application/json');
219
226
  run.terminal = true;
227
+ this.pruneRuns(this.now().getTime());
220
228
  };
221
229
  const timeoutHandle = setTimeout(() => {
222
230
  if (!run.terminal) {
@@ -242,10 +250,12 @@ export class AutomationController {
242
250
  return this.cloneRun(run, 'run_automation_tests');
243
251
  }
244
252
  async getAutomationTestRun(runId) {
253
+ this.pruneRuns(this.now().getTime());
245
254
  const run = this.runs.get(runId);
246
255
  return run ? this.cloneRun(run, 'get_automation_test_run') : null;
247
256
  }
248
257
  async listAutomationTestRuns(includeCompleted = true) {
258
+ this.pruneRuns(this.now().getTime());
249
259
  const runs = Array.from(this.runs.values())
250
260
  .filter((run) => includeCompleted || !run.terminal)
251
261
  .sort((left, right) => {
@@ -263,6 +273,7 @@ export class AutomationController {
263
273
  };
264
274
  }
265
275
  async readAutomationArtifact(runId, artifactName) {
276
+ this.pruneRuns(this.now().getTime());
266
277
  const run = this.runs.get(runId);
267
278
  if (!run) {
268
279
  return null;
@@ -284,6 +295,46 @@ export class AutomationController {
284
295
  artifacts: [...run.artifacts],
285
296
  };
286
297
  }
298
+ getRunSortTime(run) {
299
+ if (run.completedAt) {
300
+ const completedAt = Date.parse(run.completedAt);
301
+ if (Number.isFinite(completedAt)) {
302
+ return completedAt;
303
+ }
304
+ }
305
+ if (run.startedAt) {
306
+ const startedAt = Date.parse(run.startedAt);
307
+ if (Number.isFinite(startedAt)) {
308
+ return startedAt;
309
+ }
310
+ }
311
+ return 0;
312
+ }
313
+ pruneRuns(referenceTime) {
314
+ const terminalRuns = [];
315
+ for (const [runId, run] of this.runs.entries()) {
316
+ if (!run.terminal) {
317
+ continue;
318
+ }
319
+ const sortTime = this.getRunSortTime(run);
320
+ if (this.terminalRunRetentionMs >= 0 && sortTime > 0 && referenceTime - sortTime > this.terminalRunRetentionMs) {
321
+ this.runs.delete(runId);
322
+ continue;
323
+ }
324
+ terminalRuns.push({ runId, run, sortTime });
325
+ }
326
+ const activeRunCount = Array.from(this.runs.values()).filter((run) => !run.terminal).length;
327
+ const allowedTerminalRuns = Math.max(0, this.maxRunHistory - activeRunCount);
328
+ if (terminalRuns.length <= allowedTerminalRuns) {
329
+ return;
330
+ }
331
+ terminalRuns
332
+ .sort((left, right) => right.sortTime - left.sortTime)
333
+ .slice(allowedTerminalRuns)
334
+ .forEach(({ runId }) => {
335
+ this.runs.delete(runId);
336
+ });
337
+ }
287
338
  registerArtifact(run, name, filePath, mimeType, relativePath) {
288
339
  const existing = run.artifactMap.get(name);
289
340
  const artifact = {
@@ -0,0 +1,13 @@
1
+ export type ToolExample = {
2
+ title: string;
3
+ tool: string;
4
+ arguments: Record<string, unknown>;
5
+ context?: Record<string, unknown>;
6
+ expectedSuccess?: boolean;
7
+ };
8
+ export type ExampleFamily = {
9
+ summary: string;
10
+ recommended_flow: string[];
11
+ examples: ToolExample[];
12
+ };
13
+ export declare const exampleCatalog: Record<string, ExampleFamily>;