automatelab-n8n-mcp
This MCP server lets AI agents generate, inspect, lint, debug, and manage n8n workflows and executions.
Generate workflow JSON from plain-English descriptions, including AI Agent/LangChain sub-node connections.
Scaffold a TypeScript
INodeTypecustom node from a description.Lint workflows for deprecated nodes, broken connections, missing credentials/sub-nodes, IF v1, webhook issues, retry/sandbox/DST risks, and more.
Semantically diff two workflows for node, connection, settings, active, and name changes.
Explain failed executions per node, highlighting zero-item nodes, unresolved expressions, errors/hints, and token usage.
Build a self-contained replay workflow for one node, optionally using real execution/input items.
Render execution timelines with per-node start offset, duration, items in/out, and errors.
With
N8N_API_URL+N8N_API_KEY, list/get/create/activate workflows and list executions, optionally with full data.Apply runtime constraints: read-only mode, disabled tools, allowed workflow IDs, and allowed tags.
Provides tools for generating, linting, and debugging n8n workflows, as well as managing live n8n instances through REST API tools.
n8n-mcp
An MCP server for n8n that gives Claude, Cursor, and other AI agents tools for generating workflows, linting, diagnosing failed executions, and driving live n8n instances.
Why we built this
We use n8n daily inside AutomateLab and kept hitting the same LLM failures: workflow JSON that imports but fails at runtime, AI Agent clusters wired with the wrong connection types, executions that silently drop items with no clue where to look. Dumping the whole n8n catalog into context doesn't fix it - the failure modes are too subtle (typeVersion mismatches, IF v1 schema, credentials that don't survive import).
So we built a small, focused server: encode the failure modes the lint can catch, the cluster topology the generator must respect, and the diagnosis the agent can't do alone. For the historical launch walkthrough, covering the original nine tools with example output, see the launch post on automatelab.tech.
Related MCP server: Caipher MCP
Why it's different
Other n8n MCP servers (notably czlonkowski/n8n-mcp) compete on breadth - 20+ tools and an indexed corpus of every n8n node. They own that niche.
This server is the debugging-and-first-run-correctness MCP for n8n:
execution_explainis the wedge. Paste the execution JSON; get back per-node findings: which nodes returned 0 items, which had unresolved={{ ... }}expressions, error messages with concrete hints. No other MCP server does this well, and it hits the n8n community's #1 debugging pain point (silent data loss between nodes).workflow_generateis opinionated about AI Agent topology - emits proper LangChain clusters withai_languageModel/ai_memory/ai_toolconnections (sub-nodes connect upward to the agent, not viamain). Imports cleanly on n8n 1.x.workflow_lintcatches the silent failures: deprecated node types (Function → Code, spreadsheetFile → convertToFile), AI Agent missing language model, IF v1 schema, Webhook missing webhookId, broken connections across all connection types (not justmain).5 REST tools (gated on
N8N_API_URL+N8N_API_KEY) let you list, fetch, create, activate workflows and pull executions - so the lint and explain tools can run against your live workflows, not just JSON pasted in chat.
Plus: a paired Agent Skill that teaches the model when to use which tool and where to load deeper context (split into references/ so it doesn't bloat the prompt).
Tools
Tool names follow dot-notation and form a navigable tree: node.*, workflow.*, execution.*. Every tool declares an outputSchema (so callers can type-check responses) and MCP annotations (read-only / destructive / idempotent / open-world hints).
Stateless (work without a live n8n instance):
Tool | Purpose |
| Plain-English description → workflow JSON. Detects AI-agent intent. |
| Description → single |
| Workflow JSON → list of errors and warnings (20+ rules). |
| Two workflows → semantic diff (nodes added/removed/modified, connections, settings). |
| Failed execution JSON → per-node diagnosis with hints. |
| Workflow + node → self-contained replay workflow that exercises just that node. |
| Execution JSON → per-node timeline table (start, duration, items in/out, errors). |
Live-instance (require N8N_API_URL + N8N_API_KEY env vars):
Tool | Purpose |
| Paginate workflows; filter by active/tags/name. |
| Fetch a workflow by id. |
| POST a workflow. Strips read-only fields. |
| Flip active on/off. |
| Browse executions; pass |
v0.5.0 changes. Three new tools:
workflow_diff,execution_replay,execution_timeline. Lint expanded with 10 new rules (rate-limit, credential drift, expression staleness, code sandbox, webhook test path, manualTrigger-in-active, DST schedule risk, disabled-but-wired, empty Set, HTTP method/body mismatch). New runtime policy env vars:N8N_MCP_READ_ONLY,N8N_MCP_DISABLED_TOOLS,N8N_MCP_ALLOWED_WORKFLOW_IDS,N8N_MCP_ALLOWED_TAGS. DXT bundle + Dockerfile + Render/Railway/Fly deploy configs.
v0.4.0 breaking change. Tools were renamed from
n8n_*(snake_case) to dot-notation. Update any prompts, agent skills, or scripts that referenced the old names.
Runtime policy (v0.5+)
Constrain the server without forking. Set these env vars before launching:
Env var | Effect |
| Disables |
| Skip those tool registrations entirely. |
| REST tools refuse to touch any workflow outside the list. |
|
|
Useful when handing the MCP to a junior agent or wiring it behind a customer-facing assistant.
Deploy
Claude Desktop one-click: build the
.dxtbundle fromdxt/manifest.json(seedxt/README.md).Docker:
docker build -t n8n-mcp . && docker run --rm -i -e N8N_API_URL=... -e N8N_API_KEY=... n8n-mcp.Render: drop in
render.yamland click "New from Blueprint".Railway:
railway.toml—railway upin the repo root.Fly.io:
fly.toml—fly launch --copy-config.
Install
Requires Node 20 or later.
As a CLI tool
npm install -g @automatelab/n8n-mcpAs a GitHub Action
Use the n8n MCP GitHub Action to lint workflows, diagnose executions, and generate workflow JSON in your CI/CD pipeline:
- uses: ratamaha-git/n8n-mcp@v1
with:
command: 'lint'
workflow-json: ${{ env.WORKFLOW_JSON }}See ACTION.md and GITHUB-ACTION-SETUP.md for examples and publication details.
Configure your MCP host
Cursor (~/.cursor/mcp.json) or Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"n8n": {
"command": "npx",
"args": ["-y", "@automatelab/n8n-mcp"],
"env": {
"N8N_API_URL": "https://your-n8n.example.com",
"N8N_API_KEY": "n8n_..."
}
}
}
}The env block is optional - the 4 stateless tools work without it. Get an API key from n8n: Settings → API → Create API key.
Restart your MCP host. The 12 dot-notation tools (workflow.*, node.*, execution.*) appear in the MCP panel.
Tool examples
workflow_generate
Use workflow_generate to build: Stripe webhook → Slack message + new row in Google Sheets.
Returns workflow JSON ready for n8n's "Import from File" dialog.
execution_explain
Here's a failed execution from n8n. Why is the Slack node not firing? [paste JSON]
Returns:
WARNING [Filter] Returned 0 items. Downstream nodes will not execute.
hint: Common causes: (1) IF/Switch routed to the other branch — check `parameters.conditions`. (2) Filter/Set node dropped everything — inspect its output explicitly.
INFO [Last node executed was "Filter". If the workflow stopped here unexpectedly, check its output items below.]workflow_lint
Lint this workflow JSON. [paste JSON]
Returns:
ERROR [AI Agent] AI Agent has no `ai_languageModel` sub-node connected. Attach a chat model (e.g. lmChatOpenAi).
WARNING [Webhook] Webhook node has no `webhookId`. n8n auto-generates one on import, so the production URL will change.
WARNING [LegacyFunction] Node type "n8n-nodes-base.function" is deprecated. Use "n8n-nodes-base.code".Or no issues found.
Examples
The examples/ directory ships with two ready-to-import workflows:
workflow-stripe-to-slack.json- Stripe webhook fans out to Slack and Google Sheets.workflow-rss-to-discord.json- RSS feed trigger posts new items to a Discord channel.
Import either via n8n's Import from File dialog.
Development
git clone https://github.com/ratamaha-git/n8n-mcp
cd n8n-mcp
npm install
npm run build
npm run smokenpm run smoke boots the server with a --smoke flag that lists registered tools and exits without binding stdio. Useful for CI or first-run sanity checks.
License
MIT. See LICENSE.
Developed by AutomateLab.
Maintenance and verification
See the maintenance guide for interpretation limits, current tool names where applicable, and reproducible verification.
Available Tools
12 toolsexecution_explainExplain a failed n8n executionARead-onlyIdempotent
Diagnose a failed or surprising n8n execution. Paste the execution JSON (from the n8n UI 'Show details' or GET /executions/:id?includeData=true); returns a per-node summary highlighting nodes that returned 0 items, unresolved ={{ ... }} expressions, errors with hints, and LLM token usage. Hits the most common debugging pain point: items 'silently disappearing' between nodes. Deterministic, rule-based.
| Name | Required | Description | Default |
|---|---|---|---|
| execution | Yes | n8n execution payload (REST `?includeData=true` shape or raw UI export). Object or JSON string. |
Output Schema
| Name | Required | Description |
|---|---|---|
| findings | Yes | Per-node findings extracted from the execution payload. |
| error_count | Yes | Number of error-severity findings. |
| warning_count | Yes | Number of warning-severity findings. |
execution_listList recent n8n executionsARead-onlyIdempotent
List recent executions from a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Filter by workflowId, status (success|error|waiting), limit. Pass includeData: true to get the full execution body (large) — pair with execution_explain to diagnose a specific failure.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Page size (n8n default: 100, max: 250). | |
| status | No | Filter by status: success | error | waiting. | |
| workflowId | No | Filter by workflow ID. | |
| includeData | No | Include full execution data (large). Default false — pair with execution_explain. |
Output Schema
| Name | Required | Description |
|---|---|---|
| count | Yes | Number of executions returned. |
| executions | Yes | Either trimmed summaries (default) or full execution bodies (includeData=true). |
execution_replayBuild a replay workflow for one nodeARead-onlyIdempotent
Build a self-contained replay workflow that exercises a single node from a larger workflow. The replay workflow is Manual Trigger -> Replay Seed (Code node with pinned items) -> target node. Optional inputItems or an execution payload pins what the target sees. Useful for iterating on one stubborn node without re-running the whole pipeline. Returns workflow JSON ready to import or push via workflow_create.
| Name | Required | Description | Default |
|---|---|---|---|
| node | Yes | Name of the node to replay. | |
| workflow | Yes | Original workflow JSON. | |
| execution | No | Optional execution payload — pulls real input the target saw last time. | |
| inputItems | No | Optional explicit input items (each becomes `{ json: ... }`). |
Output Schema
| Name | Required | Description |
|---|---|---|
| workflow | Yes | Full n8n workflow JSON (name, nodes, connections, settings, ...). |
| item_count | Yes | Number of input items the replay seed will feed the target. |
| target_node | Yes | Name of the node being replayed. |
execution_timelineRender an execution as a per-node timelineARead-onlyIdempotent
Render an n8n execution as a per-node timeline: start offset, duration, items in/out, error flag. Complements execution_explain — that one surfaces why, this surfaces when. Output is a markdown table sorted by start time. Deterministic.
| Name | Required | Description | Default |
|---|---|---|---|
| execution | Yes | n8n execution payload (must include `data.resultData.runData`). |
Output Schema
| Name | Required | Description |
|---|---|---|
| rows | Yes | Per-node-run timing and item counts, sorted by start_ms. |
| total_ms | Yes | Wall-clock duration of the whole execution in milliseconds. |
| row_count | Yes |
node_scaffoldScaffold an n8n custom nodeARead-only
Scaffold a TypeScript skeleton for an n8n custom node from a plain-English description. Returns a single TypeScript file implementing INodeType with description, credentials reference, and an execute method stub. Pure code generation — no network, no filesystem writes.
| Name | Required | Description | Default |
|---|---|---|---|
| nodeName | No | Optional PascalCase class name, e.g. 'DiscordRateLimited'. Derived from the description if omitted. | |
| description | Yes | Plain-English description of what the node should do (1+ chars). |
Output Schema
| Name | Required | Description |
|---|---|---|
| source | Yes | The full TypeScript source of the scaffolded node. |
| language | Yes | Always 'typescript' — n8n custom nodes are TS-only. |
| node_name | Yes | PascalCase class name of the generated node. |
| display_name | Yes | Human-readable display name shown in the n8n UI. |
workflow_activateActivate or deactivate a workflowAIdempotent
Activate or deactivate a workflow on a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Pass active: false to deactivate. Idempotent — re-activating an already-active workflow is a no-op on n8n's side.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workflow ID. | |
| active | No | Defaults to true (activate). Set false to deactivate. |
Output Schema
| Name | Required | Description |
|---|---|---|
| id | Yes | The workflow ID that was (de)activated. |
| ok | Yes | |
| action | Yes | Which action was performed. |
workflow_createCreate a workflow on a live n8n instanceA
Create a workflow on a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Strips read-only fields (id, active, createdAt, ...) before posting. Workflows are created inactive — call workflow_activate afterward. Pairs with workflow_generate for end-to-end 'describe -> deploy'.
| Name | Required | Description | Default |
|---|---|---|---|
| workflow | Yes | Workflow JSON to create (typically the output of workflow_generate). Either a parsed object or a JSON string. |
Output Schema
| Name | Required | Description |
|---|---|---|
| id | Yes | The ID assigned by n8n to the new workflow. |
| name | Yes | The name of the newly created workflow. |
| workflow | Yes | Full n8n workflow JSON (name, nodes, connections, settings, ...). |
workflow_diffSemantic diff between two n8n workflowsARead-onlyIdempotent
Semantic diff between two workflows. Reports nodes added / removed / modified (with field-level deltas: type, typeVersion, parameters, credentials, disabled, position), connection topology changes, and settings drift. Ignores noise (small position deltas, createdAt/updatedAt). Pair with workflow_get to compare deployed vs local. Deterministic.
| Name | Required | Description | Default |
|---|---|---|---|
| after | Yes | The 'after' workflow JSON. | |
| before | Yes | The 'before' workflow JSON. |
Output Schema
| Name | Required | Description |
|---|---|---|
| changes | Yes | Ordered list of semantic differences. |
| summary | Yes | One-line summary of change counts by kind. |
| change_count | Yes |
workflow_generateGenerate an n8n workflow from a descriptionARead-only
Generate a valid n8n workflow JSON from a plain-English description. Handles webhook/schedule/RSS triggers, common action nodes (Slack, Google Sheets, Discord, Gmail, Notion, HTTP), and AI Agent setups (LangChain root agent + chat model + memory + optional HTTP tool, wired with ai_languageModel / ai_memory / ai_tool connections). Returns workflow JSON with unique node IDs, connections, positions, and typeVersion on every node. Output is non-deterministic (random node IDs and webhook paths).
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional workflow name. Derived from the first sentence of the description if omitted. | |
| description | Yes | Plain-English workflow description, e.g. 'Stripe webhook -> Slack message + Google Sheets row'. |
Output Schema
| Name | Required | Description |
|---|---|---|
| workflow | Yes | Full n8n workflow JSON (name, nodes, connections, settings, ...). |
workflow_getFetch a single workflow by IDARead-onlyIdempotent
Fetch a single workflow JSON by id from a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Returns the full nodes/connections payload — pair with workflow_lint to audit a deployed workflow.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workflow ID. |
Output Schema
| Name | Required | Description |
|---|---|---|
| workflow | Yes | Full n8n workflow JSON (name, nodes, connections, settings, ...). |
workflow_lintLint an n8n workflow JSONARead-onlyIdempotent
Lint an n8n workflow JSON. Returns concrete errors and warnings: missing credentials, deprecated node types (Function -> Code, spreadsheetFile -> convertToFile/extractFromFile), broken connections, missing or non-numeric typeVersion, duplicate node names or IDs, AI Agent missing ai_languageModel sub-node, Webhook missing webhookId, IF node still on v1 condition schema, rate-sensitive nodes without retries, Code-node sandbox violations, expression staleness ($('NodeName') referencing missing nodes), manualTrigger in active workflows, disabled-but-wired nodes, empty Set nodes, HTTP method/body mismatches, Schedule trigger DST risk, credential drift, webhook test paths in active workflows. Deterministic, rule-based.
| Name | Required | Description | Default |
|---|---|---|---|
| workflow | Yes | n8n workflow as either a parsed object or a JSON string (will be parsed). |
Output Schema
| Name | Required | Description |
|---|---|---|
| issues | Yes | All lint findings, ordered by node. |
| error_count | Yes | Number of error-severity issues. |
| warning_count | Yes | Number of warning-severity issues. |
workflow_listList workflows on a live n8n instanceARead-onlyIdempotent
List workflows from a live n8n instance (requires N8N_API_URL + N8N_API_KEY env vars). Returns id, name, active, nodeCount, updatedAt, tags. Filter by active, tags, name. Use this when the user asks 'what workflows do I have?' or before workflow_get.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Filter by exact workflow name. | |
| tags | No | Comma-separated tag names to filter by. | |
| limit | No | Page size (n8n default: 100, max: 250). | |
| active | No | Filter by active status. Omit to return both. |
Output Schema
| Name | Required | Description |
|---|---|---|
| count | Yes | Number of workflows returned. |
| workflows | Yes | Summary of each workflow (id, name, active, nodeCount, ...). |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
24 tool updates
v0.5.1- Added
execution_explain - Added
execution_list - Added
execution_replay - Added
execution_timeline - Removed
execution.explain - Removed
execution.list - Removed
execution.replay - Removed
execution.timeline - Added
node_scaffold - Removed
node.scaffold - Added
workflow_activate - Added
workflow_create - Added
workflow_diff - Added
workflow_generate - Added
workflow_get - Added
workflow_lint - Added
workflow_list - Removed
workflow.activate - Removed
workflow.create - Removed
workflow.diff - Removed
workflow.generate - Removed
workflow.get - Removed
workflow.lint - Removed
workflow.list
21 tool updates
v0.5.0- Added
execution.explain - Added
execution.list - Added
execution.replay - Added
execution.timeline - Removed
n8n_activate_workflow - Removed
n8n_create_workflow - Removed
n8n_explain_execution - Removed
n8n_generate_workflow - Removed
n8n_get_workflow - Removed
n8n_lint_workflow - Removed
n8n_list_executions - Removed
n8n_list_workflows - Removed
n8n_scaffold_node - Added
node.scaffold - Added
workflow.activate - Added
workflow.create - Added
workflow.diff - Added
workflow.generate - Added
workflow.get - Added
workflow.lint - Added
workflow.list
9 tool updates
v0.3.0- First observed
n8n_activate_workflow - First observed
n8n_create_workflow - First observed
n8n_explain_execution - First observed
n8n_generate_workflow - First observed
n8n_get_workflow - First observed
n8n_lint_workflow - First observed
n8n_list_executions - First observed
n8n_list_workflows - First observed
n8n_scaffold_node
TDQS
Scored across 12 tools
Each tool targets a distinct resource and action: generation, scaffolding, linting, diffing, live workflow CRUD, and execution analysis are clearly separated. The three execution tools (explain, replay, timeline) are complementary rather than overlapping, with descriptions explicitly distinguishing their purposes.
All tool names follow a consistent resource_action snake_case pattern (workflow_generate, execution_explain, node_scaffold, etc.). The convention is applied uniformly across workflow, execution, and node domains.
12 tools is well-scoped for an n8n automation server covering generation, validation, live instance management, and execution debugging. Each tool earns its place without redundancy.
The server covers creation, listing, fetching, and activation of workflows, plus execution diagnostics, but lacks workflow update and delete operations. This is a notable gap for full lifecycle management on a live n8n instance, though core generation and debugging workflows are supported.
Maintenance
Related MCP Connectors
Open-source Zapier/n8n alternative as an MCP server: agents build, run and debug your workflows.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides AI assistants with access to documentation, schemas, and operations for over 535 n8n workflow automation nodes. It enables models to understand, create, and manage n8n workflows through natural language by connecting to the n8n API.52,147 npmMIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that provides AI assistants with comprehensive access to n8n workflow automation nodes, properties, and documentation. It enables models like Claude to search for nodes, access configuration templates, and manage workflows through natural language.MIT
- AlicenseAqualityCmaintenanceAutomateLab Content Distribution publishes content across DEV.to, Hashnode, GitHub Discussions, Reddit and Bluesky, with browser workflows for LinkedIn, Medium and X. Tracks publishing state and adapts content per platform. Product and documentation: https://automatelab.tech/products/mcp/content-distribution-mcp/878 npm4MIT
- AlicenseAqualityDmaintenanceAn MCP server for n8n that gives AI agents tools for generating workflows, linting, diagnosing failed executions, and driving live n8n instances.12122 npmMIT