makafeli/n8n-workflow-builder

MCP server that lets Claude Desktop, Cline and other MCP clients create, run and manage n8n workflows, executions and tags through natural language.

  • 547 GitHub stars
  • JavaScript
  • ⚖️ MIT
  • 🎯 Intermediate
npx @makafeli/n8n-workflow-builder
makafeli/n8n-workflow-builder preview image

What it is

The n8n Workflow Builder MCP Server bridges MCP-compatible AI assistants and an n8n instance. It exposes 15 tools covering workflow CRUD, activation, execution, execution records, tags and security audits. It connects to n8n via its official API using an API key, and can run via NPX, a manual build, or the hosted Smithery.ai option.

Who it's for

  • Teams using n8n who want AI assistants to manage workflows
  • Users of Claude Desktop, Cline or other MCP-compatible clients
  • Developers who want to extend or customize an n8n MCP server

Requirements

Requirements

  • Node.js v18.0.0 or higher
  • An n8n instance (self-hosted or cloud)
  • An n8n API key with appropriate permissions
  • N8N_HOST and N8N_API_KEY environment variables

Setup

  1. Run with NPX

    Run the server locally with NPX.

    bash
    npx @makafeli/n8n-workflow-builder
  2. Set environment variables

    Set your n8n URL and API key (created under Settings → API Keys in n8n), then run the server.

    bash
    # 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
  3. Configure Claude Desktop

    Add this configuration to your claude_desktop_config.json.

    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"
          }
        }
      }
    }
  4. Manual installation (optional)

    For development or customization, clone, install, build and start.

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

Examples

Basic workflow operations

javascript
javascript
// 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" });

What it does: Lists workflows, fetches one by ID, and runs it manually.

Create a workflow

javascript
javascript
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 }]]
      }
    }
  }
});

What it does: Creates a workflow with a schedule trigger connected to an HTTP Request node.

Inspect failed executions

javascript
javascript
// List recent executions
await callTool("list_executions", {
  limit: 10,
  status: "error"
});

// Get detailed execution information
await callTool("get_execution", {
  id: "execution-123",
  includeData: true
});

What it does: Filters executions by error status and retrieves detailed data for one.

Generate a security audit

javascript
javascript
await callTool("generate_audit", {
  additionalOptions: {
    daysAbandonedWorkflow: 30,
    categories: ["credentials", "database", "nodes"]
  }
});

What it does: Produces a security audit report with configurable options.

Pros & cons

Pros

  • Pro:Broad toolset: 15 tools covering workflow CRUD, activation, executions, tags and audits
  • Pro:Works with both n8n Cloud and self-hosted instances
  • Pro:Simple setup via NPX or a hosted Smithery.ai option
  • Pro:Uses n8n's official API; the server stores no data and access can be revoked by disabling the API key

Cons

  • Con:Requires creating and managing an n8n API key and setting N8N_HOST/N8N_API_KEY
  • Con:Workflow creation requires supplying full node and connection objects in n8n's format
  • Con:Includes destructive tools (delete_workflow, delete_execution) that act on your n8n instance

Images