1.0.7 • Published 5 months ago

@n8ngine/mcp-server v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@n8ngine/mcp-server

npm version License: MIT Node.js Version

Professional MCP server for n8n workflow automation - Connect AI assistants like Claude, ChatGPT, and more to your n8n instance through the Model Context Protocol.

Seamlessly integrate your n8n workflows with AI assistants in Cursor, Cline, Windsurf, and any MCP-compatible tool. Manage workflows, monitor executions, handle credentials, and automate your entire n8n infrastructure through natural language.

🚀 Quick Start

npx @n8ngine/mcp-server --n8n-url "https://your-n8n.app" --n8n-api-key "your-api-key"

No installation required! The server runs instantly and connects your AI assistant to n8n.

✨ Features

  • 🔧 Complete n8n API Coverage - Full access to workflows, executions, credentials, and variables
  • 🤖 Multi-AI Support - Works with Cursor, Cline, Windsurf, and any MCP-compatible assistant
  • ⚡ Zero Installation - Run instantly with npx, no setup required
  • 🔒 Enterprise Security - Secure API key management and HTTPS support
  • 📈 Production Ready - Built-in retry logic, rate limiting, and error handling
  • 🌐 Cloud & Self-hosted - Supports n8n Cloud, self-hosted, and enterprise instances
  • 📝 Type Safety - Full TypeScript support with comprehensive validation

🛠️ AI Assistant Integration

Cursor IDE

Add to your Cursor MCP settings (mcp.json):

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": [
        "@n8ngine/mcp-server",
        "--n8n-url", "https://your-n8n-instance.com",
        "--n8n-api-key", "your-api-key-here"
      ]
    }
  }
}

Cline (VS Code Extension)

Configure in Cline settings:

{
  "mcpServers": {
    "n8n": {
      "command": "npx",
      "args": [
        "@n8ngine/mcp-server",
        "--n8n-url", "https://your-n8n-instance.com", 
        "--n8n-api-key", "your-api-key-here"
      ]
    }
  }
}

Windsurf IDE

Add to Windsurf MCP configuration:

{
  "mcpServers": {
    "n8n-automation": {
      "command": "npx",
      "args": [
        "@n8ngine/mcp-server",
        "--n8n-url", "https://your-n8n-instance.com",
        "--n8n-api-key", "your-api-key-here"  
      ]
    }
  }
}

📋 Available Tools

Workflow Management

  • n8n_list_workflows - List and filter workflows
  • n8n_get_workflow - Get detailed workflow information
  • n8n_create_workflow - Create new workflows
  • n8n_update_workflow - Modify existing workflows
  • n8n_delete_workflow - Remove workflows
  • n8n_activate_workflow - Enable/disable workflows
  • n8n_execute_workflow - Trigger workflow execution

Execution Monitoring

  • n8n_list_executions - Monitor workflow runs
  • n8n_get_execution - Get execution details and logs
  • n8n_delete_execution - Clean up execution history
  • n8n_stop_execution - Cancel running workflows
  • n8n_retry_execution - Restart failed executions

Credential Management

  • n8n_list_credentials - View available credentials
  • n8n_get_credential - Get credential details
  • n8n_create_credential - Add new service credentials
  • n8n_update_credential - Modify existing credentials
  • n8n_delete_credential - Remove credentials

Environment Variables

  • n8n_list_variables - List environment variables
  • n8n_get_variable - Get variable values
  • n8n_create_variable - Create new variables
  • n8n_update_variable - Update variable values
  • n8n_delete_variable - Remove variables

Health & Monitoring

  • n8n_health_check - Check n8n instance status

💡 Usage Examples

"Create a workflow that sends a Slack message"

// AI assistant can automatically:
n8n_create_workflow({
  name: "Daily Slack Report",
  nodes: [
    {
      name: "Schedule Trigger",
      type: "n8n-nodes-base.cron",
      position: [250, 300],
      parameters: { rule: { hour: 9, minute: 0 } }
    },
    {
      name: "Slack Message", 
      type: "n8n-nodes-base.slack",
      position: [450, 300],
      parameters: { 
        text: "Good morning! Here's your daily report.",
        channel: "#general"
      }
    }
  ],
  connections: { "Schedule Trigger": { "main": [["Slack Message"]] } }
})

"Show me failed workflows from today"

// AI assistant can query:
n8n_list_executions({
  status: "error",
  limit: 10,
  includeData: true
})

"Update the API key for my GitHub credential"

// AI assistant can manage:
n8n_update_credential({
  id: "credential-id",
  data: { accessToken: "new-github-token" }
})

🔐 Getting Your n8n API Key

n8n Cloud

  1. Log into your n8n Cloud account
  2. Go to SettingsAPI Keys
  3. Click Create API Key
  4. Copy the generated key

Self-hosted n8n

  1. Access your n8n instance
  2. Navigate to SettingsUsers & SecurityAPI Keys
  3. Generate a new API key
  4. Use your instance URL (e.g., https://n8n.yourcompany.com)

🌐 Supported n8n Instances

  • n8n Cloud (https://app.n8n.cloud)
  • Self-hosted n8n (any version 0.220.0+)
  • n8n Enterprise (on-premises and cloud)
  • Custom domains (white-label n8n instances)

⚙️ Configuration Options

Command Line Arguments

npx @n8ngine/mcp-server [options]

Options:
  --n8n-url <url>          n8n instance URL (required)
  --n8n-api-key <key>      n8n API key (required)
  --timeout <ms>           Request timeout (default: 30000)
  --retry-attempts <num>   Retry attempts (default: 3)
  --retry-delay <ms>       Retry delay (default: 1000)

Environment Variables

export N8N_URL="https://your-n8n-instance.com"
export N8N_API_KEY="your-api-key"
npx @n8ngine/mcp-server

🏗️ Advanced Usage

Production Deployment

For production use, deploy on Railway, Heroku, or any Node.js hosting platform:

# Railway.com deployment
railway login
railway init
railway variables set N8N_URL=https://your-n8n.com
railway variables set N8N_API_KEY=your-key
railway up

Custom Configuration

Create n8n-config.json:

{
  "n8nUrl": "https://your-n8n-instance.com",
  "n8nApiKey": "your-api-key",
  "timeout": 60000,
  "retryAttempts": 5
}

🔧 Development

# Clone and setup
git clone https://github.com/n8ngine/mcp-server.git
cd mcp-server
npm install

# Development mode
npm run dev -- --n8n-url "https://demo.n8n.io" --n8n-api-key "test-key"

# Build
npm run build

# Test
npm test

📦 What's Included

  • Full TypeScript support with comprehensive type definitions
  • Automatic retries with exponential backoff for reliability
  • Rate limiting to respect n8n API limits
  • Input validation using Zod schemas
  • Error handling with detailed error messages
  • Security best practices for API key management

🤝 Support & Community

📄 License

MIT © n8ngine


Built with ❤️ for the n8n and AI automation community