n8n-mcp
Supports generating workflows that post messages to Discord channels.
Facilitates generating workflows that add rows to Google Sheets.
Generates proper AI Agent clusters using LangChain sub-nodes for language models and memory.
Provides tools for generating, linting, diagnosing, and managing n8n workflows and executions via MCP.
Generates workflows that use OpenAI language models for AI agents.
Allows creating workflows that monitor RSS feeds and trigger actions.
Enables creation of workflows that send messages to Slack channels.
Allows generating workflows that integrate Stripe webhooks, such as Stripe to Slack or Google Sheets.
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 explain why my last execution failed"
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
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 a walkthrough of the nine tools with example output, see the launch post on automatelab.tech.
Related MCP server: n8n-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.
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.
Inputs: execution (required). Returns: findings, error_count, warning_count
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.
Inputs: workflowId, status, limit, includeData. Returns: executions, count
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.
Inputs: workflow (required), node (required), inputItems, execution. Returns: workflow, item_count, target_node
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.
Inputs: execution (required). Returns: rows, total_ms, row_count
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.
Inputs: description (required), nodeName. Returns: node_name, display_name, source, language
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.
Inputs: id (required), active. Returns: ok, id, action
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'.
Inputs: workflow (required). Returns: id, name, workflow
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.
Inputs: before (required), after (required). Returns: changes, summary, change_count
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).
Inputs: description (required), name. Returns: workflow
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.
Inputs: id (required). Returns: workflow
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.
Inputs: workflow (required). Returns: issues, error_count, warning_count
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.
Inputs: active, tags, name, limit. Returns: workflows, count
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool has a clearly distinct purpose: execution_* tools cover debugging (explain, timeline), listing, and replay, while workflow_* tools cover CRUD, diff, generate, lint, and activation. node_scaffold is separate. No overlapping functionality that would cause confusion.
Tools mostly follow verb_noun snake_case (execution_explain, workflow_create). One minor inconsistency: node_scaffold uses noun_verb instead of scaffold_node. Otherwise consistent and predictable.
12 tools is well-scoped for the n8n domain. It covers execution debugging, workflow lifecycle, and node generation without being overwhelming or sparse.
Covers core execution and workflow operations comprehensively (list, get, create, activate, diff, lint, generate, explain, replay, timeline). Missing workflow delete/update and execution cancel, but these are secondary and often handled via the UI.
Related MCP Connectors
Open-source Zapier/n8n alternative as an MCP server: agents build, run and debug your workflows.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
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.48,812 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that empowers AI assistants to build, validate, and manage n8n workflows by providing structured access to documentation for over 1,200 nodes and thousands of templates. It enables deep integration with n8n instances for automated workflow orchestration and management through natural language.48,812 npm1MIT
- AlicenseAqualityBmaintenanceAutomateLab n8n MCP helps AI agents generate and lint workflows, diagnose failed executions, and manage live n8n instances. Product and documentation: https://automatelab.tech/products/mcp/n8n-mcp/12119 npm15MIT
- 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-