n8n-mcp 2.66.1 → 2.66.3

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 (33) hide show
  1. package/README.md +2 -2
  2. package/data/nodes.db +0 -0
  3. package/dist/community/community-node-fetcher.d.ts +4 -1
  4. package/dist/community/community-node-fetcher.d.ts.map +1 -1
  5. package/dist/community/community-node-fetcher.js +5 -3
  6. package/dist/community/community-node-fetcher.js.map +1 -1
  7. package/dist/community/community-node-service.d.ts +3 -0
  8. package/dist/community/community-node-service.d.ts.map +1 -1
  9. package/dist/community/community-node-service.js +63 -7
  10. package/dist/community/community-node-service.js.map +1 -1
  11. package/dist/database/node-repository.d.ts +1 -0
  12. package/dist/database/node-repository.d.ts.map +1 -1
  13. package/dist/database/node-repository.js +7 -0
  14. package/dist/database/node-repository.js.map +1 -1
  15. package/dist/mcp/server.d.ts +0 -2
  16. package/dist/mcp/server.d.ts.map +1 -1
  17. package/dist/mcp/server.js +15 -110
  18. package/dist/mcp/server.js.map +1 -1
  19. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.d.ts.map +1 -1
  20. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js +16 -1
  21. package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js.map +1 -1
  22. package/dist/services/ai-node-validator.d.ts.map +1 -1
  23. package/dist/services/ai-node-validator.js +5 -2
  24. package/dist/services/ai-node-validator.js.map +1 -1
  25. package/dist/services/workflow-diff-engine.d.ts +1 -0
  26. package/dist/services/workflow-diff-engine.d.ts.map +1 -1
  27. package/dist/services/workflow-diff-engine.js +124 -23
  28. package/dist/services/workflow-diff-engine.js.map +1 -1
  29. package/dist/services/workflow-validator.d.ts +3 -1
  30. package/dist/services/workflow-validator.d.ts.map +1 -1
  31. package/dist/services/workflow-validator.js +48 -18
  32. package/dist/services/workflow-validator.js.map +1 -1
  33. package/package.json +1 -1
