n8n-mcp-connector

n8n-mcp-connector

A Model Context Protocol server that enables AI assistants to interact with N8N workflows, executions, and automation capabilities.

Category
访问服务器

README

N8N MCP Connector v2.0.0

A high-performance Model Context Protocol (MCP) server that provides seamless integration with N8N automation platform. This connector enables AI assistants and other MCP clients to interact with N8N workflows, executions, and automation capabilities with enterprise-grade reliability and performance.

✨ Features

Core Capabilities

  • Workflow Management: Execute, list, and manage N8N workflows with advanced filtering
  • Execution Monitoring: Real-time tracking of workflow execution status and results
  • Advanced Operations: Create nodes, manage connections, and configure webhooks
  • Node Management: Full CRUD operations for individual workflow nodes

Performance & Reliability

  • Intelligent Caching: Multi-tier caching system with TTL and LRU eviction
  • Connection Pooling: Optimized HTTP connections for better performance
  • Circuit Breaker: Resilience patterns for external API failures
  • Metrics & Monitoring: Comprehensive performance tracking and health checks
  • Rate Limiting: Built-in protection against API abuse

Developer Experience

  • Type Safety: Full TypeScript implementation with strict typing
  • Modular Architecture: Clean, maintainable, and extensible codebase
  • Comprehensive Testing: Unit, integration, and E2E test coverage
  • Rich Documentation: Detailed guides and API documentation
  • Configuration Management: Centralized, validated configuration system

CI/CD License: MIT Node.js Version

🚀 Quick Start

Prerequisites

  • Active n8n instance
  • API access configured in n8n
  • Claude Desktop installed

📦 Instalación Remota (Recomendado)

Nuestros scripts de instalación ahora detectan automáticamente el mejor ejecutor de paquetes (uvx, npx, npm) disponible en tu sistema para una experiencia más fluida y un rendimiento óptimo.

Puedes anular el ejecutor detectado configurando la variable de entorno RUNNER. Por ejemplo: RUNNER=npm ./install-remote.sh.

Opción A: Ejecución Remota con Runner Dinámico

# Instalación automática
curl -fsSL https://raw.githubusercontent.com/carlosjperez/n8n-mcp-connector/main/install-remote.sh | bash
# Selecciona la opción 1

Opción B: MCP.so

# Instalación automática
curl -fsSL https://raw.githubusercontent.com/carlosjperez/n8n-mcp-connector/main/install-remote.sh | bash
# Selecciona opción 2 (MCP.so)

🔧 Instalación Local (Desarrollo)

# Clone repository
git clone https://github.com/carlosjperez/n8n-mcp-connector.git
cd n8n-mcp-connector

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env with your n8n credentials

# Build and start
npm run build
npm start

Environment Configuration

# Required: n8n instance URL
N8N_BASE_URL=http://localhost:5678

# Option 1: API Key authentication (recommended)
N8N_API_KEY=your_api_key_here

# Option 2: Username/Password authentication
N8N_USERNAME=your_username
N8N_PASSWORD=your_password

Claude Desktop Integration

Nota: Los scripts de instalación se encargan de esto automáticamente. La siguiente configuración es un ejemplo. El campo command será rellenado por el script de instalación con el ejecutor de paquetes detectado (uvx, npx, o npm).

📦 Configuración de Ejecución Remota (Ejemplo)

{
  "mcpServers": {
    "n8n-workflows": {
      "command": "npx",
      "args": ["n8n-mcp-connector"],
      "env": {
        "N8N_BASE_URL": "https://tu-instancia-n8n.com",
        "N8N_API_KEY": "tu_api_key_aqui"
      }
    }
  }
}

☁️ Configuración MCP.so (Totalmente remoto)

{
  "mcpServers": {
    "n8n-workflows": {
      "command": "mcp",
      "args": ["install", "n8n-workflows/carlosjperez"],
      "env": {
        "N8N_BASE_URL": "https://tu-instancia-n8n.com",
        "N8N_API_KEY": "tu_api_key_aqui"
      }
    }
  }
}

🔧 Configuración Local (Desarrollo)

{
  "mcpServers": {
    "n8n-automation": {
      "command": "node",
      "args": ["./dist/index.js"],
      "cwd": "/absolute/path/to/n8n-mcp-connector",
      "env": {
        "N8N_BASE_URL": "http://localhost:5678",
        "N8N_API_KEY": "your_api_key_here"
      }
    }
  }
}

🛠️ Available Tools

The MCP server provides comprehensive tools for N8N automation:

Core Workflow Tools

  • execute_workflow: Execute workflows with advanced options and monitoring
  • list_workflows: List workflows with filtering, pagination, and caching
  • get_workflow: Get detailed workflow information with intelligent caching
  • get_execution_status: Real-time execution status with performance metrics
  • list_executions: List executions with filtering and statistics
  • activate_workflow: Activate/deactivate workflows with validation
  • create_webhook: Create webhook endpoints with security options

Advanced Node Management

  • create_node: Create new nodes with validation and type checking
  • update_node: Update existing nodes with conflict detection
  • delete_node: Safely remove nodes with dependency checking
  • create_connection: Create connections with validation
  • delete_connection: Remove connections with impact analysis

