Control n8n Workflows with Natural Language
An MCP server for n8n - create, run, activate, and monitor workflows and executions, including webhook-triggered runs, conversationally.
Maintainer of this project? Claim this page to edit the listing.
0.1.8Add to Favorites
Why it matters
Enable AI assistants to programmatically manage and execute n8n workflows using natural language commands. This asset bridges the gap between AI's conversational capabilities and n8n's powerful automation engine.
Outcomes
What it gets done
List, create, update, and delete n8n workflows via AI.
Trigger workflow executions and monitor their status.
Activate and deactivate workflows using natural language.
Execute workflows via API calls or webhooks.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-n8n | bash Capabilities
Tools your agent gets
Get a list of all workflows
Get details of a specific workflow
Create a new workflow
Update an existing workflow
Delete a workflow
Activate a workflow
Deactivate a workflow
Execute a workflow via API
Overview
n8n MCP Server
This MCP server exposes 12 tools for n8n: full workflow CRUD and activation control, plus execution management including API-triggered and webhook-triggered runs, alongside four read resources for workflows and executions. Use it when an AI assistant needs to manage or run n8n workflows conversationally. Requires an n8n instance with API access enabled and a valid API key.
What it does
An MCP server bridging AI assistants to n8n workflow automation, exposing full workflow and execution management. Workflow tools cover workflow_list, workflow_get, workflow_create, workflow_update, workflow_delete, workflow_activate, and workflow_deactivate. Execution tools cover execution_run (via the API), run_webhook (triggering a webhook-based workflow by name, such as calling <n8n-url>/webhook/hello-world with a data payload), execution_get, execution_list, and execution_stop. Webhook authentication is handled automatically using the N8N_WEBHOOK_USERNAME and N8N_WEBHOOK_PASSWORD environment variables, so the AI assistant only needs to pass the workflow name and payload. It also exposes four read-only resources: n8n://workflows/list, n8n://workflow/{id}, n8n://executions/{workflowId}, and n8n://execution/{id}.
When to use - and when NOT to
Use it when an AI assistant needs to create, inspect, activate or deactivate, run, or monitor n8n workflows via natural language. It requires an n8n instance with API access enabled and an API key generated under Settings > API > API Keys in the n8n UI. Webhook-triggered execution additionally requires a webhook node configured with Basic Authentication. It is not usable for automation platforms other than n8n.
Capabilities
Seven workflow-management tools (list, get, create, update, delete, activate, deactivate) plus five execution-management tools (run via API, run via webhook, get, list, and stop executions), and four read resources covering workflows and their executions.
How to install
npm install -g @leonardsellem/n8n-mcp-server
Or build from source (git clone, npm install, npm run build), or run via Docker:
docker run -e N8N_API_URL=http://your-n8n:5678/api/v1 -e N8N_API_KEY=your_n8n_api_key -e N8N_WEBHOOK_USERNAME=username -e N8N_WEBHOOK_PASSWORD=password leonardsellem/n8n-mcp-server
Configure via a .env file (copied from .env.example): N8N_API_URL including /api/v1, N8N_API_KEY, N8N_WEBHOOK_USERNAME and N8N_WEBHOOK_PASSWORD if using webhooks, and an optional DEBUG flag for logging. An AI client config for Claude Desktop or VS Code points node at the built build/index.js file, using its absolute path, with these environment variables set and autoApprove/disabled fields controlling how the client treats the server. Requires Node.js 20 or later and an n8n instance with API access enabled. Updating depends on the install method: a global npm install is updated with npm install -g @leonardsellem/n8n-mcp-server@latest, a source install is updated with git pull, npm install, and npm run build, and a Docker deployment is updated by pulling the latest image and recreating the container with the same environment variables.
Who it's for
Teams automating workflows in n8n who want an AI assistant to create, run, monitor, and trigger those workflows conversationally instead of switching to the n8n UI - a community-maintained, MIT-licensed project that is actively looking for co-maintainers to help it grow.
Source README
n8n MCP Server
A Model Context Protocol (MCP) server that allows AI assistants to interact with n8n workflows through natural language.
Overview
This project provides a Model Context Protocol (MCP) server that empowers AI assistants to seamlessly interact with n8n, a popular workflow automation tool. It acts as a bridge, enabling AI assistants to programmatically manage and control n8n workflows and executions using natural language commands.
Installation
Prerequisites
- Node.js 20 or later
- n8n instance with API access enabled
Install from npm
npm install -g @leonardsellem/n8n-mcp-server
Install from source
# Clone the repository
git clone https://github.com/leonardsellem/n8n-mcp-server.git
cd n8n-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Optional: Install globally
npm install -g .
Docker Installation
You can also run the server using Docker:
# Pull the image
docker pull leonardsellem/n8n-mcp-server
# Run the container with your n8n API configuration
docker run -e N8N_API_URL=http://your-n8n:5678/api/v1 \
-e N8N_API_KEY=your_n8n_api_key \
-e N8N_WEBHOOK_USERNAME=username \
-e N8N_WEBHOOK_PASSWORD=password \
leonardsellem/n8n-mcp-server
Updating the Server
How you update the server depends on how you initially installed it.
1. Installed globally via npm
If you installed the server using npm install -g @leonardsellem/n8n-mcp-server:
- Open your terminal or command prompt.
- Run the following command to get the latest version:
npm install -g @leonardsellem/n8n-mcp-server@latest - If the server is currently running (e.g., as a background process or service), you'll need to restart it for the changes to take effect.
2. Installed from source
If you cloned the repository and installed from source:
- Open your terminal or command prompt.
- Navigate to the directory where you cloned the project:
cd path/to/n8n-mcp-server - If you've made any local changes to the code that you want to keep, consider stashing them (optional):
You can apply them later withgit stashgit stash pop. - Pull the latest changes from the repository (assuming you are on the
mainbranch):
If you are on a different branch, replacegit pull origin mainmainwith your branch name. - Install or update any changed dependencies:
npm install - Rebuild the project to include the latest updates:
npm run build - If you previously installed it globally from this source folder using
npm install -g ., you might want to run this command again to update the global link:npm install -g . - Restart the server.
- If you run the server directly using a command like
node build/index.jsin your AI assistant's MCP configuration, ensure the path is still correct. Usingnpm install -g .and thenn8n-mcp-serveras the command should keep this consistent.
- If you run the server directly using a command like
3. Using Docker
If you are running the server using Docker:
- Pull the latest image from Docker Hub:
docker pull leonardsellem/n8n-mcp-server:latest - Stop and remove your old container. You'll need your container's name or ID (you can find it using
docker ps):docker stop <your_container_name_or_id> docker rm <your_container_name_or_id> - Start a new container with the updated image. Use the same
docker runcommand you used previously, including all your necessary environment variables (refer to the "Docker Installation" section for an example command). For instance:
Ensure you usedocker run -e N8N_API_URL=http://your-n8n:5678/api/v1 \ -e N8N_API_KEY=your_n8n_api_key \ -e N8N_WEBHOOK_USERNAME=username \ -e N8N_WEBHOOK_PASSWORD=password \ leonardsellem/n8n-mcp-server:latest:latestor the specific version tag you intend to run.
Configuration
Create a .env file in the directory where you'll run the server, using .env.example as a template:
cp .env.example .env
Configure the following environment variables:
| Variable | Description | Example |
|---|---|---|
N8N_API_URL |
Full URL of the n8n API, including /api/v1 |
http://localhost:5678/api/v1 |
N8N_API_KEY |
API key for authenticating with n8n | n8n_api_... |
N8N_WEBHOOK_USERNAME |
Username for webhook authentication (if using webhooks) | username |
N8N_WEBHOOK_PASSWORD |
Password for webhook authentication | password |
DEBUG |
Enable debug logging (optional) | true or false |
Generating an n8n API Key
- Open your n8n instance in a browser
- Go to Settings > API > API Keys
- Create a new API key with appropriate permissions
- Copy the key to your
.envfile
Usage
Running the Server
From the installation directory:
n8n-mcp-server
Or if installed globally:
n8n-mcp-server
Integrating with AI Assistants
After building the server (npm run build), you need to configure your AI assistant (like VS Code with the Claude extension or the Claude Desktop app) to run it. This typically involves editing a JSON configuration file.
Example Configuration (e.g., in VS Code settings.json or Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
// Give your server a unique name
"n8n-local": {
// Use 'node' to execute the built JavaScript file
"command": "node",
// Provide the *absolute path* to the built index.js file
"args": [
"/path/to/your/cloned/n8n-mcp-server/build/index.js"
// On Windows, use double backslashes:
// "C:\\path\\to\\your\\cloned\\n8n-mcp-server\\build\\index.js"
],
// Environment variables needed by the server
"env": {
"N8N_API_URL": "http://your-n8n-instance:5678/api/v1", // Replace with your n8n URL
"N8N_API_KEY": "YOUR_N8N_API_KEY", // Replace with your key
// Add webhook credentials only if you plan to use webhook tools
// "N8N_WEBHOOK_USERNAME": "your_webhook_user",
// "N8N_WEBHOOK_PASSWORD": "your_webhook_password"
},
// Ensure the server is enabled
"disabled": false,
// Default autoApprove settings
"autoApprove": []
}
// ... other servers might be configured here
}
}
Key Points:
- Replace
/path/to/your/cloned/n8n-mcp-server/with the actual absolute path where you cloned and built the repository. - Use the correct path separator for your operating system (forward slashes
/for macOS/Linux, double backslashes\\for Windows). - Ensure you provide the correct
N8N_API_URL(including/api/v1) andN8N_API_KEY. - The server needs to be built (
npm run build) before the assistant can run thebuild/index.jsfile.
Available Tools
The server provides the following tools:
Using Webhooks
This MCP server supports executing workflows through n8n webhooks. To use this functionality:
- Create a webhook-triggered workflow in n8n.
- Set up Basic Authentication on your webhook node.
- Use the
run_webhooktool to trigger the workflow, passing just the workflow name.
Example:
const result = await useRunWebhook({
workflowName: "hello-world", // Will call <n8n-url>/webhook/hello-world
data: {
prompt: "Hello from AI assistant!"
}
});
The webhook authentication is handled automatically using the N8N_WEBHOOK_USERNAME and N8N_WEBHOOK_PASSWORD environment variables.
Workflow Management
workflow_list: List all workflowsworkflow_get: Get details of a specific workflowworkflow_create: Create a new workflowworkflow_update: Update an existing workflowworkflow_delete: Delete a workflowworkflow_activate: Activate a workflowworkflow_deactivate: Deactivate a workflow
Execution Management
execution_run: Execute a workflow via the APIrun_webhook: Execute a workflow via a webhookexecution_get: Get details of a specific executionexecution_list: List executions for a workflowexecution_stop: Stop a running execution
Resources
The server provides the following resources:
n8n://workflows/list: List of all workflowsn8n://workflow/{id}: Details of a specific workflown8n://executions/{workflowId}: List of executions for a workflown8n://execution/{id}: Details of a specific execution
Roadmap
The n8n MCP Server is a community-driven project, and its future direction will be shaped by your feedback and contributions!
Currently, our roadmap is flexible and under continuous development. We believe in evolving the server based on the needs and ideas of our users.
We encourage you to get involved in shaping the future of this tool:
- Suggest Features: Have an idea for a new tool, resource, or improvement?
- Discuss Priorities: Want to weigh in on what we should focus on next?
Please share your thoughts, feature requests, and ideas by opening an issue on our GitHub Issues page. Let's build a powerful tool for AI assistants together!
Development
Building
npm run build
Running in Development Mode
npm run dev
Testing
npm test
Linting
npm run lint
🚀 Join Our Team: Call for Co-Maintainers!
This project is a vibrant, community-driven tool actively used by AI enthusiasts and developers. Currently, it's maintained on a part-time basis by a passionate individual who isn't a seasoned engineer but is dedicated to bridging AI with workflow automation. To help this project flourish, ensure its long-term health, and keep up with its growing user base, we're looking for enthusiastic co-maintainers to join the team!
Why Contribute?
- Learn and Grow: Sharpen your skills in areas like TypeScript, Node.js, API integration, and AI tool development.
- Collaborate: Work alongside other motivated developers and AI users.
- Make an Impact: Directly shape the future of this project and help build a valuable tool for the AI community.
- Open Source: Gain experience contributing to an open-source project.
How You Can Help
We welcome contributions in many forms! Here are some areas where you could make a big difference:
- Bug Fixing: Help us identify and squash bugs to improve stability.
- Feature Development: Implement new tools and functionalities based on user needs and your ideas.
- Documentation: Improve our guides, examples, and API references to make the project more accessible.
- Testing: Enhance our test suite (unit, integration) to ensure code quality and reliability.
- CI/CD: Help streamline our development and deployment pipelines.
- Code Reviews: Provide feedback on pull requests and help maintain code standards.
- Community Support: Assist users with questions and help manage discussions.
Get Involved!
If you're excited about the intersection of AI and workflow automation, and you're looking for a rewarding open-source opportunity, we'd love to hear from you!
Ready to contribute?
- Check out our GitHub Issues page to find existing tasks, suggest new ideas, or express your interest in becoming a co-maintainer.
- You can open an issue titled "Co-maintainer Application" to formally apply, or simply start contributing to existing issues.
- Alternatively, feel free to reach out to the existing maintainers if you have questions.
Let’s build the future of AI-powered workflow automation together! 🙌
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.