@emit-ia/n8n-template-mcp
v1.1.0
Published
Model Context Protocol server for n8n templates - Enables AI agents to search, browse, and export n8n workflow templates via official APIs
Maintainers
Readme
N8N Template MCP Server
A Model Context Protocol (MCP) server that provides Claude Desktop with structured access to n8n workflow templates via n8n's official REST API. This server enables Claude to search, browse, and export n8n templates without web scraping, providing fast and stable access to the n8n community template ecosystem.
Features
=
Template Search - Search n8n community templates by query, category, tags, or node types
=� Template Details - Get complete template information including workflow JSON
=� Category Browse - List all template categories and subcategories
=' Node Discovery - Find templates that use specific node types
=� Export Ready - Export templates in n8n-compatible JSON format
� Smart Caching - Intelligent caching with configurable TTL for optimal performance
=� Error Handling - Robust error handling with retry logic and graceful degradation
Quick Start
Installation
# Install dependencies
npm install
# Build the project
npm run build
# Run with npx (recommended)
npx --package=@emit-ia/n8n-template-mcp n8n-template-mcpNPX Usage
The easiest way to use this MCP server is with npx:
# Run the server directly
npx --package=@emit-ia/n8n-template-mcp n8n-template-mcp
# With Claude Desktop, add to your configuration:
{
"mcpServers": {
"n8n-templates": {
"command": "npx",
"args": ["@igoragoli/n8n-template-mcp"]
}
}
}Available Tools
=
Template Discovery
n8n_search_templates
Search n8n community templates with flexible filtering options.
Parameters:
query(optional): Search termpage(optional): Page number (default: 1)limit(optional): Results per page (default: 24, max: 100)category(optional): Filter by categorysubcategory(optional): Filter by subcategorytags(optional): Array of tags to filter bynodeTypes(optional): Array of node types to filter byofficial(optional): Filter official templates only
Example:
{
"query": "Google Sheets automation",
"category": "Data Processing",
"limit": 10,
"official": true
}n8n_list_categories
Get all available template categories and their counts.
Example Response:
{
"success": true,
"data": [
{
"name": "Data Processing",
"count": 45,
"subcategories": [
{"name": "ETL", "count": 12},
{"name": "Analytics", "count": 8}
]
}
]
}n8n_find_by_node
Find templates that use a specific node type.
Parameters:
nodeType: Node type to search for (e.g., "MySQL", "Slack", "Google Sheets")
Example:
{
"nodeType": "MySQL"
}=� Template Management
n8n_get_template
Get detailed information about a specific template including full workflow JSON.
Parameters:
templateId: Template ID from search results
Example Response:
{
"success": true,
"data": {
"id": "123",
"name": "MySQL to Google Sheets Sync",
"description": "Automatically sync MySQL data to Google Sheets",
"category": "Data Processing",
"tags": ["mysql", "google-sheets", "sync"],
"nodes": [
{
"name": "MySQL Node",
"type": "mysql",
"position": [100, 200]
}
],
"workflow": { /* Full n8n workflow JSON */ },
"author": {
"name": "Community User",
"avatar": "https://..."
}
}
}n8n_export_templates
Export multiple templates as n8n-compatible workflow JSON files.
Parameters:
templateIds: Array of template IDs to exportformat(optional): Export format ("n8n" or "json", default: "n8n")
Example:
{
"templateIds": ["123", "456", "789"],
"format": "n8n"
}Example Response:
{
"success": true,
"data": {
"version": "1.0",
"workflows": [
{
"name": "MySQL to Google Sheets Sync (imported from n8n community)",
"nodes": [ /* workflow nodes */ ],
"connections": { /* node connections */ },
"meta": {
"templateId": "123",
"originalName": "MySQL to Google Sheets Sync",
"category": "Data Processing",
"importedAt": "2024-01-15T10:30:00Z"
}
}
],
"exportedAt": "2024-01-15T10:30:00Z",
"metadata": {
"templateCount": 3,
"nodeTypes": ["mysql", "googleSheets", "set"]
}
}
}=� Utility Tools
n8n_health_check
Check the health and availability of the n8n community API and cache status.
n8n_clear_cache
Clear the template cache to force fresh data retrieval.
Configuration
Environment Variables
Copy .env.example to .env and configure:
# N8N API Configuration
N8N_API_BASE=https://api.n8n.io
ENABLE_GRAPHQL=false
# Cache Configuration (in seconds)
CACHE_SEARCH_TTL=900 # 15 minutes
CACHE_TEMPLATE_TTL=3600 # 1 hour
CACHE_CATEGORIES_TTL=86400 # 24 hours
CACHE_MAX_SIZE=1000
# Rate Limiting
RATE_LIMIT_MAX=10 # Max requests per minute
RATE_LIMIT_WINDOW=60000 # 1 minute windowCache Strategy
The server implements intelligent caching to minimize API calls and improve performance:
- Search Results: Cached for 15 minutes
- Template Details: Cached for 1 hour
- Categories: Cached for 24 hours
- Memory Management: LRU eviction with configurable max size
Integration with Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"n8n-templates": {
"command": "npx",
"args": ["@igoragoli/n8n-template-mcp"],
"env": {
"N8N_API_BASE": "https://api.n8n.io",
"CACHE_SEARCH_TTL": "900"
}
}
}
}Development
Local Development
# Install dependencies
npm install
# Start development server with hot reload
npm run dev
# Build for production
npm run build
# Start production server
npm startTesting
# Run tests
npm test
# Test with MCP Inspector
npm run dev
# Open http://localhost:3001 for MCP InspectorProject Structure
src/
�� index.ts # Main server entry point
�� services/
�� base.service.ts # Base HTTP service class
�� n8n.service.ts # N8N API service
�� index.ts # Service exports
�� tools/
�� template.tool.ts # Template management tools
�� workflow.tool.ts # Workflow export tools
�� index.ts # Tool registration
�� types/
�� index.ts # TypeScript type definitions
�� utils/
�� cache.ts # Caching implementation
�� tools.ts # Tool creation utilitiesAPI Endpoints
This MCP server uses the following n8n community API endpoints:
GET /templates/search- Search templatesGET /templates/workflows/{id}- Get template detailsGET /templates/categories- List categoriesGET /health- API health check
Error Handling
The server implements comprehensive error handling:
- Network Errors: Automatic retry with exponential backoff
- Rate Limiting: Respect API rate limits with delay
- API Errors: Graceful degradation with meaningful error messages
- Cache Errors: Fallback to direct API calls when cache fails
Performance
- Sub-200ms response times for cached queries
- Smart caching reduces API calls by 80%+
- Memory efficient with configurable cache limits
- Concurrent request handling for multiple operations
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Create an issue on GitHub
- Check the n8n community documentation
- Review the MCP specification
Built for the 18-Agent Automated Income Ecosystem
Part of Igor's comprehensive automation framework targeting �2,500+/month by November 2025.
