This n8n Workflow Builder MCP server provides an AI-friendly interface for programmatically creating and managing n8n workflows within the Cursor IDE. With it, you can:
Create, list, and manage n8n workflows
Manipulate workflow nodes: Add, edit, delete, and connect nodes
Discover node types: Explore available n8n nodes with optional filtering
Configure node details: Set parameters, type versions, and webhook IDs
Integrate AI components: Connect language models, agents, tools, and memory nodes
Add specialized connections: Support for LangChain nodes and AI-specific components
The server is designed specifically for AI agents to automate workflow creation and modification tasks.
Supports integration with LangChain components in n8n workflows, offering special tools for connecting AI components and establishing connections between agent nodes, model nodes, and tool nodes.
Provides tools for building and manipulating n8n workflows through an AI-friendly interface, including creating new workflows, adding/editing nodes, managing connections between nodes, and discovering available node types.
n8n Workflow Builder MCP
This project provides a Model Context Protocol (MCP) server for building and manipulating n8n workflows JSON in Cursor IDE. It's a way to build n8n workflows just by prompting with AI in chat.
DEMO VIDEO:
Cursor rules:
file with rules is in
rules/n8n-mcp-server-rules.mdc
Current status of implementation
Basically, it's working - MCP server creates JSON file with n8n workflow that you can copy and paste to workflow editor in n8n UI. Current problems:
sometimes llm agents put wrong parameters in the request. I plan to find a way to fix this.
not all types of node are checked working. I'm working to resolve it.
Related MCP server: mcp-n8n-builder
Key Features
Workflow Management: Create, update, and execute n8n workflows programmatically (execute is not implemented yet)
Node Discovery: Explore available n8n nodes and their capabilities
Connection Management: Create connections between workflow nodes
AI Integration: Special tools for connecting AI components in workflows
AI-Friendly Interface: Designed specifically for interaction with AI agents
N8N Version Management: Automatic version detection and compatibility handling - supports 123+ N8N versions with dynamic node filtering and "closest lower version" matching for backward compatibility
Prerequisites
Node.js (v14 or higher)
Cursor IDE (v0.48 or newer)
npm (for npx command)
Installation & Setup
Recommended: Using npx in mcp.json (Easiest)
The recommended way to install this MCP server is using npx directly in your .cursor/mcp.json file:
This approach:
✅ Automatically installs the latest version
✅ Does not require global installation
✅ Works reliably across different environments
✅ No manual building or path configuration needed
Setup Steps:
Create the
.cursordirectory in your project root (if it doesn't exist):mkdir -p .cursorCreate or update
.cursor/mcp.jsonwith the configuration above, replacing:N8N_API_URL: Your n8n instance URL (default:http://localhost:5678)N8N_API_KEY: Your n8n API key from the n8n settingsN8N_VERSION: (Optional) Override N8N version - if not set, auto-detects from API
Restart Cursor IDE for changes to take effect
Getting your n8n API Key:
Open your n8n instance in a browser
Go to Settings > API Keys
Click "Create API Key"
Copy the generated key and use it in your configuration
Alternative: Development Installation
For development or local testing, you can clone and build from source:
Clone the repository:
git clone https://github.com/ifmelate/n8n-workflow-builder-mcp.git cd n8n-workflow-builder-mcpInstall dependencies:
npm installBuild the TypeScript project:
npm run buildConfigure in
.cursor/mcp.json:{ "mcpServers": { "n8n-workflow-builder": { "command": "node", "args": ["/absolute/path/to/n8n-workflow-builder-mcp/dist/index.js"], "env": { "N8N_API_URL": "http://localhost:5678", "N8N_API_KEY": "your-n8n-api-key-here", //"N8N_VERSION": "1.76.1" - optional } } } }For development with auto-rebuild:
npm run dev
Cursor IDE Integration
Using Cursor Settings UI (Optional)
Alternatively, you can set up the MCP server through Cursor's interface:
Start Cursor IDE
Go to Settings > Features > MCP Servers
Click "Add Server"
For npx method: Use command
npxwith args["-y", "n8n-workflow-builder-mcp"]Add environment variables:
N8N_API_URL:http://localhost:5678N8N_API_KEY:your-n8n-api-key-hereN8N_VERSION:1.76.1(optional - auto-detects if not set)
Make sure the server is enabled
Restart Cursor IDE for changes to take effect
Available MCP Tools
The server provides the following tools for working with n8n workflows:
Core Workflow Management
Tool Name | Description | Key Parameters |
create_workflow | Create a new n8n workflow |
,
|
list_workflows | List workflows in the workspace |
(optional),
(optional) |
get_workflow_details | Get detailed information about a specific workflow |
,
(optional) |
validate_workflow | Validate a workflow file against node schemas and connectivity |
,
(optional) |
Node Management
Tool Name | Description | Key Parameters |
add_node | Add a new node to a workflow |
,
,
(optional),
(optional),
(optional),
(optional),
(optional),
(optional),
(optional),
(optional) |
edit_node | Edit an existing node in a workflow |
,
,
(optional),
(optional),
(optional),
(optional),
(optional),
(optional),
(optional),
(optional),
(optional) |
delete_node | Delete a node from a workflow |
,
,
(optional) |
list_available_nodes | List available node types with optional filtering. Supports tag-style synonyms and multi-token OR/AND logic |
(optional),
(optional),
(optional),
(optional),
(optional, default: true),
(optional: 'or' default, or 'and') |
Connection Management
Tool Name | Description | Key Parameters |
add_connection | Create a connection between two nodes |
,
,
,
,
,
(optional),
(optional) |
add_ai_connections | Wire AI model, tools, and memory to an agent |
,
,
(optional),
(optional),
(optional),
(optional),
(optional),
(optional),
(optional),
(optional) |
connect_main_chain | Build a minimal main path through AI workflow nodes (Trigger → Model → Memory → Embeddings → Doc Loader → Vector Store → Vector Tool → Agent) |
,
(optional),
(optional),
(optional) |
Workflow Planning & Composition
Tool Name | Description | Key Parameters |
plan_workflow | Create a non-destructive plan (nodes and connections) to update a workflow. Does not write files |
,
(nodes, connections),
(optional) |
review_workflow_plan | Apply a plan in-memory and return validation errors, warnings, and suggested fixes. Does not write files |
,
,
(optional) |
apply_workflow_plan | Apply a previously reviewed plan to the workflow on disk (atomic write) |
,
,
(optional) |
compose_ai_workflow | Compose a complex AI workflow (agent + model + memory + embeddings + vector + tools + trigger) in one call, including wiring and basic validation |
,
,
(optional) |
Parameter Management
Tool Name | Description | Key Parameters |
suggest_node_params | Suggest minimal valid parameters for a node type using defaults and required fields |
,
(optional),
(optional) |
list_missing_parameters | List required parameters missing for a node considering visibility rules |
,
(optional),
|
fix_node_params | Return parameters with defaults applied for required fields that are missing |
,
(optional),
(optional) |
Templates & Discovery
Tool Name | Description | Key Parameters |
list_template_examples | List node usage examples extracted from free templates. Filter by node_type or template_name |
(optional),
(optional),
(optional),
(optional) |
get_n8n_version_info | Get current N8N version and capabilities |
|
Validation behavior
validate_workflow promotes warnings to errors and additionally fails when any enabled node is not connected (directly or via AI ports) to the main chain starting at the inferred startNode. Use connect_from/connect_to or add_ai_connections to fix connectivity.
Troubleshooting Cursor Integration
If you're having trouble getting the MCP server to work with Cursor, try these steps:
For npx installation (Recommended method):
Make sure your .cursor/mcp.json file is properly formatted:
General troubleshooting:
Check Cursor MCP settings:
Open Cursor Settings
Go to Features > MCP Servers
Make sure your server is listed and enabled
If it's listed but not working, try clicking the refresh button
Check server logs: Look for errors in the Cursor Output panel. Select "Cursor MCP" from the dropdown in the Output panel to see MCP-specific logs.
Try manual installation: If npx fails, try the global installation method as an alternative:
npm install -g n8n-workflow-builder-mcp
Common Issues and Solutions
"Failed to create client" or "Module not found"
This usually happens when:
Internet connection issues prevent npx from downloading the package
Node.js/npm version compatibility issues
Cursor MCP service is not running properly
Try:
Check your internet connection
Update Node.js to the latest LTS version
Restart Cursor completely
Try the global installation method as fallback
MCP Server is not showing up in Cursor
This can happen if:
The
.cursor/mcp.jsonfile is not properly formattedCursor hasn't detected the configuration change
File permissions on the
.cursordirectory
Try:
Validating the JSON format of your
.cursor/mcp.jsonfileRestarting Cursor
Manually selecting the server in Cursor settings (if it appears there)
Check file permissions:
chmod 755 .cursor
MCP Server shows up but tools aren't available
This can happen if:
The server isn't properly registering its tools
Package installation is incomplete
Version compatibility issues
Try:
Check the package was downloaded correctly by npx
Clicking the refresh button in the MCP server settings in Cursor
Try clearing npm cache:
npm cache clean --forceUse the development installation method for debugging
Project Structure
/src: Main source code/src/tools: MCP tools implementation/src/models: Data models/src/utils: Utility functions/src/middleware: Authentication and middleware/config: Configuration files/tests: Test files/workflow_nodes: n8n node definitions/docs: Additional documentation
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
MIT License