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에서 설치

지엑스피1

소스에서 설치

# 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_USERNAME웹훅 인증을 위한 사용자 이름(웹훅을 사용하는 경우)username
N8N_WEBHOOK_PASSWORD웹훅 인증을 위한 비밀번호password
DEBUG디버그 로깅 활성화(선택 사항)true 또는 false

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 Desktop 앱 등)를 실행하도록 설정해야 합니다. 이 작업에는 일반적으로 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 ).

사용 가능한 도구

서버는 다음과 같은 도구를 제공합니다.

웹훅 사용

이 MCP 서버는 n8n 웹훅을 통한 워크플로 실행을 지원합니다. 이 기능을 사용하려면 다음 단계를 따르세요.

  1. n8n에서 웹훅 트리거 워크플로를 만듭니다.
  2. 웹훅 노드에서 기본 인증을 설정합니다.
  3. run_webhook 도구를 사용하여 워크플로 이름만 전달하여 워크플로를 트리거합니다.

예:

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

웹훅 인증은 N8N_WEBHOOK_USERNAMEN8N_WEBHOOK_PASSWORD 환경 변수를 사용하여 자동으로 처리됩니다.

워크플로 관리

  • workflow_list : 모든 워크플로를 나열합니다.
  • workflow_get : 특정 워크플로의 세부 정보를 가져옵니다.
  • workflow_create : 새로운 워크플로를 생성합니다
  • workflow_update : 기존 워크플로 업데이트
  • workflow_delete : 워크플로 삭제
  • workflow_activate : 워크플로 활성화
  • workflow_deactivate : 워크플로 비활성화

실행 관리

  • execution_run : API를 통해 워크플로 실행
  • run_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

특허

MIT

-
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