n8n-workflow-builder-mcp
n8n Workflow Builder MCP
一个用于构建和操作 n8n 工作流的模型上下文协议 (MCP) 服务器。只需通过 AI 提示即可构建 n8n 工作流 — 适用于 Claude Code、VS Code、Cursor 以及任何兼容 MCP 的客户端。
演示视频:
Cursor 规则
规则文件位于
rules/n8n-mcp-server-rules.mdc
Related MCP server: mcp-n8n-builder
主要功能
工作流管理:以编程方式创建、更新和执行 n8n 工作流(执行功能尚未实现)
节点发现:探索可用的 n8n 节点及其功能
连接管理:在工作流节点之间创建连接
AI 集成:用于在工作流中连接 AI 组件的专用工具
AI 友好界面:专为与 AI 代理交互而设计
N8N 版本管理:自动版本检测和兼容性处理 - 支持 184 个以上的 n8n 版本(1.86.0 – 2.6.2),具有动态节点过滤和“最接近的较低版本”匹配功能,以实现向后兼容性
先决条件
Node.js (v18 或更高版本)
npm (用于 npx 命令)
兼容 MCP 的客户端 (Claude Code, VS Code, Cursor 等)
安装与设置
获取您的 n8n API 密钥
在浏览器中打开您的 n8n 实例
转到 Settings > API Keys
点击 Create API Key
复制生成的密钥并在您的配置中使用
Claude Code (推荐)
使用 Claude Code CLI 添加 MCP 服务器:
claude mcp add n8n-workflow-builder -- npx -y n8n-workflow-builder-mcp然后设置环境变量:
claude mcp add n8n-workflow-builder \
-e N8N_API_URL=http://localhost:5678 \
-e N8N_API_KEY=your-n8n-api-key-here \
-- npx -y n8n-workflow-builder-mcp
N8N_VERSION是可选的 — 服务器会自动从 API 检测它。
VS Code / Cursor
添加到您的 MCP 配置文件中(VS Code 为 .vscode/mcp.json,Cursor 为 .cursor/mcp.json):
{
"mcpServers": {
"n8n-workflow-builder": {
"command": "npx",
"args": ["-y", "n8n-workflow-builder-mcp"],
"env": {
"N8N_API_URL": "http://localhost:5678",
"N8N_API_KEY": "your-n8n-api-key-here"
}
}
}
}重启您的 IDE 以使更改生效。
开发安装
对于开发或本地测试,请克隆并从源代码构建:
git clone https://github.com/ifmelate/n8n-workflow-builder-mcp.git
cd n8n-workflow-builder-mcp
npm install
npm run build然后将您的 MCP 客户端指向构建的入口点:
# Claude Code
claude mcp add n8n-workflow-builder -- node /absolute/path/to/n8n-workflow-builder-mcp/dist/index.js
# VS Code / Cursor — use the same JSON config above with "command": "node" and "args": ["/absolute/path/to/dist/index.js"]用于自动重新构建的开发模式:
npm run dev可用的 MCP 工具
服务器提供了以下用于处理 n8n 工作流的工具:
核心工作流管理
工具名称 | 描述 | 关键参数 |
create_workflow | 创建一个新的 n8n 工作流 |
|
list_workflows | 列出工作区中的工作流 |
|
get_workflow_details | 获取特定工作流的详细信息 |
|
validate_workflow | 根据节点模式和连接性验证工作流文件 |
|
节点管理
工具名称 | 描述 | 关键参数 |
add_node | 向工作流添加新节点 |
|
edit_node | 编辑工作流中的现有节点 |
|
delete_node | 从工作流中删除节点 |
|
list_available_nodes | 列出可用的节点类型并进行可选过滤。支持标签式同义词和多标记 OR/AND 逻辑 |
|
连接管理
工具名称 | 描述 | 关键参数 |
add_connection | 在两个节点之间创建连接 |
|
add_ai_connections | 将 AI 模型、工具和内存连接到代理 |
|
connect_main_chain | 构建通过 AI 工作流节点的主路径(触发器 → 模型 → 内存 → 嵌入 → 文档加载器 → 向量存储 → 向量工具 → 代理) |
|
工作流规划与组合
工具名称 | 描述 | 关键参数 |
plan_workflow | 创建一个非破坏性的计划(节点和连接)来更新工作流。不写入文件 |
|
review_workflow_plan | 在内存中应用计划并返回验证错误、警告和建议的修复。不写入文件 |
|
apply_workflow_plan | 将之前审查过的计划应用到磁盘上的工作流(原子写入) |
|
compose_ai_workflow | 一次性组合复杂的工作流(代理 + 模型 + 内存 + 嵌入 + 向量 + 工具 + 触发器),包括布线和基本验证 |
|
参数管理
工具名称 | 描述 | 关键参数 |
suggest_node_params | 使用默认值和必填字段为节点类型建议最小有效参数 |
|
list_missing_parameters | 列出考虑到可见性规则后节点缺少的必填参数 |
|
fix_node_params | 返回应用了默认值的缺失必填字段参数 |
|
模板与发现
工具名称 | 描述 | 关键参数 |
list_template_examples | 列出从免费模板中提取的节点使用示例。按 node_type 或 template_name 过滤 |
|
get_n8n_version_info | 获取当前的 N8N 版本和功能 |
|
验证行为
validate_workflow 会将警告提升为错误,并且当任何已启用的节点未连接(直接或通过 AI 端口)到从推断的 startNode 开始的主链时,验证会失败。使用 connect_from/connect_to 或 add_ai_connections 来修复连接。
故障排除
常规
检查您的 MCP 配置 — 确保 JSON 有效且服务器名称匹配。
将 Node.js 更新 到最新的 LTS 版本。
清除 npm 缓存(如果 npx 失败):
npm cache clean --force尝试全局安装 作为备选方案:
npm install -g n8n-workflow-builder-mcp
Claude Code
运行
claude mcp list以验证服务器是否已注册。使用
claude mcp logs n8n-workflow-builder检查日志。
VS Code / Cursor
检查输出面板 — 从下拉菜单中选择“MCP”以查看服务器日志。
确保在 Settings > Features > MCP Servers 中启用了服务器。
配置更改后重启 IDE。
项目结构
/src: 主要源代码/src/tools: MCP 工具实现/src/models: 数据模型/src/utils: 实用函数/src/middleware: 身份验证和中间件/config: 配置文件/tests: 测试文件/workflow_nodes: n8n 节点定义/docs: 附加文档
贡献
欢迎贡献!请随时提交 Pull Request。
Fork 本仓库
创建您的功能分支 (
git checkout -b feature/amazing-feature)提交您的更改 (
git commit -m 'Add some amazing feature')推送到分支 (
git push origin feature/amazing-feature)打开 Pull Request
许可证
MIT 许可证
Available Tools
10 toolsadd_ai_connectionsD
| Name | Required | Description | Default |
|---|---|---|---|
| agent_node_id | Yes | The ID of the agent node that will use the model and tools | |
| memory_node_id | No | The ID of the memory node (optional) | |
| model_node_id | No | The ID of the language model node (optional) | |
| tool_node_ids | No | Array of tool node IDs to connect to the agent (optional) | |
| workflow_name | Yes | The Name of the workflow to add the AI connections to |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_connectionD
| Name | Required | Description | Default |
|---|---|---|---|
| source_node_id | Yes | The ID of the source node for the connection | |
| source_node_output_name | Yes | The name of the output handle on the source node (e.g., 'main') | |
| target_node_id | Yes | The ID of the target node for the connection | |
| target_node_input_index | No | The index for the target node's input handle (default: 0) | |
| target_node_input_name | Yes | The name of the input handle on the target node (e.g., 'main') | |
| workflow_name | Yes | The Name of the workflow to add the connection to |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_nodeD
| Name | Required | Description | Default |
|---|---|---|---|
| node_name | No | The name for the new node (e.g., 'My Gmail Node') | |
| node_type | Yes | The type of node to add (e.g., 'gmail', 'slack', 'openAi'). You can specify with or without the 'n8n-nodes-base.' prefix. The system will handle proper casing (e.g., 'openai' will be converted to 'openAi' if that's the correct casing). | |
| parameters | No | The parameters for the node | |
| position | No | The position of the node {x,y} - will be converted to [x,y] for N8nWorkflowNode | |
| typeVersion | No | The type version for the node (e.g., 1, 1.1). Defaults to 1 if not specified. | |
| webhookId | No | Optional webhook ID for certain node types like triggers. | |
| workflow_name | Yes | The Name of the workflow to add the node to | |
| workflow_path | No | Optional direct path to the workflow file (absolute or relative to current working directory). If not provided, uses standard workflow_data directory approach. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_workflowD
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_name | Yes | The name for the new workflow | |
| workspace_dir | Yes | Absolute path to the project root directory where workflow_data will be stored |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_nodeD
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | The ID of the node to delete | |
| workflow_name | Yes | The Name of the workflow containing the node | |
| workflow_path | No | Optional direct path to the workflow file (absolute or relative to current working directory). If not provided, uses standard workflow_data directory approach. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
edit_nodeD
| Name | Required | Description | Default |
|---|---|---|---|
| node_id | Yes | The ID of the node to edit | |
| node_name | No | The new name for the node | |
| node_type | No | The new type for the node (e.g., 'gmail', 'slack', 'openAi'). You can specify with or without the 'n8n-nodes-base.' prefix. The system will handle proper casing (e.g., 'openai' will be converted to 'openAi' if that's the correct casing). | |
| parameters | No | The new parameters | |
| position | No | The new position {x,y} - will be converted to [x,y] | |
| typeVersion | No | The new type version for the node | |
| webhookId | No | Optional new webhook ID for the node. | |
| workflow_name | Yes | The Name of the workflow containing the node | |
| workflow_path | No | Optional workflow path to the workflow file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_n8n_version_infoD
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_workflow_detailsD
| Name | Required | Description | Default |
|---|---|---|---|
| workflow_name | Yes | The Name of the workflow to get details for | |
| workflow_path | No | Optional direct path to the workflow file (absolute or relative to current working directory). If not provided, uses standard workflow_data directory approach. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_available_nodesD
| Name | Required | Description | Default |
|---|---|---|---|
| n8n_version | No | Filter nodes by N8N version compatibility. If not provided, uses current configured N8N version. | |
| search_term | No | An optional search term to filter nodes by their name, type, or description. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_workflowsD
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
10 tool updates
v1.0.0- First observed
add_ai_connections - First observed
add_connection - First observed
add_node - First observed
create_workflow - First observed
delete_node - First observed
edit_node - First observed
get_n8n_version_info - First observed
get_workflow_details - First observed
list_available_nodes - First observed
list_workflows
TDQS
Scored across 10 tools
Most tools have distinct purposes targeting different aspects of n8n workflow management (e.g., create_workflow vs. list_workflows, add_node vs. edit_node vs. delete_node). However, add_ai_connections and add_connection could potentially be confused without descriptions, as their relationship is unclear—they might overlap in handling connections.
All tool names follow a consistent verb_noun pattern with snake_case throughout (e.g., add_connection, create_workflow, get_workflow_details). There are no deviations in naming conventions, making the set predictable and readable.
With 10 tools, the count is well-scoped for a workflow builder server, covering core operations like creating, listing, and managing workflows and nodes. Each tool appears to earn its place without being excessive or insufficient for the domain.
The tools cover basic CRUD operations for workflows and nodes (create, list, get, edit, delete), but there are notable gaps. For example, there's no update_workflow or delete_workflow tool, and the absence of descriptions makes it hard to assess if AI connections and general connections are fully covered, potentially leaving dead ends in workflow management.
Maintenance
Related MCP Connectors
Open-source Zapier/n8n alternative as an MCP server: agents build, run and debug your workflows.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
LLM Orchestration Agent (Mcp)
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server enabling secure interaction with n8n workflows, executions, and settings via the Model Context Protocol, designed for integration with Large Language Models (LLMs).3358 npm119MIT
- AlicenseAqualityDmaintenance🪄 MCP server for programmatic creation and management of n8n workflows. Enables AI assistants to build, modify, and manage workflows without direct user intervention through a comprehensive set of tools and resources for interacting with n8n's REST API.1050 npm86MIT
- AlicenseBqualityAmaintenanceMCP server for managing n8n workflows through AI assistants. Supports workflow CRUD operations, synchronization, inspection, and execution support for automation-focused workflows.19133 npm2MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for integrating with n8n, enabling workflow automation and management through natural language.318 npm1MIT