n8n-mcp 2.84.3 → 2.85.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 (42) hide show
  1. package/dist/mcp/handlers-n8n-manager.d.ts.map +1 -1
  2. package/dist/mcp/handlers-n8n-manager.js +8 -0
  3. package/dist/mcp/handlers-n8n-manager.js.map +1 -1
  4. package/dist/mcp/server.d.ts +0 -2
  5. package/dist/mcp/server.d.ts.map +1 -1
  6. package/dist/mcp/server.js +8 -103
  7. package/dist/mcp/server.js.map +1 -1
  8. package/dist/mcp/ui/app-configs.d.ts.map +1 -1
  9. package/dist/mcp/ui/app-configs.js +19 -0
  10. package/dist/mcp/ui/app-configs.js.map +1 -1
  11. package/dist/services/enhanced-config-validator.d.ts.map +1 -1
  12. package/dist/services/enhanced-config-validator.js +2 -0
  13. package/dist/services/enhanced-config-validator.js.map +1 -1
  14. package/dist/services/n8n-validation.d.ts +66 -64
  15. package/dist/services/n8n-validation.d.ts.map +1 -1
  16. package/dist/services/n8n-validation.js +49 -34
  17. package/dist/services/n8n-validation.js.map +1 -1
  18. package/dist/services/node-sanitizer.d.ts.map +1 -1
  19. package/dist/services/node-sanitizer.js +27 -16
  20. package/dist/services/node-sanitizer.js.map +1 -1
  21. package/dist/services/workflow-auto-fixer.d.ts.map +1 -1
  22. package/dist/services/workflow-auto-fixer.js +3 -2
  23. package/dist/services/workflow-auto-fixer.js.map +1 -1
  24. package/dist/services/workflow-diff-engine.d.ts.map +1 -1
  25. package/dist/services/workflow-diff-engine.js +25 -18
  26. package/dist/services/workflow-diff-engine.js.map +1 -1
  27. package/dist/services/workflow-validator.d.ts +6 -5
  28. package/dist/services/workflow-validator.d.ts.map +1 -1
  29. package/dist/services/workflow-validator.js +2 -1
  30. package/dist/services/workflow-validator.js.map +1 -1
  31. package/dist/types/n8n-api.d.ts +1 -1
  32. package/dist/types/n8n-api.d.ts.map +1 -1
  33. package/dist/types/n8n-api.js.map +1 -1
  34. package/dist/types/workflow-diff.d.ts +1 -1
  35. package/dist/types/workflow-diff.d.ts.map +1 -1
  36. package/dist/types/workflow-diff.js.map +1 -1
  37. package/package.json +1 -1
  38. package/ui-apps/dist/execution-history/index.html +22 -21
  39. package/ui-apps/dist/health-dashboard/index.html +22 -21
  40. package/ui-apps/dist/operation-result/index.html +22 -21
  41. package/ui-apps/dist/validation-summary/index.html +22 -21
  42. package/ui-apps/dist/workflow-list/index.html +20 -19
@@ -526,6 +526,10 @@ class N8NDocumentationMCPServer {
526
526
  });
527
527
  this.server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
528
528
  const { name, arguments: args } = request.params;