Monitoring & Diagnostics

  • Built-in health checks and status monitoring
  • Performance metrics and cache statistics
  • Error tracking and debugging tools
  • Connection pool and resource monitoring

🧪 Testing

Comprehensive testing strategy with multiple test types:

# Run all tests
npm test

# Run specific test suites
npm run test:unit        # Unit tests
npm run test:integration # Integration tests
npm run test:e2e         # End-to-end tests

# Run with coverage
npm run test:coverage

# Run in watch mode
npm run test:watch

# Performance testing
npm run test:performance

🔧 Development

# Start development server with hot reload
npm run dev

# Development with debug logging
DEBUG=n8n-mcp:* npm run dev

# Code quality
npm run lint             # ESLint
npm run format           # Prettier
npm run type-check       # TypeScript

# Build optimization
npm run build:analyze    # Bundle analysis
npm run build:production # Optimized build

🏗️ Architecture

The connector follows a modern, scalable architecture with performance optimizations:

src/
├── config/           # Centralized configuration management
│   └── index.ts      # Validated configuration with defaults
├── clients/          # External service clients
│   └── n8n-client.ts # N8N API client with caching & pooling
├── handlers/         # MCP tool handlers
│   ├── tool-handlers.ts
│   └── advanced-tool-handlers.ts
├── utils/            # Utility modules
│   ├── cache.ts      # Intelligent caching system
│   ├── metrics.ts    # Metrics and monitoring
│   ├── logger.ts     # Structured logging
│   ├── validator.ts  # Input validation
│   └── resilience.ts # Circuit breaker & retry logic
└── index.ts          # Main server with monitoring

Key Design Patterns

  • Singleton Pattern: Configuration and client instances
  • Factory Pattern: Tool handler creation
  • Observer Pattern: Event-driven metrics collection
  • Circuit Breaker: Resilience for external API calls
  • Cache-Aside: Intelligent caching with TTL and LRU eviction

Performance Features

  • Multi-tier Caching: Different TTL for different data types
  • Connection Pooling: Optimized HTTP connections
  • Request Batching: Efficient API usage
  • Lazy Loading: On-demand resource initialization
  • Memory Management: Automatic cleanup and optimization

📊 Performance Metrics

Expected Performance

  • Request Latency: < 100ms (cached), < 500ms (uncached)
  • Throughput: > 1000 requests/minute
  • Cache Hit Ratio: > 80% for repeated requests
  • Memory Usage: < 512MB under normal load
  • Uptime: > 99.9% availability

Monitoring

# Health check
curl http://localhost:3000/health

# Detailed metrics
curl http://localhost:3000/metrics

# Cache statistics
curl http://localhost:3000/health/detailed

📚 Documentation

⚙️ Configuration

The connector uses a hierarchical configuration system with environment variables. Copy .env.example to .env and configure:

Required Settings

  • N8N_BASE_URL: Your N8N instance URL (e.g., http://localhost:5678)
  • N8N_API_KEY: Your N8N API key (get from N8N Settings > API Keys)

Performance Settings

# Cache Configuration
CACHE_DEFAULT_TTL=600000          # 10 minutes default TTL
CACHE_WORKFLOWS_DETAILS_TTL=600000 # Workflow details cache
CACHE_EXECUTIONS_COMPLETED_TTL=1800000 # Completed executions cache

# Connection Settings
CONNECTION_POOL_SIZE=10           # HTTP connection pool size
REQUEST_TIMEOUT=30000             # Request timeout
CIRCUIT_BREAKER_THRESHOLD=5       # Circuit breaker threshold

# Monitoring
MONITORING_ENABLED=true           # Enable metrics collection
METRICS_INTERVAL=30000            # Metrics collection interval

Environment-Specific Settings

# Development
NODE_ENV=development
LOG_LEVEL=debug
DEBUG=n8n-mcp:*

# Production
NODE_ENV=production
LOG_LEVEL=warn
MONITORING_ENABLED=true

🔒 Security

  • Environment-based credential management
  • Input validation and sanitization
  • Rate limiting and timeout protection
  • Error isolation without information leakage

📚 Usage Examples

Basic Workflow Execution

Ask Claude: "Execute the data-processing workflow with customer ID 12345"

Monitoring Active Workflows

Ask Claude: "Show me all running workflows and their current status"

Webhook Creation

Ask Claude: "Create a webhook for the order-processing workflow"

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤖 Sistema de Automatización

¡NUEVO! Sistema automatizado de gestión de errores CI/CD con integración Linear:

  • Detección automática de fallos en CI/CD
  • 🎯 Asignación inteligente de agentes especializados
  • 📊 Sincronización GitHub ↔ Linear
  • 📈 Métricas y seguimiento automatizado

🚀 Configuración Rápida

# Configuración automática del sistema
./setup-automation-system.sh

# Verificar funcionamiento
./verify-automation-system.sh

📖 Documentación completa: README-AUTOMATION.md


🆘 Support

🛣 Roadmap

  • [ ] Advanced workflow templates
  • [ ] Bulk operations support
  • [ ] Real-time monitoring dashboard
  • [ ] Integration with additional automation platforms
  • [ ] Enhanced error reporting and analytics

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选