Skip to main content
Glama
automatelab-n8n-mcp

automatelab-n8n-mcp

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.

npm License CI

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_explain is 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_generate is opinionated about AI Agent topology - emits proper LangChain clusters with ai_languageModel / ai_memory / ai_tool connections (sub-nodes connect upward to the agent, not via main). Imports cleanly on n8n 1.x.

  • workflow_lint catches 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 just main).

  • 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

workflow_generate

Plain-English description → workflow JSON. Detects AI-agent intent.

node_scaffold

Description → single INodeType TypeScript file for a custom n8n package.

workflow_lint

Workflow JSON → list of errors and warnings (20+ rules).

workflow_diff

Two workflows → semantic diff (nodes added/removed/modified, connections, settings).

execution_explain

Failed execution JSON → per-node diagnosis with hints.

execution_replay

Workflow + node → self-contained replay workflow that exercises just that node.

execution_timeline

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

workflow_list

Paginate workflows; filter by active/tags/name.

workflow_get

Fetch a workflow by id.

workflow_create

POST a workflow. Strips read-only fields.

workflow_activate

Flip active on/off.

execution_list

Browse executions; pass includeData: true for the full body.

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

N8N_MCP_READ_ONLY=1

Disables workflow_create, workflow_activate, node_scaffold.

N8N_MCP_DISABLED_TOOLS=workflow_create,workflow_activate

Skip those tool registrations entirely.

N8N_MCP_ALLOWED_WORKFLOW_IDS=abc,def

REST tools refuse to touch any workflow outside the list.

N8N_MCP_ALLOWED_TAGS=prod,staging

workflow_list filters to workflows carrying at least one tag.

Useful when handing the MCP to a junior agent or wiring it behind a customer-facing assistant.

Deploy

  • Claude Desktop one-click: build the .dxt bundle from dxt/manifest.json (see dxt/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.yaml and click "New from Blueprint".

  • Railway: railway.toml — railway up in 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-mcp

As 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 smoke

npm 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 tools
execution_explainExplain a failed n8n executionA
Read-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.

NameRequiredDescriptionDefault
executionYesn8n execution payload (REST `?includeData=true` shape or raw UI export). Object or JSON string.

Output Schema

NameRequiredDescription
findingsYesPer-node findings extracted from the execution payload.
error_countYesNumber of error-severity findings.
warning_countYesNumber of warning-severity findings.
execution_listList recent n8n executionsA
Read-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.

NameRequiredDescriptionDefault
limitNoPage size (n8n default: 100, max: 250).
statusNoFilter by status: success | error | waiting.
workflowIdNoFilter by workflow ID.
includeDataNoInclude full execution data (large). Default false — pair with execution_explain.

Output Schema

NameRequiredDescription
countYesNumber of executions returned.
executionsYesEither trimmed summaries (default) or full execution bodies (includeData=true).
execution_replayBuild a replay workflow for one nodeA
Read-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.

NameRequiredDescriptionDefault
nodeYesName of the node to replay.
workflowYesOriginal workflow JSON.
executionNoOptional execution payload — pulls real input the target saw last time.
inputItemsNoOptional explicit input items (each becomes `{ json: ... }`).

Output Schema

NameRequiredDescription
workflowYesFull n8n workflow JSON (name, nodes, connections, settings, ...).
item_countYesNumber of input items the replay seed will feed the target.
target_nodeYesName of the node being replayed.
execution_timelineRender an execution as a per-node timelineA
Read-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.

NameRequiredDescriptionDefault
executionYesn8n execution payload (must include `data.resultData.runData`).

Output Schema

NameRequiredDescription
rowsYesPer-node-run timing and item counts, sorted by start_ms.
total_msYesWall-clock duration of the whole execution in milliseconds.
row_countYes
node_scaffoldScaffold an n8n custom nodeA
Read-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.

NameRequiredDescriptionDefault
nodeNameNoOptional PascalCase class name, e.g. 'DiscordRateLimited'. Derived from the description if omitted.
descriptionYesPlain-English description of what the node should do (1+ chars).

Output Schema

NameRequiredDescription
sourceYesThe full TypeScript source of the scaffolded node.
languageYesAlways 'typescript' — n8n custom nodes are TS-only.
node_nameYesPascalCase class name of the generated node.
display_nameYesHuman-readable display name shown in the n8n UI.
workflow_activateActivate or deactivate a workflowA
Idempotent

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.

NameRequiredDescriptionDefault
idYesWorkflow ID.
activeNoDefaults to true (activate). Set false to deactivate.

Output Schema

NameRequiredDescription
idYesThe workflow ID that was (de)activated.
okYes
actionYesWhich 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'.

NameRequiredDescriptionDefault
workflowYesWorkflow JSON to create (typically the output of workflow_generate). Either a parsed object or a JSON string.

Output Schema

NameRequiredDescription
idYesThe ID assigned by n8n to the new workflow.
nameYesThe name of the newly created workflow.
workflowYesFull n8n workflow JSON (name, nodes, connections, settings, ...).
workflow_diffSemantic diff between two n8n workflowsA
Read-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.

NameRequiredDescriptionDefault
afterYesThe 'after' workflow JSON.
beforeYesThe 'before' workflow JSON.

Output Schema

NameRequiredDescription
changesYesOrdered list of semantic differences.
summaryYesOne-line summary of change counts by kind.
change_countYes
workflow_generateGenerate an n8n workflow from a descriptionA
Read-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).

