Operate and build n8n: 61 tools, 560-node catalog, validation, autofix, snapshots and backups.
Operate and build n8n from Cursor or Claude β administration of your instance (users, projects, executions, audit) and a full builder loop: a catalog of 560 nodes with real parameter schemas extracted from the official n8n packages, validation before saving, automatic repair, snapshots with rollback and diff, per-node execution debugging, health reports, and full-instance backup.
Two env vars. Runs on your machine (stdio) or as a remote HTTP server. No hosted account.
This server is optimized to minimize token consumption, addressing one of the biggest issues with MCP servers - excessive API token usage.
n8n_list_workflows_summary endpointSee TOKEN_OPTIMIZATION.md for detailed usage guide.
n8n-nodes-base and @n8n/n8n-nodes-langchain (parameters with types, allowed options, display conditions, credentials, latest typeVersion), regenerated weekly by CI. Search with n8n_search_nodes, inspect with n8n_get_noden8n_validate_workflow checks against the real schemas β nonexistent node types, missing required params (including conditionally required ones), invalid option values, wrong typeVersion, broken connections β before save/activate{{ }} expressions missing the = prefix and references to nodes that don't exist in the workflown8n_autofix_workflow fixes missing typeVersion/positions, duplicate names, dangling connections and expression prefixes β preview first, apply with a snapshotn8n_update_workflow_partial adds/removes nodes and connections without rewriting the whole flown8n_search_public_templates, n8n_import_public_template) plus 100 bundled templates as a fallbackbuild-workflow and fix-workflow walk any agent through the full build/validate/test/repair loopn8n_get_node_execution_data shows exactly what data flowed through one node (status, item counts, output samples, error details) without downloading the whole executionn8n_debug_last_error returns the failing node and message from the last errorn8n_workflow_health computes success rate, failure count, average duration and last failure per workflow from recent executions, sorted worst-first~/.mcp-n8n/snapshots, configurable with N8N_SNAPSHOT_DIR)n8n_rollback_workflow restores any snapshot β even recreates a deleted workflow (recreate=true)n8n_diff_workflow_snapshot compares a snapshot against the current state (nodes added/removed/modified, changed parameters, connection changes) before deciding to roll backn8n_export_all_workflows saves every workflow as JSON files; n8n_import_workflows restores themn8n_trigger_webhook calls a Webhook-trigger workflow on the instance and returns the real HTTP response, so the agent can verify the flow actually worksThis is the easiest way to get started:
npm install -g mcp-n8n
Get your n8n API credentials:
Configure Claude Desktop:
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Option A - Using global installation (if you ran npm install -g mcp-n8n):
{
"mcpServers": {
"n8n": {
"command": "mcp-n8n",
"env": {
"N8N_BASE_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here",
"N8N_TOOLSETS": "all"
}
}
}
}
N8N_TOOLSETS is optional (all by default). Use core,builder if you want operations + creation without user/project admin tools. Use admin only for instance administration.
By default the server communicates over stdio (local). To run it as a shared remote server (e.g. in Docker or on a VPS), set a port:
N8N_BASE_URL=https://your-n8n-instance.com \
N8N_API_KEY=your-api-key \
N8N_MCP_HTTP_PORT=3000 \
N8N_MCP_HTTP_TOKEN=some-strong-secret \
mcp-n8n
This exposes the MCP protocol over streamable HTTP on port 3000 plus a GET /health endpoint. N8N_MCP_HTTP_TOKEN is strongly recommended: when set, every request must include Authorization: Bearer <token>. Point any MCP client that supports streamable HTTP at http://your-host:3000 with that header.
Option B - Using npx (no installation needed, always latest version):
{
"mcpServers": {
"n8n": {
"command": "npx",
"args": ["-y", "mcp-n8n"],
"env": {
"N8N_BASE_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}
Add to Cursor MCP settings (Settings β Extensions β MCP):
Recommended - Using npx (always uses latest version):
{
"mcpServers": {
"n8n": {
"command": "npx",
"args": ["-y", "mcp-n8n"],
"env": {
"N8N_BASE_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}
Note: Cursor requires using
npxfor MCP servers. The-yflag automatically installs/updates the package without prompting.
Option C - Docker:
docker build -t mcp-n8n .
{
"mcpServers": {
"n8n": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "N8N_BASE_URL", "-e", "N8N_API_KEY",
"-v", "mcp-n8n-data:/data",
"mcp-n8n"
],
"env": {
"N8N_BASE_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}
The /data volume persists workflow snapshots between runs.
Once configured, interact with n8n using natural language:
"Create a workflow that monitors my Gmail inbox and sends
Slack notifications for important emails"
"Build a daily report workflow that pulls data from my database,
generates charts, and emails them to my team"
"I need a WhatsApp chatbot with AI for customer support"
β Automatically creates workflow from "WhatsApp AI Response Bot" template
"Create an automated stock analysis workflow"
β Uses "Automated Stock Analysis with GPT-4" template
"Show me all active workflows in the production project"
β Uses n8n_list_workflows_summary for efficient token usage
"Show me the details of workflow abc123"
β Uses n8n_get_workflow to fetch complete details only when needed
"Deactivate the 'Daily Backup' workflow"
"What went wrong with execution abc123?"
"Show me the last 10 failed executions"
"Retry all failed executions from workflow xyz456"
"Delete all successful executions older than 30 days"
n8n_create_workflow - Create new workflows (validate first)n8n_list_workflows_summary - Token-efficient listingn8n_list_workflows - Full details with optional field filteringn8n_get_workflow - Full workflow JSONn8n_update_workflow - Replace fields (omitted fields keep current values)n8n_update_workflow_partial - Surgical edits: add/remove nodes and connectionsn8n_delete_workflow - Remove workflows permanentlyn8n_activate_workflow / n8n_deactivate_workflown8n_transfer_workflow / tags toolsn8n_list_workflow_snapshots - Local history of every change made through this servern8n_rollback_workflow - Restore a previous version, or recreate a deleted workflown8n_diff_workflow_snapshot - Compare a snapshot against the current state before rolling backn8n_trigger_webhook - Call a webhook workflow and get the real responsen8n_export_all_workflows / n8n_import_workflows - Full-instance backup and restoren8n_search_nodes / n8n_get_node - Full catalog: 560 nodes with real parameter schemasn8n_validate_workflow - Check JSON against real schemas before save/activaten8n_autofix_workflow - Mechanical repairs: typeVersion, positions, duplicates, dangling connections, expression prefixesn8n_search_public_templates / n8n_import_public_template - Official n8n.io libraryn8n_list_workflow_templates / n8n_get_workflow_template / n8n_create_workflow_from_template - Bundled templates100 Included Templates across 13 categories:
n8n_list_executions - Filter by status, workflow, projectn8n_get_execution - Detailed execution datan8n_delete_execution - Remove execution recordsn8n_retry_execution - Retry failed executionsn8n_debug_last_error - Failing node + message from the last errorn8n_get_node_execution_data - Data that flowed through one specific noden8n_workflow_health - Success rate, failures and duration per workflown8n_create_credential - Add new credentialsn8n_delete_credential - Remove credentials (owner only)n8n_get_credential_schema - Discover required fieldsn8n_transfer_credential - Move between projectsTags: Create, list, get, update, delete Variables: Create, list, update, delete Users: List, create, get, delete, change role Projects: Create, list, update, delete, manage users
n8n_generate_audit - Security audit reportsn8n_pull_source_control - Version control integration61 tools by default (N8N_TOOLSETS=all). core,builder exposes 28. Plus 2 MCP prompts (build-workflow, fix-workflow).
mcp-n8n/
βββ src/
β βββ index.ts # MCP server implementation
β βββ n8n-client.ts # n8n API client
β βββ types.ts # TypeScript definitions
βββ examples/
β βββ templates-metadata.json
β βββ *.json # Pre-built workflow templates
βββ dist/ # Compiled output
βββ QUICKSTART.md # Quick start guide
βββ EXAMPLES.md # Usage examples
βββ NODE_REFERENCE.md # API documentation
βββ package.json
If you want to contribute or test local changes:
# Clone repository
git clone https://github.com/leonardosepulvedat/mcp-n8n.git
cd mcp-n8n
# Install dependencies
npm install
# Build
npm run build
# Development with auto-rebuild
npm run watch
For Claude Desktop, add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"n8n": {
"command": "node",
"args": ["/absolute/path/to/mcp-n8n/dist/index.js"],
"env": {
"N8N_BASE_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}
For Cursor, add to MCP settings:
{
"mcpServers": {
"n8n": {
"command": "node",
"args": ["/absolute/path/to/mcp-n8n/dist/index.js"],
"env": {
"N8N_BASE_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}
Important: Replace /absolute/path/to/mcp-n8n/ with the actual absolute path to your cloned repository (e.g., /Users/yourname/projects/mcp-n8n/).
# Set environment variables
cp .env.example .env
# Edit .env with your credentials
# Build and test
npm run build
node dist/index.js
To run the main script, execute:
python main.py
To run the tests, execute:
pytest test_main.py
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
.env files with credentialsProblem: "Cannot connect to n8n API"
N8N_BASE_URL is correct and accessibleProblem: "Insufficient permissions"
Problem: "Template not found"
examples/ directory is presenttemplates-metadata.json existsSource-derived launch command. Check the maintainerβs required arguments and credentials before running:
npx -y mcp-n8nMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-leonardosepulvedat-mcp-n8n": {
"command": "npx",
"args": [
"-y",
"mcp-n8n"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the clientβs tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.leonardosepulvedat/mcp-n8n works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.