Special Thanks
This release is dedicated to @creativelaides (Jose Velaides) whose original PR #743 formed the foundation of this work. All 6 of their commits are co-authored on the merged squash in PR #841.
What's New
Added
- CLI lifecycle commands: New
memory launch|stop|restart|info|health|logscommands for managing the background HTTP server — cross-platform PID tracking, health polling, and clean teardown viacli/lifecycle.py. - Lazy CLI command loading: Ingestion commands (
ingest-document,ingest-directory,list-formats) are now lazy-loaded — imported only when invoked, not at CLI startup. - Lazy package imports: Heavy dependencies (torch, transformers, sentence-transformers) are imported only when lazy-loaded attributes like
Memory,MemoryQueryResult, orMemoryStorageare accessed. - Unit tests for lazy loading: Targeted unit tests covering package lazy imports, CLI lazy command availability, and lifecycle command registration.
Changed
- CLI startup performance:
memory --helpand lifecycle commands now start in under 3 seconds (was ~22s) by avoiding eager ML imports at module load time. - HTTP host/port ergonomics:
memory server --httpnow supports--http-hostand--http-port; lifecycle commands use--hostand--portwith environment fallbacks. restartinherits flags:restartthreads--storage-backendand--debugflags from the running server process automatically.- Test conftest cleanup: Removed Unicode emoji characters from
tests/conftest.pyto avoidUnicodeEncodeErroron Windows cp1252 consoles. - Test architecture:
tests/test_memory_ontology_integration.pyrewritten to dropsys.modulesshadow gymnastics; subprocess isolation for lazy-import assertions; qualified conftest imports in csv/json/semtools loader tests restored (+18 recovered tests, total ~1,803).
Security
- Fixed command injection in
launch: Replaced unsafe-ccommand string with safe argument list usingsys.executable -m uvicornwith separate args for--hostand--port. User-controlled host values no longer get interpolated into code strings. (PR #740) - Fixed file handle leak in detached launch: Parent process now explicitly closes stdout/stderr file handles immediately after spawning child process, preventing resource exhaustion. (PR #740)
MCP_ALLOW_ANONYMOUS_ACCESSpass-through: The env var is no longer forced totrueinternally; the actual environment value is now passed through to the launched server, restoring the intended security boundary.- PR #438 test-safety protections preserved: Windows test-safety positive allowlist is maintained alongside production indicators — the triple-safety system against production database deletion remains intact.
Fixed
- PID-reuse detection:
stopandrestartcommands detect PID reuse viacreate_time+cmdline_hintto avoid killing an unrelated process that inherited the same PID. - Version lookup: CLI
infocommand now reads version from_version.pydirectly instead ofimportlib.metadata, avoiding stale cached values. - Optimized log reading:
logscommand uses streaming tail withcollections.deque(maxlen=lines)instead ofread_text().splitlines()to avoid loading the entire log file into memory. (PR #740) - Security warnings in docs: Added explicit security notice in
launchcommand help text andREADME.mdlifecycle section warning that binding to non-loopback hosts exposes the API. (PR #740)
Full Changelog: https://github.com/doobidoo/mcp-memory-service/blob/main/CHANGELOG.md