mcp-n8n-workflow-builder

MCP server for Claude / Cursor building n8n workflow

GitHub Stars

157

User Rating

Not Rated

Favorites

0

Views

42

Forks

45

Issues

1

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Node.js (v14+ recommended)
npm
+2 more

Installation

Installation

Prerequisites

Please specify required software and versions:
Node.js: 14 or higher (recommended)
npm
n8n instance: Requires API access (tested with n8n version 1.82.3)
Claude App or Cursor IDE: For AI interaction

Installation Steps

1. Install from npm (Recommended)

bash

Install globally

npm install -g @kernel.salacoste/n8n-workflow-builder

Or as a local dependency

npm install @kernel.salacoste/n8n-workflow-builder

2. Clone the Repository

bash
git clone https://github.com/salacoste/mcp-n8n-workflow-builder.git
cd mcp-n8n-workflow-builder

3. Install Dependencies

bash
npm install

4. Configure Environment Variables

#### Option A: Multi-Instance Configuration (Recommended) Create a .config.json file in the project root to manage multiple n8n environments:
json
{
  "environments": {
    "production": {
      "n8n_host": "https://n8n.example.com/api/v1/",
      "n8n_api_key": "n8n_api_key_for_production"
    },
    "staging": {
      "n8n_host": "https://staging-n8n.example.com/api/v1/",
      "n8n_api_key": "n8n_api_key_for_staging"
    },
    "development": {
      "n8n_host": "http://localhost:5678/api/v1/",
      "n8n_api_key": "n8n_api_key_for_development"
    }
  },
  "defaultEnv": "development"
}
#### Option B: Single-Instance Configuration (Legacy) Create an .env file in the project root with the following variables:

N8N_HOST=https://your-n8n-instance.com/api/v1/
N8N_API_KEY=your_api_key_here

5. Build and Run

If you installed via npm globally, you can run the server using the command:
bash
n8n-workflow-builder
Or with JSON-RPC mode:
bash
n8n-workflow-builder --json-rpc

Configuration

Configuration

Basic Configuration

Environment Variables

Set the following environment variables as needed:
bash
export API_KEY="your-api-key"
export DEBUG="true"

Configuration Examples

Basic Configuration

json
{
  "mcpServers": {
    "example-mcp": {
      "command": "node",
      "args": ["server.js"],
      "env": {
        "PORT": "3000",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Advanced Configuration

json
{
  "mcpServers": {
    "advanced-mcp": {
      "command": "python",
      "args": ["-m", "server"],
      "cwd": "/path/to/server",
      "env": {
        "PYTHONPATH": "/path/to/modules",
        "CONFIG_FILE": "/path/to/config.json"
      }
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - tool1: Description of tool1
   - tool2: Description of tool2
   

Programmatic Usage

javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// Execute tool
const result = await client.callTool('toolName', {
  parameter1: 'value1',
  parameter2: 'value2'
});

console.log(result);

Advanced Examples

Automation Script

bash
#!/bin/bash

Batch processing example

for file in *.txt; do mcp-tool process "$file" done

API Integration

python

Python example

import requests import json def call_mcp_tool(tool_name, params): response = requests.post( 'http://localhost:3000/mcp/call', json={ 'tool': tool_name, 'parameters': params } ) return response.json()

Usage example

result = call_mcp_tool('analyze', { 'input': 'sample data', 'options': {'format': 'json'} })

Use Cases

Automatically generate n8n workflows based on natural language instructions.
Manage workflows across multiple environments (development, staging, production).
Activate or deactivate workflows based on specific conditions.
Quickly build workflows using predefined templates.

Additional Resources