n8n-workflow-builder
by: makafeli
MCP server for programmatically creating and managing n8n workflows
📌Overview
Purpose: The n8n Workflow Builder MCP Server aims to manage n8n workflows by providing comprehensive functionality for workflow-related operations.
Overview: This server enables users to efficiently list, create, update, delete, activate, and deactivate workflows within the n8n environment. It utilizes npm for package management and focuses on a streamlined installation and deployment process.
Key Features:
-
Workflow Management Tools: Offers commands to list all workflows, create new ones, retrieve specific workflows by ID, update them, delete them, and control their activation status.
-
Execution Management Tools: Facilitates oversight of workflow executions, providing options to list, retrieve, and delete execution details by ID.
n8n Workflow Builder MCP Server
This project provides an MCP server for managing n8n workflows. It offers functionality to list, create, update, delete, activate, and deactivate workflows through a set of defined tools.
Important:
This version exclusively supports npm for package management and running the server. (npx support will be reintroduced in a future update.)
Requirements
- Node.js (v14+ recommended)
- npm
Installation Guide
1. Clone the Repository
Clone the repository:
git clone https://github.com/makafeli/n8n-workflow-builder.git
Navigate to the project directory:
cd /root/n8n-workflow-builder
2. Install Dependencies
Use npm to install the dependencies:
npm install
3. Build and Start the Server
Build the project (compiles TypeScript files):
npm run build
Start the MCP Server:
npm start
The server will start and connect via stdio. Check the console for confirmation messages.
4. Deployment
For testing and deployment, use the above install, build, and start steps.
5. Configuration
Configure the server via the cline_mcp_settings.json
file. Ensure environment variables are set correctly:
N8N_HOST
: Your n8n API host URL.N8N_API_KEY
: Your n8n API key.
Example cline_mcp_settings.json
:
{
"n8n-workflow-builder": {
"command": "node",
"args": ["/root/n8n-workflow-builder/build/index.js"],
"env": {
"N8N_HOST": "https://n8n.io/api/v1/",
"N8N_API_KEY": "YOUR_N8N_API_KEY_HERE"
},
"disabled": false,
"alwaysAllow": [
"create_workflow",
"create_workflow_and_activate",
"update_workflow",
"activate_workflow",
"deactivate_workflow",
"get_workflow",
"delete_workflow"
],
"autoApprove": []
}
}
Available Features
MCP Tools
Workflow Management
- list_workflows: Lists all workflows from n8n.
- create_workflow: Creates a new workflow in n8n.
- get_workflow: Retrieves a workflow by its ID.
- update_workflow: Updates an existing workflow.
- delete_workflow: Deletes a workflow by its ID.
- activate_workflow: Activates a workflow by its ID.
- deactivate_workflow: Deactivates a workflow by its ID.
Execution Management
- list_executions: Lists all workflow executions with optional filters.
- get_execution: Retrieves details of a specific execution by its ID.
- delete_execution: Deletes an execution by its ID.
MCP Resources
Static Resources
- /workflows: List of all available workflows in the n8n instance
- /execution-stats: Summary statistics about workflow executions
Dynamic Resource Templates
- /workflows/{id}: Detailed information about a specific workflow
- /executions/{id}: Detailed information about a specific execution
Troubleshooting
- Ensure you are using npm (npx is unsupported in this version).
- If issues arise, clean and rebuild:
npm run clean && npm run build
- Verify environment variables in
cline_mcp_settings.json
.
Future Enhancements
- Reintroduction of npx support.
- Additional tools and workflow features.
- Improvements to deployment and scaling.
License
This project is licensed under the MIT License.