blueprint-extractor-mcp 1.1.0 → 1.3.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.
- package/dist/index.js +110 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { UEClient } from './ue-client.js';
|
|
|
6
6
|
const client = new UEClient();
|
|
7
7
|
const server = new McpServer({
|
|
8
8
|
name: 'blueprint-extractor',
|
|
9
|
-
version: '1.
|
|
9
|
+
version: '1.3.0',
|
|
10
10
|
});
|
|
11
11
|
// Shared scope enum with detailed descriptions
|
|
12
12
|
const scopeEnum = z.enum([
|
|
@@ -17,6 +17,35 @@ const scopeEnum = z.enum([
|
|
|
17
17
|
'Full',
|
|
18
18
|
'FullWithBytecode',
|
|
19
19
|
]);
|
|
20
|
+
// Resource: extraction scope reference (static docs — app-controlled read-only context)
|
|
21
|
+
server.resource('extraction-scopes', 'blueprint://scopes', {
|
|
22
|
+
description: 'Reference for Blueprint extraction scopes: what each level includes, typical sizes, and when to use.',
|
|
23
|
+
}, async (uri) => ({
|
|
24
|
+
contents: [{
|
|
25
|
+
uri: uri.href,
|
|
26
|
+
mimeType: 'text/plain',
|
|
27
|
+
text: [
|
|
28
|
+
'Blueprint Extraction Scopes',
|
|
29
|
+
'',
|
|
30
|
+
'Each scope includes everything from the previous level:',
|
|
31
|
+
'',
|
|
32
|
+
'| Scope | Adds | Typical Size | Use When |',
|
|
33
|
+
'|-------------------|---------------------------------------------------|---------------|-----------------------------------------------|',
|
|
34
|
+
'| ClassLevel | Parent class, interfaces, class flags, metadata | 1-2 KB | Checking inheritance or interface list |',
|
|
35
|
+
'| Variables | All variables with types, defaults, flags | 2-10 KB | Understanding data model (DEFAULT) |',
|
|
36
|
+
'| Components | SCS component tree with property overrides vs CDO | 5-20 KB | Analyzing component composition |',
|
|
37
|
+
'| FunctionsShallow | Function and event graph names only | 5-25 KB | Listing available functions before deep dive |',
|
|
38
|
+
'| Full | Complete graph nodes, pins, and connections | 20-500+ KB | Understanding graph logic and execution flow |',
|
|
39
|
+
'| FullWithBytecode | Raw bytecode hex dump per function | Largest | Low-level analysis (rarely needed) |',
|
|
40
|
+
'',
|
|
41
|
+
'Start with the narrowest scope that answers your question.',
|
|
42
|
+
'Full scope on complex Blueprints can exceed 200KB and will be truncated.',
|
|
43
|
+
'',
|
|
44
|
+
'Note: Scopes only apply to Blueprint extraction (extract_blueprint and extract_cascade).',
|
|
45
|
+
'DataAsset, DataTable, and StateTree always extract fully — no scope parameter is needed.',
|
|
46
|
+
].join('\n'),
|
|
47
|
+
}],
|
|
48
|
+
}));
|
|
20
49
|
// Tool 1: extract_blueprint
|
|
21
50
|
server.registerTool('extract_blueprint', {
|
|
22
51
|
title: 'Extract Blueprint',
|
|
@@ -97,10 +126,82 @@ RETURNS: JSON object with schema, state hierarchy, tasks, conditions, transition
|
|
|
97
126
|
return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true };
|
|
98
127
|
}
|
|
99
128
|
});
|
|
100
|
-
// Tool 3:
|
|
129
|
+
// Tool 3: extract_dataasset
|
|
130
|
+
server.registerTool('extract_dataasset', {
|
|
131
|
+
title: 'Extract DataAsset',
|
|
132
|
+
description: `Extract a UE5 DataAsset to structured JSON. Serializes all user-defined UPROPERTY fields using UE reflection.
|
|
133
|
+
|
|
134
|
+
USAGE GUIDELINES:
|
|
135
|
+
- Use search_assets first with class_filter "DataAsset" or a specific DataAsset subclass name to find the asset path.
|
|
136
|
+
- Returns all user-defined properties with their types and current values.
|
|
137
|
+
- Works with any UDataAsset or UPrimaryDataAsset subclass.
|
|
138
|
+
|
|
139
|
+
RETURNS: JSON object with the DataAsset's class info and all property values.`,
|
|
140
|
+
inputSchema: {
|
|
141
|
+
asset_path: z.string().describe('UE content path to the DataAsset (e.g. /Game/Data/DA_ItemDatabase). Use search_assets to find paths.'),
|
|
142
|
+
},
|
|
143
|
+
annotations: {
|
|
144
|
+
title: 'Extract DataAsset',
|
|
145
|
+
readOnlyHint: true,
|
|
146
|
+
destructiveHint: false,
|
|
147
|
+
idempotentHint: true,
|
|
148
|
+
openWorldHint: false,
|
|
149
|
+
},
|
|
150
|
+
}, async ({ asset_path }) => {
|
|
151
|
+
try {
|
|
152
|
+
const result = await client.callSubsystem('ExtractDataAsset', { AssetPath: asset_path });
|
|
153
|
+
const parsed = JSON.parse(result);
|
|
154
|
+
if (parsed.error) {
|
|
155
|
+
return { content: [{ type: 'text', text: `Error: ${parsed.error}` }], isError: true };
|
|
156
|
+
}
|
|
157
|
+
return { content: [{ type: 'text', text: JSON.stringify(parsed, null, 2) }] };
|
|
158
|
+
}
|
|
159
|
+
catch (e) {
|
|
160
|
+
return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true };
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
// Tool 4: extract_datatable
|
|
164
|
+
server.registerTool('extract_datatable', {
|
|
165
|
+
title: 'Extract DataTable',
|
|
166
|
+
description: `Extract a UE5 DataTable asset to structured JSON. Includes the row struct schema and all row data.
|
|
167
|
+
|
|
168
|
+
USAGE GUIDELINES:
|
|
169
|
+
- Use search_assets first with class_filter "DataTable" to find the asset path.
|
|
170
|
+
- Returns the row struct type, property schema, row count, and all row data with names and values.
|
|
171
|
+
- Useful for understanding game data tables (items, abilities, stats, etc.).
|
|
172
|
+
|
|
173
|
+
RETURNS: JSON object with row struct info, schema, and all rows.`,
|
|
174
|
+
inputSchema: {
|
|
175
|
+
asset_path: z.string().describe('UE content path to the DataTable (e.g. /Game/Data/DT_WeaponStats). Use search_assets to find paths.'),
|
|
176
|
+
},
|
|
177
|
+
annotations: {
|
|
178
|
+
title: 'Extract DataTable',
|
|
179
|
+
readOnlyHint: true,
|
|
180
|
+
destructiveHint: false,
|
|
181
|
+
idempotentHint: true,
|
|
182
|
+
openWorldHint: false,
|
|
183
|
+
},
|
|
184
|
+
}, async ({ asset_path }) => {
|
|
185
|
+
try {
|
|
186
|
+
const result = await client.callSubsystem('ExtractDataTable', { AssetPath: asset_path });
|
|
187
|
+
const parsed = JSON.parse(result);
|
|
188
|
+
if (parsed.error) {
|
|
189
|
+
return { content: [{ type: 'text', text: `Error: ${parsed.error}` }], isError: true };
|
|
190
|
+
}
|
|
191
|
+
const text = JSON.stringify(parsed, null, 2);
|
|
192
|
+
if (text.length > 200_000) {
|
|
193
|
+
return { content: [{ type: 'text', text: `Warning: Response is ${(text.length / 1024).toFixed(0)}KB — large DataTable.\n\n${text.substring(0, 200_000)}...\n[TRUNCATED]` }] };
|
|
194
|
+
}
|
|
195
|
+
return { content: [{ type: 'text', text }] };
|
|
196
|
+
}
|
|
197
|
+
catch (e) {
|
|
198
|
+
return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true };
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
// Tool 5: extract_cascade
|
|
101
202
|
server.registerTool('extract_cascade', {
|
|
102
203
|
title: 'Extract Cascade',
|
|
103
|
-
description: `Extract multiple Blueprint
|
|
204
|
+
description: `Extract multiple assets (Blueprint, AnimBlueprint, StateTree, DataAsset, DataTable) with automatic reference following for Blueprints and StateTrees. Follows parent classes, interfaces, component classes, and other Blueprint references up to max_depth levels deep.
|
|
104
205
|
|
|
105
206
|
USAGE GUIDELINES:
|
|
106
207
|
- Use when you need to understand an asset AND its dependencies (parent Blueprints, referenced Blueprints, etc.).
|
|
@@ -138,20 +239,20 @@ RETURNS: Summary with extracted_count and output_directory path. Read the output
|
|
|
138
239
|
return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true };
|
|
139
240
|
}
|
|
140
241
|
});
|
|
141
|
-
// Tool
|
|
242
|
+
// Tool 6: search_assets
|
|
142
243
|
server.registerTool('search_assets', {
|
|
143
244
|
title: 'Search Assets',
|
|
144
|
-
description: `Search for UE5 assets by name. This is a lightweight lookup — use it FIRST to find correct asset paths before calling extract_blueprint or
|
|
245
|
+
description: `Search for UE5 assets by name. This is a lightweight lookup — use it FIRST to find correct asset paths before calling extract_blueprint, extract_statetree, extract_dataasset, or extract_datatable.
|
|
145
246
|
|
|
146
247
|
USAGE GUIDELINES:
|
|
147
|
-
- Always call this before
|
|
248
|
+
- Always call this before any extract_* tool if you don't already have the exact asset path.
|
|
148
249
|
- Searches asset names (not full paths) — partial matches work (e.g. "Character" finds "BP_Character").
|
|
149
|
-
- Filter by class to narrow results: "Blueprint" (default), "StateTree", "WidgetBlueprint", "DataAsset", or empty string for all.
|
|
250
|
+
- Filter by class to narrow results: "Blueprint" (default), "AnimBlueprint", "StateTree", "DataTable", "WidgetBlueprint", "DataAsset", or empty string for all.
|
|
150
251
|
|
|
151
252
|
RETURNS: JSON array of objects with path, name, and class for each matching asset.`,
|
|
152
253
|
inputSchema: {
|
|
153
254
|
query: z.string().describe('Search term to match against asset names. Partial matches work (e.g. "Player" finds "BP_PlayerCharacter").'),
|
|
154
|
-
class_filter: z.string().default('Blueprint').describe('Filter by asset class. Common values: "Blueprint", "WidgetBlueprint", "StateTree", "DataAsset", or "" for all asset types.'),
|
|
255
|
+
class_filter: z.string().default('Blueprint').describe('Filter by asset class. Common values: "Blueprint", "AnimBlueprint", "WidgetBlueprint", "StateTree", "DataTable", "DataAsset", or "" for all asset types.'),
|
|
155
256
|
},
|
|
156
257
|
annotations: {
|
|
157
258
|
title: 'Search Assets',
|
|
@@ -173,7 +274,7 @@ RETURNS: JSON array of objects with path, name, and class for each matching asse
|
|
|
173
274
|
return { content: [{ type: 'text', text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true };
|
|
174
275
|
}
|
|
175
276
|
});
|
|
176
|
-
// Tool
|
|
277
|
+
// Tool 7: list_assets
|
|
177
278
|
server.registerTool('list_assets', {
|
|
178
279
|
title: 'List Assets',
|
|
179
280
|
description: `List UE5 assets under a package path. Use this to browse directory contents when you don't know asset names. If you know (part of) the asset name, prefer search_assets instead — it's faster and doesn't require knowing the directory.
|