n8n-mcp 2.24.0 → 2.26.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/README.md +117 -161
- package/data/nodes.db +0 -0
- package/dist/http-server-single-session.d.ts +4 -0
- package/dist/http-server-single-session.d.ts.map +1 -1
- package/dist/http-server-single-session.js +123 -0
- package/dist/http-server-single-session.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/handlers-n8n-manager.d.ts +0 -1
- package/dist/mcp/handlers-n8n-manager.d.ts.map +1 -1
- package/dist/mcp/handlers-n8n-manager.js +6 -61
- package/dist/mcp/handlers-n8n-manager.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +105 -115
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-docs/system/tools-documentation.js +1 -1
- package/dist/mcp/tool-docs/system/tools-documentation.js.map +1 -1
- package/dist/mcp/tool-docs/templates/get-templates-for-task.js +1 -1
- package/dist/mcp/tool-docs/templates/get-templates-for-task.js.map +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.js +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-validate-workflow.js.map +1 -1
- package/dist/mcp/tools-documentation.d.ts.map +1 -1
- package/dist/mcp/tools-documentation.js +6 -7
- package/dist/mcp/tools-documentation.js.map +1 -1
- package/dist/mcp/tools-n8n-manager.d.ts.map +1 -1
- package/dist/mcp/tools-n8n-manager.js +33 -107
- package/dist/mcp/tools-n8n-manager.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +43 -382
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp-engine.d.ts +3 -0
- package/dist/mcp-engine.d.ts.map +1 -1
- package/dist/mcp-engine.js +16 -2
- package/dist/mcp-engine.js.map +1 -1
- package/dist/services/n8n-validation.d.ts +2 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/session-state.d.ts +15 -0
- package/dist/types/session-state.d.ts.map +1 -0
- package/dist/types/session-state.js +3 -0
- package/dist/types/session-state.js.map +1 -0
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -586,38 +586,30 @@ class N8NDocumentationMCPServer {
|
|
|
586
586
|
try {
|
|
587
587
|
let validationResult;
|
|
588
588
|
switch (toolName) {
|
|
589
|
-
case '
|
|
589
|
+
case 'validate_node':
|
|
590
590
|
validationResult = validation_schemas_1.ToolValidation.validateNodeOperation(args);
|
|
591
591
|
break;
|
|
592
|
-
case 'validate_node_minimal':
|
|
593
|
-
validationResult = validation_schemas_1.ToolValidation.validateNodeMinimal(args);
|
|
594
|
-
break;
|
|
595
592
|
case 'validate_workflow':
|
|
596
|
-
case 'validate_workflow_connections':
|
|
597
|
-
case 'validate_workflow_expressions':
|
|
598
593
|
validationResult = validation_schemas_1.ToolValidation.validateWorkflow(args);
|
|
599
594
|
break;
|
|
600
595
|
case 'search_nodes':
|
|
601
596
|
validationResult = validation_schemas_1.ToolValidation.validateSearchNodes(args);
|
|
602
597
|
break;
|
|
603
|
-
case 'list_node_templates':
|
|
604
|
-
validationResult = validation_schemas_1.ToolValidation.validateListNodeTemplates(args);
|
|
605
|
-
break;
|
|
606
598
|
case 'n8n_create_workflow':
|
|
607
599
|
validationResult = validation_schemas_1.ToolValidation.validateCreateWorkflow(args);
|
|
608
600
|
break;
|
|
609
601
|
case 'n8n_get_workflow':
|
|
610
|
-
case 'n8n_get_workflow_details':
|
|
611
|
-
case 'n8n_get_workflow_structure':
|
|
612
|
-
case 'n8n_get_workflow_minimal':
|
|
613
602
|
case 'n8n_update_full_workflow':
|
|
614
603
|
case 'n8n_delete_workflow':
|
|
615
604
|
case 'n8n_validate_workflow':
|
|
616
605
|
case 'n8n_autofix_workflow':
|
|
617
|
-
case 'n8n_get_execution':
|
|
618
|
-
case 'n8n_delete_execution':
|
|
619
606
|
validationResult = validation_schemas_1.ToolValidation.validateWorkflowId(args);
|
|
620
607
|
break;
|
|
608
|
+
case 'n8n_executions':
|
|
609
|
+
validationResult = args.action
|
|
610
|
+
? { valid: true, errors: [] }
|
|
611
|
+
: { valid: false, errors: [{ field: 'action', message: 'action is required' }] };
|
|
612
|
+
break;
|
|
621
613
|
default:
|
|
622
614
|
return this.validateToolParamsBasic(toolName, args, legacyRequiredParams || []);
|
|
623
615
|
}
|
|
@@ -726,32 +718,39 @@ class N8NDocumentationMCPServer {
|
|
|
726
718
|
switch (name) {
|
|
727
719
|
case 'tools_documentation':
|
|
728
720
|
return this.getToolsDocumentation(args.topic, args.depth);
|
|
729
|
-
case 'list_nodes':
|
|
730
|
-
return this.listNodes(args);
|
|
731
721
|
case 'search_nodes':
|
|
732
722
|
this.validateToolParams(name, args, ['query']);
|
|
733
723
|
const limit = args.limit !== undefined ? Number(args.limit) || 20 : 20;
|
|
734
724
|
return this.searchNodes(args.query, limit, { mode: args.mode, includeExamples: args.includeExamples });
|
|
735
|
-
case 'list_ai_tools':
|
|
736
|
-
return this.listAITools();
|
|
737
|
-
case 'get_node_documentation':
|
|
738
|
-
this.validateToolParams(name, args, ['nodeType']);
|
|
739
|
-
return this.getNodeDocumentation(args.nodeType);
|
|
740
|
-
case 'get_database_statistics':
|
|
741
|
-
return this.getDatabaseStatistics();
|
|
742
725
|
case 'get_node':
|
|
743
726
|
this.validateToolParams(name, args, ['nodeType']);
|
|
727
|
+
if (args.mode === 'docs') {
|
|
728
|
+
return this.getNodeDocumentation(args.nodeType);
|
|
729
|
+
}
|
|
730
|
+
if (args.mode === 'search_properties') {
|
|
731
|
+
if (!args.propertyQuery) {
|
|
732
|
+
throw new Error('propertyQuery is required for mode=search_properties');
|
|
733
|
+
}
|
|
734
|
+
const maxResults = args.maxPropertyResults !== undefined ? Number(args.maxPropertyResults) || 20 : 20;
|
|
735
|
+
return this.searchNodeProperties(args.nodeType, args.propertyQuery, maxResults);
|
|
736
|
+
}
|
|
744
737
|
return this.getNode(args.nodeType, args.detail, args.mode, args.includeTypeInfo, args.includeExamples, args.fromVersion, args.toVersion);
|
|
745
|
-
case '
|
|
746
|
-
this.validateToolParams(name, args, ['nodeType', 'query']);
|
|
747
|
-
const maxResults = args.maxResults !== undefined ? Number(args.maxResults) || 20 : 20;
|
|
748
|
-
return this.searchNodeProperties(args.nodeType, args.query, maxResults);
|
|
749
|
-
case 'list_tasks':
|
|
750
|
-
return this.listTasks(args.category);
|
|
751
|
-
case 'validate_node_operation':
|
|
738
|
+
case 'validate_node':
|
|
752
739
|
this.validateToolParams(name, args, ['nodeType', 'config']);
|
|
753
740
|
if (typeof args.config !== 'object' || args.config === null) {
|
|
754
|
-
logger_1.logger.warn(`
|
|
741
|
+
logger_1.logger.warn(`validate_node called with invalid config type: ${typeof args.config}`);
|
|
742
|
+
const validationMode = args.mode || 'full';
|
|
743
|
+
if (validationMode === 'minimal') {
|
|
744
|
+
return {
|
|
745
|
+
nodeType: args.nodeType || 'unknown',
|
|
746
|
+
displayName: 'Unknown Node',
|
|
747
|
+
valid: false,
|
|
748
|
+
missingRequiredFields: [
|
|
749
|
+
'Invalid config format - expected object',
|
|
750
|
+
'🔧 RECOVERY: Use format { "resource": "...", "operation": "..." } or {} for empty config'
|
|
751
|
+
]
|
|
752
|
+
};
|
|
753
|
+
}
|
|
755
754
|
return {
|
|
756
755
|
nodeType: args.nodeType || 'unknown',
|
|
757
756
|
workflowNodeType: args.nodeType || 'unknown',
|
|
@@ -767,7 +766,7 @@ class N8NDocumentationMCPServer {
|
|
|
767
766
|
suggestions: [
|
|
768
767
|
'🔧 RECOVERY: Invalid config detected. Fix with:',
|
|
769
768
|
' • Ensure config is an object: { "resource": "...", "operation": "..." }',
|
|
770
|
-
' • Use
|
|
769
|
+
' • Use get_node to see required fields for this node type',
|
|
771
770
|
' • Check if the node type is correct before configuring it'
|
|
772
771
|
],
|
|
773
772
|
summary: {
|
|
@@ -778,90 +777,70 @@ class N8NDocumentationMCPServer {
|
|
|
778
777
|
}
|
|
779
778
|
};
|
|
780
779
|
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
if (typeof args.config !== 'object' || args.config === null) {
|
|
785
|
-
logger_1.logger.warn(`validate_node_minimal called with invalid config type: ${typeof args.config}`);
|
|
786
|
-
return {
|
|
787
|
-
nodeType: args.nodeType || 'unknown',
|
|
788
|
-
displayName: 'Unknown Node',
|
|
789
|
-
valid: false,
|
|
790
|
-
missingRequiredFields: [
|
|
791
|
-
'Invalid config format - expected object',
|
|
792
|
-
'🔧 RECOVERY: Use format { "resource": "...", "operation": "..." } or {} for empty config'
|
|
793
|
-
]
|
|
794
|
-
};
|
|
780
|
+
const validationMode = args.mode || 'full';
|
|
781
|
+
if (validationMode === 'minimal') {
|
|
782
|
+
return this.validateNodeMinimal(args.nodeType, args.config);
|
|
795
783
|
}
|
|
796
|
-
return this.
|
|
797
|
-
case 'get_property_dependencies':
|
|
798
|
-
this.validateToolParams(name, args, ['nodeType']);
|
|
799
|
-
return this.getPropertyDependencies(args.nodeType, args.config);
|
|
800
|
-
case 'get_node_as_tool_info':
|
|
801
|
-
this.validateToolParams(name, args, ['nodeType']);
|
|
802
|
-
return this.getNodeAsToolInfo(args.nodeType);
|
|
803
|
-
case 'list_templates':
|
|
804
|
-
const listLimit = Math.min(Math.max(Number(args.limit) || 10, 1), 100);
|
|
805
|
-
const listOffset = Math.max(Number(args.offset) || 0, 0);
|
|
806
|
-
const sortBy = args.sortBy || 'views';
|
|
807
|
-
const includeMetadata = Boolean(args.includeMetadata);
|
|
808
|
-
return this.listTemplates(listLimit, listOffset, sortBy, includeMetadata);
|
|
809
|
-
case 'list_node_templates':
|
|
810
|
-
this.validateToolParams(name, args, ['nodeTypes']);
|
|
811
|
-
const templateLimit = Math.min(Math.max(Number(args.limit) || 10, 1), 100);
|
|
812
|
-
const templateOffset = Math.max(Number(args.offset) || 0, 0);
|
|
813
|
-
return this.listNodeTemplates(args.nodeTypes, templateLimit, templateOffset);
|
|
784
|
+
return this.validateNodeConfig(args.nodeType, args.config, 'operation', args.profile);
|
|
814
785
|
case 'get_template':
|
|
815
786
|
this.validateToolParams(name, args, ['templateId']);
|
|
816
787
|
const templateId = Number(args.templateId);
|
|
817
|
-
const
|
|
818
|
-
return this.getTemplate(templateId,
|
|
819
|
-
case 'search_templates':
|
|
820
|
-
|
|
788
|
+
const templateMode = args.mode || 'full';
|
|
789
|
+
return this.getTemplate(templateId, templateMode);
|
|
790
|
+
case 'search_templates': {
|
|
791
|
+
const searchMode = args.searchMode || 'keyword';
|
|
821
792
|
const searchLimit = Math.min(Math.max(Number(args.limit) || 20, 1), 100);
|
|
822
793
|
const searchOffset = Math.max(Number(args.offset) || 0, 0);
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
794
|
+
switch (searchMode) {
|
|
795
|
+
case 'by_nodes':
|
|
796
|
+
if (!args.nodeTypes || !Array.isArray(args.nodeTypes) || args.nodeTypes.length === 0) {
|
|
797
|
+
throw new Error('nodeTypes array is required for searchMode=by_nodes');
|
|
798
|
+
}
|
|
799
|
+
return this.listNodeTemplates(args.nodeTypes, searchLimit, searchOffset);
|
|
800
|
+
case 'by_task':
|
|
801
|
+
if (!args.task) {
|
|
802
|
+
throw new Error('task is required for searchMode=by_task');
|
|
803
|
+
}
|
|
804
|
+
return this.getTemplatesForTask(args.task, searchLimit, searchOffset);
|
|
805
|
+
case 'by_metadata':
|
|
806
|
+
return this.searchTemplatesByMetadata({
|
|
807
|
+
category: args.category,
|
|
808
|
+
complexity: args.complexity,
|
|
809
|
+
maxSetupMinutes: args.maxSetupMinutes ? Number(args.maxSetupMinutes) : undefined,
|
|
810
|
+
minSetupMinutes: args.minSetupMinutes ? Number(args.minSetupMinutes) : undefined,
|
|
811
|
+
requiredService: args.requiredService,
|
|
812
|
+
targetAudience: args.targetAudience
|
|
813
|
+
}, searchLimit, searchOffset);
|
|
814
|
+
case 'keyword':
|
|
815
|
+
default:
|
|
816
|
+
if (!args.query) {
|
|
817
|
+
throw new Error('query is required for searchMode=keyword');
|
|
818
|
+
}
|
|
819
|
+
const searchFields = args.fields;
|
|
820
|
+
return this.searchTemplates(args.query, searchLimit, searchOffset, searchFields);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
841
823
|
case 'validate_workflow':
|
|
842
824
|
this.validateToolParams(name, args, ['workflow']);
|
|
843
825
|
return this.validateWorkflow(args.workflow, args.options);
|
|
844
|
-
case 'validate_workflow_connections':
|
|
845
|
-
this.validateToolParams(name, args, ['workflow']);
|
|
846
|
-
return this.validateWorkflowConnections(args.workflow);
|
|
847
|
-
case 'validate_workflow_expressions':
|
|
848
|
-
this.validateToolParams(name, args, ['workflow']);
|
|
849
|
-
return this.validateWorkflowExpressions(args.workflow);
|
|
850
826
|
case 'n8n_create_workflow':
|
|
851
827
|
this.validateToolParams(name, args, ['name', 'nodes', 'connections']);
|
|
852
828
|
return n8nHandlers.handleCreateWorkflow(args, this.instanceContext);
|
|
853
|
-
case 'n8n_get_workflow':
|
|
854
|
-
this.validateToolParams(name, args, ['id']);
|
|
855
|
-
return n8nHandlers.handleGetWorkflow(args, this.instanceContext);
|
|
856
|
-
case 'n8n_get_workflow_details':
|
|
857
|
-
this.validateToolParams(name, args, ['id']);
|
|
858
|
-
return n8nHandlers.handleGetWorkflowDetails(args, this.instanceContext);
|
|
859
|
-
case 'n8n_get_workflow_structure':
|
|
860
|
-
this.validateToolParams(name, args, ['id']);
|
|
861
|
-
return n8nHandlers.handleGetWorkflowStructure(args, this.instanceContext);
|
|
862
|
-
case 'n8n_get_workflow_minimal':
|
|
829
|
+
case 'n8n_get_workflow': {
|
|
863
830
|
this.validateToolParams(name, args, ['id']);
|
|
864
|
-
|
|
831
|
+
const workflowMode = args.mode || 'full';
|
|
832
|
+
switch (workflowMode) {
|
|
833
|
+
case 'details':
|
|
834
|
+
return n8nHandlers.handleGetWorkflowDetails(args, this.instanceContext);
|
|
835
|
+
case 'structure':
|
|
836
|
+
return n8nHandlers.handleGetWorkflowStructure(args, this.instanceContext);
|
|
837
|
+
case 'minimal':
|
|
838
|
+
return n8nHandlers.handleGetWorkflowMinimal(args, this.instanceContext);
|
|
839
|
+
case 'full':
|
|
840
|
+
default:
|
|
841
|
+
return n8nHandlers.handleGetWorkflow(args, this.instanceContext);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
865
844
|
case 'n8n_update_full_workflow':
|
|
866
845
|
this.validateToolParams(name, args, ['id']);
|
|
867
846
|
return n8nHandlers.handleUpdateWorkflow(args, this.repository, this.instanceContext);
|
|
@@ -888,20 +867,31 @@ class N8NDocumentationMCPServer {
|
|
|
888
867
|
case 'n8n_trigger_webhook_workflow':
|
|
889
868
|
this.validateToolParams(name, args, ['webhookUrl']);
|
|
890
869
|
return n8nHandlers.handleTriggerWebhookWorkflow(args, this.instanceContext);
|
|
891
|
-
case '
|
|
892
|
-
this.validateToolParams(name, args, ['
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
870
|
+
case 'n8n_executions': {
|
|
871
|
+
this.validateToolParams(name, args, ['action']);
|
|
872
|
+
const execAction = args.action;
|
|
873
|
+
switch (execAction) {
|
|
874
|
+
case 'get':
|
|
875
|
+
if (!args.id) {
|
|
876
|
+
throw new Error('id is required for action=get');
|
|
877
|
+
}
|
|
878
|
+
return n8nHandlers.handleGetExecution(args, this.instanceContext);
|
|
879
|
+
case 'list':
|
|
880
|
+
return n8nHandlers.handleListExecutions(args, this.instanceContext);
|
|
881
|
+
case 'delete':
|
|
882
|
+
if (!args.id) {
|
|
883
|
+
throw new Error('id is required for action=delete');
|
|
884
|
+
}
|
|
885
|
+
return n8nHandlers.handleDeleteExecution(args, this.instanceContext);
|
|
886
|
+
default:
|
|
887
|
+
throw new Error(`Unknown action: ${execAction}. Valid actions: get, list, delete`);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
899
890
|
case 'n8n_health_check':
|
|
891
|
+
if (args.mode === 'diagnostic') {
|
|
892
|
+
return n8nHandlers.handleDiagnostic({ params: { arguments: args } }, this.instanceContext);
|
|
893
|
+
}
|
|
900
894
|
return n8nHandlers.handleHealthCheck(this.instanceContext);
|
|
901
|
-
case 'n8n_list_available_tools':
|
|
902
|
-
return n8nHandlers.handleListAvailableTools(this.instanceContext);
|
|
903
|
-
case 'n8n_diagnostic':
|
|
904
|
-
return n8nHandlers.handleDiagnostic({ params: { arguments: args } }, this.instanceContext);
|
|
905
895
|
case 'n8n_workflow_versions':
|
|
906
896
|
this.validateToolParams(name, args, ['mode']);
|
|
907
897
|
return n8nHandlers.handleWorkflowVersions(args, this.repository, this.instanceContext);
|