ClaudeCodeMod

All shelves / MCP servers

n8n

leonardsellem/n8n-mcp-server · 1.6k stars · TypeScript · MIT

MCP server MCP server that provides tools and resources for interacting with n8n API

Install

In your shell
npm install -g @leonardsellem/n8n-mcp-server

These repos do not share one command. When an entry shows a command, it was copied as published. Check the repo's README before you run it.

Open the repo

Files

README.md

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

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

  1. Install or update any changed dependencies:
    npm install
  1. Rebuild the project to include the latest updates:
    npm run build
  1. 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 .
  1. Restart the server.
  • If you run the server directly using a command like node build/index.js in your AI assistant's MCP configuration, ensure the path is still correct. Using npm install -g . and then n8n-mcp-server as the command should keep this consistent.

3. Using Docker

If you are running the server using Docker:

  1. Pull the latest image from Docker Hub:
    docker pull leonardsellem/n8n-mcp-server:latest
  1. Stop and remove your old container. You'll need your container's name or ID (you can find it using docker ps):
    docker stop <your_container_name_or_id>
    docker rm <your_container_name_or_id>
  1. Start a new container with the updated image. Use the same docker run command you used previously, including all your necessary environment variables (refer to the "Docker Installation" section for an example command). For instance:
    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:latest

Ensure you use :latest or the specific version tag you intend to run.

Configuration

Create a .env file in the directory where you'll run the server, using .env.example as a template:

cp .env.example .env

Configure the following environment variables:

Generating an n8n API Key

  1. Open your n8n instance in a browser
  2. Go to Settings > API > API Keys
  3. Create a new API key with appropriate permissions
  4. Copy the key to your .env file

Usage

Running the Server

From the installation directory:

n8n-mcp-server

Or if installed globally:

n8n-mcp-server

Integrating with AI Assistants

After building the server (npm run build), you need to configure your AI assistant (like VS Code with the Claude extension or the Claude Desktop app) to run it. This typically involves editing a JSON configuration file.

Example Configuration (e.g., in VS Code settings.json or 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
  }
}

Key Points:

  • Replace /path/to/your/cloned/n8n-mcp-server/ with the actual absolute path where you cloned and built the repository.
  • Use the correct path separator for your operating system (forward slashes / for macOS/Linux, double backslashes \\ for Windows).
  • Ensure you provide the correct N8N_API_URL (including /api/v1) and N8N_API_KEY.
  • The server needs to be built (npm run build) before the assistant can run the build/index.js file.

Available Tools

The server provides the following tools:

Using Webhooks

This MCP server supports executing workflows through n8n webhooks. To use this functionality:

  1. Create a webhook-triggered workflow in n8n.
  2. Set up Basic Authentication on your webhook node.
  3. Use the run_webhook tool to trigger the workflow, passing just the workflow name.

Example:

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

The webhook authentication is handled automatically using the N8N_WEBHOOK_USERNAME and N8N_WEBHOOK_PASSWORD environment variables.

Workflow Management

  • workflow_list: List all workflows
  • workflow_get: Get details of a specific workflow
  • workflow_create: Create a new workflow
  • workflow_update: Update an existing workflow
  • workflow_delete: Delete a workflow
  • workflow_activate: Activate a workflow
  • workflow_deactivate: Deactivate a workflow

Execution Management

  • execution_run: Execute a workflow via the API
  • run_webhook: Execute a workflow via a webhook
  • execution_get: Get details of a specific execution
  • execution_list: List executions for a workflow
  • execution_stop: Stop a running execution

Resources

The server provides the following resources:

  • n8n://workflows/list: List of all workflows
  • n8n://workflow/{id}: Details of a specific workflow
  • n8n://executions/{workflowId}: List of executions for a workflow
  • n8n://execution/{id}: Details of a specific execution

Roadmap

The n8n MCP Server is a community-driven project, and its future direction will be shaped by your feedback and contributions!

Currently, our roadmap is flexible and under continuous development. We believe in evolving the server based on the needs and ideas of our users.

Facts

Kind
MCP server
Repo
leonardsellem/n8n-mcp-server
Group
Uncategorized
Stars
1.6k
License
MIT
Language
TypeScript
Last push
2025-07-09
Forks
296

More on this shelf

  1. 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  2. 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
  3. 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
  4. 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
  5. 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
  6. 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k