Sponsored by Deepsite.site

Automatelab N8n

Created By
ratamaha-gita month ago
Generate n8n workflow JSON (including LangChain AI agents), scaffold custom TypeScript nodes, and lint workflows for missing credentials, deprecated types, and broken connections.
Content

n8n-mcp

An MCP server that gives Claude, Cursor, and other MCP-compatible agents nine tools for working with n8n: scaffold a custom node, generate workflow JSON, lint, diagnose failed executions, and drive a live n8n instance via REST.

npm License

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.

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:

  • n8n_explain_execution 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).
  • n8n_generate_workflow 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.
  • n8n_lint_workflow 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

Stateless (work without a live n8n instance):

ToolPurpose
n8n_generate_workflowPlain-English description → workflow JSON. Detects AI-agent intent.
n8n_scaffold_nodeDescription → single INodeType TypeScript file for a custom n8n package.
n8n_lint_workflowWorkflow JSON → list of errors and warnings.
n8n_explain_executionFailed execution JSON → per-node diagnosis with hints.

Live-instance (require N8N_API_URL + N8N_API_KEY env vars):

ToolPurpose
n8n_list_workflowsPaginate workflows; filter by active/tags/name.
n8n_get_workflowFetch a workflow by id.
n8n_create_workflowPOST a workflow. Strips read-only fields.
n8n_activate_workflowFlip active on/off.
n8n_list_executionsBrowse executions; pass includeData: true for the full body.

Install

Requires Node 20 or later.

npm install -g @automatelab/n8n-mcp

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 9 n8n_* tools appear in the MCP panel.

Tool examples

n8n_generate_workflow

Use n8n_generate_workflow to build: Stripe webhook → Slack message + new row in Google Sheets.

Returns workflow JSON ready for n8n's "Import from File" dialog.

n8n_explain_execution

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.]

n8n_lint_workflow

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.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright McpPlaywright MCP server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor