Replace WASM Embeddings with Persistent chroma-mcp MCP Connection
Highlights
- New: ChromaMcpManager — Singleton stdio MCP client communicating with chroma-mcp via
uvx, replacing the previous ChromaServerManager (npx chroma run+chromadbnpm + ONNX/WASM) - Eliminates native binary issues — No more segfaults, WASM embedding failures, or cross-platform install headaches
- Graceful subprocess lifecycle — Wired into GracefulShutdown for clean teardown; zombie process prevention with kill-on-failure and stale
onclosehandler guards - Connection backoff — 10-second reconnect backoff prevents chroma-mcp spawn storms
- SQL injection guards — Added parameterization to ChromaSync ID exclusion queries
- Simplified ChromaSync — Reduced complexity by delegating embedding concerns to chroma-mcp
Breaking Changes
None — backward compatible. ChromaDB data is preserved; only the connection mechanism changed.
Files Changed
src/services/sync/ChromaMcpManager.ts(new) — MCP client singletonsrc/services/sync/ChromaServerManager.ts(deleted) — Old WASM/native approachsrc/services/sync/ChromaSync.ts— Simplified to use MCP clientsrc/services/worker-service.ts— Updated startup sequencesrc/services/infrastructure/GracefulShutdown.ts— Subprocess cleanup integration