All notable changes to MCP Memory Keeper will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Checkpoints now survive an export → import round trip (#37, follow-up to #36)
context_exportwrites a new0.5.0format that includes thecheckpointItemsandcheckpointFilesjoin rows (previously only the barecheckpointsrows were exported, which made imported checkpoints empty/useless).context_importrestores checkpoints and rewires their links: each checkpoint gets a fresh id, and its item/file links are remapped onto the freshly-imported context-item and file-cache ids. Links pointing at a skipped or absent row are dropped rather than aborting the import. The whole restore happens inside the existing atomic transaction.- The import summary now reports
Checkpoints: N (skipped M malformed), links restored: K. - Backward compatible: importing a pre-
0.5.0export (no join-row arrays) does not error and reports the checkpoints as not imported, preserving the prior explicit-not-imported behaviour. - The entry-count cap from #36 now also bounds checkpoint and join-row arrays.
- Merge safety: on a key/path collision during
mergeimport, the existing row is now UPDATED in place (its id preserved) instead ofINSERT OR REPLACE, so a pre-existing checkpoint's links to that row are no longer cascade-deleted. Bothcontext_itemsandfile_cache(which have UNIQUE constraints) are handled this way. - Fidelity & observability:
file_cache.sizeis restored on import; duplicate-key/path rows that collapse during import are reported (collapsed N duplicate-key); dropped dangling checkpoint links are surfaced (links restored: K (dropped N dangling)); andmetadata.totalSizenow accounts for the checkpoint join arrays.
- Server-reported version is now read from
package.jsonat runtime instead of a hardcoded string, which had drifted to0.10.0. Added an E2E test asserting the reported version matchespackage.jsonso it can't fall out of sync again.
- Arbitrary local file read via unvalidated
context_importfilePath (#35)context_importpassed the caller-suppliedfilePathstraight tofs.readFileSync, with no path confinement. A malicious MCP client — or a prompt-injected agent — could point it at any file the server process could read: full contents for any JSON file (imported into the session, then retrievable viacontext_get/context_export), and the leading bytes of any other file (echoed back inside theJSON.parseerror message)- Imports are now confined to a server-owned exports directory (
<DATA_DIR>/exports, overridable viaMEMORY_KEEPER_EXPORT_DIR). Relative paths resolve against that directory; absolute paths are accepted only if they resolve — after following symlinks viarealpath— to a location inside it. Traversal (../) and absolute paths outside the directory are rejected context_exportnow writes to that same exports directory (previously the OS temp dir), so the export → import round trip stays within the confined location- Import failures no longer echo raw exception messages — at every stage (read, JSON parse, and the database write) a generic message is returned and the detail is logged server-side, so no file bytes or inserted values can leak back to the caller
- Import is hardened further: the resolved path must be a regular file (directories are rejected), capped at 50 MB and 100k entries to avoid memory/CPU exhaustion, and the whole import runs in a single transaction so a malformed row can never leave an orphaned or partially-populated session. Per-item and session-name shape are validated;
mergeonly merges when a current session actually exists (and the result is reported honestly) - The "not found" and "outside the exports directory" cases now return an identical generic message, removing a file-existence oracle, and the resolved absolute path is never echoed back to the caller
context_export's tool description and the import path resolution now guard the exports-directory startup (graceful FATAL on an unreadable directory)- Round-trip fidelity fixes surfaced by review of the above: imported items now restore their
channel,is_private, andmetadatacolumns (previously dropped); file-cache rows withNULLcontent are preserved (previously dropped); a storedsizeof0is no longer wrongly recomputed; skipped-malformed counts and "checkpoints present but not imported" are reported instead of being silently lost; andcontext_exportwarns when a produced file is too large to be re-imported. The new current session is published only after the import transaction commits, so a failed import can no longer leavecurrentSessionIdpointing at a rolled-back session - Added an E2E security regression test suite that reproduces the issue #35 PoC (arbitrary JSON read,
/etc/passwdbyte leak,..traversal) and covers symlink escape, theexports-dir-prefix sibling boundary, the no-existence-oracle guarantee, empty/non-string paths, directory paths, valid-JSON-but-not-an-export, malformed-item skipping, and a data-preserving round trip - Reported by Zhihao Zhang (@mcfly-zzh)
0.12.2 - 2026-04-07
fulltool profile breaks OpenAI-compatible providers (#33)context_delegate.input.insightsarray property was missing requireditemsdeclaration- Stricter providers rejected the schema with
invalid_function_parameters - Added
items: { type: 'object', properties: {...} }to theinsightsproperty with properpatterns,relationships,trends, andthemesfields - Added
properties: {}tocontext_link.metadatabare object schema for strict validator compatibility - Added regression test that validates all array properties across all tool schemas have
itemsdeclared - Added comprehensive E2E test suite that spawns the actual MCP server and validates tool schemas, tool calls, and error handling over stdio
0.12.1 - 2026-03-24
- Server crashes with SQLITE_CANTOPEN when parent process CWD changes (#31)
- Server now resolves database path to an absolute location (
$DATA_DIRor~/mcp-data/memory-keeper/) instead of relying on CWD - Added try/catch around data directory creation with actionable error message
- Startup warning with exact
cpcommand when legacycontext.dbdetected in CWD - README "from source" install command now points to
bin/mcp-memory-keeperinstead ofnode dist/index.js - Added Upgrading section documenting database path change and migration steps
- Server now resolves database path to an absolute location (
- Fixed integration tests to use
DATA_DIRinstead of deadMCP_DB_PATHenvironment variable - Fixed
git.init()in tests to use--initial-branch=masterfor deterministic behavior
0.12.0 - 2026-02-06
- Selective Tool Filtering via Profiles (#29)
- Control which tools are exposed to reduce context window usage (~10-15K tokens saved with minimal profile)
- Three built-in profiles:
minimal(8 tools),standard(22 tools),full(38 tools, default) TOOL_PROFILEenvironment variable to select active profile at startupTOOL_PROFILE_CONFIGenvironment variable to specify custom config file path- Custom profile definitions via
~/.mcp-memory-keeper/config.json - Config file profiles take precedence over built-in defaults
- Helpful error messages when disabled tools are called, with guidance on enabling them
- Startup logging shows active profile, tool count, and source
- Example config file included in
examples/config.json
- New
src/utils/tool-profiles.tsmodule withALL_TOOL_NAMESsource of truth ToolNameunion type for compile-time safety- Deep config validation (guards against malformed JSON, null values, non-array profiles, non-string elements)
- Drift-detection integration test verifies
ALL_TOOL_NAMESstays in sync withindex.tstool definitions - Defense-in-depth: both
ListToolsfiltering andCallToolguard for disabled tools - 100% backwards compatible — no env var + no config = all 38 tools (existing behavior unchanged)
- All 1185 tests passing across Node.js 20, 22, and 24
0.11.0 - 2025-12-10
- Node.js 18 support dropped - Minimum required Node.js version is now 20.0.0
- Node.js 18 reached End-of-Life on April 30, 2025
- Users on Node.js 18 must upgrade to Node.js 20 or later
- Existing installations will continue working until updated
- Installation fails on Node.js 24 (#28) - Updated
better-sqlite3dependency- Upgraded from
^11.10.0to^12.1.0to support Node.js 24 (LTS "Krypton") - Prebuilt binaries now available for Node.js 20, 22, and 24
- Resolves
gyp ERR!build failures on Node.js 24
- Upgraded from
0.10.2 - 2025-09-16
- Critical Token Limit Issue (#24) - Fixed token overflow with includeMetadata
- Implemented dynamic token limit calculation based on actual content size
- Automatically adjusts item limits based on average item size in session
- More accurate token estimation (3.5 chars/token vs 4)
- Configurable via environment variables (MCP_MAX_TOKENS, MCP_TOKEN_SAFETY_BUFFER)
- Added tokenInfo to response metadata for transparency
- Resolves "MCP tool context_get response exceeds maximum allowed tokens" errors
- Token Limit Management Module (
utils/token-limits.ts)- Dynamic calculation of safe item limits
- Response overhead estimation
- Configurable token limits via environment
- Better visibility into token usage
- Proper TypeScript interfaces for context items
- Environment variable validation with bounds checking
- Safe JSON parsing with error handling
- Well-documented constants replacing magic numbers
0.10.1 - 2025-07-11
-
Token Limit Enforcement - Fixed MCP protocol token limit errors
- Added automatic response truncation when approaching 25,000 token limit
- Implemented
calculateSafeItemCount()helper to determine safe result size - Enhanced pagination metadata with
truncatedandtruncatedCountfields - Improved warning messages with specific pagination instructions
- Prevents "response exceeds maximum allowed tokens" errors from MCP clients
-
Pagination Defaults in context_get - Improved consistency
- Added proper validation of pagination parameters at handler level
- Default limit of 100 items now properly applied when not specified
- Invalid limit/offset values are validated and fallback to defaults
- Response includes
defaultsAppliedmetadata to indicate when defaults were used - Consistent behavior with
context_search_alland other paginated endpoints
-
Batch Operations - Atomic multi-item operations
context_batch_save- Save multiple items in one transactioncontext_batch_delete- Delete multiple items by keys or patterncontext_batch_update- Update multiple items with partial changes- Ensures data consistency with all-or-nothing transactions
-
Channel Reassignment - Reorganize context items
context_reassign_channel- Move items between channels- Support for key patterns, specific keys, or entire channels
- Filter by category and priority during moves
- Dry run option to preview changes
-
Context Relationships - Build knowledge graphs
context_link- Create typed relationships between itemscontext_get_related- Find related items with traversal- 14 relationship types (contains, depends_on, references, etc.)
- Multi-level depth traversal support
- Directional queries (incoming/outgoing/both)
-
Real-time Monitoring - Watch for context changes
context_watch- Create filtered watchers for changes- Support for long polling and immediate returns
- Filter by keys, categories, channels, priorities
- Track added vs updated items
- Added comprehensive documentation for all new features in API.md
- Added practical examples in EXAMPLES.md
- Added recipes for common patterns in RECIPES.md
- Added troubleshooting tips for new features
0.10.0 - 2025-06-26
-
Channels - Persistent topic-based organization (#22)
- Auto-derived from git branch names (20 chars max)
- Survives session crashes and restarts
defaultChannelparameter incontext_session_startchannelparameter incontext_saveandcontext_get- Perfect for multi-branch development and team collaboration
-
Enhanced Filtering in
context_get(#21)includeMetadata- Get timestamps and size informationsort- Sort by created/updated time (asc/desc) or prioritylimitandoffset- Pagination supportcreatedAfterandcreatedBefore- Time-based filteringkeyPattern- Regex pattern matching for keyspriorities- Filter by multiple priority levels
-
Enhanced Timeline (#21)
includeItems- Show actual items, not just countscategories- Filter timeline by specific categoriesrelativeTime- Display "2 hours ago" formatitemsPerPeriod- Limit items shown per time period
- Database schema updated with
channelcolumn in context_items table - Improved query performance with channel indexing
- Better support for cross-branch context queries
- Added channels migration (003_add_channels.ts)
- Enhanced validation for channel names
- Backward compatible - existing items default to 'default' channel
0.9.0 - 2025-06-21
- Simplified Sharing Model (#19)
- Context items are now shared across all sessions by default (public)
- Removed broken
context_shareandcontext_get_sharedcommands - Added
privateflag tocontext_savefor session-specific items - Database schema updated: replaced
sharedandshared_with_sessionscolumns withis_private - Migration included to make ALL existing items public (accessible across sessions)
- Cross-session collaboration now works reliably
- Context accessibility is consistent across all retrieval methods
- Search operations properly respect privacy settings
context_sharetool (sharing is now automatic)context_get_sharedtool (usecontext_getinstead)- Complex sharing mechanism that was causing inconsistencies
0.8.4 - 2025-06-19
- Critical fix for "table sessions has no column named working_directory" error
- Added defensive checks before using working_directory column
- Gracefully handles existing databases without the new column
- Tiered storage and retention policies (planned)
- Feature flags system (planned)
- Database migration system (planned)
0.8.3 - 2025-06-19
- Smart Project Directory Management
context_session_startprovides intelligent suggestions when no project directory is set- Detects git repositories in current directory and subdirectories
- Suggests appropriate project paths based on directory structure
- Working directory is stored in the sessions table when explicitly provided
- Git-dependent tools now prompt for project directory setup when needed
- Sessions table now includes a
working_directorycolumn - Improved user guidance for setting up git tracking
- More helpful messages when project directory is not set
- Automatic schema migration for existing databases to add the
working_directorycolumn
0.8.0 - 2025-06-18
- Session Branching & Merging (#14)
context_branch_sessiontool for creating session branches- Support for shallow (high-priority only) and deep (full copy) branching
context_merge_sessionstool with three conflict resolution strategies- Parent-child relationship tracking in sessions table
- Journal Entries (#16)
context_journal_entrytool for time-stamped reflections- Support for tags and mood tracking
- Integration with timeline visualization
- Timeline View (#16)
context_timelinetool to visualize activity patterns- Grouping by hour, day, or week
- Category distribution over time
- Journal entry integration
- Progressive Compression (#17)
context_compresstool for intelligent space management- Preserve important categories while compressing old data
- Automatic compression ratio calculation
- Target size optimization support
- Cross-Tool Integration (#18)
context_integrate_toolto record events from other MCP tools- Automatic high-priority context item creation for important events
- Support for tool event metadata storage
- Updated database schema to support new features
- Enhanced documentation with comprehensive examples
- Improved test coverage with 19 new test cases
- Added
parent_idcolumn to sessions table - New tables:
journal_entries,compressed_context,tool_events - All 255 tests passing
0.7.0 - 2025-06-18
- Multi-Agent System (#9)
- Agent framework with specialized roles
AnalyzerAgentfor pattern detection and relationship analysisSynthesizerAgentfor summarization and recommendationsAgentCoordinatorfor managing agent workflowscontext_delegatetool for intelligent task delegation- Agent chaining capability for complex workflows
- Confidence scoring for agent outputs
- Improved documentation with multi-agent examples
- Enhanced EXAMPLES.md with agent usage patterns
- Created
src/utils/agents.tswith complete agent implementation - Added comprehensive test coverage (30 new tests)
- All 236 tests passing
0.6.0 - 2025-06-17
- Semantic Search (#4)
context_semantic_searchtool for natural language queries- Lightweight vector embeddings using character n-grams
- No external dependencies required
- Similarity threshold filtering
- Integration with existing search infrastructure
- Updated examples with semantic search patterns
- Enhanced documentation for natural language queries
- Implemented
VectorStoreclass for embedding management - Added
vector_embeddingstable to database schema - Comprehensive test coverage for semantic search
- All 206 tests passing
0.5.0 - 2025-06-17
- Knowledge Graph Integration (#3)
- Automatic entity extraction from context
- Relationship detection between entities
context_analyzetool for building knowledge graphcontext_find_relatedtool for exploring connectionscontext_visualizetool with graph/timeline/heatmap views- Confidence scoring for relationships
- Enhanced database schema for knowledge graph support
- Improved context analysis capabilities
- New tables:
entities,relations,observations - Added
knowledge-graph.tsutility module - Comprehensive test coverage for graph operations
0.4.2 - 2025-06-17
- Documentation Improvements
- Comprehensive TROUBLESHOOTING.md guide
- Enhanced EXAMPLES.md with real-world scenarios
- Started RECIPES.md for common patterns
- Git integration error handling
- Session list date filtering
0.4.1 - 2025-06-17
- Database initialization race condition
- Checkpoint restoration with missing files
- Search result ranking accuracy
- Improved error messages for better debugging
- Enhanced validation for file paths
0.4.0 - 2025-06-17
- Git Integration (#2)
context_git_committool with auto-save- Automatic context correlation with commits
- Git status capture in checkpoints
- Branch tracking
- Checkpoint system now includes git information
- Enhanced session metadata with git branch
- Added
simple-gitdependency - Created
git.tsutility module - 97% test coverage maintained
0.3.0 - 2025-06-17
- Smart Compaction (#1)
context_prepare_compactiontool- Automatic identification of critical items
- Unfinished task preservation
- Restoration instructions generation
- Search Functionality
context_searchtool with full-text search- Search in keys and values
- Category and session filtering
- Export/Import
context_exporttool for JSON/CSV exportcontext_importtool with merge strategies- Session backup and restore capability
- Improved checkpoint metadata
- Enhanced error handling across all tools
- Added search indexes for performance
- Implemented streaming for large exports
- Transaction support for atomic operations
0.2.0 - 2025-06-17
- Checkpoint System
context_checkpointtool for complete snapshotscontext_restore_checkpointfor state restoration- File cache inclusion in checkpoints
- Git status integration
- Context Summarization
context_summarizetool- AI-friendly markdown summaries
- Category and priority grouping
- Session statistics
- Enhanced File Management
- SHA-256 hash-based change detection
- File size tracking
- Automatic cache invalidation
- Improved session management with metadata
- Better error messages with error codes
- Enhanced validation for all inputs
- Memory leak in file cache operations
- Session switching race condition
0.1.0 - 2025-06-17
- Initial release
- Core Features
context_saveandcontext_gettoolscontext_deletefor item removal- Session management with
context_session_startandcontext_session_list - File caching with
context_cache_fileandcontext_file_changed - Status monitoring with
context_status
- Database Setup
- SQLite with WAL mode
- Automatic database creation
- Size tracking and limits
- MCP Integration
- Full MCP protocol implementation
- Tool discovery and schema validation
- Error handling and reporting
- TypeScript implementation
- Comprehensive test suite
- Zero runtime dependencies (except MCP SDK and SQLite)
- Fixed Windows path handling
- Added Node.js 18+ compatibility
- Initial beta release
- Basic functionality testing
- Community feedback integration
- Added: New features
- Changed: Changes in existing functionality
- Deprecated: Soon-to-be removed features
- Removed: Removed features
- Fixed: Bug fixes
- Security: Security updates
- Technical: Internal improvements