LN

leonardsellem/n8n-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

1629 stars 296 forks 质量 73 趋势 24MIT

MCP 服务器提供与 n8n API 交互的工具和资源

概览

一个模型上下文协议(MCP)服务器,允许AI助手通过自然语言与n8n工作流程交互。 该项目提供了一个模型上下文协议(MCP)服务器,使AI助手能够无缝与n8n——一种流行的工作流程自动化工具——交互交互。它作为桥梁,使AI助手能够通过自然语言命令程序化管理和控制n8n的工作流和执行。 - Node.js 20及以上版本 - 启用API访问的n8n实例 你也可以用Docker来运行服务器: 你怎么更新服务器取决于你最初是怎么安装的。 如果你用npm安装服务器,安装 -g @leonardsellem/n8n-mcp-server: 1. 打开终端或命令提示符。2. 执行以下命令以获取最新版本:3. 如果服务器当前正在运行(例如作为后台进程或服务),你需要重启它以使更改生效。 如果你克隆了仓库并从源代码安装:

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,允许AI助手通过自然语言与n8n工作流程交互。

概述

该项目提供了一个模型上下文协议(MCP)服务器,使AI助手能够无缝与n8n——一种流行的工作流程自动化工具——交互交互。它作为桥梁,使AI助手能够通过自然语言命令程序化管理和控制n8n的工作流和执行。

安装

先决条件

  • Node.js 20岁或更晚
  • 启用 API 访问的 n8n 实例

从 npm 安装

从源头安装

Docker 安装

你也可以用Docker来运行服务器:

更新服务器

你怎么更新服务器取决于你最初是怎么安装的。

1.通过 npm 全局安装

如果你用 npm install -g @leonardsellem/n8n-mcp-server 安装服务器:

  1. 打开终端或命令提示符。

  2. 执行以下命令以获取最新版本:

  3. 如果服务器当前正在运行(例如作为后台进程或服务),你需要重启它才能生效更改。

2.从源头安装

如果你克隆了仓库并从源代码安装:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

n8n MCP Server

A Model Context Protocol (MCP) server that allows AI assistants to interact with n8n workflows through natural language.

Overview

This project provides a Model Context Protocol (MCP) server that empowers AI assistants to seamlessly interact with n8n, a popular workflow automation tool. It acts as a bridge, enabling AI assistants to programmatically manage and control n8n workflows and executions using natural language commands.

Installation

Prerequisites

  • Node.js 20 or later
  • n8n instance with API access enabled

Install from npm

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

Install from source

# Clone the repository
git clone https://github.com/leonardsellem/n8n-mcp-server.git
cd n8n-mcp-server

# Install dependencies
npm install

# Build the project
npm run build

# Optional: Install globally
npm install -g .

Docker Installation

You can also run the server using Docker:

# Pull the image
docker pull leonardsellem/n8n-mcp-server

# Run the container with your n8n API configuration
docker run -e N8N_API_URL=http://your-n8n:5678/api/v1 \
  -e N8N_API_KEY=your_n8n_api_key \
  -e N8N_WEBHOOK_USERNAME=username \
  -e N8N_WEBHOOK_PASSWORD=password \
  leonardsellem/n8n-mcp-server

Updating the Server

How you update the server depends on how you initially installed it.

1. Installed globally via npm

If you installed the server using npm install -g @leonardsellem/n8n-mcp-server:

  1. Open your terminal or command prompt.
  2. Run the following command to get the latest version:
    npm install -g @leonardsellem/n8n-mcp-server@latest
    
  3. If the server is currently running (e.g., as a background process or service), you’ll need to restart it for the changes to take effect.

2. Installed from source

If you cloned the repository and installed from source:

  1. Open your terminal or command prompt.
  2. Navigate to the directory where you cloned the project:
    cd path/to/n8n-mcp-server
    
  3. If you’ve made any local changes to the code that you want to keep, consider stashing them (optional):
    git stash
    
    You can apply them later with git stash pop.
  4. Pull the latest changes from the repository (assuming you are on the main branch):
    git pull origin main
    
    If you are on a different branch, replace main with your branch name.
  5. Install or update any changed dependencies:
    npm install
    
  6. Rebuild the project to include the latest updates:
    npm run build
    
  7. If you previously installed it globally from this source folder using npm install -g ., you might want to run this command again to update the global link:
    npm install -g .
    
  8. Restart the server.
在 GitHub 查看完整 README

安装

docker run -e N8N_API_URL=http://your-n8n:5678/api/v1 \
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { // Give your server a unique name "n8n-local": { // Use 'node' to execute the built JavaScript file "command": "node", // Provide the *absolute path* to the built index.js file "args": [ "/path/to/your/cloned/n8n-mcp-server/build/index.js" // On Windows, use double backslashes: // "C:\\path\\to\\your\\cloned\\n8n-mcp-server\\build\\index.js" ], // Environment variables needed by the server "env": { "N8N_API_URL": "http://your-n8n-instance:5678/api/v1", // Replace with your n8n URL "N8N_API_KEY": "YOUR_N8N_API_KEY", // Replace with your key // Add webhook credentials only if you plan to use webhook tools // "N8N_WEBHOOK_USERNAME": "your_webhook_user", // "N8N_WEBHOOK_PASSWORD": "your_webhook_password" }, // Ensure the server is enabled "disabled": false, // Default autoApprove settings "autoApprove": [] } // ... other servers might be configured here } }