n8n MCP Agent
You can use this MCP server to connect to n8n and automate or inspect workflows, executions, credentials, users, projects, variables, tags, templates, and instance health from an AI client.
Initialize an n8n connection using URL and API key, then pass the returned clientId to tools.
Create, list, get, update, delete, activate, and deactivate workflows.
Extract webhook URLs, execute webhooks, and test workflows with automatic trigger detection.
List, get, and delete executions with filters and optional execution data.
Create, delete, and inspect credential schemas; list credentials via n8n login/session cookie.
Manage tags and workflow-tag assignments.
Manage users, plus Enterprise projects and variables when enabled.
Generate n8n security audits.
Search and retrieve 4343+ workflow templates, categories, stats, and integrations.
Run diagnostics, analyze logs for known error patterns, and perform health checks.
Supports credential creation for Airtable, allowing n8n workflows to manage Airtable bases.
Enables credential creation for GitHub, allowing n8n workflows to interact with GitHub.
Supports credential creation for Google services, enabling n8n workflows to use Google APIs.
Supports credential creation for MySQL, allowing n8n workflows to execute database queries.
Provides comprehensive tools for managing n8n instances, including workflows, executions, credentials, tags, and variables.
Enables credential creation for Notion, allowing n8n workflows to interact with Notion.
Supports credential creation for OpenAI, allowing n8n workflows to use OpenAI APIs.
Provides access to Shopify workflow templates, enabling e-commerce automation.
Enables credential creation for Slack, allowing n8n workflows to interact with Slack.
Allows credential creation for Telegram, enabling n8n workflows to send and receive messages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@n8n MCP Agent list my recent workflows"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
n8n MCP Agent
Autonomous AI agent for n8n workflow automation with credential factories, execution helpers, 4343+ workflow templates, and specialized sub-agents.
Features
38 MCP Tools - Full n8n API coverage for workflows, executions, credentials, tags, variables, and more
4343+ Workflow Templates - Access to Zie619 database with 268 integrations across 16 categories
Credential Factories - Type-safe factories for Google, Postgres, Slack, Telegram, OpenAI, GitHub, and more
Execution Helpers - Wait for completion, extract output data, get errors, batch operations
Workflow Helpers - Webhook URL extraction, duplication with credential stripping, node management
Auto-Connect - Automatic connection from environment variables (N8N_URL, N8N_API_KEY)
TypeScript First - Built with TypeScript, well-tested with 205+ tests
Related MCP server: n8n-mcp
Installation
Get your n8n API Key
Log into your n8n instance
Click your user icon in the bottom left
Go to Settings
Select API
Click "Create API Key"
Copy your API key (you will not be able to see it again)
Install from npm
npm install -g @anatolykoptev/n8n-mcp-agentInstall from Source
git clone https://github.com/anatolykoptev/n8n-mcp-agent.git
cd n8n-mcp-agent
npm install
npm run buildConfiguration
Claude Desktop
Open your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.jsonAdd the n8n configuration:
{
"mcpServers": {
"n8n": {
"command": "n8n-mcp-agent",
"env": {
"N8N_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}Cline (VS Code)
Open VS Code
Open the Cline extension from the left sidebar
Click the "MCP Servers" icon at the top of the pane
Scroll to bottom and click "Configure MCP Servers"
Add to the opened settings file:
{
"mcpServers": {
"n8n": {
"command": "n8n-mcp-agent",
"env": {
"N8N_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}Environment Variables
The server auto-connects when these environment variables are set:
Variable | Description |
| Your n8n instance URL (e.g., |
| Your n8n API key |
Optional flags choose which tools are registered. With none set, the 35 core tools are available; the Enterprise and user-management tools are off by default.
Variable | Effect when |
| enable the project and variable tools (n8n Enterprise) |
| enable the user-management tools |
| enable every tool (46 in total) |
MCP Tools
Workflow Management (8 tools)
init-n8n- Initialize connection to n8n instancelist-workflows- List all workflowsget-workflow- Get workflow by IDcreate-workflow- Create new workflowupdate-workflow- Update existing workflowdelete-workflow- Delete workflowactivate-workflow- Activate workflowdeactivate-workflow- Deactivate workflow
Execution Management (3 tools)
list-executions- List executions with filtersget-execution- Get execution by IDdelete-execution- Delete execution
Credential Management (3 tools)
create-credential- Create credentialdelete-credential- Delete credentialget-credential-schema- Get schema for credential type
Tag Management (7 tools)
list-tags- List all tagscreate-tag- Create new tagget-tag- Get tag by IDupdate-tag- Update tag namedelete-tag- Delete tagget-workflow-tags- Get tags for workflowupdate-workflow-tags- Update workflow tags
User Management (4 tools)
list-users- List all userscreate-users- Create usersget-user- Get user by ID or emaildelete-user- Delete user
Project Management (4 tools, Enterprise)
list-projects- List all projectscreate-project- Create projectupdate-project- Update projectdelete-project- Delete project
Variable Management (3 tools, Enterprise)
list-variables- List all variablescreate-variable- Create variabledelete-variable- Delete variable
Security (1 tool)
generate-audit- Generate security audit
Workflow Templates (5 tools)
n8n-patterns-stats- Get database statisticsn8n-patterns-search- Search templatesn8n-patterns-get- Get template by IDn8n-patterns-categories- List categoriesn8n-patterns-integrations- List top integrations
Credential Factories
Type-safe factory methods for creating credentials programmatically:
// Available factories
createGoogleServiceAccount(name, email, privateKey)
createPostgres(name, host, database, user, password, port?, ssl?)
createHttpBasic(name, username, password)
createApiKey(name, apiKey, headerName?)
createSlack(name, accessToken)
createTelegram(name, accessToken)
createOpenAI(name, apiKey)
createAirtable(name, apiKey)
createNotion(name, apiKey)
createGitHub(name, accessToken)
createSmtp(name, host, port, user, password, secure?)
createMySql(name, host, database, user, password, port?)Execution Helpers
Advanced execution monitoring and data extraction:
// Wait for execution to complete with polling
waitForCompletion(executionId, timeout?, pollInterval?)
// Extract output data from execution
getOutput(executionId)
// Get error message from failed execution
getError(executionId)
// Check if execution is running
isRunning(executionId)
// List failed executions
listFailed(workflowId?, limit?)
// List running executions
listRunning(workflowId?, limit?)
// Delete multiple executions
deleteMany({ workflowId?, status?, limit? })Workflow Helpers
Advanced workflow manipulation:
// Extract webhook URL from workflow
getWebhookUrl(workflowId)
// Duplicate workflow with credential stripping
duplicate(sourceId, newName, stripCredentials?)
// Add node to existing workflow
addNode(workflowId, node)
// Create workflow with trigger
createWithTrigger(name, triggerType, triggerConfig?)
// Get workflow statistics
getStats(workflowId)Workflow Templates
Access 4343+ workflow templates from the Zie619 database:
268 integrations - Shopify, OpenAI, Slack, Telegram, GitHub, and more
16 categories - E-commerce, AI Agent Development, Marketing, CRM, and more
Complexity levels - Low, Medium, High
Trigger types - Manual, Webhook, Scheduled, Complex
Validation
After configuration:
Restart your LLM application
Ask: "List my n8n workflows"
You should see your workflows listed
If you get an error:
Check that your n8n instance is running
Verify your API key has correct permissions
Ensure N8N_URL has no trailing slash
Troubleshooting
Common Issues
"Client not initialized"
Check N8N_URL and N8N_API_KEY are set correctly
Ensure n8n instance is accessible
Verify API key permissions
"License required"
You are trying to use an Enterprise feature
Either upgrade to n8n Enterprise or use core features only
Connection Issues
Verify n8n instance is running
Check URL protocol (http/https)
Remove trailing slash from N8N_URL
Security Best Practices
API Key Management
Use minimal permissions necessary
Rotate keys regularly
Never commit keys to version control
Instance Access
Use HTTPS for production
Enable n8n authentication
Keep n8n updated
Development
npm install
npm run lint # tsc --noEmit
npm test # vitest run
npm run build # tsc, writes build/See CONTRIBUTING.md and DEVELOPMENT.md; all documents are listed in docs/INDEX.md.
Support
Author
Anatoly Koptev
License
Available Tools
46 toolsactivate-workflowB
Activate a workflow by ID. This will enable the workflow to run. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: id (required), clientId (required).
create-credentialA
Create a credential that can be used by nodes of the specified type. Use get-credential-schema first to see required fields.
Inputs: data (required), name (required), type (required), clientId (required).
create-projectB
Create a new project in n8n. NOTE: Requires n8n Enterprise license. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: name (required), clientId (required).
create-tagC
Create a new tag in your instance.
Inputs: name (required), clientId (required).
create-usersB
Create one or more users in your instance.
Inputs: users (required), clientId (required).
create-variableB
Create a new variable in n8n. Variables can be used across workflows. NOTE: Requires n8n Enterprise license. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: key (required), value (required), clientId (required).
create-workflowA
Create a new workflow in n8n. Must provide full workflow structure including nodes and connections arrays, even if empty. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: name (required), clientId (required), nodes, connections.
deactivate-workflowA
Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: id (required), clientId (required).
delete-credentialB
Delete a credential by ID. You must be the owner of the credentials.
Inputs: id (required), clientId (required).
delete-executionB
Delete a specific execution by ID.
Inputs: id (required), clientId (required).
delete-projectA
Delete a project by ID. NOTE: Requires n8n Enterprise license. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required), projectId (required).
delete-tagC
Delete a tag by ID.
Inputs: id (required), clientId (required).
delete-userB
Delete a user from your instance.
Inputs: clientId (required), idOrEmail (required).
delete-variableB
Delete a variable by ID. NOTE: Requires n8n Enterprise license. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: id (required), clientId (required).
delete-workflowA
Delete a workflow by ID. This action cannot be undone. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: id (required), clientId (required).
execute-webhookA
Execute a workflow via its webhook URL. Workflow must have a Webhook trigger node and be active. Returns the workflow response. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required), webhookPath (required), data, method, +2 more.
generate-auditC
Generate a security audit for your n8n instance.
Inputs: clientId (required), categories, daysAbandonedWorkflow.
get-credential-schemaA
Show credential data schema for a specific credential type.
Inputs: clientId (required), credentialTypeName (required).
get-executionB
Retrieve a specific execution by ID.
Inputs: id (required), clientId (required), includeData.
get-tagA
Retrieve a specific tag by ID.
Inputs: id (required), clientId (required).
get-userA
Get user by ID or email address.
Inputs: clientId (required), idOrEmail (required).
get-webhook-urlA
Get the webhook URL for a workflow. Extracts webhook path from workflow nodes. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: id (required), clientId (required).
get-workflowA
Retrieve a workflow by ID. Use after list-workflows to get detailed information about a specific workflow. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: id (required), clientId (required).
get-workflow-tagsB
Get tags associated with a workflow.
Inputs: clientId (required), workflowId (required).
init-n8nA
Initialize connection to n8n instance. Use this tool whenever an n8n URL and API key are shared to establish the connection. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: url (required), apiKey (required).
list-credentialsA
List all credentials via REST API. Requires sessionCookie from n8n-login. Returns full credential list with type, name, and usage info.
Inputs: clientId (required), sessionCookie (required), includeScopes.
list-executionsC
Retrieve all executions from your instance with optional filtering.
Inputs: clientId (required), limit, status, workflowId, +1 more.
list-projectsB
List all projects from n8n. NOTE: Requires n8n Enterprise license. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required).
list-tagsB
Retrieve all tags from your instance.
Inputs: clientId (required), limit.
list-usersA
Retrieve all users from your instance. Only available for the instance owner.
Inputs: clientId (required).
list-variablesB
List all variables from n8n. NOTE: Requires n8n Enterprise license. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required).
list-workflowsA
List all workflows from n8n. Use after init-n8n to see available workflows. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required).
n8n-analyze-logsB
Analyze n8n logs for known error patterns. Returns categorized issues with suggested actions. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: logs (required), clientId (required), service, filterBotScans.
n8n-diagnoseC
Run comprehensive n8n diagnostics. Checks container status, analyzes logs for errors, provides actionable fixes. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required), verbose, logLines, includeExecutions.
n8n-health-checkB
Quick health check of n8n instance. Returns healthy/unhealthy status with details. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required), timeout.
n8n-loginA
Login to n8n using email/password. Returns session cookie for REST API operations (e.g., list-credentials). Required because some endpoints are not available in Public API.
Inputs: email (required), clientId (required), password (required).
n8n-patterns-categoriesA
List all workflow categories (16 total).
Inputs: no named parameters.
n8n-patterns-getA
Get full workflow JSON template by ID. Use this to fetch a template for deployment.
Inputs: workflow_id (required).
n8n-patterns-integrationsA
List top integrations by usage count.
Inputs: limit.
n8n-patterns-searchB
Search workflow templates from Zie619 database. Filter by query, category, integration, complexity, or trigger type.
Inputs: limit, query, category, complexity, +2 more.
n8n-patterns-statsA
Get Zie619 workflow database statistics (4343 workflows, 268 integrations, 16 categories).
Inputs: no named parameters.
test-workflowA
Universal workflow testing tool. Automatically detects trigger type and uses appropriate testing method:
Webhook trigger → direct webhook call
Execute Sub-workflow Trigger → via Test Runner workflow
Manual/Schedule Trigger → use autoConvert:true to add Execute Sub-workflow Trigger
Returns structured response with execution results and AI-friendly diagnosis for errors. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: clientId (required), workflowId (required), data, timeout, +2 more.
update-projectA
Update a project's name. NOTE: Requires n8n Enterprise license. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: name (required), clientId (required), projectId (required).
update-tagB
Update a tag's name.
Inputs: id (required), name (required), clientId (required).
update-workflowB
Update an existing workflow in n8n. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Inputs: id (required), clientId (required), workflow (required).
update-workflow-tagsB
Update tags associated with a workflow.
Inputs: tagIds (required), clientId (required), workflowId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 46 tools
Every tool has a clear, distinct purpose targeting specific resources (workflows, credentials, tags, users, etc.). Descriptions are detailed, preventing confusion even with many tools.
All tools follow a consistent verb_noun pattern (e.g., create-workflow, list-users, delete-credential). Even the n8n-* group is consistent within itself.
46 tools is excessive for a single server. While each tool is distinct, the count far exceeds typical well-scoped ranges (3-15), suggesting the surface should be split into smaller, focused servers.
The tool set covers CRUD for most resources (workflows, credentials, tags, users, variables) plus operations like activate, test, and execute. Minor gaps: missing update-credential and get-project.
Maintenance
Related MCP Connectors
AI automation platform (n8n/Zapier alternative): build, schedule and run workflows from your agent.
Automate 1,000+ services from any MCP-compatible AI agent: build Applets, run actions and queries.
Open-source Zapier/n8n alternative as an MCP server: agents build, run and debug your workflows.
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceProvides seamless integration between MCP-compatible AI assistants and n8n workflow automation, enabling intelligent management and automation of n8n workflows through natural language.5-
- AlicenseBqualityDmaintenanceA comprehensive MCP server that provides full control over n8n automation workflows through natural language. It offers 43 tools for managing workflows, executions, credentials, and data tables, with safety features like write-mode protection and double-validated workflow creation.431MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI models to manage workflows, credentials, nodes, templates, and monitor executions on the n8n automation platform through a standardized MCP interface.47,449 npmMIT
- FlicenseBqualityDmaintenanceA full-power MCP server for n8n that enables AI agents to create, read, update, delete, and test workflows and credentials, including webhook testing, validation, and backup/versioning.319-