n8n Workflow Builder MCP server

Enables creation and management of n8n workflows for simplified automation and integration tasks.
Back to servers
Setup instructions
Provider
makafeli
Release date
Jan 15, 2025
Language
TypeScript
Stats
342 stars

The n8n Workflow Builder MCP Server enables AI assistants to interact with your n8n automation platform. This Model Context Protocol (MCP) server creates a bridge between AI tools like Claude Desktop or ChatGPT and your n8n instance, allowing you to manage workflows through natural language commands.

Installation Options

Using Smithery.ai (Hosted Version)

The simplest option is using the hosted version:

  1. Visit smithery.ai
  2. Search for "n8n-workflow-builder"
  3. Configure with your n8n host and API key
  4. Access from any MCP-compatible AI assistant

Using NPX (Local Installation)

Run locally with NPX:

npx @makafeli/n8n-workflow-builder

Manual Installation

For development or customization:

# Clone the repository
git clone https://github.com/makafeli/n8n-workflow-builder.git
cd n8n-workflow-builder

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

Configuration

Required Environment Variables

Configure these environment variables to connect to your n8n instance:

Variable Description Example
N8N_HOST Your n8n instance URL http://localhost:5678 or https://your-n8n.com/api/v1
N8N_API_KEY Your n8n API key n8n_api_1234567890abcdef...

Getting Your n8n API Key

  1. Open your n8n instance
  2. Go to SettingsAPI Keys
  3. Click Create API Key
  4. Copy the generated key

Setting Environment Variables

# For local testing
export N8N_HOST="http://localhost:5678"
export N8N_API_KEY="your-api-key-here"

# Then run the server
npx @makafeli/n8n-workflow-builder

MCP Client Setup

Claude Desktop

Add this configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "n8n-workflow-builder": {
      "command": "npx",
      "args": ["@makafeli/n8n-workflow-builder"],
      "env": {
        "N8N_HOST": "http://localhost:5678",
        "N8N_API_KEY": "your-api-key-here"
      }
    }
  }
}

Cline (VS Code Extension)

Add this to your Cline MCP settings:

{
  "mcpServers": {
    "n8n-workflow-builder": {
      "command": "npx",
      "args": ["@makafeli/n8n-workflow-builder"],
      "env": {
        "N8N_HOST": "http://localhost:5678",
        "N8N_API_KEY": "your-api-key-here"
      }
    }
  }
}

Available Tools

The MCP server provides comprehensive tools for n8n workflow management:

Core Workflow Operations

  • list_workflows - List all workflows from your n8n instance
  • get_workflow - Retrieve detailed information about a specific workflow
  • create_workflow - Create a new workflow with nodes and connections
  • execute_workflow - Manually execute a workflow

Workflow Lifecycle Management

  • update_workflow - Update an existing workflow's configuration
  • activate_workflow - Activate a workflow to enable automatic execution
  • deactivate_workflow - Deactivate a workflow to stop automatic execution
  • delete_workflow - Permanently delete a workflow

Advanced Operations

  • create_workflow_and_activate - Create a new workflow and immediately activate it
  • list_executions - List workflow executions with filtering and pagination
  • get_execution - Get detailed information about a specific execution
  • delete_execution - Delete a workflow execution record
  • list_tags - List all workflow tags with pagination
  • create_tag - Create a new workflow tag for organization
  • generate_audit - Generate comprehensive security audit report

Usage Examples

Basic Operations

// List all workflows
await callTool("list_workflows", {});

// Get detailed information about a workflow
await callTool("get_workflow", { id: "workflow-123" });

// Execute a workflow manually
await callTool("execute_workflow", { id: "workflow-123" });

Creating Workflows

// Create a simple workflow
await callTool("create_workflow", {
  workflow: {
    name: "My Automation Workflow",
    nodes: [
      {
        id: "trigger",
        name: "Schedule Trigger",
        type: "n8n-nodes-base.scheduleTrigger",
        typeVersion: 1,
        position: [240, 300],
        parameters: {
          interval: [{ field: "unit", value: "hours" }]
        }
      },
      {
        id: "action",
        name: "HTTP Request",
        type: "n8n-nodes-base.httpRequest",
        typeVersion: 4,
        position: [460, 300],
        parameters: {
          url: "https://api.example.com/webhook",
          method: "POST"
        }
      }
    ],
    connections: {
      "Schedule Trigger": {
        "main": [[{ "node": "HTTP Request", "type": "main", "index": 0 }]]
      }
    }
  }
});

Workflow Management

// Activate a workflow
await callTool("activate_workflow", { id: "workflow-123" });

// Update a workflow
await callTool("update_workflow", {
  id: "workflow-123",
  workflow: { name: "Updated Workflow Name" }
});

// Deactivate a workflow
await callTool("deactivate_workflow", { id: "workflow-123" });

Troubleshooting

Common Issues

"Connection refused" or "ECONNREFUSED"

  • Verify your N8N_HOST is correct and n8n is running
  • Try accessing your n8n instance in a browser first

"Unauthorized" or "401 Error"

  • Verify your N8N_API_KEY is correct
  • Ensure the API key has proper permissions
  • Check if the API key hasn't expired

"Workflow not found" or "404 Error"

  • Use list_workflows to get valid workflow IDs

Server won't start

  • Ensure Node.js v18+ is installed: node --version
  • Try clearing npm cache: npm cache clean --force
  • For manual installation, run: npm install && npm run build

Debug Mode

For detailed logging, set the debug environment variable:

DEBUG=n8n-workflow-builder npx @makafeli/n8n-workflow-builder

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "n8n-workflow-builder" '{"command":"node","args":["/root/n8n-workflow-builder/build/index.js"],"env":{"N8N_HOST":"https://n8n.io/api/v1/","N8N_API_KEY":"YOUR_N8N_API_KEY_HERE"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "n8n-workflow-builder": {
            "command": "node",
            "args": [
                "/root/n8n-workflow-builder/build/index.js"
            ],
            "env": {
                "N8N_HOST": "https://n8n.io/api/v1/",
                "N8N_API_KEY": "YOUR_N8N_API_KEY_HERE"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "n8n-workflow-builder": {
            "command": "node",
            "args": [
                "/root/n8n-workflow-builder/build/index.js"
            ],
            "env": {
                "N8N_HOST": "https://n8n.io/api/v1/",
                "N8N_API_KEY": "YOUR_N8N_API_KEY_HERE"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later