mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 06:22:04 +00:00
Fixes production search failures where 69% of user searches returned zero results for critical nodes (webhook, merge, split batch) despite nodes existing in database. Root Cause: - schema.sql missing nodes_fts FTS5 virtual table - No validation to detect empty database or missing FTS5 - rebuild.ts used schema without search index - Result: 9 of 13 searches failed in production Changes: 1. Schema Updates (src/database/schema.sql): - Added nodes_fts FTS5 virtual table with full-text indexing - Added INSERT/UPDATE/DELETE triggers for auto-sync - Indexes: node_type, display_name, description, documentation, operations 2. Database Validation (src/scripts/rebuild.ts): - Added empty database detection (fails if zero nodes) - Added FTS5 existence and synchronization validation - Added searchability tests for critical nodes - Added minimum node count check (500+) 3. Runtime Health Checks (src/mcp/server.ts): - Database health validation on first access - Detects empty database with clear error - Detects missing FTS5 with actionable warning 4. Test Suite (53 new tests): - tests/integration/database/node-fts5-search.test.ts (14 tests) - tests/integration/database/empty-database.test.ts (14 tests) - tests/integration/ci/database-population.test.ts (25 tests) 5. Database Rebuild: - data/nodes.db rebuilt with FTS5 index - 535 nodes fully synchronized with FTS5 Impact: - ✅ All critical searches now work (webhook, merge, split, code, http) - ✅ FTS5 provides fast ranked search (< 100ms) - ✅ Clear error messages if database empty - ✅ CI validates committed database integrity - ✅ Runtime health checks detect issues immediately Performance: - FTS5 search: < 100ms for typical queries - LIKE fallback: < 500ms (unchanged, still functional) Testing: LIKE search investigation revealed it was perfectly functional, only failed because database was empty. No changes needed. Related: Issue #296 Part 2 (Part 1: v2.18.4 fixed adapter bypass) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>