529
+ const isAdditionalTool = this.additionalToolsByName.has(name);
530
+ const resultMeta = !isAdditionalTool && ui_1.UIAppRegistry.getAppForTool(name)?.html
531
+ ? { _meta: { 'n8n-mcp/toolName': name } }
532
+ : {};
529
533
  logger_1.logger.info('Tool call received', {
530
534
  toolName: name,
531
535
  ...(0, redaction_1.summarizeToolCallArgs)(args),
@@ -536,6 +540,7 @@ class N8NDocumentationMCPServer {
536
540
  if (disabledTools.has(name)) {
537
541
  logger_1.logger.warn(`Attempted to call disabled tool: ${name}`);
538
542
  return {
543
+ ...resultMeta,
539
544
  content: [{
540
545
  type: 'text',
541
546
  text: JSON.stringify({
@@ -602,6 +607,7 @@ class N8NDocumentationMCPServer {
602
607
  if (requestedOp && disabledOpsForTool.has(String(requestedOp).toLowerCase())) {
603
608
  logger_1.logger.warn(`Attempted to call disabled operation: ${name}.${requestedOp}`);
604
609
  return {
610
+ ...resultMeta,
605
611
  content: [{
606
612
  type: 'text',
607
613
  text: JSON.stringify({
@@ -617,7 +623,6 @@ class N8NDocumentationMCPServer {
617
623
  }
618
624
  }
619
625
  }
620
- const isAdditionalTool = this.additionalToolsByName.has(name);
621
626
  try {
622
627
  logger_1.logger.debug(`Executing tool: ${name}`, (0, redaction_1.summarizeToolCallArgs)(processedArgs));
623
628
  const startTime = Date.now();
@@ -656,6 +661,7 @@ class N8NDocumentationMCPServer {
656
661
  structuredContent = null;
657
662
  }
658
663
  const mcpResponse = {
664
+ ...resultMeta,
659
665
  content: [
660
666
  {
661
667
  type: 'text',
@@ -711,6 +717,7 @@ class N8NDocumentationMCPServer {
711
717
  }
712
718
  catch { }
713
719
  return {
720
+ ...resultMeta,
714
721
  content: [
715
722
  {
716
723
  type: 'text',
@@ -3415,108 +3422,6 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
3415
3422
  };
3416
3423
  }
3417
3424
  }
3418
- async validateWorkflowConnections(workflow) {
3419
- await this.ensureInitialized();
3420
- if (!this.repository)
3421
- throw new Error('Repository not initialized');
3422
- const validator = new workflow_validator_1.WorkflowValidator(this.repository, enhanced_config_validator_1.EnhancedConfigValidator);
3423
- try {
3424
- const result = await validator.validateWorkflow(workflow, {
3425
- validateNodes: false,
3426
- validateConnections: true,
3427
- validateExpressions: false
3428
- });
3429
- const response = {
3430
- valid: result.errors.length === 0,
3431
- statistics: {
3432
- totalNodes: result.statistics.totalNodes,
3433
- triggerNodes: result.statistics.triggerNodes,
3434
- validConnections: result.statistics.validConnections,
3435
- invalidConnections: result.statistics.invalidConnections
3436
- }
3437
- };
3438
- const connectionErrors = result.errors.filter(e => e.message.includes('connection') ||
3439
- e.message.includes('cycle') ||
3440
- e.message.includes('orphaned'));
3441
- const connectionWarnings = result.warnings.filter(w => w.message.includes('connection') ||
3442
- w.message.includes('orphaned') ||
3443
- w.message.includes('trigger'));
3444
- if (connectionErrors.length > 0) {
3445
- response.errors = connectionErrors.map(e => ({
3446
- node: e.nodeName || 'workflow',
3447
- message: e.message
3448
- }));
3449
- }
3450
- if (connectionWarnings.length > 0) {
3451
- response.warnings = connectionWarnings.map(w => ({
3452
- node: w.nodeName || 'workflow',
3453
- message: w.message
3454
- }));
3455
- }
3456
- return response;
3457
- }
3458
- catch (error) {
3459
- logger_1.logger.error('Error validating workflow connections:', error);
3460
- return {
3461
- valid: false,
3462
- error: error instanceof Error ? error.message : 'Unknown error validating connections'
3463
- };
3464
- }
3465
- }
3466
- async validateWorkflowExpressions(workflow) {
3467
- await this.ensureInitialized();
3468
- if (!this.repository)
3469
- throw new Error('Repository not initialized');
3470
- const validator = new workflow_validator_1.WorkflowValidator(this.repository, enhanced_config_validator_1.EnhancedConfigValidator);
3471
- try {
3472
- const result = await validator.validateWorkflow(workflow, {
3473
- validateNodes: false,
3474
- validateConnections: false,
3475
- validateExpressions: true
3476
- });
3477
- const response = {
3478
- valid: result.errors.length === 0,
3479
- statistics: {
3480
- totalNodes: result.statistics.totalNodes,
3481
- expressionsValidated: result.statistics.expressionsValidated
3482
- }
3483
- };
3484
- const expressionErrors = result.errors.filter(e => e.message.includes('Expression') ||
3485
- e.message.includes('$') ||
3486
- e.message.includes('{{'));
3487
- const expressionWarnings = result.warnings.filter(w => w.message.includes('Expression') ||
3488
- w.message.includes('$') ||
3489
- w.message.includes('{{'));
3490
- if (expressionErrors.length > 0) {
3491
- response.errors = expressionErrors.map(e => ({
3492
- node: e.nodeName || 'workflow',
3493
- message: e.message
3494
- }));
3495
- }
3496
- if (expressionWarnings.length > 0) {
3497
- response.warnings = expressionWarnings.map(w => ({
3498
- node: w.nodeName || 'workflow',
3499
- message: w.message
3500
- }));
3501
- }
3502
- if (expressionErrors.length > 0 || expressionWarnings.length > 0) {
3503
- response.tips = [
3504
- 'Use {{ }} to wrap expressions',
3505
- 'Reference data with $json.propertyName',
3506
- 'Reference other nodes with $node["Node Name"].json',
3507
- 'Use $input.item for input data in loops'
3508
- ];
3509
- }
3510
- return response;
3511
- }
3512
- catch (error) {
3513
- logger_1.logger.error('Error validating workflow expressions:', error);
3514
- return {
3515
- valid: false,
3516
- error: error instanceof Error ? error.message : 'Unknown error validating expressions'
3517
- };
3518
- }
3519
- }
3520
3425
  async run() {
3521
3426
  (0, stdio_guard_1.installStdioGuard)();
3522
3427
  await this.ensureInitialized();