@@ -1489,15 +1489,22 @@ class N8NDocumentationMCPServer {
1489
1489
  if (!node) {
1490
1490
  throw new Error(`Node ${nodeType} not found`);
1491
1491
  }
1492
+ const isCommunityNode = node.isCommunity ?? false;
1493
+ const isMarkedAsAITool = node.isAITool ?? false;
1494
+ let aiToolFlagSource = null;
1495
+ if (isMarkedAsAITool) {
1496
+ aiToolFlagSource = isCommunityNode ? 'declared-or-ai-category' : 'declared-property';
1497
+ }
1492
1498
  const aiToolCapabilities = {
1493
1499
  canBeUsedAsTool: true,
1494
- hasUsableAsToolProperty: node.isAITool ?? false,
1495
- requiresEnvironmentVariable: !(node.isAITool ?? false) && node.package !== 'n8n-nodes-base',
1500
+ hasUsableAsToolProperty: isMarkedAsAITool,
1501
+ aiToolFlagSource,
1502
+ requiresEnvironmentVariable: isCommunityNode,
1496
1503
  toolConnectionType: 'ai_tool',
1497
1504
  commonToolUseCases: this.getCommonAIToolUseCases(node.nodeType),
1498
- environmentRequirement: node.package && node.package !== 'n8n-nodes-base' ?
1499
- 'N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true' :
1500
- null
1505
+ environmentRequirement: isCommunityNode
1506
+ ? 'N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true'
1507
+ : null
1501
1508
  };
1502
1509
  let outputs = undefined;
1503
1510
  if (node.outputNames && Array.isArray(node.outputNames) && node.outputNames.length > 0) {
@@ -2105,11 +2112,11 @@ class N8NDocumentationMCPServer {
2105
2112
  tools,
2106
2113
  totalCount: tools.length,
2107
2114
  requirements: {
2108
- environmentVariable: 'N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true',
2109
- nodeProperty: 'usableAsTool: true',
2115
+ environmentVariable: 'N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true (community nodes only; built-in tools need no environment variable)',
2116
+ nodeProperty: 'usableAsTool (declared; community nodes may instead carry the codex AI category)',
2110
2117
  },
2111
2118
  usage: {
2112
- description: 'These nodes have the usableAsTool property set to true, making them optimized for AI agent usage.',
2119
+ description: 'These nodes are marked as AI tools. For built-in nodes this reflects a declared usableAsTool property; for community nodes it can also be inferred from the package\'s AI category, since community metadata often omits the property.',
2113
2120
  note: 'ANY node in n8n can be used as an AI tool by connecting it to the ai_tool port of an AI Agent node.',
2114
2121
  examples: [
2115
2122
  'Regular nodes like Slack, Google Sheets, or HTTP Request can be used as tools',
@@ -2863,61 +2870,6 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
2863
2870
  } : undefined
2864
2871
  };
2865
2872
  }
2866
- async getNodeAsToolInfo(nodeType) {
2867
- await this.ensureInitialized();
2868
- if (!this.repository)
2869
- throw new Error('Repository not initialized');
2870
- const normalizedType = node_type_normalizer_1.NodeTypeNormalizer.normalizeToFullForm(nodeType);
2871
- let node = this.repository.getNode(normalizedType);
2872
- if (!node && normalizedType !== nodeType) {
2873
- node = this.repository.getNode(nodeType);
2874
- }
2875
- if (!node) {
2876
- const alternatives = (0, node_utils_1.getNodeTypeAlternatives)(normalizedType);
2877
- for (const alt of alternatives) {
2878
- const found = this.repository.getNode(alt);
2879
- if (found) {
2880
- node = found;
2881
- break;
2882
- }
2883
- }
2884
- }
2885
- if (!node) {
2886
- throw new Error(`Node ${nodeType} not found`);
2887
- }
2888
- const commonUseCases = this.getCommonAIToolUseCases(node.nodeType);
2889
- const aiToolCapabilities = {
2890
- canBeUsedAsTool: true,
2891
- hasUsableAsToolProperty: node.isAITool,
2892
- requiresEnvironmentVariable: !node.isAITool && node.package !== 'n8n-nodes-base',
2893
- connectionType: 'ai_tool',
2894
- commonUseCases,
2895
- requirements: {
2896
- connection: 'Connect to the "ai_tool" port of an AI Agent node',
2897
- environment: node.package !== 'n8n-nodes-base' ?
2898
- 'Set N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true for community nodes' :
2899
- 'No special environment variables needed for built-in nodes'
2900
- },
2901
- examples: this.getAIToolExamples(node.nodeType),
2902
- tips: [
2903
- 'Give the tool a clear, descriptive name in the AI Agent settings',
2904
- 'Write a detailed tool description to help the AI understand when to use it',
2905
- 'Test the node independently before connecting it as a tool',
2906
- node.isAITool ?
2907
- 'This node is optimized for AI tool usage' :
2908
- 'This is a regular node that can be used as an AI tool'
2909
- ]
2910
- };
2911
- return {
2912
- nodeType: node.nodeType,
2913
- workflowNodeType: (0, node_utils_1.getWorkflowNodeType)(node.package, node.nodeType),
2914
- displayName: node.displayName,
2915
- description: node.description,
2916
- package: node.package,
2917
- isMarkedAsAITool: node.isAITool,
2918
- aiToolCapabilities
2919
- };
2920
- }
2921
2873
  getOutputDescriptions(nodeType, outputName, index) {
2922
2874
  if (nodeType === 'nodes-base.splitInBatches') {
2923
2875
  if (outputName === 'done' && index === 0) {
@@ -3035,53 +2987,6 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
3035
2987
  }
3036
2988
  return undefined;
3037
2989
  }
3038
- getAIToolExamples(nodeType) {
3039
- const exampleMap = {
3040
- 'nodes-base.slack': {
3041
- toolName: 'Send Slack Message',
3042
- toolDescription: 'Sends a message to a specified Slack channel or user. Use this to notify team members about important events or results.',
3043
- nodeConfig: {
3044
- resource: 'message',
3045
- operation: 'post',
3046
- channel: '={{ $fromAI("channel", "The Slack channel to send to, e.g. #general") }}',
3047
- text: '={{ $fromAI("message", "The message content to send") }}'
3048
- }
3049
- },
3050
- 'nodes-base.googleSheets': {
3051
- toolName: 'Update Google Sheet',
3052
- toolDescription: 'Reads or updates data in a Google Sheets spreadsheet. Use this to log information, retrieve data, or update records.',
3053
- nodeConfig: {
3054
- operation: 'append',
3055
- sheetId: 'your-sheet-id',
3056
- range: 'A:Z',
3057
- dataMode: 'autoMap'
3058
- }
3059
- },
3060
- 'nodes-base.httpRequest': {
3061
- toolName: 'Call API',
3062
- toolDescription: 'Makes HTTP requests to external APIs. Use this to fetch data, trigger webhooks, or integrate with any web service.',
3063
- nodeConfig: {
3064
- method: '={{ $fromAI("method", "HTTP method: GET, POST, PUT, DELETE") }}',
3065
- url: '={{ $fromAI("url", "The complete API endpoint URL") }}',
3066
- sendBody: true,
3067
- bodyContentType: 'json',
3068
- jsonBody: '={{ $fromAI("body", "Request body as JSON object") }}'
3069
- }
3070
- }
3071
- };
3072
- for (const [key, example] of Object.entries(exampleMap)) {
3073
- if (nodeType.includes(key)) {
3074
- return example;
3075
- }
3076
- }
3077
- return {
3078
- toolName: 'Custom Tool',
3079
- toolDescription: 'Performs specific operations. Describe what this tool does and when to use it.',
3080
- nodeConfig: {
3081
- note: 'Configure the node based on its specific requirements'
3082
- }
3083
- };
3084
- }
3085
2990
  async validateNodeMinimal(nodeType, config) {
3086
2991
  await this.ensureInitialized();
3087
2992
  if (!this.repository)