Skip to main content
Glama
mcp-n8n-builder

mcp-n8n-builder

by spences10

mcp-n8n-builder

一个模型上下文协议 (MCP) 服务器,用于以编程方式创建和管理 n8n 工作流。该服务器提供与 n8n REST API 交互的工具和资源,使 AI 助手无需用户直接干预即可构建、修改和管理工作流。

特征

  • 🔄工作流管理:创建、读取、更新、删除、激活和停用工作流

  • 📊执行管理:列出并检索工作流执行详细信息

  • ✅模式验证:使用 Zod 对输入和输出数据进行全面验证

  • 🔍节点验证:在创建工作流之前根据 n8n 的可用节点验证节点类型,以防止出现错误

  • 🤔智能建议:当检测到无效节点时,提供类似节点类型的建议

  • 🛠️错误处理:用于故障排除的详细错误消息

  • 📝文档:所有工具和资源的详尽文档

  • 🔍搜索和过滤:按名称、标签或活动状态过滤工作流程

Related MCP server: n8n-manager-mcp

配置

此服务器需要通过您的 MCP 客户端进行配置。以下是不同环境的示例:

克莱恩配置

将其添加到您的 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 桌面

对于 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 工作流执行的详细信息

发展

设置

  1. 克隆存储库

  2. 安装依赖项:

npm install
  1. 构建项目:

npm run build
  1. 以开发模式运行:

npm run dev

出版

该项目使用变更集进行版本管理。要发布:

  1. 创建变更集:

npm changeset
  1. 对包进行版本控制:

npm changeset version
  1. 发布到 npm:

npm release

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

MIT 许可证 - 有关详细信息,请参阅LICENSE文件。

致谢

Available Tools

10 tools
activate_workflowA

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.

Inputs: id (required).

create_workflowA

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.

Inputs: workflow (required), activate.

deactivate_workflowA

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.

Inputs: id (required).

delete_workflowA

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.

Inputs: id (required).

get_executionA

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.

Inputs: id (required), includeData, verbosity.

get_workflowA

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.

Inputs: id (required), verbosity.

list_available_nodesA

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.

Inputs: category, verbosity.

list_executionsA

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.

Inputs: limit, status, verbosity, workflowId.

list_workflowsA

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.

Inputs: active, name, tags, verbosity.

update_workflowA

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.

Inputs: id (required), workflow (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap. For example, activate_workflow and deactivate_workflow are opposites, while create_workflow, update_workflow, and delete_workflow cover different lifecycle stages. The list_* tools target different resources (workflows, executions, nodes), and get_* tools retrieve specific items versus lists.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case throughout. Verbs like activate, create, deactivate, delete, get, list, and update are used predictably, and nouns like workflow, execution, and nodes are consistently paired with appropriate actions.

    Tool Count5/5

    With 10 tools, this server is well-scoped for managing n8n workflows. It covers core operations (CRUD for workflows, activation/deactivation), monitoring (executions), and utilities (listing nodes), with each tool serving a clear and necessary function without bloat.

    Completeness5/5

    The toolset provides complete coverage for the n8n workflow management domain. It includes full CRUD lifecycle for workflows (create, get, update, delete, list), activation control, execution monitoring (list and get), and utility tools for node discovery, leaving no obvious gaps for agent operations.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers