
N8n Mcp
io.github.ratamaha-git由 GitHub 账号 ratamaha-git 发布v0.3.0更新于 Oct 24, 2026
MCP server for n8n: generate, lint, explain failed executions, drive live n8n via REST.
概览
面向 n8n 的 MCP 服务器,让助手生成、检查、对比和诊断 n8n 工作流,并可通过 REST 接口操作线上 n8n 实例。
- 可以做什么
- 根据自然语言描述生成工作流 JSON,包括 AI Agent 子节点连接结构,并生成自定义节点的 TypeScript 文件
- 用 20 多条规则检查工作流 JSON,并对两个工作流做语义差异对比
- 诊断失败的执行:逐节点说明并给出提示、为单个节点生成回放工作流、输出逐节点时间线
- 管理线上工作流:列出、获取、创建和启用或停用
- 浏览线上实例的执行记录,可选择包含完整执行数据
- 适用场景
- 适合在构建或维护 n8n 自动化时使用,让助手产出可直接导入的工作流 JSON、在导入前发现静默失败,或解释某次执行为何丢失数据。若希望助手读取或修改运行中 n8n 服务器上的工作流,可再启用线上实例工具。
- 运行要求
- 以 npm 包形式在本地通过 stdio 运行,需要 Node 20 或更高版本,通常用 npx 启动。无状态工具无需其他配置。REST 工具需要环境变量 N8N_API_URL 和 N8N_API_KEY,密钥在 n8n 的 Settings、API 中创建。可选策略变量 N8N_MCP_READ_ONLY、N8N_MCP_DISABLED_TOOLS、N8N_MCP_ALLOWED_WORKFLOW_IDS 和 N8N_MCP_ALLOWED_TAGS 可限制其权限。
安装
在 SourceWeft 中
- 打开 控制台中的 N8n Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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.
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):
Live-instance (require N8N_API_URL + N8N_API_KEY env vars):
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:
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
As a GitHub Action
Use the n8n MCP GitHub Action to lint workflows, diagnose executions, and generate workflow JSON in your CI/CD pipeline:
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):
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:
workflow_lint
Lint this workflow JSON. [paste JSON]
Returns:
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
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.
来源:README.md,提交 28904f6
工具
0版本历史
1- v0.3.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分