n8n_agent
MCP server for n8n workflows — vectorizes, validates, and manages automation flows
This project provides Model Context Protocol (MCP) servers and tools for analyzing, categorizing, and managing n8n automation workflows. It integrates with Qdrant for semantic search, Supabase for metadata storage, and directly with n8n's API. Developers can vectorize workflows, validate them against best practices, and programmatically manage their n8n instances.
- Vectorizes n8n workflows for semantic search in Qdrant
- Validates workflows against best practices (naming, error handling, security)
- Manages n8n workflows directly via API (list, create, update, delete)
- Parses workflow JSON to extract metadata, descriptions, and tags
- Integrates with Supabase for structured metadata storage
README
View on GitHub ↗n8n Workflow Vectorization and Knowledge Graph
This project provides tools for analyzing, categorizing, and storing n8n workflows across multiple database types:
- Vector Database (QDRANT): For semantic search and similarity matching
- Graph Database (Neo4j): For relationship mapping and ontological representation
- Relational Database (Supabase): For structured metadata storage
MCP Integrations
This project now includes Model Context Protocol (MCP) integrations for:
- n8n: Import and manage workflows directly with n8n's API
- QDRANT: Vector search and similarity matching for workflows
- Supabase: Structured data storage for workflow metadata
- Workflow Validation: Validate workflows against best practices
Project Structure
workflow-parser.js: Processes n8n workflow JSON files, extracts metadata, and generates descriptionsvectorize-workflows.js: Demonstrates how to use the QDRANT MCP server to vectorize workflowsn8n-mcp-client.js: Client for interacting with the n8n MCP servern8n-workflow-validator.js: Validator for n8n workflows against best practicesvalidate-workflow.js: CLI tool for validating workflowsimport-to-n8n.js: Tool for importing workflows to n8nprocessed-workflows/: Contains the processed workflow data with enriched metadataworkflows/: Directory containing original n8n workflow files- MCP Servers located in
/Users/kinglerbercy/MCP/:
Setup and Installation
1. Process Workflows
The workflow-parser.js script processes n8n workflow files, extracting metadata and generating descriptions:
npm run parse
# or
node workflow-parser.js
This creates enriched workflow data in the processed-workflows/ directory.
2. Configure Environment Variables
Copy the example environment file and update with your settings:
cp .env.example .env
# Edit .env with your configuration
3. MCP Integrations
QDRANT MCP Integration
# Connect to QDRANT for vectorization and semantic search
npm run vectorize-mcp
Supabase MCP Integration
# Store workflows in Supabase
npm run supabase-mcp
n8n MCP Integration
# Connect to n8n and list workflows
npm run n8n-demo
# Import all workflows to n8n
npm run import-all
# Import a specific workflow to n8n
npm run import <workflow-id>
# or
npm run import <workflow-file.json>
Workflow Validation
# Validate a workflow in n8n by ID
npm run validate <workflow-id>
# Validate a local workflow file
npm run validate -f <workflow-file.json>
# Validate with high strictness
npm run validate -s high <workflow-id>
# Run specific validators only
npm run validate -v naming,security,errorHandling <workflow-id>
The workflow validator checks for best practices in five categories:
- Naming: Ensures workflows and nodes have descriptive names
- Error Handling: Checks for proper error handling nodes and patterns
- Security: Validates credential usage and security practices
- Performance: Identifies potential performance issues
- Documentation: Ensures workflows are properly documented
4. Manual Vectorization (Legacy Method)
The QDRANT MCP server can also be configured in the Cline MCP settings:
"n8n-workflows-qdrant": {
"command": "node",
"args": [
"/Users/kinglerbercy/MCP/qdrant-server/index.js"
],
"env": {
"OPENAI_API_KEY": "your-openai-api-key",
"QDRANT_URL": "http://localhost:6333"
},
"disabled": false,
"autoApprove": []
}
After restarting Cline with the MCP server configuration, you can use the MCP tools to vectorize and search workflows:
// Vectorize workflows
use_mcp_tool(
server_name: "n8n-workflows-qdrant",
tool_name: "vectorize_workflows",
arguments: {
"workflowsDir": "/path/to/workflows",
"processedDir": "/path/to/processed-workflows"
}
)
// Search for similar workflows
use_mcp_tool(
server_name: "n8n-workflows-qdrant",
tool_name: "search_similar_workflows",
arguments: {
"query": "workflow that handles email automation",
"limit": 5,
"filter": {
"category": "workflow",
"tags": ["email", "automation"],
"complexity": "moderate"
}
}
)
Workflow Analysis
The workflow parser extracts the following information:
- Category: Derived from the filename prefix (e.g., "agent:", "workflow:", "tool:")
- Name: Extracted from the filename
- Description: Generated from workflow content, including node types and documentation
- Tags: Extracted from node types and services used
- Complexity: Analyzed based on node count, connection count, and unique node types
Database Integration
Vector Database (QDRANT)
- Purpose: Semantic search and similarity matching
- Implementation: QDRANT MCP server with OpenAI embeddings
- Features: Search by query, filter by category, tags, and complexity
Graph Database (Neo4j)
- Purpose: Relationship mapping and ontological representation
- Implementation: To be implemented
- Features: Query relationships between workflows, node types, and categories
Relational Database (Supabase)
- Purpose: Structured metadata storage
- Implementation: To be implemented
- Features: SQL queries for structured data analysis
Available MCP Tools
QDRANT MCP Tools
The QDRANT MCP server provides the following tools:
vectorize_workflows: Vectorize n8n workflows and store them in Qdrantsearch_similar_workflows: Search for similar workflows based on a queryget_workflow_categories: Get all workflow categoriesget_workflow_tags: Get all workflow tags
n8n MCP Tools
The n8n MCP server provides the following tools:
list_workflows: Get all workflows from n8nget_workflow: Get a specific workflow by IDcreate_workflow: Create a new workflowupdate_workflow: Update an existing workflowdelete_workflow: Delete a workflowimport_workflow: Import a workflow from a fileexport_workflow: Export a workflow to a file
Workflow Validation Tools
The workflow validator provides the following validation categories:
naming: Validate node and workflow naming conventionserrorHandling: Validate error handling patternssecurity: Validate security practices and credential usageperformance: Identify potential performance issuesdocumentation: Ensure proper workflow documentation
Future Enhancements
- Implement Neo4j integration for relationship mapping
- Implement Supabase integration for structured metadata storage
- Create a web interface for browsing and searching workflows
- Add more advanced analytics and visualization tools
Similar mcp servers
ruflo
Multi-agent orchestration MCP server for Claude Code — deploys swarms, coordinates workflows, learns from outcomes
claude-task-master
MCP server for AI task management — streamlines development workflows with Claude and other AI chats
n8n-mcp
MCP server for n8n workflow automation — provides AI assistants deep access to 1,500+ n8n nodes and templates
ccusage
MCP server for Claude Code usage — real-time token and cost analysis from local JSONL files