UNPKG

n8n-mcp

Version:

Integration between n8n workflow automation and Model Context Protocol (MCP)

35 lines 1.51 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const n8n_api_client_1 = require("../services/n8n-api-client"); const dotenv_1 = require("dotenv"); (0, dotenv_1.config)(); process.env.LOG_LEVEL = 'debug'; async function testApiHeaders() { const apiUrl = process.env.N8N_API_URL || 'https://n8n.energyhouse.com.pl'; const apiKey = process.env.N8N_API_KEY || 'n8n_api_f94c0b3fb3bf1a3a690f37bb0c5c0de43c7b690c0a33c88b6baaa37ae896dc96'; console.log('Testing N8nApiClient headers...'); console.log('API URL:', apiUrl); console.log('API Key:', apiKey.substring(0, 20) + '...\n'); console.log('LOG_LEVEL:', process.env.LOG_LEVEL); try { const client = new n8n_api_client_1.N8nApiClient({ baseUrl: apiUrl, apiKey: apiKey }); console.log('\nDefault headers on axios instance:'); console.log(JSON.stringify(client['client'].defaults.headers, null, 2)); console.log('\nCalling listWorkflows...'); const workflows = await client.listWorkflows({ limit: 1 }); console.log('\nResult: Found', workflows.data.length, 'workflows'); } catch (error) { console.error('Error:', error.message); if (error.response) { console.error('Response status:', error.response.status); console.error('Response data:', error.response.data); } } } testApiHeaders().catch(console.error); //# sourceMappingURL=test-api-headers.js.map