n8n MCP Server

by leonardsellem
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Uses .env files for configuration of the MCP server, allowing setting of n8n API URL, API key, and debug options.

  • Used for cloning the repository during source installation of the MCP server.

  • Provides access to the source code repository for manual installation and development of the MCP server.

n8n MCP サーバー

AI アシスタントが自然言語を通じて n8n ワークフローと対話できるようにするモデル コンテキスト プロトコル (MCP) サーバー。

概要

このMCPサーバーは、AIアシスタントがn8nのワークフローと実行を管理するためのツールとリソースを提供します。アシスタントは以下のことが可能になります。

  • ワークフローの一覧表示、作成、更新、削除
  • ワークフローの有効化と無効化
  • ワークフローを実行し、そのステータスを監視する
  • ワークフロー情報と実行統計にアクセスする

インストール

前提条件

  • Node.js 18以降
  • APIアクセスが有効になっているn8nインスタンス

npmからインストール

npm install -g n8n-mcp-server

ソースからインストール

# 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 .

構成

.env.exampleテンプレートとして使用して、サーバーを実行するディレクトリに.envファイルを作成します。

cp .env.example .env

次の環境変数を設定します。

変数説明
N8N_API_URL/api/v1を含む n8n API の完全な URLhttp://localhost:5678/api/v1
N8N_API_KEYn8nで認証するためのAPIキーn8n_api_...
N8N_WEBHOOK_USERNAMEWebhook 認証のユーザー名 (Webhook を使用している場合)username
N8N_WEBHOOK_PASSWORDWebhook認証用のパスワードpassword
DEBUGデバッグログを有効にする(オプション)truefalse

n8n APIキーの生成

  1. ブラウザでn8nインスタンスを開く
  2. 設定 > API > APIキーに移動します
  3. 適切な権限を持つ新しいAPIキーを作成する
  4. キーを.envファイルにコピーします

使用法

サーバーの実行

インストールディレクトリから:

n8n-mcp-server

またはグローバルにインストールされている場合:

n8n-mcp-server

AIアシスタントとの統合

サーバーをビルド( npm run build )した後、AIアシスタント(Claude拡張機能付きのVS CodeやClaudeデスクトップアプリなど)を実行して動作させるには、設定が必要です。通常はJSON設定ファイルを編集する必要があります。

構成例 (例: VS Code のsettings.jsonまたは Claude Desktop のclaude_desktop_config.json ):

{ "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 } }

要点:

  • /path/to/your/cloned/n8n-mcp-server/リポジトリをクローンして構築した実際の絶対パスに置き換えます。
  • オペレーティング システムに適したパス区切り文字を使用します (macOS/Linux の場合はスラッシュ/ 、Windows の場合は二重のバックスラッシュ\\ )。
  • 正しいN8N_API_URL ( /api/v1を含む) とN8N_API_KEYを指定していることを確認してください。
  • アシスタントがbuild/index.jsファイルを実行する前に、サーバーをビルドする必要があります ( npm run build )。

利用可能なツール

サーバーは次のツールを提供します。

Webhookの使用

このMCPサーバーは、n8nウェブフックを介したワークフローの実行をサポートしています。この機能を使用するには、以下の手順を実行してください。

  1. n8n で Webhook トリガーのワークフローを作成します。
  2. Webhook ノードに基本認証を設定します。
  3. ワークフロー名のみを渡して、 run_webhookツールを使用してワークフローをトリガーします。

例:

const result = await useRunWebhook({ workflowName: "hello-world", // Will call <n8n-url>/webhook/hello-world data: { prompt: "Hello from AI assistant!" } });

Webhook 認証は、 N8N_WEBHOOK_USERNAMEおよびN8N_WEBHOOK_PASSWORD環境変数を使用して自動的に処理されます。

ワークフロー管理

  • workflow_list : すべてのワークフローを一覧表示する
  • workflow_get : 特定のワークフローの詳細を取得する
  • workflow_create : 新しいワークフローを作成する
  • workflow_update : 既存のワークフローを更新する
  • workflow_delete : ワークフローを削除する
  • workflow_activate : ワークフローをアクティブ化する
  • workflow_deactivate : ワークフローを非アクティブ化する

実行管理

  • execution_run : API経由でワークフローを実行する
  • run_webhook : Webhook経由でワークフローを実行する
  • execution_get : 特定の実行の詳細を取得する
  • execution_list : ワークフローの実行を一覧表示する
  • execution_stop : 実行中の実行を停止する

リソース

サーバーは次のリソースを提供します。

  • n8n://workflows/list : すべてのワークフローのリスト
  • n8n://workflow/{id} : 特定のワークフローの詳細
  • n8n://executions/{workflowId} : ワークフローの実行リスト
  • n8n://execution/{id} : 特定の実行の詳細

発達

建物

npm run build

開発モードで実行

npm run dev

テスト

npm test

リンティング

npm run lint

ライセンス

マサチューセッツ工科大学

-
security - not tested
F
license - not found
-
quality - not tested

AI アシスタントが自然言語を通じて n8n ワークフローと対話できるようにし、ワークフローの一覧表示、作成、更新、実行、監視などのアクションをサポートするモデル コンテキスト プロトコル サーバー。

  1. Overview
    1. Installation
      1. Prerequisites
      2. Install from npm
      3. Install from source
    2. Configuration
      1. Generating an n8n API Key
    3. Usage
      1. Running the Server
      2. Integrating with AI Assistants
    4. Available Tools
      1. Using Webhooks
      2. Workflow Management
      3. Execution Management
    5. Resources
      1. Development
        1. Building
        2. Running in Development Mode
        3. Testing
        4. Linting
      2. License
        ID: bysl8wgg6t