We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lowprofix/n8n-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
index.ts•1.19 KiB
import { MCPServer } from 'mcp-framework';
import dotenv from 'dotenv';
import path from 'path';
import { fileURLToPath } from 'url';
// Import direct de l'outil
import WorkflowValidatorTool from './tools/WorkflowValidatorTool.js';
// Charger les variables d'environnement
dotenv.config();
// Obtenir le chemin du répertoire actuel en ESM
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Créer une instance du serveur MCP
const server = new MCPServer({
name: 'n8n-mcp-server',
// Configuration du transport (optionnel)
transport: {
type: 'stdio' // Par défaut: stdio, alternatives: sse
}
});
// Créer une instance de l'outil et l'exposer explicitement
const workflowValidator = new WorkflowValidatorTool();
// Exposer l'outil via une propriété globale (hack pour contourner l'auto-découverte)
(global as any).MCPTools = {
'workflow-validator': workflowValidator
};
// Démarrer le serveur
server.start().then(() => {
console.log('Serveur MCP pour n8n démarré avec succès!');
console.log('Outil WorkflowValidatorTool exposé manuellement');
}).catch((error) => {
console.error('Erreur lors du démarrage du serveur MCP:', error);
});