Skip to main content
Glama

n8n-MCP

by 88-888
demo-enhanced-documentation.jsβ€’4.79 kB
#!/usr/bin/env node const { EnhancedDocumentationFetcher } = require('../dist/utils/enhanced-documentation-fetcher'); async function demoEnhancedDocumentation() { console.log('=== Enhanced Documentation Parser Demo ===\n'); console.log('This demo shows how the enhanced DocumentationFetcher extracts rich content from n8n documentation.\n'); const fetcher = new EnhancedDocumentationFetcher(); try { // Demo 1: Slack node (complex app node with many operations) console.log('1. SLACK NODE DOCUMENTATION'); console.log('=' .repeat(50)); const slackDoc = await fetcher.getEnhancedNodeDocumentation('n8n-nodes-base.slack'); if (slackDoc) { console.log('\nπŸ“„ Basic Information:'); console.log(` β€’ Title: ${slackDoc.title}`); console.log(` β€’ Description: ${slackDoc.description}`); console.log(` β€’ URL: ${slackDoc.url}`); console.log('\nπŸ“Š Content Statistics:'); console.log(` β€’ Operations: ${slackDoc.operations?.length || 0} operations across multiple resources`); console.log(` β€’ API Methods: ${slackDoc.apiMethods?.length || 0} mapped to Slack API endpoints`); console.log(` β€’ Examples: ${slackDoc.examples?.length || 0} code examples`); console.log(` β€’ Resources: ${slackDoc.relatedResources?.length || 0} related documentation links`); console.log(` β€’ Scopes: ${slackDoc.requiredScopes?.length || 0} OAuth scopes`); // Show operations breakdown if (slackDoc.operations && slackDoc.operations.length > 0) { console.log('\nπŸ”§ Operations by Resource:'); const resourceMap = new Map(); slackDoc.operations.forEach(op => { if (!resourceMap.has(op.resource)) { resourceMap.set(op.resource, []); } resourceMap.get(op.resource).push(op); }); for (const [resource, ops] of resourceMap) { console.log(`\n ${resource} (${ops.length} operations):`); ops.slice(0, 5).forEach(op => { console.log(` β€’ ${op.operation}: ${op.description}`); }); if (ops.length > 5) { console.log(` ... and ${ops.length - 5} more`); } } } // Show API method mappings if (slackDoc.apiMethods && slackDoc.apiMethods.length > 0) { console.log('\nπŸ”— API Method Mappings (sample):'); slackDoc.apiMethods.slice(0, 5).forEach(api => { console.log(` β€’ ${api.resource}.${api.operation} β†’ ${api.apiMethod}`); console.log(` URL: ${api.apiUrl}`); }); if (slackDoc.apiMethods.length > 5) { console.log(` ... and ${slackDoc.apiMethods.length - 5} more mappings`); } } } // Demo 2: If node (core node with conditions) console.log('\n\n2. IF NODE DOCUMENTATION'); console.log('=' .repeat(50)); const ifDoc = await fetcher.getEnhancedNodeDocumentation('n8n-nodes-base.if'); if (ifDoc) { console.log('\nπŸ“„ Basic Information:'); console.log(` β€’ Title: ${ifDoc.title}`); console.log(` β€’ Description: ${ifDoc.description}`); console.log(` β€’ URL: ${ifDoc.url}`); if (ifDoc.relatedResources && ifDoc.relatedResources.length > 0) { console.log('\nπŸ“š Related Resources:'); ifDoc.relatedResources.forEach(res => { console.log(` β€’ ${res.title} (${res.type})`); console.log(` ${res.url}`); }); } } // Demo 3: Summary of enhanced parsing capabilities console.log('\n\n3. ENHANCED PARSING CAPABILITIES'); console.log('=' .repeat(50)); console.log('\nThe enhanced DocumentationFetcher can extract:'); console.log(' βœ“ Markdown frontmatter (metadata, tags, priority)'); console.log(' βœ“ Operations with resource grouping and descriptions'); console.log(' βœ“ API method mappings from markdown tables'); console.log(' βœ“ Code examples (JSON, JavaScript, YAML)'); console.log(' βœ“ Template references'); console.log(' βœ“ Related resources and documentation links'); console.log(' βœ“ Required OAuth scopes'); console.log('\nThis rich content enables AI agents to:'); console.log(' β€’ Understand node capabilities in detail'); console.log(' β€’ Map operations to actual API endpoints'); console.log(' β€’ Provide accurate examples and usage patterns'); console.log(' β€’ Navigate related documentation'); console.log(' β€’ Understand authentication requirements'); } catch (error) { console.error('\nError:', error); } finally { await fetcher.cleanup(); console.log('\n\nβœ“ Demo completed'); } } // Run the demo demoEnhancedDocumentation().catch(console.error);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/88-888/n8n-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server