mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
Updates: - Updated n8n from 1.113.3 to 1.114.3 - Updated n8n-core from 1.112.1 to 1.113.1 - Updated n8n-workflow from 1.110.0 to 1.111.0 - Updated @n8n/n8n-nodes-langchain from 1.112.2 to 1.113.1 - Rebuilt node database with 536 nodes - Updated template database (2647 → 2653, +6 new templates) - Sanitized 24 templates to remove API tokens Performance Improvements: - Optimized template update to fetch only last 2 weeks - Reduced update time from 10+ minutes to ~60 seconds - Added getMostRecentTemplateDate() to TemplateRepository - Modified TemplateFetcher to support date-based filtering - Update mode now fetches templates since (most_recent - 14 days) All tests passing (933 unit, 249 integration) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
n8n Templates Integration
This module provides integration with n8n.io's workflow templates, allowing AI agents to discover and use proven workflow patterns.
Features
- API Integration: Connects to n8n.io's official template API
- Fresh Templates: Only includes templates updated within the last 6 months
- Manual Fetch: Templates are fetched separately from the main node database
- Full Workflow JSON: Complete workflow definitions ready for import
- Smart Search: Find templates by nodes, keywords, or task categories
Usage
Fetching Templates
npm run fetch:templates
This command will:
- Connect to n8n.io API
- Fetch all templates from the last 6 months
- Download complete workflow JSON for each template
- Store in local SQLite database
- Display progress and statistics
Testing
npm run test:templates
MCP Tools
The following tools are available via MCP:
list_node_templates(nodeTypes, limit)- Find templates using specific nodesget_template(templateId)- Get complete workflow JSONsearch_templates(query, limit)- Search by keywordsget_templates_for_task(task)- Get templates for common tasks
Task Categories
ai_automation- AI-powered workflowsdata_sync- Database and spreadsheet synchronizationwebhook_processing- Webhook handling workflowsemail_automation- Email processing workflowsslack_integration- Slack bots and notificationsdata_transformation- Data manipulation workflowsfile_processing- File handling workflowsscheduling- Scheduled and recurring tasksapi_integration- External API connectionsdatabase_operations- Database CRUD operations
Implementation Details
Architecture
template-fetcher.ts- Handles API communication and rate limitingtemplate-repository.ts- Database operations and queriestemplate-service.ts- Business logic and MCP integration
Database Schema
Templates are stored in a dedicated table with:
- Workflow metadata (name, description, author)
- Node usage tracking
- View counts for popularity
- Complete workflow JSON
- Creation/update timestamps
- 6-month freshness constraint
API Endpoints Used
/api/templates/workflows- List all workflows/api/templates/search- Search with pagination/api/templates/workflows/{id}- Get specific workflow/api/templates/search/filters- Available filters
Notes
- Templates are NOT fetched during regular database rebuilds
- Run
fetch:templatesmanually when you need fresh templates - API rate limiting is implemented (200-500ms between requests)
- Progress is shown during fetching for large datasets