mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
Problem: - search_templates_by_metadata with no filters caused Claude Desktop timeouts - Query loaded ALL templates with metadata_json and decompressed workflows - With 2,646 templates, this caused significant performance issues Solution: - Implement two-phase query optimization: 1. Phase 1: SELECT id only (fast, no workflow data) 2. Phase 2: Fetch full records only for matching IDs (decompress only needed rows) - Prevents loading/decompressing thousands of rows when only 20 are needed Performance Impact: - No filters: Now responds instantly instead of timing out - With filters: Same fast performance, minimal overhead - Only decompresses the exact number of rows needed (limit parameter) Testing: - Tested with no filters: ✅ 2,646 templates, returned 5 in <1s - Tested with complexity filter: ✅ 262 templates, returned 3 in <1s 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>