Environment Configuration Loading Bug Fix
This patch release fixes a critical bug where the HTTP server wasn't loading .env configuration properly, causing it to default to incorrect settings.
Fixed
Environment Configuration Loading Bug (commit 626d7e8)
Problem: HTTP server wasn't loading .env configuration properly, defaulting to wrong settings:
- OAuth enabled when it should be disabled
- sqlite_vec backend selected instead of configured hybrid backend
- Other environment variables not being loaded from .env files
Root Causes:
python-dotenvwas missing from dependencies in pyproject.toml, causing silent import failures- .env loading only checked a single location (relative to config file), which failed for:
- Source installations (
pip install -e .) - Different working directories
- Docker/containerized deployments
- Windows environments with different path structures
- Source installations (
Solution:
- Added
python-dotenv>=1.0.0to dependencies - Implemented
_find_and_load_dotenv()function with comprehensive multi-location search strategy:- Current working directory (highest priority)
- Relative to config file (for source installs)
- Project root markers (searches for pyproject.toml)
- Common Windows project paths
- User home directory (~/.mcp-memory/.env)
- Uses
override=Falseto respect existing environment variables
Impact:
- Fixes critical configuration loading issues across all deployment scenarios
- Resolves incorrect backend selection in HTTP server
- Ensures .env files are properly loaded in development, source installs, Docker, and Windows
Files Changed:
src/mcp_memory_service/config.py- Added _find_and_load_dotenv() with comprehensive search logicpyproject.toml- Added python-dotenv dependency
Installation
pip install --upgrade mcp-memory-serviceUpgrade Notes
No breaking changes. The fix is backward compatible. If you were experiencing configuration loading issues, this release should resolve them automatically.
Full Changelog: v8.62.7...v8.62.8