n8n MCP Server

n8n MCP Server

一个 MCP 服务器,通过模型上下文协议 (Model Context Protocol) 实现与 n8n 工作流、执行和设置的安全交互,专为与大型语言模型 (LLM) 集成而设计。

开发者工具
操作系统自动化
访问服务器

Tools

init-n8n

Initialize connection to n8n instance. Use this tool whenever an n8n URL and API key are shared to establish the connection. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

list-workflows

List all workflows from n8n. Use after init-n8n to see available workflows. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

get-workflow

Retrieve a workflow by ID. Use after list-workflows to get detailed information about a specific workflow. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

create-workflow

Create a new workflow in n8n. Use to set up a new workflow with optional nodes and connections. IMPORTANT: 1) Arguments must be provided as compact, single-line JSON without whitespace or newlines. 2) Must provide full workflow structure including nodes and connections arrays, even if empty. The 'active' property should not be included as it is read-only.

update-workflow

Update an existing workflow in n8n. Use after get-workflow to modify a workflow's properties, nodes, or connections. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

delete-workflow

Delete a workflow by ID. This action cannot be undone. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

activate-workflow

Activate a workflow by ID. This will enable the workflow to run. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

deactivate-workflow

Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

list-projects

List all projects from n8n. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

create-project

Create a new project in n8n. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

delete-project

Delete a project by ID. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

update-project

Update a project's name. NOTE: Requires n8n Enterprise license with project management features enabled. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

list-users

Retrieve all users from your instance. Only available for the instance owner.

create-users

Create one or more users in your instance.

get-user

Get user by ID or email address.

delete-user

Delete a user from your instance.

list-variables

List all variables from n8n. NOTE: Requires n8n Enterprise license with variable management features enabled. Use after init-n8n to see available variables. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

create-variable

Create a new variable in n8n. NOTE: Requires n8n Enterprise license with variable management features enabled. Variables can be used across workflows to store and share data. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

delete-variable

Delete a variable by ID. NOTE: Requires n8n Enterprise license with variable management features enabled. Use after list-variables to get the ID of the variable to delete. This action cannot be undone. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

create-credential

Create a credential that can be used by nodes of the specified type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). Use get-credential-schema first to see what fields are required for the credential type you want to create.

delete-credential

Delete a credential by ID. You must be the owner of the credentials.

get-credential-schema

Show credential data schema for a specific credential type. The credential type name can be found in the n8n UI when creating credentials (e.g., 'cloudflareApi', 'githubApi', 'slackOAuth2Api'). This will show you what fields are required for creating credentials of this type.

list-executions

Retrieve all executions from your instance with optional filtering.

get-execution

Retrieve a specific execution by ID.

delete-execution

Delete a specific execution by ID.

create-tag

Create a new tag in your instance.

list-tags

Retrieve all tags from your instance.

get-tag

Retrieve a specific tag by ID.

update-tag

Update a tag's name.

delete-tag

Delete a tag by ID.

get-workflow-tags

Get tags associated with a workflow.

update-workflow-tags

Update tags associated with a workflow.

generate-audit

Generate a security audit for your n8n instance.

README

n8n MCP 服务器

一个 MCP 服务器,通过模型上下文协议提供对 n8n 工作流、执行、凭据等的访问。这允许大型语言模型 (LLM) 以安全和标准化的方式与 n8n 实例交互。

安装

获取您的 n8n API 密钥

  1. 登录到您的 n8n 实例
  2. 点击左下角的用户图标
  3. 进入设置
  4. 选择 API
  5. 点击“创建 API 密钥”
  6. 复制您的 API 密钥(您将无法再次看到它)

安装 MCP 服务器

选项 1:从 npm 安装(推荐)

npm install -g @illuminaresolutions/n8n-mcp-server

选项 2:从源代码安装

  1. 克隆存储库:

    git clone https://github.com/illuminaresolutions/n8n-mcp-server.git
    cd n8n-mcp-server
    
  2. 安装依赖项并构建:

    npm install
    npm run build
    
  3. 在后台启动服务器:

    nohup npm start > n8n-mcp.log 2>&1 &
    

    停止服务器:

    pkill -f "node build/index.js"
    

注意:从 npm 安装时,服务器将作为 n8n-mcp-server 在您的 PATH 中可用。

