mcp-n8n-builder
🪄 MCP 服务器,用于以编程方式创建和管理 n8n 工作流。它使 AI 助手能够构建、修改和管理工作流,而无需用户直接干预,并通过一套全面的工具和资源来与 n8n 的 REST API 进行交互。
Tools
list_available_nodes
Lists all available nodes in the n8n instance. Use this tool BEFORE creating or updating workflows to ensure you only use valid node types. This helps prevent errors caused by using node types that do not exist in the current n8n instance.
list_workflows
Lists all workflows from n8n with their basic information including ID, name, status, creation date, and tags. Use this tool to get an overview of available workflows before performing operations on specific workflows. Results can be filtered by active status, tags, or name.
create_workflow
Creates a new workflow in n8n with specified nodes and connections. Note that only workflows with automatic trigger nodes (schedule, webhook, etc.) can be activated - workflows with only manual triggers cannot be activated. Returns the created workflow with its assigned ID.
get_workflow
Retrieves complete details of a specific workflow by its ID, including all nodes, connections, settings, and metadata. Use this tool when you need to examine a workflow's structure before updating it or to understand how it works.
update_workflow
Updates an existing workflow with new configuration. Typically used after retrieving a workflow with get_workflow, modifying its structure, and then saving the changes. The entire workflow structure must be provided, not just the parts being changed.
delete_workflow
Permanently deletes a workflow by its ID. This action cannot be undone, so use with caution. Consider deactivating workflows instead if you might need them again later.
activate_workflow
Activates a workflow by its ID, enabling it to run automatically based on its trigger (schedule, webhook, etc.). Note that only workflows with automatic trigger nodes can be activated - workflows with only manual triggers cannot be activated.
deactivate_workflow
Deactivates a workflow by its ID, preventing it from running automatically. The workflow will still exist and can be manually executed or reactivated later. Use this instead of deleting workflows that you might need again.
list_executions
Lists workflow execution history with details on success/failure status, duration, and timestamps. Use this tool to monitor workflow performance, troubleshoot issues, or verify that workflows are running as expected. Results can be filtered by workflow ID, status, and limited to a specific number.
get_execution
Retrieves detailed information about a specific workflow execution, including execution time, status, and optionally the full data processed at each step. Particularly useful for debugging failed workflows or understanding data transformations between nodes.
README
mcp-n8n-builder
一个用于程序化创建和管理 n8n 工作流的模型上下文协议 (MCP) 服务器。该服务器提供工具和资源,用于与 n8n 的 REST API 交互,允许 AI 助手构建、修改和管理工作流,而无需用户直接干预。
<a href="https://glama.ai/mcp/servers/@spences10/mcp-n8n-builder"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@spences10/mcp-n8n-builder/badge" /> </a>
特性
- 🔄 工作流管理: 创建、读取、更新、删除、激活和停用工作流
- 📊 执行管理: 列出和检索工作流执行详情
- ✅ 模式验证: 使用 Zod 对输入和输出数据进行全面验证
- 🔍 节点验证: 在创建工作流之前,根据 n8n 的可用节点验证节点类型,以防止出错
- 🤔 智能建议: 在检测到无效节点时,提供类似节点类型的建议
- 🛠️ 错误处理: 详细的错误消息,便于故障排除
- 📝 文档: 所有工具和资源的详尽文档
- 🔍 搜索 & 筛选: 按名称、标签或活动状态筛选工作流
配置
此服务器需要通过您的 MCP 客户端进行配置。以下是不同环境的示例:
Cline 配置
将其添加到您的 Cline MCP 设置中:
{
"mcpServers": {
"n8n-workflow-builder": {
"command": "npx",
"args": ["-y", "mcp-n8n-builder"],
"env": {
"N8N_HOST": "http://localhost:5678/api/v1",
"N8N_API_KEY": "your-n8n-api-key",
"OUTPUT_VERBOSITY": "concise" // Options: 'concise' or 'full'
}
}
}
}
带有 WSL 的 Claude Desktop 配置
对于 WSL 环境,将其添加到您的 Claude Desktop 配置中:
{
"mcpServers": {
"n8n-workflow-builder": {
"command": "wsl.exe",
"args": [
"bash",
"-c",
"N8N_HOST=http://localhost:5678/api/v1 N8N_API_KEY=your-n8n-api-key OUTPUT_VERBOSITY=concise npx -y mcp-n8n-builder"
]
}
}
}
环境变量
可以使用环境变量配置服务器:
| 变量 | 描述 | 默认值 |
|---|---|---|
N8N_HOST |
n8n API 的 URL | http://localhost:5678/api/v1 |
N8N_API_KEY |
用于 n8n 身份验证的 API 密钥 | "" |
SERVER_NAME |
MCP 服务器的名称 | "n8n-workflow-builder" |
SERVER_VERSION |
MCP 服务器的版本 | 包版本 |
LOG_LEVEL |
日志级别 | "info" |
CACHE_ENABLED |
启用缓存 | false |
CACHE_TTL |
缓存 TTL(以秒为单位) | 300 |
OUTPUT_VERBOSITY |
输出详细程度级别(concise 或 full) |
"concise" |
MCP 工具
节点管理
list_available_nodes: 列出 n8n 实例中的所有可用节点。重要提示:在创建或更新工作流之前使用此工具,以确保您仅使用有效的节点类型。这有助于防止因使用当前 n8n 实例中不存在的节点类型而导致的错误。
工作流管理
list_workflows: 列出 n8n 中的所有工作流,以及它们的基本信息,包括 ID、名称、状态、创建日期和标签。结果可以按活动状态、标签或名称进行筛选。create_workflow: 在 n8n 中创建一个新的工作流,其中包含指定的节点和连接。返回创建的工作流及其分配的 ID。验证所有节点类型是否存在于 n8n 实例中。get_workflow: 检索特定工作流的完整详细信息,包括其 ID、所有节点、连接、设置和元数据。update_workflow: 使用新配置更新现有工作流。必须提供整个工作流结构,而不仅仅是被更改的部分。验证所有节点类型是否存在于 n8n 实例中。delete_workflow: 按 ID 永久删除工作流。此操作无法撤消。activate_workflow: 按 ID 激活工作流,使其能够根据其触发器自动运行。deactivate_workflow: 按 ID 停用工作流,阻止其自动运行。
执行管理
list_executions: 列出工作流执行历史记录,其中包含成功/失败状态、持续时间和时间戳的详细信息。结果可以按工作流 ID、状态进行筛选,并限制为特定数量。get_execution: 检索有关特定工作流执行的详细信息,包括执行时间、状态,以及可选的每个步骤处理的完整数据。
MCP 资源
n8n://workflows: n8n 中所有工作流的列表n8n://workflows/{id}: 特定 n8n 工作流的详细信息n8n://executions/{id}: 特定 n8n 工作流执行的详细信息
开发
设置
- 克隆存储库
- 安装依赖项:
npm install
- 构建项目:
npm run build
- 在开发模式下运行:
npm run dev
发布
该项目使用 changesets 进行版本管理。要发布:
- 创建一个 changeset:
npm changeset
- 对包进行版本控制:
npm changeset version
- 发布到 npm:
npm release
贡献
欢迎贡献!请随时提交 Pull Request。
许可证
MIT 许可证 - 有关详细信息,请参阅 LICENSE 文件。
致谢
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。