mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 21:43:07 +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:
@@ -59,22 +59,26 @@ export class TemplateSanitizer {
|
||||
* Sanitize a workflow object
|
||||
*/
|
||||
sanitizeWorkflow(workflow: any): { sanitized: any; wasModified: boolean } {
|
||||
if (!workflow) {
|
||||
return { sanitized: workflow, wasModified: false };
|
||||
}
|
||||
|
||||
const original = JSON.stringify(workflow);
|
||||
let sanitized = this.sanitizeObject(workflow);
|
||||
|
||||
|
||||
// Remove sensitive workflow data
|
||||
if (sanitized.pinData) {
|
||||
if (sanitized && sanitized.pinData) {
|
||||
delete sanitized.pinData;
|
||||
}
|
||||
if (sanitized.executionId) {
|
||||
if (sanitized && sanitized.executionId) {
|
||||
delete sanitized.executionId;
|
||||
}
|
||||
if (sanitized.staticData) {
|
||||
if (sanitized && sanitized.staticData) {
|
||||
delete sanitized.staticData;
|
||||
}
|
||||
|
||||
|
||||
const wasModified = JSON.stringify(sanitized) !== original;
|
||||
|
||||
|
||||
return { sanitized, wasModified };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user