n
n8n
community
ai
This MCP server provides tools and resources for AI assistants to manage n8n workflows and executions, including listing, creating, updating, and deleting workflows, as well as monitoring their execution status.
n8n MCP Server
A Model Context Protocol (MCP) server that allows AI assistants to interact with n8n workflows through natural language.
Overview
This MCP server provides tools and resources for AI assistants to manage n8n workflows and executions. It allows assistants to:
- List, create, update, and delete workflows
- Activate and deactivate workflows
- Execute workflows and monitor their status
- Access workflow information and execution statistics
Installation
Prerequisites
- Node.js 18 or later
- n8n instance with API access enabled
Install from npm
npm install -g 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 .
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 |
---|---|---|
| Full URL of the n8n API, including
|
|
| API key for authenticating with n8n |
|
| Username for webhook authentication (if using webhooks) |
|
| Password for webhook authentication |
|
| Enable debug logging (optional) | or
|
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
file.env
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
with the actual absolute path where you cloned and built the repository./path/to/your/cloned/n8n-mcp-server/
- Use the correct path separator for your operating system (forward slashes
for macOS/Linux, double backslashes/
for Windows).\\
- Ensure you provide the correct
(includingN8N_API_URL
) and/api/v1
.N8N_API_KEY
- The server needs to be built (
) before the assistant can run thenpm run build
file.build/index.js
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
tool to trigger the workflow, passing just the workflow name.run_webhook
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
: List all workflowsworkflow_list
: Get details of a specific workflowworkflow_get
: Create a new workflowworkflow_create
: Update an existing workflowworkflow_update
: Delete a workflowworkflow_delete
: Activate a workflowworkflow_activate
: Deactivate a workflowworkflow_deactivate
Execution Management
: Execute a workflow via the APIexecution_run
: Execute a workflow via a webhookrun_webhook
: Get details of a specific executionexecution_get
: List executions for a workflowexecution_list
: Stop a running executionexecution_stop
Resources
The server provides the following resources:
: List of all workflowsn8n://workflows/list
: Details of a specific workflown8n://workflow/{id}
: List of executions for a workflown8n://executions/{workflowId}
: Details of a specific executionn8n://execution/{id}
Development
Building
npm run build
Running in Development Mode
npm run dev
Testing
npm test
Linting
npm run lint
License
MIT
Related Servers

AgentQL
official
Enable AI agents to get structured data from unstructured web with [AgentQL](https://www.agentql.com/).
View Details
BICScan
official
Risk score / asset holdings of EVM blockchain address (EOA, CA, ENS) and even domain names.
View DetailsChronulus AI
official
Predict anything with Chronulus AI forecasting and prediction agents.
View Details