mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 13:33:11 +00:00
fix: integrate webhook autofixer with MCP server and improve template sanitization
- Register n8n_autofix_workflow handler in MCP server - Export n8nAutofixWorkflowDoc in tool documentation indices - Use normalizeNodeType utility in workflow validator for consistent type handling - Add defensive null checks in template sanitizer to prevent runtime errors - Update workflow validator test to handle new error message formats These changes complete the webhook autofixer integration, ensuring the tool is properly exposed through the MCP server and documentation system. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -18,9 +18,20 @@ async function sanitizeTemplates() {
|
||||
const problematicTemplates: any[] = [];
|
||||
|
||||
for (const template of templates) {
|
||||
const originalWorkflow = JSON.parse(template.workflow_json);
|
||||
if (!template.workflow_json) {
|
||||
continue; // Skip templates without workflow data
|
||||
}
|
||||
|
||||
let originalWorkflow;
|
||||
try {
|
||||
originalWorkflow = JSON.parse(template.workflow_json);
|
||||
} catch (e) {
|
||||
console.log(`⚠️ Skipping template ${template.id}: Invalid JSON`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const { sanitized: sanitizedWorkflow, wasModified } = sanitizer.sanitizeWorkflow(originalWorkflow);
|
||||
|
||||
|
||||
if (wasModified) {
|
||||
// Get detected tokens for reporting
|
||||
const detectedTokens = sanitizer.detectTokens(originalWorkflow);
|
||||
|
||||
Reference in New Issue
Block a user