NameRequiredDescriptionDefault
nameNoOptional workflow name. Derived from the first sentence of the description if omitted.
descriptionYesPlain-English workflow description, e.g. 'Stripe webhook -> Slack message + Google Sheets row'.

Output Schema

NameRequiredDescription
workflowYesFull n8n workflow JSON (name, nodes, connections, settings, ...).
workflow_getFetch a single workflow by IDA
Read-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.

NameRequiredDescriptionDefault
idYesWorkflow ID.

Output Schema

NameRequiredDescription
workflowYesFull n8n workflow JSON (name, nodes, connections, settings, ...).
workflow_lintLint an n8n workflow JSONA
Read-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.

NameRequiredDescriptionDefault
workflowYesn8n workflow as either a parsed object or a JSON string (will be parsed).

Output Schema

NameRequiredDescription
issuesYesAll lint findings, ordered by node.
error_countYesNumber of error-severity issues.
warning_countYesNumber of warning-severity issues.
workflow_listList workflows on a live n8n instanceA
Read-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.

NameRequiredDescriptionDefault
nameNoFilter by exact workflow name.
tagsNoComma-separated tag names to filter by.
limitNoPage size (n8n default: 100, max: 250).
activeNoFilter by active status. Omit to return both.

Output Schema

NameRequiredDescription
countYesNumber of workflows returned.
workflowsYesSummary of each workflow (id, name, active, nodeCount, ...).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 24 tool updatesv0.5.1
    • Addedexecution_explain
    • Addedexecution_list
    • Addedexecution_replay
    • Addedexecution_timeline
    • Removedexecution.explain
    • Removedexecution.list
    • Removedexecution.replay
    • Removedexecution.timeline
    • Addednode_scaffold
    • Removednode.scaffold
    • Addedworkflow_activate
    • Addedworkflow_create
    • Addedworkflow_diff
    • Addedworkflow_generate
    • Addedworkflow_get
    • Addedworkflow_lint
    • Addedworkflow_list
    • Removedworkflow.activate
    • Removedworkflow.create
    • Removedworkflow.diff
    • Removedworkflow.generate
    • Removedworkflow.get
    • Removedworkflow.lint
    • Removedworkflow.list
  2. 21 tool updatesv0.5.0
    • Addedexecution.explain
    • Addedexecution.list
    • Addedexecution.replay
    • Addedexecution.timeline
    • Removedn8n_activate_workflow
    • Removedn8n_create_workflow
    • Removedn8n_explain_execution
    • Removedn8n_generate_workflow
    • Removedn8n_get_workflow
    • Removedn8n_lint_workflow
    • Removedn8n_list_executions
    • Removedn8n_list_workflows
    • Removedn8n_scaffold_node
    • Addednode.scaffold
    • Addedworkflow.activate
    • Addedworkflow.create
    • Addedworkflow.diff
    • Addedworkflow.generate
    • Addedworkflow.get
    • Addedworkflow.lint
    • Addedworkflow.list
  3. 9 tool updatesv0.3.0
    • First observedn8n_activate_workflow
    • First observedn8n_create_workflow
    • First observedn8n_explain_execution
    • First observedn8n_generate_workflow
    • First observedn8n_get_workflow
    • First observedn8n_lint_workflow
    • First observedn8n_list_executions
    • First observedn8n_list_workflows
    • First observedn8n_scaffold_node

TDQS

A4.3/5.0

Scored across 12 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness3/5

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

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An 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 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    An 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
  • A
    license
    A
    quality
    C
    maintenance
    AutomateLab 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/
    8
    78 npm
    4
    MIT