配置

Claude Desktop

  1. 打开您的 Claude Desktop 配置:

    ~/Library/Application Support/Claude/claude_desktop_config.json
    
  2. 添加 n8n 配置:

    {
      "mcpServers": {
         "n8n": {
          "command": "n8n-mcp-server",
          "env": {
            "N8N_HOST": "https://your-n8n-instance.com",
            "N8N_API_KEY": "your-api-key-here"
          }
        }
      }
    }
    

Cline (VS Code)

  1. 安装服务器(按照上面的安装步骤)
  2. 打开 VS Code
  3. 从左侧边栏打开 Cline 扩展
  4. 点击窗格顶部的“MCP 服务器”图标
  5. 滚动到底部并点击“配置 MCP 服务器”
  6. 添加到打开的设置文件:
    {
      "mcpServers": {
        "n8n": {
          "command": "n8n-mcp-server",
          "env": {
            "N8N_HOST": "https://your-n8n-instance.com",
            "N8N_API_KEY": "your-api-key-here"
          }
        }
      }
    }
    
  7. 保存文件
  8. 确保 MCP 开关已启用(绿色)并且状态指示器为绿色
  9. 开始在 Cline 中使用 MCP 命令

Sage

即将推出! n8n MCP 服务器将通过以下方式提供:

  • Smithery.ai 市场
  • 从 Claude Desktop 导入

目前,请使用 Claude Desktop 或 Cline。

验证

配置后:

  1. 重新启动您的 LLM 应用程序
  2. 询问:“列出我的 n8n 工作流”
  3. 您应该看到您的工作流已列出

如果出现错误:

  • 检查您的 n8n 实例是否正在运行
  • 验证您的 API 密钥是否具有正确的权限
  • 确保 N8N_HOST 没有尾部斜杠

特性

核心特性

  • 列出和管理工作流
  • 查看工作流详细信息
  • 执行工作流
  • 管理凭据
  • 处理标签和执行
  • 生成安全审计
  • 管理工作流标签

企业特性

这些特性需要 n8n 企业许可证:

  • 项目管理
  • 变量管理
  • 高级用户管理

故障排除

常见问题

  1. “客户端未初始化”

    • 检查 N8N_HOST 和 N8N_API_KEY 是否设置正确
    • 确保 n8n 实例可访问
    • 验证 API 密钥权限
  2. “需要许可证”

    • 您正在尝试使用企业特性
    • 要么升级到 n8n 企业版,要么仅使用核心特性
  3. 连接问题

    • 验证 n8n 实例是否正在运行
    • 检查 URL 协议 (http/https)
    • 从 N8N_HOST 中删除尾部斜杠

安全最佳实践

  1. API 密钥管理

    • 使用必要的最小权限
    • 定期轮换密钥
    • 永远不要将密钥提交到版本控制
  2. 实例访问

    • 对生产环境使用 HTTPS
    • 启用 n8n 身份验证
    • 保持 n8n 更新

支持

许可证

MIT License

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
MCP Package Docs Server

MCP Package Docs Server

促进大型语言模型高效访问和获取 Go、Python 和 NPM 包的结构化文档,通过多语言支持和性能优化来增强软件开发。

精选
本地
TypeScript
Claude Code MCP

Claude Code MCP

一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。

精选
本地
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

用于任务管理的模型上下文协议服务器。它允许 Claude Desktop(或任何 MCP 客户端)在基于队列的系统中管理和执行任务。

精选
本地
JavaScript
mermaid-mcp-server

mermaid-mcp-server

一个模型上下文协议 (MCP) 服务器,用于将 Mermaid 图表转换为 PNG 图像。

精选
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP 服务器向 AI 编码助手(如 Cursor)提供 Jira 工单信息。

精选
TypeScript
Linear MCP Server

Linear MCP Server

一个模型上下文协议(Model Context Protocol)服务器,它与 Linear 的问题跟踪系统集成,允许大型语言模型(LLM)通过自然语言交互来创建、更新、搜索和评论 Linear 问题。

精选
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Curri MCP Server

Curri MCP Server

通过管理文本笔记、提供笔记创建工具以及使用结构化提示生成摘要,从而实现与 Curri API 的交互。

官方
本地
JavaScript