Skip to main content
Glama
gcorroto

MCP N8N Webhook Server

by gcorroto

n8n_health_check

Verify connectivity and operational status of the n8n webhook server to ensure reliable data transmission for storage, indexing, and retrieval tasks.

Instructions

Verificar la conectividad y estado del webhook de n8n

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:53-72 (registration)
    Registration of the MCP tool 'n8n_health_check' with empty input schema (zod object), description, and an inline handler function that calls the healthCheckWebhook helper and formats the response as MCP content.
    server.tool(
      "n8n_health_check",
      "Verificar la conectividad y estado del webhook de n8n",
      {},
      async () => {
        console.error(`🔍 Verificando estado del webhook n8n...`);
        
        const result = await webhookTools.healthCheckWebhook();
    
        const statusIcon = result.success ? '✅' : '❌';
        const content = `${statusIcon} **Estado del Webhook N8N**\n\n**Estado:** ${result.success ? 'DISPONIBLE' : 'NO DISPONIBLE'}\n**Mensaje:** ${result.message}\n**Verificado:** ${result.timestamp}`;
    
        return {
          content: [{ 
            type: "text", 
            text: content
          }],
        };
      }
    );
  • Core implementation of the health check logic: sends a test POST request to the n8n webhook URL with a dummy payload, checks HTTP response, and returns success/failure status via WebhookResponse type.
    export async function healthCheckWebhook(): Promise<WebhookResponse> {
      try {
        console.error(`🔍 Verificando conectividad del webhook...`);
        
        // Intento básico de conectividad (sin enviar datos reales)
        const testPayload = {
          metadata: {
            timestamp: generateTimestamp(),
            source: 'health_check',
            version: '1.0'
          },
          project: {
            id: 'health_check',
            name: 'Health Check'
          },
          content: {
            title: 'Verificación de conectividad',
            text: 'Este es un mensaje de prueba para verificar la conectividad'
          }
        };
        
        const response = await fetch(`${WEBHOOK_URL}/${WEBHOOK_ID}`, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
            'Authorization-n8n-api-key': API_KEY,
            'User-Agent': 'MCP-N8N-Webhook/1.0'
          },
          body: JSON.stringify(testPayload)
        });
        
        if (!response.ok) {
          return {
            success: false,
            message: `Webhook no disponible: HTTP ${response.status}`,
            timestamp: generateTimestamp()
          };
        }
        
        return {
          success: true,
          message: 'Webhook disponible y funcionando correctamente',
          timestamp: generateTimestamp()
        };
        
      } catch (error) {
        return {
          success: false,
          message: `Error de conectividad: ${(error as Error).message}`,
          timestamp: generateTimestamp()
        };
      }
    }
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gcorroto/mcp-n8n-webhook'

If you have feedback or need assistance with the MCP directory API, please join our Discord server