n8n-mcp 2.47.11 → 2.47.13
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/database/node-repository.d.ts +1 -0
- package/dist/database/node-repository.d.ts.map +1 -1
- package/dist/database/node-repository.js +7 -0
- package/dist/database/node-repository.js.map +1 -1
- package/dist/mcp/handlers-n8n-manager.d.ts.map +1 -1
- package/dist/mcp/handlers-n8n-manager.js +4 -1
- package/dist/mcp/handlers-n8n-manager.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +77 -27
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools-n8n-manager.js +1 -1
- package/dist/mcp/tools-n8n-manager.js.map +1 -1
- package/dist/services/node-specific-validators.d.ts.map +1 -1
- package/dist/services/node-specific-validators.js.map +1 -1
- package/dist/services/workflow-auto-fixer.d.ts +2 -0
- package/dist/services/workflow-auto-fixer.d.ts.map +1 -1
- package/dist/services/workflow-auto-fixer.js +9 -7
- package/dist/services/workflow-auto-fixer.js.map +1 -1
- package/dist/services/workflow-diff-engine.d.ts.map +1 -1
- package/dist/services/workflow-diff-engine.js +56 -11
- package/dist/services/workflow-diff-engine.js.map +1 -1
- package/dist/templates/template-repository.d.ts +1 -0
- package/dist/templates/template-repository.d.ts.map +1 -1
- package/dist/templates/template-repository.js +8 -2
- package/dist/templates/template-repository.js.map +1 -1
- package/dist/templates/template-service.d.ts +1 -0
- package/dist/templates/template-service.d.ts.map +1 -1
- package/dist/templates/template-service.js +3 -0
- package/dist/templates/template-service.js.map +1 -1
- package/dist/utils/redaction.d.ts +1 -0
- package/dist/utils/redaction.d.ts.map +1 -1
- package/dist/utils/redaction.js +29 -0
- package/dist/utils/redaction.js.map +1 -1
- package/package.json +1 -1
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"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B;YAiBZ,gBAAgB;YA6HhB,2BAA2B;YAiE3B,2BAA2B;IAyEnC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BpB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAgEhC"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -48,6 +48,7 @@ const tools_n8n_manager_1 = require("./tools-n8n-manager");
|
|
|
48
48
|
const tools_n8n_friendly_1 = require("./tools-n8n-friendly");
|
|
49
49
|
const workflow_examples_1 = require("./workflow-examples");
|
|
50
50
|
const logger_1 = require("../utils/logger");
|
|
51
|
+
const redaction_1 = require("../utils/redaction");
|
|
51
52
|
const node_repository_1 = require("../database/node-repository");
|
|
52
53
|
const database_adapter_1 = require("../database/database-adapter");
|
|
53
54
|
const shared_database_1 = require("../database/shared-database");
|
|
@@ -438,15 +439,11 @@ class N8NDocumentationMCPServer {
|
|
|
438
439
|
});
|
|
439
440
|
this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
440
441
|
const { name, arguments: args } = request.params;
|
|
441
|
-
logger_1.logger.info('Tool call received
|
|
442
|
+
logger_1.logger.info('Tool call received', {
|
|
442
443
|
toolName: name,
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
hasNodeType: args && 'nodeType' in args,
|
|
447
|
-
hasConfig: args && 'config' in args,
|
|
448
|
-
configType: args && args.config ? typeof args.config : 'N/A',
|
|
449
|
-
rawRequest: JSON.stringify(request.params)
|
|
444
|
+
...(0, redaction_1.summarizeToolCallArgs)(args),
|
|
445
|
+
hasNodeType: !!(args && typeof args === 'object' && 'nodeType' in args),
|
|
446
|
+
hasConfig: !!(args && typeof args === 'object' && 'config' in args),
|
|
450
447
|
});
|
|
451
448
|
const disabledTools = this.getDisabledTools();
|
|
452
449
|
if (disabledTools.has(name)) {
|
|
@@ -482,8 +479,9 @@ class N8NDocumentationMCPServer {
|
|
|
482
479
|
const parsed = JSON.parse(possibleNestedData);
|
|
483
480
|
if (parsed && typeof parsed === 'object') {
|
|
484
481
|
logger_1.logger.warn('Detected n8n nested output bug, attempting to extract actual arguments', {
|
|
485
|
-
|
|
486
|
-
|
|
482
|
+
toolName: name,
|
|
483
|
+
originalArgsKeys: Object.keys(args),
|
|
484
|
+
extractedArgsKeys: Object.keys(parsed),
|
|
487
485
|
});
|
|
488
486
|
if (this.validateExtractedArgs(name, parsed)) {
|
|
489
487
|
processedArgs = parsed;
|
|
@@ -491,7 +489,7 @@ class N8NDocumentationMCPServer {
|
|
|
491
489
|
else {
|
|
492
490
|
logger_1.logger.warn('Extracted arguments failed validation, using original args', {
|
|
493
491
|
toolName: name,
|
|
494
|
-
|
|
492
|
+
extractedArgsKeys: Object.keys(parsed),
|
|
495
493
|
});
|
|
496
494
|
}
|
|
497
495
|
}
|
|
@@ -508,7 +506,7 @@ class N8NDocumentationMCPServer {
|
|
|
508
506
|
processedArgs = JSON.parse(JSON.stringify(processedArgs));
|
|
509
507
|
}
|
|
510
508
|
try {
|
|
511
|
-
logger_1.logger.debug(`Executing tool: ${name}`,
|
|
509
|
+
logger_1.logger.debug(`Executing tool: ${name}`, (0, redaction_1.summarizeToolCallArgs)(processedArgs));
|
|
512
510
|
const startTime = Date.now();
|
|
513
511
|
const result = await this.executeTool(name, processedArgs);
|
|
514
512
|
const duration = Date.now() - startTime;
|
|
@@ -800,8 +798,8 @@ class N8NDocumentationMCPServer {
|
|
|
800
798
|
if (!(requiredField in args)) {
|
|
801
799
|
logger_1.logger.debug(`Extracted args missing required field: ${requiredField}`, {
|
|
802
800
|
toolName,
|
|
803
|
-
|
|
804
|
-
required
|
|
801
|
+
extractedArgsKeys: Object.keys(args),
|
|
802
|
+
required,
|
|
805
803
|
});
|
|
806
804
|
return false;
|
|
807
805
|
}
|
|
@@ -818,7 +816,6 @@ class N8NDocumentationMCPServer {
|
|
|
818
816
|
toolName,
|
|
819
817
|
expectedType,
|
|
820
818
|
actualType,
|
|
821
|
-
fieldValue
|
|
822
819
|
});
|
|
823
820
|
return false;
|
|
824
821
|
}
|
|
@@ -931,7 +928,7 @@ class N8NDocumentationMCPServer {
|
|
|
931
928
|
}
|
|
932
929
|
if (coercedAny) {
|
|
933
930
|
logger_1.logger.warn(`Coerced mistyped params for tool "${toolName}"`, {
|
|
934
|
-
original: Object.fromEntries(Object.entries(args).map(([k, v]) => [k,
|
|
931
|
+
original: Object.fromEntries(Object.entries(args).map(([k, v]) => [k, typeof v])),
|
|
935
932
|
});
|
|
936
933
|
}
|
|
937
934
|
return coerced;
|
|
@@ -942,11 +939,7 @@ class N8NDocumentationMCPServer {
|
|
|
942
939
|
if (disabledTools.has(name)) {
|
|
943
940
|
throw new Error(`Tool '${name}' is disabled via DISABLED_TOOLS environment variable`);
|
|
944
941
|
}
|
|
945
|
-
logger_1.logger.info(`Tool execution: ${name}`,
|
|
946
|
-
args: typeof args === 'object' ? JSON.stringify(args) : args,
|
|
947
|
-
argsType: typeof args,
|
|
948
|
-
argsKeys: typeof args === 'object' ? Object.keys(args) : 'not-object'
|
|
949
|
-
});
|
|
942
|
+
logger_1.logger.info(`Tool execution: ${name}`, (0, redaction_1.summarizeToolCallArgs)(args));
|
|
950
943
|
if (typeof args !== 'object' || args === null) {
|
|
951
944
|
throw new Error(`Invalid arguments for tool ${name}: expected object, got ${typeof args}`);
|
|
952
945
|
}
|
|
@@ -2308,18 +2301,34 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
2308
2301
|
}
|
|
2309
2302
|
const versions = this.repository.getNodeVersions(nodeType);
|
|
2310
2303
|
const latest = this.repository.getLatestNodeVersion(nodeType);
|
|
2304
|
+
const nodeRow = latest ? null : this.repository.getNode(nodeType);
|
|
2311
2305
|
const summary = {
|
|
2312
|
-
currentVersion: latest?.version
|
|
2306
|
+
currentVersion: latest?.version ?? nodeRow?.version ?? 'unknown',
|
|
2313
2307
|
totalVersions: versions.length,
|
|
2314
2308
|
hasVersionHistory: versions.length > 0
|
|
2315
2309
|
};
|
|
2316
2310
|
this.cache.set(cacheKey, summary, 86400000);
|
|
2317
2311
|
return summary;
|
|
2318
2312
|
}
|
|
2313
|
+
versionMetadataUnavailable(nodeType, extra = {}) {
|
|
2314
|
+
const node = this.repository.getNode(nodeType);
|
|
2315
|
+
return {
|
|
2316
|
+
nodeType,
|
|
2317
|
+
available: false,
|
|
2318
|
+
reason: 'Version metadata not populated for this node. Callers must not infer upgrade safety from this response.',
|
|
2319
|
+
currentVersion: node?.version ?? null,
|
|
2320
|
+
isVersioned: node?.isVersioned ?? false,
|
|
2321
|
+
...extra
|
|
2322
|
+
};
|
|
2323
|
+
}
|
|
2319
2324
|
getVersionHistory(nodeType) {
|
|
2325
|
+
if (!this.repository.hasVersionMetadata(nodeType)) {
|
|
2326
|
+
return this.versionMetadataUnavailable(nodeType, { totalVersions: 0, versions: [] });
|
|
2327
|
+
}
|
|
2320
2328
|
const versions = this.repository.getNodeVersions(nodeType);
|
|
2321
2329
|
return {
|
|
2322
2330
|
nodeType,
|
|
2331
|
+
available: true,
|
|
2323
2332
|
totalVersions: versions.length,
|
|
2324
2333
|
versions: versions.map(v => ({
|
|
2325
2334
|
version: v.version,
|
|
@@ -2330,14 +2339,18 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
2330
2339
|
breakingChangesCount: (v.breakingChanges || []).length,
|
|
2331
2340
|
deprecatedProperties: v.deprecatedProperties || [],
|
|
2332
2341
|
addedProperties: v.addedProperties || []
|
|
2333
|
-
}))
|
|
2334
|
-
available: versions.length > 0,
|
|
2335
|
-
message: versions.length === 0 ?
|
|
2336
|
-
'No version history available. Version tracking may not be enabled for this node.' :
|
|
2337
|
-
undefined
|
|
2342
|
+
}))
|
|
2338
2343
|
};
|
|
2339
2344
|
}
|
|
2340
2345
|
compareVersions(nodeType, fromVersion, toVersion) {
|
|
2346
|
+
if (!this.repository.hasVersionMetadata(nodeType)) {
|
|
2347
|
+
return this.versionMetadataUnavailable(nodeType, {
|
|
2348
|
+
fromVersion,
|
|
2349
|
+
toVersion: toVersion ?? 'latest',
|
|
2350
|
+
totalChanges: 0,
|
|
2351
|
+
changes: []
|
|
2352
|
+
});
|
|
2353
|
+
}
|
|
2341
2354
|
const latest = this.repository.getLatestNodeVersion(nodeType);
|
|
2342
2355
|
const targetVersion = toVersion || latest?.version;
|
|
2343
2356
|
if (!targetVersion) {
|
|
@@ -2346,6 +2359,7 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
2346
2359
|
const changes = this.repository.getPropertyChanges(nodeType, fromVersion, targetVersion);
|
|
2347
2360
|
return {
|
|
2348
2361
|
nodeType,
|
|
2362
|
+
available: true,
|
|
2349
2363
|
fromVersion,
|
|
2350
2364
|
toVersion: targetVersion,
|
|
2351
2365
|
totalChanges: changes.length,
|
|
@@ -2363,9 +2377,18 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
2363
2377
|
};
|
|
2364
2378
|
}
|
|
2365
2379
|
getBreakingChanges(nodeType, fromVersion, toVersion) {
|
|
2380
|
+
if (!this.repository.hasVersionMetadata(nodeType)) {
|
|
2381
|
+
return this.versionMetadataUnavailable(nodeType, {
|
|
2382
|
+
fromVersion,
|
|
2383
|
+
toVersion: toVersion ?? 'latest',
|
|
2384
|
+
totalBreakingChanges: 0,
|
|
2385
|
+
changes: []
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2366
2388
|
const breakingChanges = this.repository.getBreakingChanges(nodeType, fromVersion, toVersion);
|
|
2367
2389
|
return {
|
|
2368
2390
|
nodeType,
|
|
2391
|
+
available: true,
|
|
2369
2392
|
fromVersion,
|
|
2370
2393
|
toVersion: toVersion || 'latest',
|
|
2371
2394
|
totalBreakingChanges: breakingChanges.length,
|
|
@@ -2383,10 +2406,20 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
2383
2406
|
};
|
|
2384
2407
|
}
|
|
2385
2408
|
getMigrations(nodeType, fromVersion, toVersion) {
|
|
2409
|
+
if (!this.repository.hasVersionMetadata(nodeType)) {
|
|
2410
|
+
return this.versionMetadataUnavailable(nodeType, {
|
|
2411
|
+
fromVersion,
|
|
2412
|
+
toVersion,
|
|
2413
|
+
autoMigratableChanges: 0,
|
|
2414
|
+
totalChanges: 0,
|
|
2415
|
+
migrations: []
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2386
2418
|
const migrations = this.repository.getAutoMigratableChanges(nodeType, fromVersion, toVersion);
|
|
2387
2419
|
const allChanges = this.repository.getPropertyChanges(nodeType, fromVersion, toVersion);
|
|
2388
2420
|
return {
|
|
2389
2421
|
nodeType,
|
|
2422
|
+
available: true,
|
|
2390
2423
|
fromVersion,
|
|
2391
2424
|
toVersion,
|
|
2392
2425
|
autoMigratableChanges: migrations.length,
|
|
@@ -3021,6 +3054,21 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
3021
3054
|
await this.ensureInitialized();
|
|
3022
3055
|
if (!this.templateService)
|
|
3023
3056
|
throw new Error('Template service not initialized');
|
|
3057
|
+
const metadataAvailable = await this.templateService.hasMetadataCoverage();
|
|
3058
|
+
if (!metadataAvailable) {
|
|
3059
|
+
return {
|
|
3060
|
+
available: false,
|
|
3061
|
+
reason: 'Template metadata has not been enriched yet. by_metadata search requires ' +
|
|
3062
|
+
'running the metadata enrichment job (see scripts/fetch-templates). ' +
|
|
3063
|
+
'Use searchMode "keyword", "by_nodes", or "patterns" in the meantime.',
|
|
3064
|
+
filters,
|
|
3065
|
+
items: [],
|
|
3066
|
+
total: 0,
|
|
3067
|
+
limit,
|
|
3068
|
+
offset,
|
|
3069
|
+
hasMore: false
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3024
3072
|
const result = await this.templateService.searchTemplatesByMetadata(filters, limit, offset);
|
|
3025
3073
|
const filterSummary = [];
|
|
3026
3074
|
if (filters.category)
|
|
@@ -3040,6 +3088,7 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
3040
3088
|
const availableAudiences = await this.templateService.getAvailableTargetAudiences();
|
|
3041
3089
|
return {
|
|
3042
3090
|
...result,
|
|
3091
|
+
available: true,
|
|
3043
3092
|
message: `No templates found with filters: ${filterSummary.join(', ')}`,
|
|
3044
3093
|
availableCategories: availableCategories.slice(0, 10),
|
|
3045
3094
|
availableAudiences: availableAudiences.slice(0, 5),
|
|
@@ -3048,6 +3097,7 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
3048
3097
|
}
|
|
3049
3098
|
return {
|
|
3050
3099
|
...result,
|
|
3100
|
+
available: true,
|
|
3051
3101
|
filters,
|
|
3052
3102
|
filterSummary: filterSummary.join(', '),
|
|
3053
3103
|
tip: `Found ${result.total} templates matching filters. Showing ${result.items.length}. Each includes AI-generated metadata.`
|